| Server IP : 89.248.107.232 / Your IP : 216.73.217.70 Web Server : Apache System : Linux host2.kasilh.com 5.14.0-687.36.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Aug 7 05:40:49 EDT 2026 x86_64 User : seg ( 10005) PHP Version : 7.4.33 Disable Function : opcache_get_status MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /var/www/vhosts/seg-sa.es/grupo-seg.com/wp-content/litespeed/js/ |
Upload File : |
/*! jQuery Migrate v3.4.1 | (c) OpenJS Foundation and other contributors | jquery.org/license */
"undefined"==typeof jQuery.migrateMute&&(jQuery.migrateMute=!0),function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],function(e){return t(e,window)}):"object"==typeof module&&module.exports?module.exports=t(require("jquery"),window):t(jQuery,window)}(function(s,n){"use strict";function e(e){return 0<=function(e,t){for(var r=/^(\d+)\.(\d+)\.(\d+)/,n=r.exec(e)||[],o=r.exec(t)||[],a=1;a<=3;a++){if(+o[a]<+n[a])return 1;if(+n[a]<+o[a])return-1}return 0}(s.fn.jquery,e)}s.migrateVersion="3.4.1";var t=Object.create(null);s.migrateDisablePatches=function(){for(var e=0;e<arguments.length;e++)t[arguments[e]]=!0},s.migrateEnablePatches=function(){for(var e=0;e<arguments.length;e++)delete t[arguments[e]]},s.migrateIsPatchEnabled=function(e){return!t[e]},n.console&&n.console.log&&(s&&e("3.0.0")&&!e("5.0.0")||n.console.log("JQMIGRATE: jQuery 3.x-4.x REQUIRED"),s.migrateWarnings&&n.console.log("JQMIGRATE: Migrate plugin loaded multiple times"),n.console.log("JQMIGRATE: Migrate is installed"+(s.migrateMute?"":" with logging active")+", version "+s.migrateVersion));var o={};function u(e,t){var r=n.console;!s.migrateIsPatchEnabled(e)||s.migrateDeduplicateWarnings&&o[t]||(o[t]=!0,s.migrateWarnings.push(t+" ["+e+"]"),r&&r.warn&&!s.migrateMute&&(r.warn("JQMIGRATE: "+t),s.migrateTrace&&r.trace&&r.trace()))}function r(e,t,r,n,o){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){return u(n,o),r},set:function(e){u(n,o),r=e}})}function a(e,t,r,n,o){var a=e[t];e[t]=function(){return o&&u(n,o),(s.migrateIsPatchEnabled(n)?r:a||s.noop).apply(this,arguments)}}function c(e,t,r,n,o){if(!o)throw new Error("No warning message provided");return a(e,t,r,n,o),0}function i(e,t,r,n){return a(e,t,r,n),0}s.migrateDeduplicateWarnings=!0,s.migrateWarnings=[],void 0===s.migrateTrace&&(s.migrateTrace=!0),s.migrateReset=function(){o={},s.migrateWarnings.length=0},"BackCompat"===n.document.compatMode&&u("quirks","jQuery is not compatible with Quirks Mode");var d,l,p,f={},m=s.fn.init,y=s.find,h=/\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/,g=/\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/g,v=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;for(d in i(s.fn,"init",function(e){var t=Array.prototype.slice.call(arguments);return s.migrateIsPatchEnabled("selector-empty-id")&&"string"==typeof e&&"#"===e&&(u("selector-empty-id","jQuery( '#' ) is not a valid selector"),t[0]=[]),m.apply(this,t)},"selector-empty-id"),s.fn.init.prototype=s.fn,i(s,"find",function(t){var r=Array.prototype.slice.call(arguments);if("string"==typeof t&&h.test(t))try{n.document.querySelector(t)}catch(e){t=t.replace(g,function(e,t,r,n){return"["+t+r+'"'+n+'"]'});try{n.document.querySelector(t),u("selector-hash","Attribute selector with '#' must be quoted: "+r[0]),r[0]=t}catch(e){u("selector-hash","Attribute selector with '#' was not fixed: "+r[0])}}return y.apply(this,r)},"selector-hash"),y)Object.prototype.hasOwnProperty.call(y,d)&&(s.find[d]=y[d]);c(s.fn,"size",function(){return this.length},"size","jQuery.fn.size() is deprecated and removed; use the .length property"),c(s,"parseJSON",function(){return JSON.parse.apply(null,arguments)},"parseJSON","jQuery.parseJSON is deprecated; use JSON.parse"),c(s,"holdReady",s.holdReady,"holdReady","jQuery.holdReady is deprecated"),c(s,"unique",s.uniqueSort,"unique","jQuery.unique is deprecated; use jQuery.uniqueSort"),r(s.expr,"filters",s.expr.pseudos,"expr-pre-pseudos","jQuery.expr.filters is deprecated; use jQuery.expr.pseudos"),r(s.expr,":",s.expr.pseudos,"expr-pre-pseudos","jQuery.expr[':'] is deprecated; use jQuery.expr.pseudos"),e("3.1.1")&&c(s,"trim",function(e){return null==e?"":(e+"").replace(v,"$1")},"trim","jQuery.trim is deprecated; use String.prototype.trim"),e("3.2.0")&&(c(s,"nodeName",function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},"nodeName","jQuery.nodeName is deprecated"),c(s,"isArray",Array.isArray,"isArray","jQuery.isArray is deprecated; use Array.isArray")),e("3.3.0")&&(c(s,"isNumeric",function(e){var t=typeof e;return("number"==t||"string"==t)&&!isNaN(e-parseFloat(e))},"isNumeric","jQuery.isNumeric() is deprecated"),s.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){f["[object "+t+"]"]=t.toLowerCase()}),c(s,"type",function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?f[Object.prototype.toString.call(e)]||"object":typeof e},"type","jQuery.type is deprecated"),c(s,"isFunction",function(e){return"function"==typeof e},"isFunction","jQuery.isFunction() is deprecated"),c(s,"isWindow",function(e){return null!=e&&e===e.window},"isWindow","jQuery.isWindow() is deprecated")),s.ajax&&(l=s.ajax,p=/(=)\?(?=&|$)|\?\?/,i(s,"ajax",function(){var e=l.apply(this,arguments);return e.promise&&(c(e,"success",e.done,"jqXHR-methods","jQXHR.success is deprecated and removed"),c(e,"error",e.fail,"jqXHR-methods","jQXHR.error is deprecated and removed"),c(e,"complete",e.always,"jqXHR-methods","jQXHR.complete is deprecated and removed")),e},"jqXHR-methods"),e("4.0.0")||s.ajaxPrefilter("+json",function(e){!1!==e.jsonp&&(p.test(e.url)||"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&p.test(e.data))&&u("jsonp-promotion","JSON-to-JSONP auto-promotion is deprecated")}));var j=s.fn.removeAttr,b=s.fn.toggleClass,w=/\S+/g;function x(e){return e.replace(/-([a-z])/g,function(e,t){return t.toUpperCase()})}i(s.fn,"removeAttr",function(e){var r=this,n=!1;return s.each(e.match(w),function(e,t){s.expr.match.bool.test(t)&&r.each(function(){if(!1!==s(this).prop(t))return!(n=!0)}),n&&(u("removeAttr-bool","jQuery.fn.removeAttr no longer sets boolean properties: "+t),r.prop(t,!1))}),j.apply(this,arguments)},"removeAttr-bool"),i(s.fn,"toggleClass",function(t){return void 0!==t&&"boolean"!=typeof t?b.apply(this,arguments):(u("toggleClass-bool","jQuery.fn.toggleClass( boolean ) is deprecated"),this.each(function(){var e=this.getAttribute&&this.getAttribute("class")||"";e&&s.data(this,"__className__",e),this.setAttribute&&this.setAttribute("class",!e&&!1!==t&&s.data(this,"__className__")||"")}))},"toggleClass-bool");var Q,A,R=!1,C=/^[a-z]/,N=/^(?:Border(?:Top|Right|Bottom|Left)?(?:Width|)|(?:Margin|Padding)?(?:Top|Right|Bottom|Left)?|(?:Min|Max)?(?:Width|Height))$/;s.swap&&s.each(["height","width","reliableMarginRight"],function(e,t){var r=s.cssHooks[t]&&s.cssHooks[t].get;r&&(s.cssHooks[t].get=function(){var e;return R=!0,e=r.apply(this,arguments),R=!1,e})}),i(s,"swap",function(e,t,r,n){var o,a,i={};for(a in R||u("swap","jQuery.swap() is undocumented and deprecated"),t)i[a]=e.style[a],e.style[a]=t[a];for(a in o=r.apply(e,n||[]),t)e.style[a]=i[a];return o},"swap"),e("3.4.0")&&"undefined"!=typeof Proxy&&(s.cssProps=new Proxy(s.cssProps||{},{set:function(){return u("cssProps","jQuery.cssProps is deprecated"),Reflect.set.apply(this,arguments)}})),e("4.0.0")?(A={animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},"undefined"!=typeof Proxy?s.cssNumber=new Proxy(A,{get:function(){return u("css-number","jQuery.cssNumber is deprecated"),Reflect.get.apply(this,arguments)},set:function(){return u("css-number","jQuery.cssNumber is deprecated"),Reflect.set.apply(this,arguments)}}):s.cssNumber=A):A=s.cssNumber,Q=s.fn.css,i(s.fn,"css",function(e,t){var r,n,o=this;return e&&"object"==typeof e&&!Array.isArray(e)?(s.each(e,function(e,t){s.fn.css.call(o,e,t)}),this):("number"==typeof t&&(r=x(e),n=r,C.test(n)&&N.test(n[0].toUpperCase()+n.slice(1))||A[r]||u("css-number",'Number-typed values are deprecated for jQuery.fn.css( "'+e+'", value )')),Q.apply(this,arguments))},"css-number");var S,P,k,H,E=s.data;i(s,"data",function(e,t,r){var n,o,a;if(t&&"object"==typeof t&&2===arguments.length){for(a in n=s.hasData(e)&&E.call(this,e),o={},t)a!==x(a)?(u("data-camelCase","jQuery.data() always sets/gets camelCased names: "+a),n[a]=t[a]):o[a]=t[a];return E.call(this,e,o),t}return t&&"string"==typeof t&&t!==x(t)&&(n=s.hasData(e)&&E.call(this,e))&&t in n?(u("data-camelCase","jQuery.data() always sets/gets camelCased names: "+t),2<arguments.length&&(n[t]=r),n[t]):E.apply(this,arguments)},"data-camelCase"),s.fx&&(k=s.Tween.prototype.run,H=function(e){return e},i(s.Tween.prototype,"run",function(){1<s.easing[this.easing].length&&(u("easing-one-arg","'jQuery.easing."+this.easing.toString()+"' should use only one argument"),s.easing[this.easing]=H),k.apply(this,arguments)},"easing-one-arg"),S=s.fx.interval,P="jQuery.fx.interval is deprecated",n.requestAnimationFrame&&Object.defineProperty(s.fx,"interval",{configurable:!0,enumerable:!0,get:function(){return n.document.hidden||u("fx-interval",P),s.migrateIsPatchEnabled("fx-interval")&&void 0===S?13:S},set:function(e){u("fx-interval",P),S=e}}));var M=s.fn.load,q=s.event.add,O=s.event.fix;s.event.props=[],s.event.fixHooks={},r(s.event.props,"concat",s.event.props.concat,"event-old-patch","jQuery.event.props.concat() is deprecated and removed"),i(s.event,"fix",function(e){var t,r=e.type,n=this.fixHooks[r],o=s.event.props;if(o.length){u("event-old-patch","jQuery.event.props are deprecated and removed: "+o.join());while(o.length)s.event.addProp(o.pop())}if(n&&!n._migrated_&&(n._migrated_=!0,u("event-old-patch","jQuery.event.fixHooks are deprecated and removed: "+r),(o=n.props)&&o.length))while(o.length)s.event.addProp(o.pop());return t=O.call(this,e),n&&n.filter?n.filter(t,e):t},"event-old-patch"),i(s.event,"add",function(e,t){return e===n&&"load"===t&&"complete"===n.document.readyState&&u("load-after-event","jQuery(window).on('load'...) called after load event occurred"),q.apply(this,arguments)},"load-after-event"),s.each(["load","unload","error"],function(e,t){i(s.fn,t,function(){var e=Array.prototype.slice.call(arguments,0);return"load"===t&&"string"==typeof e[0]?M.apply(this,e):(u("shorthand-removed-v3","jQuery.fn."+t+"() is deprecated"),e.splice(0,0,t),arguments.length?this.on.apply(this,e):(this.triggerHandler.apply(this,e),this))},"shorthand-removed-v3")}),s.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,r){c(s.fn,r,function(e,t){return 0<arguments.length?this.on(r,null,e,t):this.trigger(r)},"shorthand-deprecated-v3","jQuery.fn."+r+"() event shorthand is deprecated")}),s(function(){s(n.document).triggerHandler("ready")}),s.event.special.ready={setup:function(){this===n.document&&u("ready-event","'ready' event is deprecated")}},c(s.fn,"bind",function(e,t,r){return this.on(e,null,t,r)},"pre-on-methods","jQuery.fn.bind() is deprecated"),c(s.fn,"unbind",function(e,t){return this.off(e,null,t)},"pre-on-methods","jQuery.fn.unbind() is deprecated"),c(s.fn,"delegate",function(e,t,r,n){return this.on(t,e,r,n)},"pre-on-methods","jQuery.fn.delegate() is deprecated"),c(s.fn,"undelegate",function(e,t,r){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",r)},"pre-on-methods","jQuery.fn.undelegate() is deprecated"),c(s.fn,"hover",function(e,t){return this.on("mouseenter",e).on("mouseleave",t||e)},"pre-on-methods","jQuery.fn.hover() is deprecated");function T(e){var t=n.document.implementation.createHTMLDocument("");return t.body.innerHTML=e,t.body&&t.body.innerHTML}var F=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi;s.UNSAFE_restoreLegacyHtmlPrefilter=function(){s.migrateEnablePatches("self-closed-tags")},i(s,"htmlPrefilter",function(e){var t,r;return(r=(t=e).replace(F,"<$1></$2>"))!==t&&T(t)!==T(r)&&u("self-closed-tags","HTML tags must be properly nested and closed: "+t),e.replace(F,"<$1></$2>")},"self-closed-tags"),s.migrateDisablePatches("self-closed-tags");var D,W,_,I=s.fn.offset;return i(s.fn,"offset",function(){var e=this[0];return!e||e.nodeType&&e.getBoundingClientRect?I.apply(this,arguments):(u("offset-valid-elem","jQuery.fn.offset() requires a valid DOM element"),arguments.length?this:void 0)},"offset-valid-elem"),s.ajax&&(D=s.param,i(s,"param",function(e,t){var r=s.ajaxSettings&&s.ajaxSettings.traditional;return void 0===t&&r&&(u("param-ajax-traditional","jQuery.param() no longer uses jQuery.ajaxSettings.traditional"),t=r),D.call(this,e,t)},"param-ajax-traditional")),c(s.fn,"andSelf",s.fn.addBack,"andSelf","jQuery.fn.andSelf() is deprecated and removed, use jQuery.fn.addBack()"),s.Deferred&&(W=s.Deferred,_=[["resolve","done",s.Callbacks("once memory"),s.Callbacks("once memory"),"resolved"],["reject","fail",s.Callbacks("once memory"),s.Callbacks("once memory"),"rejected"],["notify","progress",s.Callbacks("memory"),s.Callbacks("memory")]],i(s,"Deferred",function(e){var a=W(),i=a.promise();function t(){var o=arguments;return s.Deferred(function(n){s.each(_,function(e,t){var r="function"==typeof o[e]&&o[e];a[t[1]](function(){var e=r&&r.apply(this,arguments);e&&"function"==typeof e.promise?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[t[0]+"With"](this===i?n.promise():this,r?[e]:arguments)})}),o=null}).promise()}return c(a,"pipe",t,"deferred-pipe","deferred.pipe() is deprecated"),c(i,"pipe",t,"deferred-pipe","deferred.pipe() is deprecated"),e&&e.call(a,a),a},"deferred-pipe"),s.Deferred.exceptionHook=W.exceptionHook),s});
;jQuery(document).ready(function($){"use strict";function NectarSocial(){this.$body=$('body');this.$window=$(window);this.$wpAdminBar=$('#wpadminbar');this.usingMobileBrowser=(navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/))?!0:!1;this.mouseEvents();this.nectarLove();if($('body').find('.nectar-social.fixed').length>0){this.fixedStyle()}}
NectarSocial.prototype.mouseEvents=function(){this.$body.on('click','#single-below-header .nectar-social a',function(){return!1});$('body.single-product .nectar-social').addClass('woo');this.$body.on('click','.facebook-share:not(.inactive)',this.facebookShare);this.$body.on('click','.nectar-social:not(".woo") .twitter-share:not(.inactive)',this.twitterShare);this.$body.on('click','.nectar-social.woo .twitter-share',this.wooTwitterShare);this.$body.on('click','.nectar-social:not(".woo") .linkedin-share:not(.inactive)',this.linkedInShare);this.$body.on('click','.nectar-social.woo .linkedin-share',this.woolinkedInShare);this.$body.on('click','.nectar-social:not(".woo") .pinterest-share:not(.inactive)',this.pinterestShare);this.$body.on('click','.nectar-social.woo .pinterest-share',this.wooPinterestShare);this.$body.on('click','.nectar-social.fixed > a',function(){return!1});if(!this.usingMobileBrowser){var $socialTimeout;this.$body.on('mouseenter','.nectar-social.hover .share-btn',function(){clearTimeout($socialTimeout);if($(this).parents('[id*="-meta"]').length>0){$(this).parents('[id*="-meta"]').addClass('social-hovered')}
if($(this).parents('#single-below-header').length>0){$(this).parents('#single-below-header').addClass('social-hovered')}
$(this).parent().addClass('visible')});this.$body.on('mouseleave','.nectar-social.hover',function(){var $that=$(this);$socialTimeout=setTimeout(function(){$that.removeClass('visible');if($that.parents('[id*="-meta"]').length>0){$that.parents('[id*="-meta"]').removeClass('social-hovered')}
if($that.parents('#single-below-header').length>0){$that.parents('#single-below-header').removeClass('social-hovered')}},200)})}else{this.$body.on('click','.nectar-social.hover .share-btn',function(){if($(this).parents('[id*="-meta"]').length>0){$(this).parents('[id*="-meta"]').addClass('social-hovered')}
if($(this).parents('#single-below-header').length>0){$(this).parents('#single-below-header').addClass('social-hovered')}
$(this).parent().addClass('visible');return!1})}};NectarSocial.prototype.facebookShare=function(){var windowLocation=window.location.href.replace(window.location.hash,'');window.open('https://www.facebook.com/sharer/sharer.php?u='+windowLocation,"facebookWindow","height=380,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0");return!1};NectarSocial.prototype.facebookShare=function(){var windowLocation=window.location.href.replace(window.location.hash,'');window.open('https://www.facebook.com/sharer/sharer.php?u='+windowLocation,"facebookWindow","height=380,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0");return!1};NectarSocial.prototype.twitterShare=function(){var windowLocation=window.location.href.replace(window.location.hash,'');var $pageTitle;if($(".section-title h1").length>0){$pageTitle=encodeURIComponent($(".section-title h1").text())}else{$pageTitle=encodeURIComponent($(document).find("title").text())}
window.open('http://twitter.com/intent/tweet?text='+$pageTitle+' '+windowLocation,"twitterWindow","height=380,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0");return!1};NectarSocial.prototype.wooTwitterShare=function(){var windowLocation=window.location.href.replace(window.location.hash,'');window.open('http://twitter.com/intent/tweet?text='+$("h1.product_title").text()+' '+windowLocation,"twitterWindow","height=380,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0");return!1};NectarSocial.prototype.linkedInShare=function(){var windowLocation=window.location.href.replace(window.location.hash,'');var $pageTitle;if($(".section-title h1").length>0){$pageTitle=encodeURIComponent($(".section-title h1").text())}else{$pageTitle=encodeURIComponent($(document).find("title").text())}
window.open('http://www.linkedin.com/shareArticle?mini=true&url='+windowLocation+'&title='+$pageTitle+'',"linkedInWindow","height=480,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0");return!1};NectarSocial.prototype.woolinkedInShare=function(){var windowLocation=window.location.href.replace(window.location.hash,'');window.open('http://www.linkedin.com/shareArticle?mini=true&url='+windowLocation+'&title='+$("h1.product_title").text(),"twitterWindow","height=380,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0");return!1};NectarSocial.prototype.pinterestShare=function(){var windowLocation=window.location.href.replace(window.location.hash,'');var $sharingImg=($('.single-portfolio').length>0&&$('div[data-featured-img]').attr('data-featured-img')!='empty')?$('div[data-featured-img]').attr('data-featured-img'):$('#ajax-content-wrap img').first().attr('src');var $pageTitle;if($(".section-title h1").length>0){$pageTitle=encodeURIComponent($(".section-title h1").text())}else{$pageTitle=encodeURIComponent($(document).find("title").text())}
window.open('http://pinterest.com/pin/create/button/?url='+windowLocation+'&media='+$sharingImg+'&description='+$pageTitle,"pinterestWindow","height=640,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0");return!1};NectarSocial.prototype.wooPinterestShare=function(){var $imgToShare=($('img.attachment-shop_single').length>0)?$('img.attachment-shop_single').first().attr('src'):$('.single-product-main-image img').first().attr('src');var windowLocation=window.location.href.replace(window.location.hash,'');window.open('http://pinterest.com/pin/create/button/?url='+windowLocation+'&media='+$imgToShare+'&description='+$('h1.product_title').text(),"pinterestWindow","height=640,width=660,resizable=0,toolbar=0,menubar=0,status=0,location=0,scrollbars=0");return!1};NectarSocial.prototype.nectarLove=function(){this.$body.on('click','.nectar-love',function(){var $loveLink=$(this),$id=$(this).attr('id'),$that=$(this);if($loveLink.hasClass('loved')||$(this).hasClass('inactive')){return!1}
var $dataToPass={action:'nectar-love',loves_id:$id,love_nonce:window.nectarLove.loveNonce};$.post(window.nectarLove.ajaxurl,$dataToPass,function(data){$loveLink.find('.nectar-love-count').html(data);$loveLink.addClass('loved').attr('title','You already love this!');$that.find('.icon-salient-heart-2').addClass('loved')});$(this).addClass('inactive');return!1})};NectarSocial.prototype.fixedStyle=function(){$('.wpb_wrapper .nectar-social.fixed').each(function(i){if(i!==0){$(this).remove()}else{var $fixedMarkup=$(this).clone();$('body').append($fixedMarkup);$(this).remove()}});function showFixedSharing(){if($(window).scrollTop()>150){$('.nectar-social.fixed').addClass('visible');$(window).off('scroll',showFixedSharing);$(window).on('scroll',hideFixedSharing)}}
function hideFixedSharing(){if($(window).scrollTop()<150){$('.nectar-social.fixed').removeClass('visible');$(window).off('scroll',hideFixedSharing);$(window).on('scroll',showFixedSharing)}}
if($('.nectar-social.fixed').length>0){if($(window).width()<1000){if($(window).scrollTop()>150){$(window).on('scroll',hideFixedSharing)}else{$(window).on('scroll',showFixedSharing)}}
$(window).on('smartresize',function(){if($(window).width()>1000){$('.nectar-social.fixed').addClass('visible')}else if($(window).scrollTop()<150){$(window).off('scroll',hideFixedSharing);$(window).on('scroll',showFixedSharing);$('.nectar-social.fixed').removeClass('visible')}else{$(window).off('scroll',showFixedSharing);$(window).on('scroll',hideFixedSharing)}})}};var nectarSocialInit=new NectarSocial();window.NectarSocial=NectarSocial})
;/*
* jQuery Easing v1.4.1 - http://gsgd.co.uk/sandbox/jquery/easing/
*/
!function(n){"function"==typeof define&&define.amd?define(["jquery"],function(e){return n(e)}):"object"==typeof module&&"object"==typeof module.exports?module.exports=n(require("jquery")):n(jQuery)}(function(n){function e(n){var e=7.5625,t=2.75;return n<1/t?e*n*n:n<2/t?e*(n-=1.5/t)*n+.75:n<2.5/t?e*(n-=2.25/t)*n+.9375:e*(n-=2.625/t)*n+.984375}void 0!==n.easing&&(n.easing.jswing=n.easing.swing);var t=Math.pow,u=Math.sqrt,r=Math.sin,i=Math.cos,a=Math.PI,o=1.70158,c=1.525*o,s=2*a/3,f=2*a/4.5;return n.extend(n.easing,{def:"easeOutQuad",swing:function(e){return n.easing[n.easing.def](e)},easeInQuad:function(n){return n*n},easeOutQuad:function(n){return 1-(1-n)*(1-n)},easeInOutQuad:function(n){return n<.5?2*n*n:1-t(-2*n+2,2)/2},easeInCubic:function(n){return n*n*n},easeOutCubic:function(n){return 1-t(1-n,3)},easeInOutCubic:function(n){return n<.5?4*n*n*n:1-t(-2*n+2,3)/2},easeInQuart:function(n){return n*n*n*n},easeOutQuart:function(n){return 1-t(1-n,4)},easeInOutQuart:function(n){return n<.5?8*n*n*n*n:1-t(-2*n+2,4)/2},easeInQuint:function(n){return n*n*n*n*n},easeOutQuint:function(n){return 1-t(1-n,5)},easeInOutQuint:function(n){return n<.5?16*n*n*n*n*n:1-t(-2*n+2,5)/2},easeInSine:function(n){return 1-i(n*a/2)},easeOutSine:function(n){return r(n*a/2)},easeInOutSine:function(n){return-(i(a*n)-1)/2},easeInExpo:function(n){return 0===n?0:t(2,10*n-10)},easeOutExpo:function(n){return 1===n?1:1-t(2,-10*n)},easeInOutExpo:function(n){return 0===n?0:1===n?1:n<.5?t(2,20*n-10)/2:(2-t(2,-20*n+10))/2},easeInCirc:function(n){return 1-u(1-t(n,2))},easeOutCirc:function(n){return u(1-t(n-1,2))},easeInOutCirc:function(n){return n<.5?(1-u(1-t(2*n,2)))/2:(u(1-t(-2*n+2,2))+1)/2},easeInElastic:function(n){return 0===n?0:1===n?1:-t(2,10*n-10)*r((10*n-10.75)*s)},easeOutElastic:function(n){return 0===n?0:1===n?1:t(2,-10*n)*r((10*n-.75)*s)+1},easeInOutElastic:function(n){return 0===n?0:1===n?1:n<.5?-t(2,20*n-10)*r((20*n-11.125)*f)/2:t(2,-20*n+10)*r((20*n-11.125)*f)/2+1},easeInBack:function(n){return 2.70158*n*n*n-o*n*n},easeOutBack:function(n){return 1+2.70158*t(n-1,3)+o*t(n-1,2)},easeInOutBack:function(n){return n<.5?t(2*n,2)*(7.189819*n-c)/2:(t(2*n-2,2)*((c+1)*(2*n-2)+c)+2)/2},easeInBounce:function(n){return 1-e(1-n)},easeOutBounce:e,easeInOutBounce:function(n){return n<.5?(1-e(1-2*n))/2:(1+e(2*n-1))/2}}),n});
;/*!
* jQuery Mousewheel 3.1.13
* Copyright OpenJS Foundation and other contributors
*/
!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?module.exports=e:e(jQuery)}(function(u){var f,d,e=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],t="onwheel"in window.document||9<=window.document.documentMode?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],w=Array.prototype.slice;if(u.event.fixHooks)for(var i=e.length;i;)u.event.fixHooks[e[--i]]=u.event.mouseHooks;var c=u.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var e=t.length;e;)this.addEventListener(t[--e],n,{passive:false});else this.onmousewheel=n;u.data(this,"mousewheel-line-height",c.getLineHeight(this)),u.data(this,"mousewheel-page-height",c.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var e=t.length;e;)this.removeEventListener(t[--e],n,!1);else this.onmousewheel=null;u.removeData(this,"mousewheel-line-height"),u.removeData(this,"mousewheel-page-height")},getLineHeight:function(e){var t=u(e),i=t["offsetParent"in u.fn?"offsetParent":"parent"]();return i.length||(i=u("body")),parseInt(i.css("fontSize"),10)||parseInt(t.css("fontSize"),10)||16},getPageHeight:function(e){return u(e).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};function n(e){var t,i=e||window.event,n=w.call(arguments,1),o=0,l=0,s=0;if((e=u.event.fix(i)).type="mousewheel","detail"in i&&(s=-1*i.detail),"wheelDelta"in i&&(s=i.wheelDelta),"wheelDeltaY"in i&&(s=i.wheelDeltaY),"wheelDeltaX"in i&&(l=-1*i.wheelDeltaX),"axis"in i&&i.axis===i.HORIZONTAL_AXIS&&(l=-1*s,s=0),o=0===s?l:s,"deltaY"in i&&(o=s=-1*i.deltaY),"deltaX"in i&&(l=i.deltaX,0===s&&(o=-1*l)),0!==s||0!==l){if(1===i.deltaMode){var a=u.data(this,"mousewheel-line-height");o*=a,s*=a,l*=a}else if(2===i.deltaMode){var h=u.data(this,"mousewheel-page-height");o*=h,s*=h,l*=h}if(t=Math.max(Math.abs(s),Math.abs(l)),(!d||t<d)&&g(i,d=t)&&(d/=40),g(i,t)&&(o/=40,l/=40,s/=40),o=Math[1<=o?"floor":"ceil"](o/d),l=Math[1<=l?"floor":"ceil"](l/d),s=Math[1<=s?"floor":"ceil"](s/d),c.settings.normalizeOffset&&this.getBoundingClientRect){var r=this.getBoundingClientRect();e.offsetX=e.clientX-r.left,e.offsetY=e.clientY-r.top}return e.deltaX=l,e.deltaY=s,e.deltaFactor=d,e.deltaMode=0,n.unshift(e,o,l,s),f&&window.clearTimeout(f),f=window.setTimeout(m,200),(u.event.dispatch||u.event.handle).apply(this,n)}}function m(){d=null}function g(e,t){return c.settings.adjustOldDeltas&&"mousewheel"===e.type&&t%120==0}u.fn.extend({mousewheel:function(e){return e?this.on("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.off("mousewheel",e)}})});
;var headerEl=document.getElementById("header-outer"),headerSpaceEl=document.getElementById("header-space");void 0!==headerEl&&null!=headerEl&&void 0!==headerSpaceEl&&null!=headerSpaceEl&&headerSpaceEl.hasAttribute("data-secondary-header-display")&&(headerSpaceEl.style.height=headerEl.clientHeight+"px"),jQuery(function(e){"use strict";var t,a,r,n,o,d,i=!1;function h(){var a=t.offset().top;e("#page-header-wrap.fullscreen-header").css("height","auto"),t.css("height",parseInt(window.innerHeight)-parseInt(a)+"px")}if(navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)&&(i=!0),i&&e("#page-header-bg.fullscreen-header").length>0){t=e("#page-header-bg"),h();var l=window.innerWidth,s=window.innerHeight;e(window).resize(function(){e(window).width()!=l&&e(window).height!=s&&(h(),l=window.innerWidth,s=window.innerHeight)})}i&&e(".nectar_fullscreen_zoom_recent_projects").length>0&&(a=e(".body-border-top").length>0&&e(window).width()>1e3?e(".body-border-top").height():0,e(".nectar_fullscreen_zoom_recent_projects").each(function(){e(this).parents(".first-section").length>0?e(this).css("height",e(window).height()-e(this).offset().top-a):e(this).css("height",e(window).height())})),e('#header-outer[data-format="centered-menu-bottom-bar"]').length>0&&(r=e('#header-outer[data-format="centered-menu-bottom-bar"] header#top .span_9'),n=e('#header-outer[data-format="centered-menu-bottom-bar"] header#top .span_3'),o=e("#header-secondary-outer"),(d=n.find("#logo").clone()).is('[data-supplied-ml="true"]')&&d.find("img:not(.mobile-only-logo)").remove(),d.find("img.starting-logo").remove(),o.length>0&&o.addClass("centered-menu-bottom-bar"),e('#header-outer[data-condense="true"]').length>0&&0==e('#header-outer[data-menu-bottom-bar-align="left"]').length&&r.prepend(d)),e('#page-header-bg[data-animate-in-effect="zoom-out"]').addClass("loaded")})
;/*!
* jQuery Transit - CSS3 transitions and transformations
* (c) 2011-2012 Rico Sta. Cruz <rico@ricostacruz.com>
* MIT Licensed.
*/
(function(k){k.transit={version:"0.9.9",propertyMap:{marginLeft:"margin",marginRight:"margin",marginBottom:"margin",marginTop:"margin",paddingLeft:"padding",paddingRight:"padding",paddingBottom:"padding",paddingTop:"padding"},enabled:true,useTransitionEnd:false};var d=document.createElement("div");var q={};function b(v){if(v in d.style){return v}var u=["Moz","Webkit","O","ms"];var r=v.charAt(0).toUpperCase()+v.substr(1);if(v in d.style){return v}for(var t=0;t<u.length;++t){var s=u[t]+r;if(s in d.style){return s}}}function e(){d.style[q.transform]="";d.style[q.transform]="rotateY(90deg)";return d.style[q.transform]!==""}var a=navigator.userAgent.toLowerCase().indexOf("chrome")>-1;q.transition=b("transition");q.transitionDelay=b("transitionDelay");q.transform=b("transform");q.transformOrigin=b("transformOrigin");q.transform3d=e();var i={transition:"transitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",WebkitTransition:"webkitTransitionEnd",msTransition:"MSTransitionEnd"};var f=q.transitionEnd=i[q.transition]||null;for(var p in q){if(q.hasOwnProperty(p)&&typeof k.support[p]==="undefined"){k.support[p]=q[p]}}d=null;k.cssEase={_default:"ease","in":"ease-in",out:"ease-out","in-out":"ease-in-out",snap:"cubic-bezier(0,1,.5,1)",easeOutCubic:"cubic-bezier(.215,.61,.355,1)",easeInOutCubic:"cubic-bezier(.645,.045,.355,1)",easeInCirc:"cubic-bezier(.6,.04,.98,.335)",easeOutCirc:"cubic-bezier(.075,.82,.165,1)",easeInOutCirc:"cubic-bezier(.785,.135,.15,.86)",easeInExpo:"cubic-bezier(.95,.05,.795,.035)",easeOutExpo:"cubic-bezier(.19,1,.22,1)",easeInOutExpo:"cubic-bezier(1,0,0,1)",easeInQuad:"cubic-bezier(.55,.085,.68,.53)",easeOutQuad:"cubic-bezier(.25,.46,.45,.94)",easeInOutQuad:"cubic-bezier(.455,.03,.515,.955)",easeInQuart:"cubic-bezier(.895,.03,.685,.22)",easeOutQuart:"cubic-bezier(.165,.84,.44,1)",easeInOutQuart:"cubic-bezier(.77,0,.175,1)",easeInQuint:"cubic-bezier(.755,.05,.855,.06)",easeOutQuint:"cubic-bezier(.23,1,.32,1)",easeInOutQuint:"cubic-bezier(.86,0,.07,1)",easeInSine:"cubic-bezier(.47,0,.745,.715)",easeOutSine:"cubic-bezier(.39,.575,.565,1)",easeInOutSine:"cubic-bezier(.445,.05,.55,.95)",easeInBack:"cubic-bezier(.6,-.28,.735,.045)",easeOutBack:"cubic-bezier(.175, .885,.32,1.275)",easeInOutBack:"cubic-bezier(.68,-.55,.265,1.55)"};k.cssHooks["transit:transform"]={get:function(r){return k(r).data("transform")||new j()},set:function(s,r){var t=r;if(!(t instanceof j)){t=new j(t)}if(q.transform==="WebkitTransform"&&!a){s.style[q.transform]=t.toString(true)}else{s.style[q.transform]=t.toString()}k(s).data("transform",t)}};k.cssHooks.transform={set:k.cssHooks["transit:transform"].set};if(k.fn.jquery<"1.8"){k.cssHooks.transformOrigin={get:function(r){return r.style[q.transformOrigin]},set:function(r,s){r.style[q.transformOrigin]=s}};k.cssHooks.transition={get:function(r){return r.style[q.transition]},set:function(r,s){r.style[q.transition]=s}}}n("scale");n("translate");n("rotate");n("rotateX");n("rotateY");n("rotate3d");n("perspective");n("skewX");n("skewY");n("x",true);n("y",true);function j(r){if(typeof r==="string"){this.parse(r)}return this}j.prototype={setFromString:function(t,s){var r=(typeof s==="string")?s.split(","):(s.constructor===Array)?s:[s];r.unshift(t);j.prototype.set.apply(this,r)},set:function(s){var r=Array.prototype.slice.apply(arguments,[1]);if(this.setter[s]){this.setter[s].apply(this,r)}else{this[s]=r.join(",")}},get:function(r){if(this.getter[r]){return this.getter[r].apply(this)}else{return this[r]||0}},setter:{rotate:function(r){this.rotate=o(r,"deg")},rotateX:function(r){this.rotateX=o(r,"deg")},rotateY:function(r){this.rotateY=o(r,"deg")},scale:function(r,s){if(s===undefined){s=r}this.scale=r+","+s},skewX:function(r){this.skewX=o(r,"deg")},skewY:function(r){this.skewY=o(r,"deg")},perspective:function(r){this.perspective=o(r,"px")},x:function(r){this.set("translate",r,null)},y:function(r){this.set("translate",null,r)},translate:function(r,s){if(this._translateX===undefined){this._translateX=0}if(this._translateY===undefined){this._translateY=0}if(r!==null&&r!==undefined){this._translateX=o(r,"px")}if(s!==null&&s!==undefined){this._translateY=o(s,"px")}this.translate=this._translateX+","+this._translateY}},getter:{x:function(){return this._translateX||0},y:function(){return this._translateY||0},scale:function(){var r=(this.scale||"1,1").split(",");if(r[0]){r[0]=parseFloat(r[0])}if(r[1]){r[1]=parseFloat(r[1])}return(r[0]===r[1])?r[0]:r},rotate3d:function(){var t=(this.rotate3d||"0,0,0,0deg").split(",");for(var r=0;r<=3;++r){if(t[r]){t[r]=parseFloat(t[r])}}if(t[3]){t[3]=o(t[3],"deg")}return t}},parse:function(s){var r=this;s.replace(/([a-zA-Z0-9]+)\((.*?)\)/g,function(t,v,u){r.setFromString(v,u)})},toString:function(t){var s=[];for(var r in this){if(this.hasOwnProperty(r)){if((!q.transform3d)&&((r==="rotateX")||(r==="rotateY")||(r==="perspective")||(r==="transformOrigin"))){continue}if(r[0]!=="_"){if(t&&(r==="scale")){s.push(r+"3d("+this[r]+",1)")}else{if(t&&(r==="translate")){s.push(r+"3d("+this[r]+",0)")}else{s.push(r+"("+this[r]+")")}}}}}return s.join(" ")}};function m(s,r,t){if(r===true){s.queue(t)}else{if(r){s.queue(r,t)}else{t()}}}function h(s){var r=[];k.each(s,function(t){t=k.camelCase(t);t=k.transit.propertyMap[t]||k.cssProps[t]||t;t=c(t);if(k.inArray(t,r)===-1){r.push(t)}});return r}function g(s,v,x,r){var t=h(s);if(k.cssEase[x]){x=k.cssEase[x]}var w=""+l(v)+" "+x;if(parseInt(r,10)>0){w+=" "+l(r)}var u=[];k.each(t,function(z,y){u.push(y+" "+w)});return u.join(", ")}k.fn.transition=k.fn.transit=function(z,s,y,C){var D=this;var u=0;var w=true;if(typeof s==="function"){C=s;s=undefined}if(typeof y==="function"){C=y;y=undefined}if(typeof z.easing!=="undefined"){y=z.easing;delete z.easing}if(typeof z.duration!=="undefined"){s=z.duration;delete z.duration}if(typeof z.complete!=="undefined"){C=z.complete;delete z.complete}if(typeof z.queue!=="undefined"){w=z.queue;delete z.queue}if(typeof z.delay!=="undefined"){u=z.delay;delete z.delay}if(typeof s==="undefined"){s=k.fx.speeds._default}if(typeof y==="undefined"){y=k.cssEase._default}s=l(s);var E=g(z,s,y,u);var B=k.transit.enabled&&q.transition;var t=B?(parseInt(s,10)+parseInt(u,10)):0;if(t===0){var A=function(F){D.css(z);if(C){C.apply(D)}if(F){F()}};m(D,w,A);return D}var x={};var r=function(H){var G=false;var F=function(){if(G){D.unbind(f,F)}if(t>0){D.each(function(){this.style[q.transition]=(x[this]||null)})}if(typeof C==="function"){C.apply(D)}if(typeof H==="function"){H()}};if((t>0)&&(f)&&(k.transit.useTransitionEnd)){G=true;D.bind(f,F)}else{window.setTimeout(F,t)}D.each(function(){if(t>0){this.style[q.transition]=E}k(this).css(z)})};var v=function(F){this.offsetWidth;r(F)};m(D,w,v);return this};function n(s,r){if(!r){k.cssNumber[s]=true}k.transit.propertyMap[s]=q.transform;k.cssHooks[s]={get:function(v){var u=k(v).css("transit:transform");return u.get(s)},set:function(v,w){var u=k(v).css("transit:transform");u.setFromString(s,w);k(v).css({"transit:transform":u})}}}function c(r){return r.replace(/([A-Z])/g,function(s){return"-"+s.toLowerCase()})}function o(s,r){if((typeof s==="string")&&(!s.match(/^[\-0-9\.]+$/))){return s}else{return""+s+r}}function l(s){var r=s;if(k.fx.speeds[r]){r=k.fx.speeds[r]}return o(r,"ms")}k.transit.getTransitionValue=g})(jQuery);
;!function(){"use strict";var t=0,e={};function i(o){if(!o)throw new Error("No options passed to Waypoint constructor");if(!o.element)throw new Error("No element option passed to Waypoint constructor");if(!o.handler)throw new Error("No handler option passed to Waypoint constructor");this.key="waypoint-"+t,this.options=i.Adapter.extend({},i.defaults,o),this.element=this.options.element,this.adapter=new i.Adapter(this.element),this.callback=o.handler,this.axis=this.options.horizontal?"horizontal":"vertical",this.enabled=this.options.enabled,this.triggerPoint=null,this.group=i.Group.findOrCreate({name:this.options.group,axis:this.axis}),this.context=i.Context.findOrCreateByElement(this.options.context),i.offsetAliases[this.options.offset]&&(this.options.offset=i.offsetAliases[this.options.offset]),this.group.add(this),this.context.add(this),e[this.key]=this,t+=1}i.prototype.queueTrigger=function(t){this.group.queueTrigger(this,t)},i.prototype.trigger=function(t){this.enabled&&this.callback&&this.callback.apply(this,t)},i.prototype.destroy=function(){this.context.remove(this),this.group.remove(this),delete e[this.key]},i.prototype.disable=function(){return this.enabled=!1,this},i.prototype.enable=function(){return this.context.refresh(),this.enabled=!0,this},i.prototype.next=function(){return this.group.next(this)},i.prototype.previous=function(){return this.group.previous(this)},i.invokeAll=function(t){var i=[];for(var o in e)i.push(e[o]);for(var n=0,r=i.length;n<r;n++)i[n][t]()},i.destroyAll=function(){i.invokeAll("destroy")},i.disableAll=function(){i.invokeAll("disable")},i.enableAll=function(){for(var t in i.Context.refreshAll(),e)e[t].enabled=!0;return this},i.refreshAll=function(){i.Context.refreshAll()},i.viewportHeight=function(){return window.nectarDOMInfo&&window.nectarDOMInfo.winH?window.nectarDOMInfo.winH:window.innerHeight||document.documentElement.clientHeight},i.viewportWidth=function(){return window.nectarDOMInfo&&window.nectarDOMInfo.winW?window.nectarDOMInfo.winW:document.documentElement.clientWidth},i.adapters=[],i.defaults={context:window,continuous:!0,enabled:!0,group:"default",horizontal:!1,offset:0},i.offsetAliases={"bottom-in-view":function(){return this.context.innerHeight()-this.adapter.outerHeight()},"right-in-view":function(){return this.context.innerWidth()-this.adapter.outerWidth()}},window.Waypoint=i}(),function(){"use strict";function t(t){window.setTimeout(t,1e3/60)}var e=0,i={},o=window.Waypoint,n=window.onload;function r(t){this.element=t,this.Adapter=o.Adapter,this.adapter=new this.Adapter(t),this.key="waypoint-context-"+e,this.didScroll=!1,this.didResize=!1,this.oldScroll={x:this.adapter.scrollLeft(),y:this.adapter.scrollTop()},this.waypoints={vertical:{},horizontal:{}},t.waypointContextKey=this.key,i[t.waypointContextKey]=this,e+=1,o.windowContext||(o.windowContext=!0,o.windowContext=new r(window)),this.createThrottledScrollHandler(),this.createThrottledResizeHandler()}r.prototype.add=function(t){var e=t.options.horizontal?"horizontal":"vertical";this.waypoints[e][t.key]=t,this.refresh()},r.prototype.checkEmpty=function(){var t=this.Adapter.isEmptyObject(this.waypoints.horizontal),e=this.Adapter.isEmptyObject(this.waypoints.vertical),o=this.element==this.element.window;t&&e&&!o&&(this.adapter.off(".waypoints"),delete i[this.key])},r.prototype.createThrottledResizeHandler=function(){var t=this;function e(){t.handleResize(),t.didResize=!1}this.adapter.on("resize.waypoints",function(){t.didResize||(t.didResize=!0,o.requestAnimationFrame(e))})},r.prototype.createThrottledScrollHandler=function(){var t=this;function e(){t.handleScroll(),t.didScroll=!1}this.adapter.on("scroll.waypoints",function(){t.didScroll&&!o.isTouch||(t.didScroll=!0,o.requestAnimationFrame(e))})},r.prototype.handleResize=function(){setTimeout(function(){o.Context.refreshAll()},150)},r.prototype.handleScroll=function(){var t={},e={horizontal:{newScroll:0,oldScroll:0,forward:"right",backward:"left"},vertical:{newScroll:window.nectarDOMInfo?window.nectarDOMInfo.scrollTop:0,oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};for(var i in e){var o=e[i],n=o.newScroll>o.oldScroll?o.forward:o.backward;for(var r in this.waypoints[i]){var s=this.waypoints[i][r];if(null!==s.triggerPoint){var a=o.oldScroll<s.triggerPoint,l=o.newScroll>=s.triggerPoint;(a&&l||!a&&!l)&&(s.queueTrigger(n),t[s.group.id]=s.group)}}}for(var h in t)t[h].flushTriggers();this.oldScroll={x:e.horizontal.newScroll,y:e.vertical.newScroll}},r.prototype.innerHeight=function(){return this.element==this.element.window?o.viewportHeight():this.adapter.innerHeight()},r.prototype.remove=function(t){delete this.waypoints[t.axis][t.key],this.checkEmpty()},r.prototype.innerWidth=function(){return this.element==this.element.window?o.viewportWidth():this.adapter.innerWidth()},r.prototype.destroy=function(){var t=[];for(var e in this.waypoints)for(var i in this.waypoints[e])t.push(this.waypoints[e][i]);for(var o=0,n=t.length;o<n;o++)t[o].destroy()},r.prototype.refresh=function(){var t,e=this.element==this.element.window,i=e?void 0:this.adapter.offset(),n={};for(var r in this.handleScroll(),t={horizontal:{contextOffset:e?0:i.left,contextScroll:e?0:this.oldScroll.x,contextDimension:this.innerWidth(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:e?0:i.top,contextScroll:e?0:this.oldScroll.y,contextDimension:this.innerHeight(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}}){var s=t[r];for(var a in this.waypoints[r]){var l,h,p,c,u=this.waypoints[r][a],d=u.options.offset,f=u.triggerPoint,w=0,y=null==f;u.element!==u.element.window&&(w=u.adapter.offset()[s.offsetProp]),"function"==typeof d?d=d.apply(u):"string"==typeof d&&(d=parseFloat(d),u.options.offset.indexOf("%")>-1&&(d=Math.ceil(s.contextDimension*d/100))),l=s.contextScroll-s.contextOffset,u.triggerPoint=Math.floor(w+l-d),h=f<s.oldScroll,p=u.triggerPoint>=s.oldScroll,c=!h&&!p,!y&&(h&&p)?(u.queueTrigger(s.backward),n[u.group.id]=u.group):!y&&c?(u.queueTrigger(s.forward),n[u.group.id]=u.group):y&&s.oldScroll>=u.triggerPoint&&(u.queueTrigger(s.forward),n[u.group.id]=u.group)}}return o.requestAnimationFrame(function(){for(var t in n)n[t].flushTriggers()}),this},r.findOrCreateByElement=function(t){return r.findByElement(t)||new r(t)},r.refreshAll=function(){for(var t in i)i[t].refresh()},r.findByElement=function(t){return i[t.waypointContextKey]},window.onload=function(){n&&n(),r.refreshAll()},o.requestAnimationFrame=function(e){(window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||t).call(window,e)},o.Context=r}(),function(){"use strict";function t(t,e){return t.triggerPoint-e.triggerPoint}function e(t,e){return e.triggerPoint-t.triggerPoint}var i={vertical:{},horizontal:{}},o=window.Waypoint;function n(t){this.name=t.name,this.axis=t.axis,this.id=this.name+"-"+this.axis,this.waypoints=[],this.clearTriggerQueues(),i[this.axis][this.name]=this}n.prototype.add=function(t){this.waypoints.push(t)},n.prototype.clearTriggerQueues=function(){this.triggerQueues={up:[],down:[],left:[],right:[]}},n.prototype.flushTriggers=function(){for(var i in this.triggerQueues){var o=this.triggerQueues[i],n="up"===i||"left"===i;o.sort(n?e:t);for(var r=0,s=o.length;r<s;r+=1){var a=o[r];(a.options.continuous||r===o.length-1)&&a.trigger([i])}}this.clearTriggerQueues()},n.prototype.next=function(e){this.waypoints.sort(t);var i=o.Adapter.inArray(e,this.waypoints);return i===this.waypoints.length-1?null:this.waypoints[i+1]},n.prototype.previous=function(e){this.waypoints.sort(t);var i=o.Adapter.inArray(e,this.waypoints);return i?this.waypoints[i-1]:null},n.prototype.queueTrigger=function(t,e){this.triggerQueues[e].push(t)},n.prototype.remove=function(t){var e=o.Adapter.inArray(t,this.waypoints);e>-1&&this.waypoints.splice(e,1)},n.prototype.first=function(){return this.waypoints[0]},n.prototype.last=function(){return this.waypoints[this.waypoints.length-1]},n.findOrCreate=function(t){return i[t.axis][t.name]||new n(t)},o.Group=n}(),function(){"use strict";var t=window.jQuery,e=window.Waypoint;function i(e){this.$element=t(e)}t.each(["innerHeight","innerWidth","off","offset","on","outerHeight","outerWidth","scrollLeft","scrollTop"],function(t,e){i.prototype[e]=function(){var t=Array.prototype.slice.call(arguments);return this.$element[e].apply(this.$element,t)}}),t.each(["extend","inArray","isEmptyObject"],function(e,o){i[o]=t[o]}),e.adapters.push({name:"jquery",Adapter:i}),e.Adapter=i}(),function(){"use strict";var t=window.Waypoint;function e(e){return function(){var i=[],o=arguments[0];return e.isFunction(arguments[0])&&((o=e.extend({},arguments[1])).handler=arguments[0]),this.each(function(){var n=e.extend({},o,{element:this});"string"==typeof n.context&&(n.context=e(this).closest(n.context)[0]),i.push(new t(n))}),i}}window.jQuery&&(window.jQuery.fn.waypoint=e(window.jQuery)),window.Zepto&&(window.Zepto.fn.waypoint=e(window.Zepto))}()
;/*!
* imagesLoaded PACKAGED v4.1.4
* JavaScript is all like "You images are done yet or what?"
* MIT License
*/
!function(e,t){"function"==typeof define&&define.amd?define("ev-emitter/ev-emitter",t):"object"==typeof module&&module.exports?module.exports=t():e.EvEmitter=t()}("undefined"!=typeof window?window:this,function(){function e(){}var t=e.prototype;return t.on=function(e,t){if(e&&t){var i=this._events=this._events||{},n=i[e]=i[e]||[];return n.indexOf(t)==-1&&n.push(t),this}},t.once=function(e,t){if(e&&t){this.on(e,t);var i=this._onceEvents=this._onceEvents||{},n=i[e]=i[e]||{};return n[t]=!0,this}},t.off=function(e,t){var i=this._events&&this._events[e];if(i&&i.length){var n=i.indexOf(t);return n!=-1&&i.splice(n,1),this}},t.emitEvent=function(e,t){var i=this._events&&this._events[e];if(i&&i.length){i=i.slice(0),t=t||[];for(var n=this._onceEvents&&this._onceEvents[e],o=0;o<i.length;o++){var r=i[o],s=n&&n[r];s&&(this.off(e,r),delete n[r]),r.apply(this,t)}return this}},t.allOff=function(){delete this._events,delete this._onceEvents},e}),function(e,t){"use strict";"function"==typeof define&&define.amd?define(["ev-emitter/ev-emitter"],function(i){return t(e,i)}):"object"==typeof module&&module.exports?module.exports=t(e,require("ev-emitter")):e.imagesLoaded=t(e,e.EvEmitter)}("undefined"!=typeof window?window:this,function(e,t){function i(e,t){for(var i in t)e[i]=t[i];return e}function n(e){if(Array.isArray(e))return e;var t="object"==typeof e&&"number"==typeof e.length;return t?d.call(e):[e]}function o(e,t,r){if(!(this instanceof o))return new o(e,t,r);var s=e;return"string"==typeof e&&(s=document.querySelectorAll(e)),s?(this.elements=n(s),this.options=i({},this.options),"function"==typeof t?r=t:i(this.options,t),r&&this.on("always",r),this.getImages(),h&&(this.jqDeferred=new h.Deferred),void setTimeout(this.check.bind(this))):void a.error("Bad element for imagesLoaded "+(s||e))}function r(e){this.img=e}function s(e,t){this.url=e,this.element=t,this.img=new Image}var h=e.jQuery,a=e.console,d=Array.prototype.slice;o.prototype=Object.create(t.prototype),o.prototype.options={},o.prototype.getImages=function(){this.images=[],this.elements.forEach(this.addElementImages,this)},o.prototype.addElementImages=function(e){"IMG"==e.nodeName&&this.addImage(e),this.options.background===!0&&this.addElementBackgroundImages(e);var t=e.nodeType;if(t&&u[t]){for(var i=e.querySelectorAll("img"),n=0;n<i.length;n++){var o=i[n];this.addImage(o)}if("string"==typeof this.options.background){var r=e.querySelectorAll(this.options.background);for(n=0;n<r.length;n++){var s=r[n];this.addElementBackgroundImages(s)}}}};var u={1:!0,9:!0,11:!0};return o.prototype.addElementBackgroundImages=function(e){var t=getComputedStyle(e);if(t)for(var i=/url\((['"])?(.*?)\1\)/gi,n=i.exec(t.backgroundImage);null!==n;){var o=n&&n[2];o&&this.addBackground(o,e),n=i.exec(t.backgroundImage)}},o.prototype.addImage=function(e){var t=new r(e);this.images.push(t)},o.prototype.addBackground=function(e,t){var i=new s(e,t);this.images.push(i)},o.prototype.check=function(){function e(e,i,n){setTimeout(function(){t.progress(e,i,n)})}var t=this;return this.progressedCount=0,this.hasAnyBroken=!1,this.images.length?void this.images.forEach(function(t){t.once("progress",e),t.check()}):void this.complete()},o.prototype.progress=function(e,t,i){this.progressedCount++,this.hasAnyBroken=this.hasAnyBroken||!e.isLoaded,this.emitEvent("progress",[this,e,t]),this.jqDeferred&&this.jqDeferred.notify&&this.jqDeferred.notify(this,e),this.progressedCount==this.images.length&&this.complete(),this.options.debug&&a&&a.log("progress: "+i,e,t)},o.prototype.complete=function(){var e=this.hasAnyBroken?"fail":"done";if(this.isComplete=!0,this.emitEvent(e,[this]),this.emitEvent("always",[this]),this.jqDeferred){var t=this.hasAnyBroken?"reject":"resolve";this.jqDeferred[t](this)}},r.prototype=Object.create(t.prototype),r.prototype.check=function(){var e=this.getIsImageComplete();return e?void this.confirm(0!==this.img.naturalWidth,"naturalWidth"):(this.proxyImage=new Image,this.proxyImage.addEventListener("load",this),this.proxyImage.addEventListener("error",this),this.img.addEventListener("load",this),this.img.addEventListener("error",this),void(this.proxyImage.src=this.img.src))},r.prototype.getIsImageComplete=function(){return this.img.complete&&this.img.naturalWidth},r.prototype.confirm=function(e,t){this.isLoaded=e,this.emitEvent("progress",[this,this.img,t])},r.prototype.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},r.prototype.onload=function(){this.confirm(!0,"onload"),this.unbindEvents()},r.prototype.onerror=function(){this.confirm(!1,"onerror"),this.unbindEvents()},r.prototype.unbindEvents=function(){this.proxyImage.removeEventListener("load",this),this.proxyImage.removeEventListener("error",this),this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},s.prototype=Object.create(r.prototype),s.prototype.check=function(){this.img.addEventListener("load",this),this.img.addEventListener("error",this),this.img.src=this.url;var e=this.getIsImageComplete();e&&(this.confirm(0!==this.img.naturalWidth,"naturalWidth"),this.unbindEvents())},s.prototype.unbindEvents=function(){this.img.removeEventListener("load",this),this.img.removeEventListener("error",this)},s.prototype.confirm=function(e,t){this.isLoaded=e,this.emitEvent("progress",[this,this.element,t])},o.makeJQueryPlugin=function(t){t=t||e.jQuery,t&&(h=t,h.fn.imagesLoaded=function(e,t){var i=new o(this,e,t);return i.jqDeferred.promise(h(this))})},o.makeJQueryPlugin(),o});
;/*!
* hoverIntent v1.9.0 // 2017.09.01 // jQuery v1.7.0+
* http://briancherne.github.io/jquery-hoverIntent/
*
* You may use hoverIntent under the terms of the MIT license. Basically that
* means you are free to use hoverIntent as long as this header is left intact.
* Copyright 2007-2017 Brian Cherne
*/
!function(factory){"use strict";"function"==typeof define&&define.amd?define(["jquery"],factory):jQuery&&!jQuery.fn.hoverIntent&&factory(jQuery)}(function($){"use strict";var cX,cY,_cfg={interval:100,sensitivity:6,timeout:0},INSTANCE_COUNT=0,track=function(ev){cX=ev.pageX,cY=ev.pageY},compare=function(ev,$el,s,cfg){if(Math.sqrt((s.pX-cX)*(s.pX-cX)+(s.pY-cY)*(s.pY-cY))<cfg.sensitivity)return $el.off(s.event,track),delete s.timeoutId,s.isActive=!0,ev.pageX=cX,ev.pageY=cY,delete s.pX,delete s.pY,cfg.over.apply($el[0],[ev]);s.pX=cX,s.pY=cY,s.timeoutId=setTimeout(function(){compare(ev,$el,s,cfg)},cfg.interval)},delay=function(ev,$el,s,out){return delete $el.data("hoverIntent")[s.id],out.apply($el[0],[ev])};$.fn.hoverIntent=function(handlerIn,handlerOut,selector){var instanceId=INSTANCE_COUNT++,cfg=$.extend({},_cfg);$.isPlainObject(handlerIn)?(cfg=$.extend(cfg,handlerIn),$.isFunction(cfg.out)||(cfg.out=cfg.over)):cfg=$.isFunction(handlerOut)?$.extend(cfg,{over:handlerIn,out:handlerOut,selector:selector}):$.extend(cfg,{over:handlerIn,out:handlerIn,selector:handlerOut});var handleHover=function(e){var ev=$.extend({},e),$el=$(this),hoverIntentData=$el.data("hoverIntent");hoverIntentData||$el.data("hoverIntent",hoverIntentData={});var state=hoverIntentData[instanceId];state||(hoverIntentData[instanceId]=state={id:instanceId}),state.timeoutId&&(state.timeoutId=clearTimeout(state.timeoutId));var mousemove=state.event="mousemove.hoverIntent.hoverIntent"+instanceId;if("mouseenter"===e.type){if(state.isActive)return;state.pX=ev.pageX,state.pY=ev.pageY,$el.off(mousemove,track).on(mousemove,track),state.timeoutId=setTimeout(function(){compare(ev,$el,state,cfg)},cfg.interval)}else{if(!state.isActive)return;$el.off(mousemove,track),state.timeoutId=setTimeout(function(){delay(ev,$el,state,cfg.out)},cfg.timeout)}};return this.on({"mouseenter.hoverIntent":handleHover,"mouseleave.hoverIntent":handleHover},cfg.selector)}});
;// ==================================================
// fancyBox v3.5.7
//
// Licensed GPLv3 for open source use
// or fancyBox Commercial License for commercial use
//
// http://fancyapps.com/fancybox/
// Copyright 2019 fancyApps
//
// ==================================================
!function(t,e,n,o){"use strict";function i(t,e){var o,i,a,s=[],r=0;t&&t.isDefaultPrevented()||(t.preventDefault(),e=e||{},t&&t.data&&(e=h(t.data.options,e)),o=e.$target||n(t.currentTarget).trigger("blur"),(a=n.fancybox.getInstance())&&a.$trigger&&a.$trigger.is(o)||(e.selector?s=n(e.selector):(i=o.attr("data-fancybox")||"",i?(s=t.data?t.data.items:[],s=s.length?s.filter('[data-fancybox="'+i+'"]'):n('[data-fancybox="'+i+'"]')):s=[o]),r=n(s).index(o),r<0&&(r=0),a=n.fancybox.open(s,e,r),a.$trigger=o))}if(t.console=t.console||{info:function(t){}},n){if(n.fn.fancybox)return void console.info("fancyBox already initialized");var a={closeExisting:!1,loop:!1,gutter:50,keyboard:!0,preventCaptionOverlap:!0,arrows:!0,infobar:!0,smallBtn:"auto",toolbar:"auto",buttons:["zoom","slideShow","thumbs","close"],idleTime:3,protect:!1,modal:!1,image:{preload:!1},ajax:{settings:{data:{fancybox:!0}}},iframe:{tpl:'<iframe id="fancybox-frame{rnd}" name="fancybox-frame{rnd}" class="fancybox-iframe" allowfullscreen="allowfullscreen" allow="autoplay; fullscreen" src=""></iframe>',preload:!0,css:{},attr:{scrolling:"auto"}},video:{tpl:'<video class="fancybox-video" playsinline controls controlsList="nodownload" poster="{{poster}}"><source src="{{src}}" type="{{format}}" />Sorry, your browser doesn\'t support embedded videos, <a href="{{src}}">download</a> and watch with your favorite video player!</video>',format:"",autoStart:!0},defaultType:"image",animationEffect:"zoom",animationDuration:366,zoomOpacity:"auto",transitionEffect:"fade",transitionDuration:366,slideClass:"",baseClass:"",baseTpl:'<div class="fancybox-container" role="dialog" tabindex="-1"><div class="fancybox-bg"></div><div class="fancybox-inner"><div class="fancybox-infobar"><span data-fancybox-index></span> / <span data-fancybox-count></span></div><div class="fancybox-toolbar">{{buttons}}</div><div class="fancybox-navigation">{{arrows}}</div><div class="fancybox-stage"></div><div class="fancybox-caption"><div class="fancybox-caption__body"></div></div></div></div>',spinnerTpl:'<div class="fancybox-loading"></div>',errorTpl:'<div class="fancybox-error"><p>{{ERROR}}</p></div>',btnTpl:{download:'<a download data-fancybox-download class="fancybox-button fancybox-button--download" title="{{DOWNLOAD}}" href="javascript:;"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.62 17.09V19H5.38v-1.91zm-2.97-6.96L17 11.45l-5 4.87-5-4.87 1.36-1.32 2.68 2.64V5h1.92v7.77z"/></svg></a>',zoom:'<button data-fancybox-zoom class="fancybox-button fancybox-button--zoom" title="{{ZOOM}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.7 17.3l-3-3a5.9 5.9 0 0 0-.6-7.6 5.9 5.9 0 0 0-8.4 0 5.9 5.9 0 0 0 0 8.4 5.9 5.9 0 0 0 7.7.7l3 3a1 1 0 0 0 1.3 0c.4-.5.4-1 0-1.5zM8.1 13.8a4 4 0 0 1 0-5.7 4 4 0 0 1 5.7 0 4 4 0 0 1 0 5.7 4 4 0 0 1-5.7 0z"/></svg></button>',close:'<button data-fancybox-close class="fancybox-button fancybox-button--close" title="{{CLOSE}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 10.6L6.6 5.2 5.2 6.6l5.4 5.4-5.4 5.4 1.4 1.4 5.4-5.4 5.4 5.4 1.4-1.4-5.4-5.4 5.4-5.4-1.4-1.4-5.4 5.4z"/></svg></button>',arrowLeft:'<button data-fancybox-prev class="fancybox-button fancybox-button--arrow_left" title="{{PREV}}"><div><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11.28 15.7l-1.34 1.37L5 12l4.94-5.07 1.34 1.38-2.68 2.72H19v1.94H8.6z"/></svg></div></button>',arrowRight:'<button data-fancybox-next class="fancybox-button fancybox-button--arrow_right" title="{{NEXT}}"><div><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15.4 12.97l-2.68 2.72 1.34 1.38L19 12l-4.94-5.07-1.34 1.38 2.68 2.72H5v1.94z"/></svg></div></button>',smallBtn:'<button type="button" data-fancybox-close class="fancybox-button fancybox-close-small" title="{{CLOSE}}"><svg xmlns="http://www.w3.org/2000/svg" version="1" viewBox="0 0 24 24"><path d="M13 12l5-5-1-1-5 5-5-5-1 1 5 5-5 5 1 1 5-5 5 5 1-1z"/></svg></button>'},parentEl:"body",hideScrollbar:!0,autoFocus:!0,backFocus:!0,trapFocus:!0,fullScreen:{autoStart:!1},touch:{vertical:!0,momentum:!0},hash:null,media:{},slideShow:{autoStart:!1,speed:3e3},thumbs:{autoStart:!1,hideOnClose:!0,parentEl:".fancybox-container",axis:"y"},wheel:"auto",onInit:n.noop,beforeLoad:n.noop,afterLoad:n.noop,beforeShow:n.noop,afterShow:n.noop,beforeClose:n.noop,afterClose:n.noop,onActivate:n.noop,onDeactivate:n.noop,clickContent:function(t,e){return"image"===t.type&&"zoom"},clickSlide:"close",clickOutside:"close",dblclickContent:!1,dblclickSlide:!1,dblclickOutside:!1,mobile:{preventCaptionOverlap:!1,idleTime:!1,clickContent:function(t,e){return"image"===t.type&&"toggleControls"},clickSlide:function(t,e){return"image"===t.type?"toggleControls":"close"},dblclickContent:function(t,e){return"image"===t.type&&"zoom"},dblclickSlide:function(t,e){return"image"===t.type&&"zoom"}},lang:"en",i18n:{en:{CLOSE:"Close",NEXT:"Next",PREV:"Previous",ERROR:"The requested content cannot be loaded. <br/> Please try again later.",PLAY_START:"Start slideshow",PLAY_STOP:"Pause slideshow",FULL_SCREEN:"Full screen",THUMBS:"Thumbnails",DOWNLOAD:"Download",SHARE:"Share",ZOOM:"Zoom"},de:{CLOSE:"Schließen",NEXT:"Weiter",PREV:"Zurück",ERROR:"Die angeforderten Daten konnten nicht geladen werden. <br/> Bitte versuchen Sie es später nochmal.",PLAY_START:"Diaschau starten",PLAY_STOP:"Diaschau beenden",FULL_SCREEN:"Vollbild",THUMBS:"Vorschaubilder",DOWNLOAD:"Herunterladen",SHARE:"Teilen",ZOOM:"Vergrößern"}}},s=n(t),r=n(e),c=0,l=function(t){return t&&t.hasOwnProperty&&t instanceof n},d=function(){return t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||function(e){return t.setTimeout(e,1e3/60)}}(),u=function(){return t.cancelAnimationFrame||t.webkitCancelAnimationFrame||t.mozCancelAnimationFrame||t.oCancelAnimationFrame||function(e){t.clearTimeout(e)}}(),f=function(){var t,n=e.createElement("fakeelement"),o={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(t in o)if(void 0!==n.style[t])return o[t];return"transitionend"}(),p=function(t){return t&&t.length&&t[0].offsetHeight},h=function(t,e){var o=n.extend(!0,{},t,e);return n.each(e,function(t,e){n.isArray(e)&&(o[t]=e)}),o},g=function(t){var o,i;return!(!t||t.ownerDocument!==e)&&(n(".fancybox-container").css("pointer-events","none"),o={x:t.getBoundingClientRect().left+t.offsetWidth/2,y:t.getBoundingClientRect().top+t.offsetHeight/2},i=e.elementFromPoint(o.x,o.y)===t,n(".fancybox-container").css("pointer-events",""),i)},b=function(t,e,o){var i=this;i.opts=h({index:o},n.fancybox.defaults),n.isPlainObject(e)&&(i.opts=h(i.opts,e)),n.fancybox.isMobile&&(i.opts=h(i.opts,i.opts.mobile)),i.id=i.opts.id||++c,i.currIndex=parseInt(i.opts.index,10)||0,i.prevIndex=null,i.prevPos=null,i.currPos=0,i.firstRun=!0,i.group=[],i.slides={},i.addContent(t),i.group.length&&i.init()};n.extend(b.prototype,{init:function(){var o,i,a=this,s=a.group[a.currIndex],r=s.opts;r.closeExisting&&n.fancybox.close(!0),n("body").addClass("fancybox-active"),!n.fancybox.getInstance()&&!1!==r.hideScrollbar&&!n.fancybox.isMobile&&e.body.scrollHeight>t.innerHeight&&(n("head").append('<style id="fancybox-style-noscroll" type="text/css">.compensate-for-scrollbar{margin-right:'+(t.innerWidth-e.documentElement.clientWidth)+"px;}</style>"),n("body").addClass("compensate-for-scrollbar")),i="",n.each(r.buttons,function(t,e){i+=r.btnTpl[e]||""}),o=n(a.translate(a,r.baseTpl.replace("{{buttons}}",i).replace("{{arrows}}",r.btnTpl.arrowLeft+r.btnTpl.arrowRight))).attr("id","fancybox-container-"+a.id).addClass(r.baseClass).data("FancyBox",a).appendTo(r.parentEl),a.$refs={container:o},["bg","inner","infobar","toolbar","stage","caption","navigation"].forEach(function(t){a.$refs[t]=o.find(".fancybox-"+t)}),a.trigger("onInit"),a.activate(),a.jumpTo(a.currIndex)},translate:function(t,e){var n=t.opts.i18n[t.opts.lang]||t.opts.i18n.en;return e.replace(/\{\{(\w+)\}\}/g,function(t,e){return void 0===n[e]?t:n[e]})},addContent:function(t){var e,o=this,i=n.makeArray(t);n.each(i,function(t,e){var i,a,s,r,c,l={},d={};n.isPlainObject(e)?(l=e,d=e.opts||e):"object"===n.type(e)&&n(e).length?(i=n(e),d=i.data()||{},d=n.extend(!0,{},d,d.options),d.$orig=i,l.src=o.opts.src||d.src||i.attr("href"),l.type||l.src||(l.type="inline",l.src=e)):l={type:"html",src:e+""},l.opts=n.extend(!0,{},o.opts,d),n.isArray(d.buttons)&&(l.opts.buttons=d.buttons),n.fancybox.isMobile&&l.opts.mobile&&(l.opts=h(l.opts,l.opts.mobile)),a=l.type||l.opts.type,r=l.src||"",!a&&r&&((s=r.match(/\.(mp4|mov|ogv|webm)((\?|#).*)?$/i))?(a="video",l.opts.video.format||(l.opts.video.format="video/"+("ogv"===s[1]?"ogg":s[1]))):r.match(/(^data:image\/[a-z0-9+\/=]*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg|ico)((\?|#).*)?$)/i)?a="image":r.match(/\.(pdf)((\?|#).*)?$/i)?(a="iframe",l=n.extend(!0,l,{contentType:"pdf",opts:{iframe:{preload:!1}}})):"#"===r.charAt(0)&&(a="inline")),a?l.type=a:o.trigger("objectNeedsType",l),l.contentType||(l.contentType=n.inArray(l.type,["html","inline","ajax"])>-1?"html":l.type),l.index=o.group.length,"auto"==l.opts.smallBtn&&(l.opts.smallBtn=n.inArray(l.type,["html","inline","ajax"])>-1),"auto"===l.opts.toolbar&&(l.opts.toolbar=!l.opts.smallBtn),l.$thumb=l.opts.$thumb||null,l.opts.$trigger&&l.index===o.opts.index&&(l.$thumb=l.opts.$trigger.find("img:first"),l.$thumb.length&&(l.opts.$orig=l.opts.$trigger)),l.$thumb&&l.$thumb.length||!l.opts.$orig||(l.$thumb=l.opts.$orig.find("img:first")),l.$thumb&&!l.$thumb.length&&(l.$thumb=null),l.thumb=l.opts.thumb||(l.$thumb?l.$thumb[0].src:null),"function"===n.type(l.opts.caption)&&(l.opts.caption=l.opts.caption.apply(e,[o,l])),"function"===n.type(o.opts.caption)&&(l.opts.caption=o.opts.caption.apply(e,[o,l])),l.opts.caption instanceof n||(l.opts.caption=void 0===l.opts.caption?"":l.opts.caption+""),"ajax"===l.type&&(c=r.split(/\s+/,2),c.length>1&&(l.src=c.shift(),l.opts.filter=c.shift())),l.opts.modal&&(l.opts=n.extend(!0,l.opts,{trapFocus:!0,infobar:0,toolbar:0,smallBtn:0,keyboard:0,slideShow:0,fullScreen:0,thumbs:0,touch:0,clickContent:!1,clickSlide:!1,clickOutside:!1,dblclickContent:!1,dblclickSlide:!1,dblclickOutside:!1})),o.group.push(l)}),Object.keys(o.slides).length&&(o.updateControls(),(e=o.Thumbs)&&e.isActive&&(e.create(),e.focus()))},addEvents:function(){var e=this;e.removeEvents(),e.$refs.container.on("click.fb-close","[data-fancybox-close]",function(t){t.stopPropagation(),t.preventDefault(),e.close(t)}).on("touchstart.fb-prev click.fb-prev","[data-fancybox-prev]",function(t){t.stopPropagation(),t.preventDefault(),e.previous()}).on("touchstart.fb-next click.fb-next","[data-fancybox-next]",function(t){t.stopPropagation(),t.preventDefault(),e.next()}).on("click.fb","[data-fancybox-zoom]",function(t){e[e.isScaledDown()?"scaleToActual":"scaleToFit"]()}),s.on("orientationchange.fb resize.fb",function(t){t&&t.originalEvent&&"resize"===t.originalEvent.type?(e.requestId&&u(e.requestId),e.requestId=d(function(){e.update(t)})):(e.current&&"iframe"===e.current.type&&e.$refs.stage.hide(),setTimeout(function(){e.$refs.stage.show(),e.update(t)},n.fancybox.isMobile?600:250))}),r.on("keydown.fb",function(t){var o=n.fancybox?n.fancybox.getInstance():null,i=o.current,a=t.keyCode||t.which;if(9==a)return void(i.opts.trapFocus&&e.focus(t));if(!(!i.opts.keyboard||t.ctrlKey||t.altKey||t.shiftKey||n(t.target).is("input,textarea,video,audio,select")))return 8===a||27===a?(t.preventDefault(),void e.close(t)):37===a||38===a?(t.preventDefault(),void e.previous()):39===a||40===a?(t.preventDefault(),void e.next()):void e.trigger("afterKeydown",t,a)}),e.group[e.currIndex].opts.idleTime&&(e.idleSecondsCounter=0,r.on("mousemove.fb-idle mouseleave.fb-idle mousedown.fb-idle touchstart.fb-idle touchmove.fb-idle scroll.fb-idle keydown.fb-idle",function(t){e.idleSecondsCounter=0,e.isIdle&&e.showControls(),e.isIdle=!1}),e.idleInterval=t.setInterval(function(){++e.idleSecondsCounter>=e.group[e.currIndex].opts.idleTime&&!e.isDragging&&(e.isIdle=!0,e.idleSecondsCounter=0,e.hideControls())},1e3))},removeEvents:function(){var e=this;s.off("orientationchange.fb resize.fb"),r.off("keydown.fb .fb-idle"),this.$refs.container.off(".fb-close .fb-prev .fb-next"),e.idleInterval&&(t.clearInterval(e.idleInterval),e.idleInterval=null)},previous:function(t){return this.jumpTo(this.currPos-1,t)},next:function(t){return this.jumpTo(this.currPos+1,t)},jumpTo:function(t,e){var o,i,a,s,r,c,l,d,u,f=this,h=f.group.length;if(!(f.isDragging||f.isClosing||f.isAnimating&&f.firstRun)){if(t=parseInt(t,10),!(a=f.current?f.current.opts.loop:f.opts.loop)&&(t<0||t>=h))return!1;if(o=f.firstRun=!Object.keys(f.slides).length,r=f.current,f.prevIndex=f.currIndex,f.prevPos=f.currPos,s=f.createSlide(t),h>1&&((a||s.index<h-1)&&f.createSlide(t+1),(a||s.index>0)&&f.createSlide(t-1)),f.current=s,f.currIndex=s.index,f.currPos=s.pos,f.trigger("beforeShow",o),f.updateControls(),s.forcedDuration=void 0,n.isNumeric(e)?s.forcedDuration=e:e=s.opts[o?"animationDuration":"transitionDuration"],e=parseInt(e,10),i=f.isMoved(s),s.$slide.addClass("fancybox-slide--current"),o)return s.opts.animationEffect&&e&&f.$refs.container.css("transition-duration",e+"ms"),f.$refs.container.addClass("fancybox-is-open").trigger("focus"),f.loadSlide(s),void f.preload("image");c=n.fancybox.getTranslate(r.$slide),l=n.fancybox.getTranslate(f.$refs.stage),n.each(f.slides,function(t,e){n.fancybox.stop(e.$slide,!0)}),r.pos!==s.pos&&(r.isComplete=!1),r.$slide.removeClass("fancybox-slide--complete fancybox-slide--current"),i?(u=c.left-(r.pos*c.width+r.pos*r.opts.gutter),n.each(f.slides,function(t,o){o.$slide.removeClass("fancybox-animated").removeClass(function(t,e){return(e.match(/(^|\s)fancybox-fx-\S+/g)||[]).join(" ")});var i=o.pos*c.width+o.pos*o.opts.gutter;n.fancybox.setTranslate(o.$slide,{top:0,left:i-l.left+u}),o.pos!==s.pos&&o.$slide.addClass("fancybox-slide--"+(o.pos>s.pos?"next":"previous")),p(o.$slide),n.fancybox.animate(o.$slide,{top:0,left:(o.pos-s.pos)*c.width+(o.pos-s.pos)*o.opts.gutter},e,function(){o.$slide.css({transform:"",opacity:""}).removeClass("fancybox-slide--next fancybox-slide--previous"),o.pos===f.currPos&&f.complete()})})):e&&s.opts.transitionEffect&&(d="fancybox-animated fancybox-fx-"+s.opts.transitionEffect,r.$slide.addClass("fancybox-slide--"+(r.pos>s.pos?"next":"previous")),n.fancybox.animate(r.$slide,d,e,function(){r.$slide.removeClass(d).removeClass("fancybox-slide--next fancybox-slide--previous")},!1)),s.isLoaded?f.revealContent(s):f.loadSlide(s),f.preload("image")}},createSlide:function(t){var e,o,i=this;return o=t%i.group.length,o=o<0?i.group.length+o:o,!i.slides[t]&&i.group[o]&&(e=n('<div class="fancybox-slide"></div>').appendTo(i.$refs.stage),i.slides[t]=n.extend(!0,{},i.group[o],{pos:t,$slide:e,isLoaded:!1}),i.updateSlide(i.slides[t])),i.slides[t]},scaleToActual:function(t,e,o){var i,a,s,r,c,l=this,d=l.current,u=d.$content,f=n.fancybox.getTranslate(d.$slide).width,p=n.fancybox.getTranslate(d.$slide).height,h=d.width,g=d.height;l.isAnimating||l.isMoved()||!u||"image"!=d.type||!d.isLoaded||d.hasError||(l.isAnimating=!0,n.fancybox.stop(u),t=void 0===t?.5*f:t,e=void 0===e?.5*p:e,i=n.fancybox.getTranslate(u),i.top-=n.fancybox.getTranslate(d.$slide).top,i.left-=n.fancybox.getTranslate(d.$slide).left,r=h/i.width,c=g/i.height,a=.5*f-.5*h,s=.5*p-.5*g,h>f&&(a=i.left*r-(t*r-t),a>0&&(a=0),a<f-h&&(a=f-h)),g>p&&(s=i.top*c-(e*c-e),s>0&&(s=0),s<p-g&&(s=p-g)),l.updateCursor(h,g),n.fancybox.animate(u,{top:s,left:a,scaleX:r,scaleY:c},o||366,function(){l.isAnimating=!1}),l.SlideShow&&l.SlideShow.isActive&&l.SlideShow.stop())},scaleToFit:function(t){var e,o=this,i=o.current,a=i.$content;o.isAnimating||o.isMoved()||!a||"image"!=i.type||!i.isLoaded||i.hasError||(o.isAnimating=!0,n.fancybox.stop(a),e=o.getFitPos(i),o.updateCursor(e.width,e.height),n.fancybox.animate(a,{top:e.top,left:e.left,scaleX:e.width/a.width(),scaleY:e.height/a.height()},t||366,function(){o.isAnimating=!1}))},getFitPos:function(t){var e,o,i,a,s=this,r=t.$content,c=t.$slide,l=t.width||t.opts.width,d=t.height||t.opts.height,u={};return!!(t.isLoaded&&r&&r.length)&&(e=n.fancybox.getTranslate(s.$refs.stage).width,o=n.fancybox.getTranslate(s.$refs.stage).height,e-=parseFloat(c.css("paddingLeft"))+parseFloat(c.css("paddingRight"))+parseFloat(r.css("marginLeft"))+parseFloat(r.css("marginRight")),o-=parseFloat(c.css("paddingTop"))+parseFloat(c.css("paddingBottom"))+parseFloat(r.css("marginTop"))+parseFloat(r.css("marginBottom")),l&&d||(l=e,d=o),i=Math.min(1,e/l,o/d),l*=i,d*=i,l>e-.5&&(l=e),d>o-.5&&(d=o),"image"===t.type?(u.top=Math.floor(.5*(o-d))+parseFloat(c.css("paddingTop")),u.left=Math.floor(.5*(e-l))+parseFloat(c.css("paddingLeft"))):"video"===t.contentType&&(a=t.opts.width&&t.opts.height?l/d:t.opts.ratio||16/9,d>l/a?d=l/a:l>d*a&&(l=d*a)),u.width=l,u.height=d,u)},update:function(t){var e=this;n.each(e.slides,function(n,o){e.updateSlide(o,t)})},updateSlide:function(t,e){var o=this,i=t&&t.$content,a=t.width||t.opts.width,s=t.height||t.opts.height,r=t.$slide;o.adjustCaption(t),i&&(a||s||"video"===t.contentType)&&!t.hasError&&(n.fancybox.stop(i),n.fancybox.setTranslate(i,o.getFitPos(t)),t.pos===o.currPos&&(o.isAnimating=!1,o.updateCursor())),o.adjustLayout(t),r.length&&(r.trigger("refresh"),t.pos===o.currPos&&o.$refs.toolbar.add(o.$refs.navigation.find(".fancybox-button--arrow_right")).toggleClass("compensate-for-scrollbar",r.get(0).scrollHeight>r.get(0).clientHeight)),o.trigger("onUpdate",t,e)},centerSlide:function(t){var e=this,o=e.current,i=o.$slide;!e.isClosing&&o&&(i.siblings().css({transform:"",opacity:""}),i.parent().children().removeClass("fancybox-slide--previous fancybox-slide--next"),n.fancybox.animate(i,{top:0,left:0,opacity:1},void 0===t?0:t,function(){i.css({transform:"",opacity:""}),o.isComplete||e.complete()},!1))},isMoved:function(t){var e,o,i=t||this.current;return!!i&&(o=n.fancybox.getTranslate(this.$refs.stage),e=n.fancybox.getTranslate(i.$slide),!i.$slide.hasClass("fancybox-animated")&&(Math.abs(e.top-o.top)>.5||Math.abs(e.left-o.left)>.5))},updateCursor:function(t,e){var o,i,a=this,s=a.current,r=a.$refs.container;s&&!a.isClosing&&a.Guestures&&(r.removeClass("fancybox-is-zoomable fancybox-can-zoomIn fancybox-can-zoomOut fancybox-can-swipe fancybox-can-pan"),o=a.canPan(t,e),i=!!o||a.isZoomable(),r.toggleClass("fancybox-is-zoomable",i),n("[data-fancybox-zoom]").prop("disabled",!i),o?r.addClass("fancybox-can-pan"):i&&("zoom"===s.opts.clickContent||n.isFunction(s.opts.clickContent)&&"zoom"==s.opts.clickContent(s))?r.addClass("fancybox-can-zoomIn"):s.opts.touch&&(s.opts.touch.vertical||a.group.length>1)&&"video"!==s.contentType&&r.addClass("fancybox-can-swipe"))},isZoomable:function(){var t,e=this,n=e.current;if(n&&!e.isClosing&&"image"===n.type&&!n.hasError){if(!n.isLoaded)return!0;if((t=e.getFitPos(n))&&(n.width>t.width||n.height>t.height))return!0}return!1},isScaledDown:function(t,e){var o=this,i=!1,a=o.current,s=a.$content;return void 0!==t&&void 0!==e?i=t<a.width&&e<a.height:s&&(i=n.fancybox.getTranslate(s),i=i.width<a.width&&i.height<a.height),i},canPan:function(t,e){var o=this,i=o.current,a=null,s=!1;return"image"===i.type&&(i.isComplete||t&&e)&&!i.hasError&&(s=o.getFitPos(i),void 0!==t&&void 0!==e?a={width:t,height:e}:i.isComplete&&(a=n.fancybox.getTranslate(i.$content)),a&&s&&(s=Math.abs(a.width-s.width)>1.5||Math.abs(a.height-s.height)>1.5)),s},loadSlide:function(t){var e,o,i,a=this;if(!t.isLoading&&!t.isLoaded){if(t.isLoading=!0,!1===a.trigger("beforeLoad",t))return t.isLoading=!1,!1;switch(e=t.type,o=t.$slide,o.off("refresh").trigger("onReset").addClass(t.opts.slideClass),e){case"image":a.setImage(t);break;case"iframe":a.setIframe(t);break;case"html":a.setContent(t,t.src||t.content);break;case"video":a.setContent(t,t.opts.video.tpl.replace(/\{\{src\}\}/gi,t.src).replace("{{format}}",t.opts.videoFormat||t.opts.video.format||"").replace("{{poster}}",t.thumb||""));break;case"inline":n(t.src).length?a.setContent(t,n(t.src)):a.setError(t);break;case"ajax":a.showLoading(t),i=n.ajax(n.extend({},t.opts.ajax.settings,{url:t.src,success:function(e,n){"success"===n&&a.setContent(t,e)},error:function(e,n){e&&"abort"!==n&&a.setError(t)}})),o.one("onReset",function(){i.abort()});break;default:a.setError(t)}return!0}},setImage:function(t){var o,i=this;setTimeout(function(){var e=t.$image;i.isClosing||!t.isLoading||e&&e.length&&e[0].complete||t.hasError||i.showLoading(t)},50),i.checkSrcset(t),t.$content=n('<div class="fancybox-content"></div>').addClass("fancybox-is-hidden").appendTo(t.$slide.addClass("fancybox-slide--image")),!1!==t.opts.preload&&t.opts.width&&t.opts.height&&t.thumb&&(t.width=t.opts.width,t.height=t.opts.height,o=e.createElement("img"),o.onerror=function(){n(this).remove(),t.$ghost=null},o.onload=function(){i.afterLoad(t)},t.$ghost=n(o).addClass("fancybox-image").appendTo(t.$content).attr("src",t.thumb)),i.setBigImage(t)},checkSrcset:function(e){var n,o,i,a,s=e.opts.srcset||e.opts.image.srcset;if(s){i=t.devicePixelRatio||1,a=t.innerWidth*i,o=s.split(",").map(function(t){var e={};return t.trim().split(/\s+/).forEach(function(t,n){var o=parseInt(t.substring(0,t.length-1),10);if(0===n)return e.url=t;o&&(e.value=o,e.postfix=t[t.length-1])}),e}),o.sort(function(t,e){return t.value-e.value});for(var r=0;r<o.length;r++){var c=o[r];if("w"===c.postfix&&c.value>=a||"x"===c.postfix&&c.value>=i){n=c;break}}!n&&o.length&&(n=o[o.length-1]),n&&(e.src=n.url,e.width&&e.height&&"w"==n.postfix&&(e.height=e.width/e.height*n.value,e.width=n.value),e.opts.srcset=s)}},setBigImage:function(t){var o=this,i=e.createElement("img"),a=n(i);t.$image=a.one("error",function(){o.setError(t)}).one("load",function(){var e;t.$ghost||(o.resolveImageSlideSize(t,this.naturalWidth,this.naturalHeight),o.afterLoad(t)),o.isClosing||(t.opts.srcset&&(e=t.opts.sizes,e&&"auto"!==e||(e=(t.width/t.height>1&&s.width()/s.height()>1?"100":Math.round(t.width/t.height*100))+"vw"),a.attr("sizes",e).attr("srcset",t.opts.srcset)),t.$ghost&&setTimeout(function(){t.$ghost&&!o.isClosing&&t.$ghost.hide()},Math.min(300,Math.max(1e3,t.height/1600))),o.hideLoading(t))}).addClass("fancybox-image").attr("src",t.src).appendTo(t.$content),(i.complete||"complete"==i.readyState)&&a.naturalWidth&&a.naturalHeight?a.trigger("load"):i.error&&a.trigger("error")},resolveImageSlideSize:function(t,e,n){var o=parseInt(t.opts.width,10),i=parseInt(t.opts.height,10);t.width=e,t.height=n,o>0&&(t.width=o,t.height=Math.floor(o*n/e)),i>0&&(t.width=Math.floor(i*e/n),t.height=i)},setIframe:function(t){var e,o=this,i=t.opts.iframe,a=t.$slide;t.$content=n('<div class="fancybox-content'+(i.preload?" fancybox-is-hidden":"")+'"></div>').css(i.css).appendTo(a),a.addClass("fancybox-slide--"+t.contentType),t.$iframe=e=n(i.tpl.replace(/\{rnd\}/g,(new Date).getTime())).attr(i.attr).appendTo(t.$content),i.preload?(o.showLoading(t),e.on("load.fb error.fb",function(e){this.isReady=1,t.$slide.trigger("refresh"),o.afterLoad(t)}),a.on("refresh.fb",function(){var n,o,s=t.$content,r=i.css.width,c=i.css.height;if(1===e[0].isReady){try{n=e.contents(),o=n.find("body")}catch(t){}o&&o.length&&o.children().length&&(a.css("overflow","visible"),s.css({width:"100%","max-width":"100%",height:"9999px"}),void 0===r&&(r=Math.ceil(Math.max(o[0].clientWidth,o.outerWidth(!0)))),s.css("width",r||"").css("max-width",""),void 0===c&&(c=Math.ceil(Math.max(o[0].clientHeight,o.outerHeight(!0)))),s.css("height",c||""),a.css("overflow","auto")),s.removeClass("fancybox-is-hidden")}})):o.afterLoad(t),e.attr("src",t.src),a.one("onReset",function(){try{n(this).find("iframe").hide().unbind().attr("src","//about:blank")}catch(t){}n(this).off("refresh.fb").empty(),t.isLoaded=!1,t.isRevealed=!1})},setContent:function(t,e){var o=this;o.isClosing||(o.hideLoading(t),t.$content&&n.fancybox.stop(t.$content),t.$slide.empty(),l(e)&&e.parent().length?((e.hasClass("fancybox-content")||e.parent().hasClass("fancybox-content"))&&e.parents(".fancybox-slide").trigger("onReset"),t.$placeholder=n("<div>").hide().insertAfter(e),e.css("display","inline-block")):t.hasError||("string"===n.type(e)&&(e=n("<div>").append(n.trim(e)).contents()),t.opts.filter&&(e=n("<div>").html(e).find(t.opts.filter))),t.$slide.one("onReset",function(){n(this).find("video,audio").trigger("pause"),t.$placeholder&&(t.$placeholder.after(e.removeClass("fancybox-content").hide()).remove(),t.$placeholder=null),t.$smallBtn&&(t.$smallBtn.remove(),t.$smallBtn=null),t.hasError||(n(this).empty(),t.isLoaded=!1,t.isRevealed=!1)}),n(e).appendTo(t.$slide),n(e).is("video,audio")&&(n(e).addClass("fancybox-video"),n(e).wrap("<div></div>"),t.contentType="video",t.opts.width=t.opts.width||n(e).attr("width"),t.opts.height=t.opts.height||n(e).attr("height")),t.$content=t.$slide.children().filter("div,form,main,video,audio,article,.fancybox-content").first(),t.$content.siblings().hide(),t.$content.length||(t.$content=t.$slide.wrapInner("<div></div>").children().first()),t.$content.addClass("fancybox-content"),t.$slide.addClass("fancybox-slide--"+t.contentType),o.afterLoad(t))},setError:function(t){t.hasError=!0,t.$slide.trigger("onReset").removeClass("fancybox-slide--"+t.contentType).addClass("fancybox-slide--error"),t.contentType="html",this.setContent(t,this.translate(t,t.opts.errorTpl)),t.pos===this.currPos&&(this.isAnimating=!1)},showLoading:function(t){var e=this;(t=t||e.current)&&!t.$spinner&&(t.$spinner=n(e.translate(e,e.opts.spinnerTpl)).appendTo(t.$slide).hide().fadeIn("fast"))},hideLoading:function(t){var e=this;(t=t||e.current)&&t.$spinner&&(t.$spinner.stop().remove(),delete t.$spinner)},afterLoad:function(t){var e=this;e.isClosing||(t.isLoading=!1,t.isLoaded=!0,e.trigger("afterLoad",t),e.hideLoading(t),!t.opts.smallBtn||t.$smallBtn&&t.$smallBtn.length||(t.$smallBtn=n(e.translate(t,t.opts.btnTpl.smallBtn)).appendTo(t.$content)),t.opts.protect&&t.$content&&!t.hasError&&(t.$content.on("contextmenu.fb",function(t){return 2==t.button&&t.preventDefault(),!0}),"image"===t.type&&n('<div class="fancybox-spaceball"></div>').appendTo(t.$content)),e.adjustCaption(t),e.adjustLayout(t),t.pos===e.currPos&&e.updateCursor(),e.revealContent(t))},adjustCaption:function(t){var e,n=this,o=t||n.current,i=o.opts.caption,a=o.opts.preventCaptionOverlap,s=n.$refs.caption,r=!1;s.toggleClass("fancybox-caption--separate",a),a&&i&&i.length&&(o.pos!==n.currPos?(e=s.clone().appendTo(s.parent()),e.children().eq(0).empty().html(i),r=e.outerHeight(!0),e.empty().remove()):n.$caption&&(r=n.$caption.outerHeight(!0)),o.$slide.css("padding-bottom",r||""))},adjustLayout:function(t){var e,n,o,i,a=this,s=t||a.current;s.isLoaded&&!0!==s.opts.disableLayoutFix&&(s.$content.css("margin-bottom",""),s.$content.outerHeight()>s.$slide.height()+.5&&(o=s.$slide[0].style["padding-bottom"],i=s.$slide.css("padding-bottom"),parseFloat(i)>0&&(e=s.$slide[0].scrollHeight,s.$slide.css("padding-bottom",0),Math.abs(e-s.$slide[0].scrollHeight)<1&&(n=i),s.$slide.css("padding-bottom",o))),s.$content.css("margin-bottom",n))},revealContent:function(t){var e,o,i,a,s=this,r=t.$slide,c=!1,l=!1,d=s.isMoved(t),u=t.isRevealed;return t.isRevealed=!0,e=t.opts[s.firstRun?"animationEffect":"transitionEffect"],i=t.opts[s.firstRun?"animationDuration":"transitionDuration"],i=parseInt(void 0===t.forcedDuration?i:t.forcedDuration,10),!d&&t.pos===s.currPos&&i||(e=!1),"zoom"===e&&(t.pos===s.currPos&&i&&"image"===t.type&&!t.hasError&&(l=s.getThumbPos(t))?c=s.getFitPos(t):e="fade"),"zoom"===e?(s.isAnimating=!0,c.scaleX=c.width/l.width,c.scaleY=c.height/l.height,a=t.opts.zoomOpacity,"auto"==a&&(a=Math.abs(t.width/t.height-l.width/l.height)>.1),a&&(l.opacity=.1,c.opacity=1),n.fancybox.setTranslate(t.$content.removeClass("fancybox-is-hidden"),l),p(t.$content),void n.fancybox.animate(t.$content,c,i,function(){s.isAnimating=!1,s.complete()})):(s.updateSlide(t),e?(n.fancybox.stop(r),o="fancybox-slide--"+(t.pos>=s.prevPos?"next":"previous")+" fancybox-animated fancybox-fx-"+e,r.addClass(o).removeClass("fancybox-slide--current"),t.$content.removeClass("fancybox-is-hidden"),p(r),"image"!==t.type&&t.$content.hide().show(0),void n.fancybox.animate(r,"fancybox-slide--current",i,function(){r.removeClass(o).css({transform:"",opacity:""}),t.pos===s.currPos&&s.complete()},!0)):(t.$content.removeClass("fancybox-is-hidden"),u||!d||"image"!==t.type||t.hasError||t.$content.hide().fadeIn("fast"),void(t.pos===s.currPos&&s.complete())))},getThumbPos:function(t){var e,o,i,a,s,r=!1,c=t.$thumb;return!(!c||!g(c[0]))&&(e=n.fancybox.getTranslate(c),o=parseFloat(c.css("border-top-width")||0),i=parseFloat(c.css("border-right-width")||0),a=parseFloat(c.css("border-bottom-width")||0),s=parseFloat(c.css("border-left-width")||0),r={top:e.top+o,left:e.left+s,width:e.width-i-s,height:e.height-o-a,scaleX:1,scaleY:1},e.width>0&&e.height>0&&r)},complete:function(){var t,e=this,o=e.current,i={};!e.isMoved()&&o.isLoaded&&(o.isComplete||(o.isComplete=!0,o.$slide.siblings().trigger("onReset"),e.preload("inline"),p(o.$slide),o.$slide.addClass("fancybox-slide--complete"),n.each(e.slides,function(t,o){o.pos>=e.currPos-1&&o.pos<=e.currPos+1?i[o.pos]=o:o&&(n.fancybox.stop(o.$slide),o.$slide.off().remove())}),e.slides=i),e.isAnimating=!1,e.updateCursor(),e.trigger("afterShow"),o.opts.video.autoStart&&o.$slide.find("video,audio").filter(":visible:first").trigger("play").one("ended",function(){Document.exitFullscreen?Document.exitFullscreen():this.webkitExitFullscreen&&this.webkitExitFullscreen(),e.next()}),o.opts.autoFocus&&"html"===o.contentType&&(t=o.$content.find("input[autofocus]:enabled:visible:first"),t.length?t.trigger("focus"):e.focus(null,!0)),o.$slide.scrollTop(0).scrollLeft(0))},preload:function(t){var e,n,o=this;o.group.length<2||(n=o.slides[o.currPos+1],e=o.slides[o.currPos-1],e&&e.type===t&&o.loadSlide(e),n&&n.type===t&&o.loadSlide(n))},focus:function(t,o){var i,a,s=this,r=["a[href]","area[href]",'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',"select:not([disabled]):not([aria-hidden])","textarea:not([disabled]):not([aria-hidden])","button:not([disabled]):not([aria-hidden])","iframe","object","embed","video","audio","[contenteditable]",'[tabindex]:not([tabindex^="-"])'].join(",");s.isClosing||(i=!t&&s.current&&s.current.isComplete?s.current.$slide.find("*:visible"+(o?":not(.fancybox-close-small)":"")):s.$refs.container.find("*:visible"),i=i.filter(r).filter(function(){return"hidden"!==n(this).css("visibility")&&!n(this).hasClass("disabled")}),i.length?(a=i.index(e.activeElement),t&&t.shiftKey?(a<0||0==a)&&(t.preventDefault(),i.eq(i.length-1).trigger("focus")):(a<0||a==i.length-1)&&(t&&t.preventDefault(),i.eq(0).trigger("focus"))):s.$refs.container.trigger("focus"))},activate:function(){var t=this;n(".fancybox-container").each(function(){var e=n(this).data("FancyBox");e&&e.id!==t.id&&!e.isClosing&&(e.trigger("onDeactivate"),e.removeEvents(),e.isVisible=!1)}),t.isVisible=!0,(t.current||t.isIdle)&&(t.update(),t.updateControls()),t.trigger("onActivate"),t.addEvents()},close:function(t,e){var o,i,a,s,r,c,l,u=this,f=u.current,h=function(){u.cleanUp(t)};return!u.isClosing&&(u.isClosing=!0,!1===u.trigger("beforeClose",t)?(u.isClosing=!1,d(function(){u.update()}),!1):(u.removeEvents(),a=f.$content,o=f.opts.animationEffect,i=n.isNumeric(e)?e:o?f.opts.animationDuration:0,f.$slide.removeClass("fancybox-slide--complete fancybox-slide--next fancybox-slide--previous fancybox-animated"),!0!==t?n.fancybox.stop(f.$slide):o=!1,f.$slide.siblings().trigger("onReset").remove(),i&&u.$refs.container.removeClass("fancybox-is-open").addClass("fancybox-is-closing").css("transition-duration",i+"ms"),u.hideLoading(f),u.hideControls(!0),u.updateCursor(),"zoom"!==o||a&&i&&"image"===f.type&&!u.isMoved()&&!f.hasError&&(l=u.getThumbPos(f))||(o="fade"),"zoom"===o?(n.fancybox.stop(a),s=n.fancybox.getTranslate(a),c={top:s.top,left:s.left,scaleX:s.width/l.width,scaleY:s.height/l.height,width:l.width,height:l.height},r=f.opts.zoomOpacity,
"auto"==r&&(r=Math.abs(f.width/f.height-l.width/l.height)>.1),r&&(l.opacity=0),n.fancybox.setTranslate(a,c),p(a),n.fancybox.animate(a,l,i,h),!0):(o&&i?n.fancybox.animate(f.$slide.addClass("fancybox-slide--previous").removeClass("fancybox-slide--current"),"fancybox-animated fancybox-fx-"+o,i,h):!0===t?setTimeout(h,i):h(),!0)))},cleanUp:function(e){var o,i,a,s=this,r=s.current.opts.$orig;s.current.$slide.trigger("onReset"),s.$refs.container.empty().remove(),s.trigger("afterClose",e),s.current.opts.backFocus&&(r&&r.length&&r.is(":visible")||(r=s.$trigger),r&&r.length&&(i=t.scrollX,a=t.scrollY,r.trigger("focus"),n("html, body").scrollTop(a).scrollLeft(0))),s.current=null,o=n.fancybox.getInstance(),o?o.activate():(n("body").removeClass("fancybox-active compensate-for-scrollbar"),n("#fancybox-style-noscroll").remove())},trigger:function(t,e){var o,i=Array.prototype.slice.call(arguments,1),a=this,s=e&&e.opts?e:a.current;if(s?i.unshift(s):s=a,i.unshift(a),n.isFunction(s.opts[t])&&(o=s.opts[t].apply(s,i)),!1===o)return o;"afterClose"!==t&&a.$refs?a.$refs.container.trigger(t+".fb",i):r.trigger(t+".fb",i)},updateControls:function(){var t=this,o=t.current,i=o.index,a=t.$refs.container,s=t.$refs.caption,r=o.opts.caption;o.$slide.trigger("refresh"),r&&r.length?(t.$caption=s,s.children().eq(0).html(r)):t.$caption=null,t.hasHiddenControls||t.isIdle||t.showControls(),a.find("[data-fancybox-count]").html(t.group.length),a.find("[data-fancybox-index]").html(i+1),a.find("[data-fancybox-prev]").prop("disabled",!o.opts.loop&&i<=0),a.find("[data-fancybox-next]").prop("disabled",!o.opts.loop&&i>=t.group.length-1),"image"===o.type?a.find("[data-fancybox-zoom]").show().end().find("[data-fancybox-download]").attr("href",o.opts.image.src||o.src).show():o.opts.toolbar&&a.find("[data-fancybox-download],[data-fancybox-zoom]").hide(),n(e.activeElement).is(":hidden,[disabled]")&&t.$refs.container.trigger("focus")},hideControls:function(t){var e=this,n=["infobar","toolbar","nav"];!t&&e.current.opts.preventCaptionOverlap||n.push("caption"),this.$refs.container.removeClass(n.map(function(t){return"fancybox-show-"+t}).join(" ")),this.hasHiddenControls=!0},showControls:function(){var t=this,e=t.current?t.current.opts:t.opts,n=t.$refs.container;t.hasHiddenControls=!1,t.idleSecondsCounter=0,n.toggleClass("fancybox-show-toolbar",!(!e.toolbar||!e.buttons)).toggleClass("fancybox-show-infobar",!!(e.infobar&&t.group.length>1)).toggleClass("fancybox-show-caption",!!t.$caption).toggleClass("fancybox-show-nav",!!(e.arrows&&t.group.length>1)).toggleClass("fancybox-is-modal",!!e.modal)},toggleControls:function(){this.hasHiddenControls?this.showControls():this.hideControls()}}),n.fancybox={version:"3.5.7",defaults:a,getInstance:function(t){var e=n('.fancybox-container:not(".fancybox-is-closing"):last').data("FancyBox"),o=Array.prototype.slice.call(arguments,1);return e instanceof b&&("string"===n.type(t)?e[t].apply(e,o):"function"===n.type(t)&&t.apply(e,o),e)},open:function(t,e,n){return new b(t,e,n)},close:function(t){var e=this.getInstance();e&&(e.close(),!0===t&&this.close(t))},destroy:function(){this.close(!0),r.add("body").off("click.fb-start","**")},isMobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),use3d:function(){var n=e.createElement("div");return t.getComputedStyle&&t.getComputedStyle(n)&&t.getComputedStyle(n).getPropertyValue("transform")&&!(e.documentMode&&e.documentMode<11)}(),getTranslate:function(t){var e;return!(!t||!t.length)&&(e=t[0].getBoundingClientRect(),{top:e.top||0,left:e.left||0,width:e.width,height:e.height,opacity:parseFloat(t.css("opacity"))})},setTranslate:function(t,e){var n="",o={};if(t&&e)return void 0===e.left&&void 0===e.top||(n=(void 0===e.left?t.position().left:e.left)+"px, "+(void 0===e.top?t.position().top:e.top)+"px",n=this.use3d?"translate3d("+n+", 0px)":"translate("+n+")"),void 0!==e.scaleX&&void 0!==e.scaleY?n+=" scale("+e.scaleX+", "+e.scaleY+")":void 0!==e.scaleX&&(n+=" scaleX("+e.scaleX+")"),n.length&&(o.transform=n),void 0!==e.opacity&&(o.opacity=e.opacity),void 0!==e.width&&(o.width=e.width),void 0!==e.height&&(o.height=e.height),t.css(o)},animate:function(t,e,o,i,a){var s,r=this;n.isFunction(o)&&(i=o,o=null),r.stop(t),s=r.getTranslate(t),t.on(f,function(c){(!c||!c.originalEvent||t.is(c.originalEvent.target)&&"z-index"!=c.originalEvent.propertyName)&&(r.stop(t),n.isNumeric(o)&&t.css("transition-duration",""),n.isPlainObject(e)?void 0!==e.scaleX&&void 0!==e.scaleY&&r.setTranslate(t,{top:e.top,left:e.left,width:s.width*e.scaleX,height:s.height*e.scaleY,scaleX:1,scaleY:1}):!0!==a&&t.removeClass(e),n.isFunction(i)&&i(c))}),n.isNumeric(o)&&t.css("transition-duration",o+"ms"),n.isPlainObject(e)?(void 0!==e.scaleX&&void 0!==e.scaleY&&(delete e.width,delete e.height,t.parent().hasClass("fancybox-slide--image")&&t.parent().addClass("fancybox-is-scaling")),n.fancybox.setTranslate(t,e)):t.addClass(e),t.data("timer",setTimeout(function(){t.trigger(f)},o+33))},stop:function(t,e){t&&t.length&&(clearTimeout(t.data("timer")),e&&t.trigger(f),t.off(f).css("transition-duration",""),t.parent().removeClass("fancybox-is-scaling"))}},n.fn.fancybox=function(t){var e;return t=t||{},e=t.selector||!1,e?n("body").off("click.fb-start",e).on("click.fb-start",e,{options:t},i):this.off("click.fb-start").on("click.fb-start",{items:this,options:t},i),this},r.on("click.fb-start","[data-fancybox]",i),r.on("click.fb-start","[data-fancybox-trigger]",function(t){n('[data-fancybox="'+n(this).attr("data-fancybox-trigger")+'"]').eq(n(this).attr("data-fancybox-index")||0).trigger("click.fb-start",{$trigger:n(this)})}),function(){var t=null;r.on("mousedown mouseup focus blur",".fancybox-button",function(e){switch(e.type){case"mousedown":t=n(this);break;case"mouseup":t=null;break;case"focusin":n(".fancybox-button").removeClass("fancybox-focus"),n(this).is(t)||n(this).is("[disabled]")||n(this).addClass("fancybox-focus");break;case"focusout":n(".fancybox-button").removeClass("fancybox-focus")}})}()}}(window,document,jQuery),function(t){"use strict";var e={youtube:{matcher:/(youtube\.com|youtu\.be|youtube\-nocookie\.com)\/(watch\?(.*&)?v=|v\/|u\/|embed\/?)?(videoseries\?list=(.*)|[\w-]{11}|\?listType=(.*)&list=(.*))(.*)/i,params:{autoplay:1,autohide:1,fs:1,rel:0,hd:1,wmode:"transparent",enablejsapi:1,html5:1},paramPlace:8,type:"iframe",url:"https://www.youtube-nocookie.com/embed/$4",thumb:"https://img.youtube.com/vi/$4/hqdefault.jpg"},vimeo:{matcher:/^.+vimeo.com\/(.*\/)?([\d]+)(.*)?/,params:{autoplay:1,hd:1,show_title:1,show_byline:1,show_portrait:0,fullscreen:1},paramPlace:3,type:"iframe",url:"//player.vimeo.com/video/$2"},instagram:{matcher:/(instagr\.am|instagram\.com)\/p\/([a-zA-Z0-9_\-]+)\/?/i,type:"image",url:"//$1/p/$2/media/?size=l"},gmap_place:{matcher:/(maps\.)?google\.([a-z]{2,3}(\.[a-z]{2})?)\/(((maps\/(place\/(.*)\/)?\@(.*),(\d+.?\d+?)z))|(\?ll=))(.*)?/i,type:"iframe",url:function(t){return"//maps.google."+t[2]+"/?ll="+(t[9]?t[9]+"&z="+Math.floor(t[10])+(t[12]?t[12].replace(/^\//,"&"):""):t[12]+"").replace(/\?/,"&")+"&output="+(t[12]&&t[12].indexOf("layer=c")>0?"svembed":"embed")}},gmap_search:{matcher:/(maps\.)?google\.([a-z]{2,3}(\.[a-z]{2})?)\/(maps\/search\/)(.*)/i,type:"iframe",url:function(t){return"//maps.google."+t[2]+"/maps?q="+t[5].replace("query=","q=").replace("api=1","")+"&output=embed"}}},n=function(e,n,o){if(e)return o=o||"","object"===t.type(o)&&(o=t.param(o,!0)),t.each(n,function(t,n){e=e.replace("$"+t,n||"")}),o.length&&(e+=(e.indexOf("?")>0?"&":"?")+o),e};t(document).on("objectNeedsType.fb",function(o,i,a){var s,r,c,l,d,u,f,p=a.src||"",h=!1;s=t.extend(!0,{},e,a.opts.media),t.each(s,function(e,o){if(c=p.match(o.matcher)){if(h=o.type,f=e,u={},o.paramPlace&&c[o.paramPlace]){d=c[o.paramPlace],"?"==d[0]&&(d=d.substring(1)),d=d.split("&");for(var i=0;i<d.length;++i){var s=d[i].split("=",2);2==s.length&&(u[s[0]]=decodeURIComponent(s[1].replace(/\+/g," ")))}}return l=t.extend(!0,{},o.params,a.opts[e],u),p="function"===t.type(o.url)?o.url.call(this,c,l,a):n(o.url,c,l),r="function"===t.type(o.thumb)?o.thumb.call(this,c,l,a):n(o.thumb,c),"youtube"===e?p=p.replace(/&t=((\d+)m)?(\d+)s/,function(t,e,n,o){return"&start="+((n?60*parseInt(n,10):0)+parseInt(o,10))}):"vimeo"===e&&(p=p.replace("&%23","#")),!1}}),h?(a.opts.thumb||a.opts.$thumb&&a.opts.$thumb.length||(a.opts.thumb=r),"iframe"===h&&(a.opts=t.extend(!0,a.opts,{iframe:{preload:!1,attr:{scrolling:"no"}}})),t.extend(a,{type:h,src:p,origSrc:a.src,contentSource:f,contentType:"image"===h?"image":"gmap_place"==f||"gmap_search"==f?"map":"video"})):p&&(a.type=a.opts.defaultType)});var o={youtube:{src:"https://www.youtube.com/iframe_api",class:"YT",loading:!1,loaded:!1},vimeo:{src:"https://player.vimeo.com/api/player.js",class:"Vimeo",loading:!1,loaded:!1},load:function(t){var e,n=this;if(this[t].loaded)return void setTimeout(function(){n.done(t)});this[t].loading||(this[t].loading=!0,e=document.createElement("script"),e.type="text/javascript",e.src=this[t].src,"youtube"===t?window.onYouTubeIframeAPIReady=function(){n[t].loaded=!0,n.done(t)}:e.onload=function(){n[t].loaded=!0,n.done(t)},document.body.appendChild(e))},done:function(e){var n,o,i;"youtube"===e&&delete window.onYouTubeIframeAPIReady,(n=t.fancybox.getInstance())&&(o=n.current.$content.find("iframe"),"youtube"===e&&void 0!==YT&&YT?i=new YT.Player(o.attr("id"),{events:{onStateChange:function(t){0==t.data&&n.next()}}}):"vimeo"===e&&void 0!==Vimeo&&Vimeo&&(i=new Vimeo.Player(o),i.on("ended",function(){n.next()})))}};t(document).on({"afterShow.fb":function(t,e,n){e.group.length>1&&("youtube"===n.contentSource||"vimeo"===n.contentSource)&&o.load(n.contentSource)}})}(jQuery),function(t,e,n){"use strict";var o=function(){return t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||function(e){return t.setTimeout(e,1e3/60)}}(),i=function(){return t.cancelAnimationFrame||t.webkitCancelAnimationFrame||t.mozCancelAnimationFrame||t.oCancelAnimationFrame||function(e){t.clearTimeout(e)}}(),a=function(e){var n=[];e=e.originalEvent||e||t.e,e=e.touches&&e.touches.length?e.touches:e.changedTouches&&e.changedTouches.length?e.changedTouches:[e];for(var o in e)e[o].pageX?n.push({x:e[o].pageX,y:e[o].pageY}):e[o].clientX&&n.push({x:e[o].clientX,y:e[o].clientY});return n},s=function(t,e,n){return e&&t?"x"===n?t.x-e.x:"y"===n?t.y-e.y:Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)):0},r=function(t){if(t.is('a,area,button,[role="button"],input,label,select,summary,textarea,video,audio,iframe')||n.isFunction(t.get(0).onclick)||t.data("selectable"))return!0;for(var e=0,o=t[0].attributes,i=o.length;e<i;e++)if("data-fancybox-"===o[e].nodeName.substr(0,14))return!0;return!1},c=function(e){var n=t.getComputedStyle(e)["overflow-y"],o=t.getComputedStyle(e)["overflow-x"],i=("scroll"===n||"auto"===n)&&e.scrollHeight>e.clientHeight,a=("scroll"===o||"auto"===o)&&e.scrollWidth>e.clientWidth;return i||a},l=function(t){for(var e=!1;;){if(e=c(t.get(0)))break;if(t=t.parent(),!t.length||t.hasClass("fancybox-stage")||t.is("body"))break}return e},d=function(t){var e=this;e.instance=t,e.$bg=t.$refs.bg,e.$stage=t.$refs.stage,e.$container=t.$refs.container,e.destroy(),e.$container.on("touchstart.fb.touch mousedown.fb.touch",n.proxy(e,"ontouchstart"))};d.prototype.destroy=function(){var t=this;t.$container.off(".fb.touch"),n(e).off(".fb.touch"),t.requestId&&(i(t.requestId),t.requestId=null),t.tapped&&(clearTimeout(t.tapped),t.tapped=null)},d.prototype.ontouchstart=function(o){var i=this,c=n(o.target),d=i.instance,u=d.current,f=u.$slide,p=u.$content,h="touchstart"==o.type;if(h&&i.$container.off("mousedown.fb.touch"),(!o.originalEvent||2!=o.originalEvent.button)&&f.length&&c.length&&!r(c)&&!r(c.parent())&&(c.is("img")||!(o.originalEvent.clientX>c[0].clientWidth+c.offset().left))){if(!u||d.isAnimating||u.$slide.hasClass("fancybox-animated"))return o.stopPropagation(),void o.preventDefault();i.realPoints=i.startPoints=a(o),i.startPoints.length&&(u.touch&&o.stopPropagation(),i.startEvent=o,i.canTap=!0,i.$target=c,i.$content=p,i.opts=u.opts.touch,i.isPanning=!1,i.isSwiping=!1,i.isZooming=!1,i.isScrolling=!1,i.canPan=d.canPan(),i.startTime=(new Date).getTime(),i.distanceX=i.distanceY=i.distance=0,i.canvasWidth=Math.round(f[0].clientWidth),i.canvasHeight=Math.round(f[0].clientHeight),i.contentLastPos=null,i.contentStartPos=n.fancybox.getTranslate(i.$content)||{top:0,left:0},i.sliderStartPos=n.fancybox.getTranslate(f),i.stagePos=n.fancybox.getTranslate(d.$refs.stage),i.sliderStartPos.top-=i.stagePos.top,i.sliderStartPos.left-=i.stagePos.left,i.contentStartPos.top-=i.stagePos.top,i.contentStartPos.left-=i.stagePos.left,n(e).off(".fb.touch").on(h?"touchend.fb.touch touchcancel.fb.touch":"mouseup.fb.touch mouseleave.fb.touch",n.proxy(i,"ontouchend")).on(h?"touchmove.fb.touch":"mousemove.fb.touch",n.proxy(i,"ontouchmove")),n.fancybox.isMobile&&e.addEventListener("scroll",i.onscroll,!0),((i.opts||i.canPan)&&(c.is(i.$stage)||i.$stage.find(c).length)||(c.is(".fancybox-image")&&o.preventDefault(),n.fancybox.isMobile&&c.parents(".fancybox-caption").length))&&(i.isScrollable=l(c)||l(c.parent()),n.fancybox.isMobile&&i.isScrollable||o.preventDefault(),(1===i.startPoints.length||u.hasError)&&(i.canPan?(n.fancybox.stop(i.$content),i.isPanning=!0):i.isSwiping=!0,i.$container.addClass("fancybox-is-grabbing")),2===i.startPoints.length&&"image"===u.type&&(u.isLoaded||u.$ghost)&&(i.canTap=!1,i.isSwiping=!1,i.isPanning=!1,i.isZooming=!0,n.fancybox.stop(i.$content),i.centerPointStartX=.5*(i.startPoints[0].x+i.startPoints[1].x)-n(t).scrollLeft(),i.centerPointStartY=.5*(i.startPoints[0].y+i.startPoints[1].y)-n(t).scrollTop(),i.percentageOfImageAtPinchPointX=(i.centerPointStartX-i.contentStartPos.left)/i.contentStartPos.width,i.percentageOfImageAtPinchPointY=(i.centerPointStartY-i.contentStartPos.top)/i.contentStartPos.height,i.startDistanceBetweenFingers=s(i.startPoints[0],i.startPoints[1]))))}},d.prototype.onscroll=function(t){var n=this;n.isScrolling=!0,e.removeEventListener("scroll",n.onscroll,!0)},d.prototype.ontouchmove=function(t){var e=this;return void 0!==t.originalEvent.buttons&&0===t.originalEvent.buttons?void e.ontouchend(t):e.isScrolling?void(e.canTap=!1):(e.newPoints=a(t),void((e.opts||e.canPan)&&e.newPoints.length&&e.newPoints.length&&(e.isSwiping&&!0===e.isSwiping||t.preventDefault(),e.distanceX=s(e.newPoints[0],e.startPoints[0],"x"),e.distanceY=s(e.newPoints[0],e.startPoints[0],"y"),e.distance=s(e.newPoints[0],e.startPoints[0]),e.distance>0&&(e.isSwiping?e.onSwipe(t):e.isPanning?e.onPan():e.isZooming&&e.onZoom()))))},d.prototype.onSwipe=function(e){var a,s=this,r=s.instance,c=s.isSwiping,l=s.sliderStartPos.left||0;if(!0!==c)"x"==c&&(s.distanceX>0&&(s.instance.group.length<2||0===s.instance.current.index&&!s.instance.current.opts.loop)?l+=Math.pow(s.distanceX,.8):s.distanceX<0&&(s.instance.group.length<2||s.instance.current.index===s.instance.group.length-1&&!s.instance.current.opts.loop)?l-=Math.pow(-s.distanceX,.8):l+=s.distanceX),s.sliderLastPos={top:"x"==c?0:s.sliderStartPos.top+s.distanceY,left:l},s.requestId&&(i(s.requestId),s.requestId=null),s.requestId=o(function(){s.sliderLastPos&&(n.each(s.instance.slides,function(t,e){var o=e.pos-s.instance.currPos;n.fancybox.setTranslate(e.$slide,{top:s.sliderLastPos.top,left:s.sliderLastPos.left+o*s.canvasWidth+o*e.opts.gutter})}),s.$container.addClass("fancybox-is-sliding"))});else if(Math.abs(s.distance)>10){if(s.canTap=!1,r.group.length<2&&s.opts.vertical?s.isSwiping="y":r.isDragging||!1===s.opts.vertical||"auto"===s.opts.vertical&&n(t).width()>800?s.isSwiping="x":(a=Math.abs(180*Math.atan2(s.distanceY,s.distanceX)/Math.PI),s.isSwiping=a>45&&a<135?"y":"x"),"y"===s.isSwiping&&n.fancybox.isMobile&&s.isScrollable)return void(s.isScrolling=!0);r.isDragging=s.isSwiping,s.startPoints=s.newPoints,n.each(r.slides,function(t,e){var o,i;n.fancybox.stop(e.$slide),o=n.fancybox.getTranslate(e.$slide),i=n.fancybox.getTranslate(r.$refs.stage),e.$slide.css({transform:"",opacity:"","transition-duration":""}).removeClass("fancybox-animated").removeClass(function(t,e){return(e.match(/(^|\s)fancybox-fx-\S+/g)||[]).join(" ")}),e.pos===r.current.pos&&(s.sliderStartPos.top=o.top-i.top,s.sliderStartPos.left=o.left-i.left),n.fancybox.setTranslate(e.$slide,{top:o.top-i.top,left:o.left-i.left})}),r.SlideShow&&r.SlideShow.isActive&&r.SlideShow.stop()}},d.prototype.onPan=function(){var t=this;if(s(t.newPoints[0],t.realPoints[0])<(n.fancybox.isMobile?10:5))return void(t.startPoints=t.newPoints);t.canTap=!1,t.contentLastPos=t.limitMovement(),t.requestId&&i(t.requestId),t.requestId=o(function(){n.fancybox.setTranslate(t.$content,t.contentLastPos)})},d.prototype.limitMovement=function(){var t,e,n,o,i,a,s=this,r=s.canvasWidth,c=s.canvasHeight,l=s.distanceX,d=s.distanceY,u=s.contentStartPos,f=u.left,p=u.top,h=u.width,g=u.height;return i=h>r?f+l:f,a=p+d,t=Math.max(0,.5*r-.5*h),e=Math.max(0,.5*c-.5*g),n=Math.min(r-h,.5*r-.5*h),o=Math.min(c-g,.5*c-.5*g),l>0&&i>t&&(i=t-1+Math.pow(-t+f+l,.8)||0),l<0&&i<n&&(i=n+1-Math.pow(n-f-l,.8)||0),d>0&&a>e&&(a=e-1+Math.pow(-e+p+d,.8)||0),d<0&&a<o&&(a=o+1-Math.pow(o-p-d,.8)||0),{top:a,left:i}},d.prototype.limitPosition=function(t,e,n,o){var i=this,a=i.canvasWidth,s=i.canvasHeight;return n>a?(t=t>0?0:t,t=t<a-n?a-n:t):t=Math.max(0,a/2-n/2),o>s?(e=e>0?0:e,e=e<s-o?s-o:e):e=Math.max(0,s/2-o/2),{top:e,left:t}},d.prototype.onZoom=function(){var e=this,a=e.contentStartPos,r=a.width,c=a.height,l=a.left,d=a.top,u=s(e.newPoints[0],e.newPoints[1]),f=u/e.startDistanceBetweenFingers,p=Math.floor(r*f),h=Math.floor(c*f),g=(r-p)*e.percentageOfImageAtPinchPointX,b=(c-h)*e.percentageOfImageAtPinchPointY,m=(e.newPoints[0].x+e.newPoints[1].x)/2-n(t).scrollLeft(),v=(e.newPoints[0].y+e.newPoints[1].y)/2-n(t).scrollTop(),y=m-e.centerPointStartX,x=v-e.centerPointStartY,w=l+(g+y),$=d+(b+x),S={top:$,left:w,scaleX:f,scaleY:f};e.canTap=!1,e.newWidth=p,e.newHeight=h,e.contentLastPos=S,e.requestId&&i(e.requestId),e.requestId=o(function(){n.fancybox.setTranslate(e.$content,e.contentLastPos)})},d.prototype.ontouchend=function(t){var o=this,s=o.isSwiping,r=o.isPanning,c=o.isZooming,l=o.isScrolling;if(o.endPoints=a(t),o.dMs=Math.max((new Date).getTime()-o.startTime,1),o.$container.removeClass("fancybox-is-grabbing"),n(e).off(".fb.touch"),e.removeEventListener("scroll",o.onscroll,!0),o.requestId&&(i(o.requestId),o.requestId=null),o.isSwiping=!1,o.isPanning=!1,o.isZooming=!1,o.isScrolling=!1,o.instance.isDragging=!1,o.canTap)return o.onTap(t);o.speed=100,o.velocityX=o.distanceX/o.dMs*.5,o.velocityY=o.distanceY/o.dMs*.5,r?o.endPanning():c?o.endZooming():o.endSwiping(s,l)},d.prototype.endSwiping=function(t,e){var o=this,i=!1,a=o.instance.group.length,s=Math.abs(o.distanceX),r="x"==t&&a>1&&(o.dMs>130&&s>10||s>50);o.sliderLastPos=null,"y"==t&&!e&&Math.abs(o.distanceY)>50?(n.fancybox.animate(o.instance.current.$slide,{top:o.sliderStartPos.top+o.distanceY+150*o.velocityY,opacity:0},200),i=o.instance.close(!0,250)):r&&o.distanceX>0?i=o.instance.previous(300):r&&o.distanceX<0&&(i=o.instance.next(300)),!1!==i||"x"!=t&&"y"!=t||o.instance.centerSlide(200),o.$container.removeClass("fancybox-is-sliding")},d.prototype.endPanning=function(){var t,e,o,i=this;i.contentLastPos&&(!1===i.opts.momentum||i.dMs>350?(t=i.contentLastPos.left,e=i.contentLastPos.top):(t=i.contentLastPos.left+500*i.velocityX,e=i.contentLastPos.top+500*i.velocityY),o=i.limitPosition(t,e,i.contentStartPos.width,i.contentStartPos.height),o.width=i.contentStartPos.width,o.height=i.contentStartPos.height,n.fancybox.animate(i.$content,o,366))},d.prototype.endZooming=function(){var t,e,o,i,a=this,s=a.instance.current,r=a.newWidth,c=a.newHeight;a.contentLastPos&&(t=a.contentLastPos.left,e=a.contentLastPos.top,i={top:e,left:t,width:r,height:c,scaleX:1,scaleY:1},n.fancybox.setTranslate(a.$content,i),r<a.canvasWidth&&c<a.canvasHeight?a.instance.scaleToFit(150):r>s.width||c>s.height?a.instance.scaleToActual(a.centerPointStartX,a.centerPointStartY,150):(o=a.limitPosition(t,e,r,c),n.fancybox.animate(a.$content,o,150)))},d.prototype.onTap=function(e){var o,i=this,s=n(e.target),r=i.instance,c=r.current,l=e&&a(e)||i.startPoints,d=l[0]?l[0].x-n(t).scrollLeft()-i.stagePos.left:0,u=l[0]?l[0].y-n(t).scrollTop()-i.stagePos.top:0,f=function(t){var o=c.opts[t];if(n.isFunction(o)&&(o=o.apply(r,[c,e])),o)switch(o){case"close":r.close(i.startEvent);break;case"toggleControls":r.toggleControls();break;case"next":r.next();break;case"nextOrClose":r.group.length>1?r.next():r.close(i.startEvent);break;case"zoom":"image"==c.type&&(c.isLoaded||c.$ghost)&&(r.canPan()?r.scaleToFit():r.isScaledDown()?r.scaleToActual(d,u):r.group.length<2&&r.close(i.startEvent))}};if((!e.originalEvent||2!=e.originalEvent.button)&&(s.is("img")||!(d>s[0].clientWidth+s.offset().left))){if(s.is(".fancybox-bg,.fancybox-inner,.fancybox-outer,.fancybox-container"))o="Outside";else if(s.is(".fancybox-slide"))o="Slide";else{if(!r.current.$content||!r.current.$content.find(s).addBack().filter(s).length)return;o="Content"}if(i.tapped){if(clearTimeout(i.tapped),i.tapped=null,Math.abs(d-i.tapX)>50||Math.abs(u-i.tapY)>50)return this;f("dblclick"+o)}else i.tapX=d,i.tapY=u,c.opts["dblclick"+o]&&c.opts["dblclick"+o]!==c.opts["click"+o]?i.tapped=setTimeout(function(){i.tapped=null,r.isAnimating||f("click"+o)},500):f("click"+o);return this}},n(e).on("onActivate.fb",function(t,e){e&&!e.Guestures&&(e.Guestures=new d(e))}).on("beforeClose.fb",function(t,e){e&&e.Guestures&&e.Guestures.destroy()})}(window,document,jQuery),function(t,e){"use strict";e.extend(!0,e.fancybox.defaults,{btnTpl:{slideShow:'<button data-fancybox-play class="fancybox-button fancybox-button--play" title="{{PLAY_START}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M6.5 5.4v13.2l11-6.6z"/></svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.33 5.75h2.2v12.5h-2.2V5.75zm5.15 0h2.2v12.5h-2.2V5.75z"/></svg></button>'},slideShow:{autoStart:!1,speed:3e3,progress:!0}});var n=function(t){this.instance=t,this.init()};e.extend(n.prototype,{timer:null,isActive:!1,$button:null,init:function(){var t=this,n=t.instance,o=n.group[n.currIndex].opts.slideShow;t.$button=n.$refs.toolbar.find("[data-fancybox-play]").on("click",function(){t.toggle()}),n.group.length<2||!o?t.$button.hide():o.progress&&(t.$progress=e('<div class="fancybox-progress"></div>').appendTo(n.$refs.inner))},set:function(t){var n=this,o=n.instance,i=o.current;i&&(!0===t||i.opts.loop||o.currIndex<o.group.length-1)?n.isActive&&"video"!==i.contentType&&(n.$progress&&e.fancybox.animate(n.$progress.show(),{scaleX:1},i.opts.slideShow.speed),n.timer=setTimeout(function(){o.current.opts.loop||o.current.index!=o.group.length-1?o.next():o.jumpTo(0)},i.opts.slideShow.speed)):(n.stop(),o.idleSecondsCounter=0,o.showControls())},clear:function(){var t=this;clearTimeout(t.timer),t.timer=null,t.$progress&&t.$progress.removeAttr("style").hide()},start:function(){var t=this,e=t.instance.current;e&&(t.$button.attr("title",(e.opts.i18n[e.opts.lang]||e.opts.i18n.en).PLAY_STOP).removeClass("fancybox-button--play").addClass("fancybox-button--pause"),t.isActive=!0,e.isComplete&&t.set(!0),t.instance.trigger("onSlideShowChange",!0))},stop:function(){var t=this,e=t.instance.current;t.clear(),t.$button.attr("title",(e.opts.i18n[e.opts.lang]||e.opts.i18n.en).PLAY_START).removeClass("fancybox-button--pause").addClass("fancybox-button--play"),t.isActive=!1,t.instance.trigger("onSlideShowChange",!1),t.$progress&&t.$progress.removeAttr("style").hide()},toggle:function(){var t=this;t.isActive?t.stop():t.start()}}),e(t).on({"onInit.fb":function(t,e){e&&!e.SlideShow&&(e.SlideShow=new n(e))},"beforeShow.fb":function(t,e,n,o){var i=e&&e.SlideShow;o?i&&n.opts.slideShow.autoStart&&i.start():i&&i.isActive&&i.clear()},"afterShow.fb":function(t,e,n){var o=e&&e.SlideShow;o&&o.isActive&&o.set()},"afterKeydown.fb":function(n,o,i,a,s){var r=o&&o.SlideShow;!r||!i.opts.slideShow||80!==s&&32!==s||e(t.activeElement).is("button,a,input")||(a.preventDefault(),r.toggle())},"beforeClose.fb onDeactivate.fb":function(t,e){var n=e&&e.SlideShow;n&&n.stop()}}),e(t).on("visibilitychange",function(){var n=e.fancybox.getInstance(),o=n&&n.SlideShow;o&&o.isActive&&(t.hidden?o.clear():o.set())})}(document,jQuery),function(t,e){"use strict";var n=function(){for(var e=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],n={},o=0;o<e.length;o++){var i=e[o];if(i&&i[1]in t){for(var a=0;a<i.length;a++)n[e[0][a]]=i[a];return n}}return!1}();if(n){var o={request:function(e){e=e||t.documentElement,e[n.requestFullscreen](e.ALLOW_KEYBOARD_INPUT)},exit:function(){t[n.exitFullscreen]()},toggle:function(e){e=e||t.documentElement,this.isFullscreen()?this.exit():this.request(e)},isFullscreen:function(){return Boolean(t[n.fullscreenElement])},enabled:function(){return Boolean(t[n.fullscreenEnabled])}};e.extend(!0,e.fancybox.defaults,{btnTpl:{fullScreen:'<button data-fancybox-fullscreen class="fancybox-button fancybox-button--fsenter" title="{{FULL_SCREEN}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 14H5v5h5v-2H7v-3zm-2-4h2V7h3V5H5v5zm12 7h-3v2h5v-5h-2v3zM14 5v2h3v3h2V5h-5z"/></svg><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M5 16h3v3h2v-5H5zm3-8H5v2h5V5H8zm6 11h2v-3h3v-2h-5zm2-11V5h-2v5h5V8z"/></svg></button>'},fullScreen:{autoStart:!1}}),e(t).on(n.fullscreenchange,function(){var t=o.isFullscreen(),n=e.fancybox.getInstance();n&&(n.current&&"image"===n.current.type&&n.isAnimating&&(n.isAnimating=!1,n.update(!0,!0,0),n.isComplete||n.complete()),n.trigger("onFullscreenChange",t),n.$refs.container.toggleClass("fancybox-is-fullscreen",t),n.$refs.toolbar.find("[data-fancybox-fullscreen]").toggleClass("fancybox-button--fsenter",!t).toggleClass("fancybox-button--fsexit",t))})}e(t).on({"onInit.fb":function(t,e){var i;if(!n)return void e.$refs.toolbar.find("[data-fancybox-fullscreen]").remove();e&&e.group[e.currIndex].opts.fullScreen?(i=e.$refs.container,i.on("click.fb-fullscreen","[data-fancybox-fullscreen]",function(t){t.stopPropagation(),t.preventDefault(),o.toggle()}),e.opts.fullScreen&&!0===e.opts.fullScreen.autoStart&&o.request(),e.FullScreen=o):e&&e.$refs.toolbar.find("[data-fancybox-fullscreen]").hide()},"afterKeydown.fb":function(t,e,n,o,i){e&&e.FullScreen&&70===i&&(o.preventDefault(),e.FullScreen.toggle())},"beforeClose.fb":function(t,e){e&&e.FullScreen&&e.$refs.container.hasClass("fancybox-is-fullscreen")&&o.exit()}})}(document,jQuery),function(t,e){"use strict";var n="fancybox-thumbs";e.fancybox.defaults=e.extend(!0,{btnTpl:{thumbs:'<button data-fancybox-thumbs class="fancybox-button fancybox-button--thumbs" title="{{THUMBS}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14.59 14.59h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76H5.65v-3.76zm8.94-4.47h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76h-3.76v-3.76zm-4.47 0h3.76v3.76H5.65v-3.76zm8.94-4.47h3.76v3.76h-3.76V5.65zm-4.47 0h3.76v3.76h-3.76V5.65zm-4.47 0h3.76v3.76H5.65V5.65z"/></svg></button>'},thumbs:{autoStart:!1,hideOnClose:!0,parentEl:".fancybox-container",axis:"y"}},e.fancybox.defaults);var o=function(t){this.init(t)};e.extend(o.prototype,{$button:null,$grid:null,$list:null,isVisible:!1,isActive:!1,init:function(t){var e=this,n=t.group,o=0;e.instance=t,e.opts=n[t.currIndex].opts.thumbs,t.Thumbs=e,e.$button=t.$refs.toolbar.find("[data-fancybox-thumbs]");for(var i=0,a=n.length;i<a&&(n[i].thumb&&o++,!(o>1));i++);o>1&&e.opts?(e.$button.removeAttr("style").on("click",function(){e.toggle()}),e.isActive=!0):e.$button.hide()},create:function(){var t,o=this,i=o.instance,a=o.opts.parentEl,s=[];o.$grid||(o.$grid=e('<div class="'+n+" "+n+"-"+o.opts.axis+'"></div>').appendTo(i.$refs.container.find(a).addBack().filter(a)),o.$grid.on("click","a",function(){i.jumpTo(e(this).attr("data-index"))})),o.$list||(o.$list=e('<div class="'+n+'__list">').appendTo(o.$grid)),e.each(i.group,function(e,n){t=n.thumb,t||"image"!==n.type||(t=n.src),s.push('<a href="javascript:;" tabindex="0" data-index="'+e+'"'+(t&&t.length?' style="background-image:url('+t+')"':'class="fancybox-thumbs-missing"')+"></a>")}),o.$list[0].innerHTML=s.join(""),"x"===o.opts.axis&&o.$list.width(parseInt(o.$grid.css("padding-right"),10)+i.group.length*o.$list.children().eq(0).outerWidth(!0))},focus:function(t){var e,n,o=this,i=o.$list,a=o.$grid;o.instance.current&&(e=i.children().removeClass("fancybox-thumbs-active").filter('[data-index="'+o.instance.current.index+'"]').addClass("fancybox-thumbs-active"),n=e.position(),"y"===o.opts.axis&&(n.top<0||n.top>i.height()-e.outerHeight())?i.stop().animate({scrollTop:i.scrollTop()+n.top},t):"x"===o.opts.axis&&(n.left<a.scrollLeft()||n.left>a.scrollLeft()+(a.width()-e.outerWidth()))&&i.parent().stop().animate({scrollLeft:n.left},t))},update:function(){var t=this;t.instance.$refs.container.toggleClass("fancybox-show-thumbs",this.isVisible),t.isVisible?(t.$grid||t.create(),t.instance.trigger("onThumbsShow"),t.focus(0)):t.$grid&&t.instance.trigger("onThumbsHide"),t.instance.update()},hide:function(){this.isVisible=!1,this.update()},show:function(){this.isVisible=!0,this.update()},toggle:function(){this.isVisible=!this.isVisible,this.update()}}),e(t).on({"onInit.fb":function(t,e){var n;e&&!e.Thumbs&&(n=new o(e),n.isActive&&!0===n.opts.autoStart&&n.show())},"beforeShow.fb":function(t,e,n,o){var i=e&&e.Thumbs;i&&i.isVisible&&i.focus(o?0:250)},"afterKeydown.fb":function(t,e,n,o,i){var a=e&&e.Thumbs;a&&a.isActive&&71===i&&(o.preventDefault(),a.toggle())},"beforeClose.fb":function(t,e){var n=e&&e.Thumbs;n&&n.isVisible&&!1!==n.opts.hideOnClose&&n.$grid.hide()}})}(document,jQuery),function(t,e){"use strict";function n(t){var e={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};return String(t).replace(/[&<>"'`=\/]/g,function(t){return e[t]})}e.extend(!0,e.fancybox.defaults,{btnTpl:{share:'<button data-fancybox-share class="fancybox-button fancybox-button--share" title="{{SHARE}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M2.55 19c1.4-8.4 9.1-9.8 11.9-9.8V5l7 7-7 6.3v-3.5c-2.8 0-10.5 2.1-11.9 4.2z"/></svg></button>'},share:{url:function(t,e){return!t.currentHash&&"inline"!==e.type&&"html"!==e.type&&(e.origSrc||e.src)||window.location},
tpl:'<div class="fancybox-share"><h1>{{SHARE}}</h1><p><a class="fancybox-share__button fancybox-share__button--fb" href="https://www.facebook.com/sharer/sharer.php?u={{url}}"><svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="m287 456v-299c0-21 6-35 35-35h38v-63c-7-1-29-3-55-3-54 0-91 33-91 94v306m143-254h-205v72h196" /></svg><span>Facebook</span></a><a class="fancybox-share__button fancybox-share__button--tw" href="https://twitter.com/intent/tweet?url={{url}}&text={{descr}}"><svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="m456 133c-14 7-31 11-47 13 17-10 30-27 37-46-15 10-34 16-52 20-61-62-157-7-141 75-68-3-129-35-169-85-22 37-11 86 26 109-13 0-26-4-37-9 0 39 28 72 65 80-12 3-25 4-37 2 10 33 41 57 77 57-42 30-77 38-122 34 170 111 378-32 359-208 16-11 30-25 41-42z" /></svg><span>Twitter</span></a><a class="fancybox-share__button fancybox-share__button--pt" href="https://www.pinterest.com/pin/create/button/?url={{url}}&description={{descr}}&media={{media}}"><svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><path d="m265 56c-109 0-164 78-164 144 0 39 15 74 47 87 5 2 10 0 12-5l4-19c2-6 1-8-3-13-9-11-15-25-15-45 0-58 43-110 113-110 62 0 96 38 96 88 0 67-30 122-73 122-24 0-42-19-36-44 6-29 20-60 20-81 0-19-10-35-31-35-25 0-44 26-44 60 0 21 7 36 7 36l-30 125c-8 37-1 83 0 87 0 3 4 4 5 2 2-3 32-39 42-75l16-64c8 16 31 29 56 29 74 0 124-67 124-157 0-69-58-132-146-132z" fill="#fff"/></svg><span>Pinterest</span></a></p><p><input class="fancybox-share__input" type="text" value="{{url_raw}}" onclick="select()" /></p></div>'}}),e(t).on("click","[data-fancybox-share]",function(){var t,o,i=e.fancybox.getInstance(),a=i.current||null;a&&("function"===e.type(a.opts.share.url)&&(t=a.opts.share.url.apply(a,[i,a])),o=a.opts.share.tpl.replace(/\{\{media\}\}/g,"image"===a.type?encodeURIComponent(a.src):"").replace(/\{\{url\}\}/g,encodeURIComponent(t)).replace(/\{\{url_raw\}\}/g,n(t)).replace(/\{\{descr\}\}/g,i.$caption?encodeURIComponent(i.$caption.text()):""),e.fancybox.open({src:i.translate(i,o),type:"html",opts:{touch:!1,animationEffect:!1,afterLoad:function(t,e){i.$refs.container.one("beforeClose.fb",function(){t.close(null,0)}),e.$content.find(".fancybox-share__button").click(function(){return window.open(this.href,"Share","width=550, height=450"),!1})},mobile:{autoFocus:!1}}}))})}(document,jQuery),function(t,e,n){"use strict";function o(){var e=t.location.hash.substr(1),n=e.split("-"),o=n.length>1&&/^\+?\d+$/.test(n[n.length-1])?parseInt(n.pop(-1),10)||1:1,i=n.join("-");return{hash:e,index:o<1?1:o,gallery:i}}function i(t){""!==t.gallery&&n("[data-fancybox='"+n.escapeSelector(t.gallery)+"']").eq(t.index-1).focus().trigger("click.fb-start")}function a(t){var e,n;return!!t&&(e=t.current?t.current.opts:t.opts,""!==(n=e.hash||(e.$orig?e.$orig.data("fancybox")||e.$orig.data("fancybox-trigger"):""))&&n)}n.escapeSelector||(n.escapeSelector=function(t){return(t+"").replace(/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g,function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t})}),n(function(){!1!==n.fancybox.defaults.hash&&(n(e).on({"onInit.fb":function(t,e){var n,i;!1!==e.group[e.currIndex].opts.hash&&(n=o(),(i=a(e))&&n.gallery&&i==n.gallery&&(e.currIndex=n.index-1))},"beforeShow.fb":function(n,o,i,s){var r;i&&!1!==i.opts.hash&&(r=a(o))&&(o.currentHash=r+(o.group.length>1?"-"+(i.index+1):""),t.location.hash!=="#"+o.currentHash&&(s&&!o.origHash&&(o.origHash=t.location.hash),o.hashTimer&&clearTimeout(o.hashTimer),o.hashTimer=setTimeout(function(){"replaceState"in t.history?(t.history[s?"pushState":"replaceState"]({},e.title,t.location.pathname+t.location.search+"#"+o.currentHash),s&&(o.hasCreatedHistory=!0)):t.location.hash=o.currentHash,o.hashTimer=null},300)))},"beforeClose.fb":function(n,o,i){i&&!1!==i.opts.hash&&(clearTimeout(o.hashTimer),o.currentHash&&o.hasCreatedHistory?t.history.back():o.currentHash&&("replaceState"in t.history?t.history.replaceState({},e.title,t.location.pathname+t.location.search+(o.origHash||"")):t.location.hash=o.origHash),o.currentHash=null)}}),n(t).on("hashchange.fb",function(){var t=o(),e=null;n.each(n(".fancybox-container").get().reverse(),function(t,o){var i=n(o).data("FancyBox");if(i&&i.currentHash)return e=i,!1}),e?e.currentHash===t.gallery+"-"+t.index||1===t.index&&e.currentHash==t.gallery||(e.currentHash=null,e.close()):""!==t.gallery&&i(t)}),setTimeout(function(){n.fancybox.getInstance()||i(o())},50))})}(window,document,jQuery),function(t,e){"use strict";var n=(new Date).getTime();e(t).on({"onInit.fb":function(t,e,o){e.$refs.stage.on("mousewheel DOMMouseScroll wheel MozMousePixelScroll",function(t){var o=e.current,i=(new Date).getTime();e.group.length<2||!1===o.opts.wheel||"auto"===o.opts.wheel&&"image"!==o.type||(t.preventDefault(),t.stopPropagation(),o.$slide.hasClass("fancybox-animated")||(t=t.originalEvent||t,i-n<250||(n=i,e[(-t.deltaY||-t.deltaX||t.wheelDelta||-t.detail)<0?"next":"previous"]())))})}})}(document,jQuery);
;/*
* anime.js v3.2.1
* (c) 2020 Julian Garnier
* Released under the MIT license
* animejs.com
*/
!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):n.anime=e()}(this,function(){"use strict";var n={update:null,begin:null,loopBegin:null,changeBegin:null,change:null,changeComplete:null,loopComplete:null,complete:null,loop:1,direction:"normal",autoplay:!0,timelineOffset:0},e={duration:1e3,delay:0,endDelay:0,easing:"easeOutElastic(1, .5)",round:0},t=["translateX","translateY","translateZ","rotate","rotateX","rotateY","rotateZ","scale","scaleX","scaleY","scaleZ","skew","skewX","skewY","perspective","matrix","matrix3d"],r={CSS:{},springs:{}};function a(n,e,t){return Math.min(Math.max(n,e),t)}function o(n,e){return n.indexOf(e)>-1}function u(n,e){return n.apply(null,e)}var i={arr:function(n){return Array.isArray(n)},obj:function(n){return o(Object.prototype.toString.call(n),"Object")},pth:function(n){return i.obj(n)&&n.hasOwnProperty("totalLength")},svg:function(n){return n instanceof SVGElement},inp:function(n){return n instanceof HTMLInputElement},dom:function(n){return n.nodeType||i.svg(n)},str:function(n){return"string"==typeof n},fnc:function(n){return"function"==typeof n},und:function(n){return void 0===n},nil:function(n){return i.und(n)||null===n},hex:function(n){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(n)},rgb:function(n){return/^rgb/.test(n)},hsl:function(n){return/^hsl/.test(n)},col:function(n){return i.hex(n)||i.rgb(n)||i.hsl(n)},key:function(t){return!n.hasOwnProperty(t)&&!e.hasOwnProperty(t)&&"targets"!==t&&"keyframes"!==t}};function c(n){var e=/\(([^)]+)\)/.exec(n);return e?e[1].split(",").map(function(n){return parseFloat(n)}):[]}function s(n,e){var t=c(n),o=a(i.und(t[0])?1:t[0],.1,100),u=a(i.und(t[1])?100:t[1],.1,100),s=a(i.und(t[2])?10:t[2],.1,100),f=a(i.und(t[3])?0:t[3],.1,100),l=Math.sqrt(u/o),d=s/(2*Math.sqrt(u*o)),p=d<1?l*Math.sqrt(1-d*d):0,v=1,h=d<1?(d*l-f)/p:-f+l;function g(n){var t=e?e*n/1e3:n;return t=d<1?Math.exp(-t*d*l)*(v*Math.cos(p*t)+h*Math.sin(p*t)):(v+h*t)*Math.exp(-t*l),0===n||1===n?n:1-t}return e?g:function(){var e=r.springs[n];if(e)return e;for(var t=0,a=0;;)if(1===g(t+=1/6)){if(++a>=16)break}else a=0;var o=t*(1/6)*1e3;return r.springs[n]=o,o}}function f(n){return void 0===n&&(n=10),function(e){return Math.ceil(a(e,1e-6,1)*n)*(1/n)}}var l,d,p=function(){var n=11,e=1/(n-1);function t(n,e){return 1-3*e+3*n}function r(n,e){return 3*e-6*n}function a(n){return 3*n}function o(n,e,o){return((t(e,o)*n+r(e,o))*n+a(e))*n}function u(n,e,o){return 3*t(e,o)*n*n+2*r(e,o)*n+a(e)}return function(t,r,a,i){if(0<=t&&t<=1&&0<=a&&a<=1){var c=new Float32Array(n);if(t!==r||a!==i)for(var s=0;s<n;++s)c[s]=o(s*e,t,a);return function(n){return t===r&&a===i?n:0===n||1===n?n:o(f(n),r,i)}}function f(r){for(var i=0,s=1,f=n-1;s!==f&&c[s]<=r;++s)i+=e;var l=i+(r-c[--s])/(c[s+1]-c[s])*e,d=u(l,t,a);return d>=.001?function(n,e,t,r){for(var a=0;a<4;++a){var i=u(e,t,r);if(0===i)return e;e-=(o(e,t,r)-n)/i}return e}(r,l,t,a):0===d?l:function(n,e,t,r,a){for(var u,i,c=0;(u=o(i=e+(t-e)/2,r,a)-n)>0?t=i:e=i,Math.abs(u)>1e-7&&++c<10;);return i}(r,i,i+e,t,a)}}}(),v=(l={linear:function(){return function(n){return n}}},d={Sine:function(){return function(n){return 1-Math.cos(n*Math.PI/2)}},Circ:function(){return function(n){return 1-Math.sqrt(1-n*n)}},Back:function(){return function(n){return n*n*(3*n-2)}},Bounce:function(){return function(n){for(var e,t=4;n<((e=Math.pow(2,--t))-1)/11;);return 1/Math.pow(4,3-t)-7.5625*Math.pow((3*e-2)/22-n,2)}},Elastic:function(n,e){void 0===n&&(n=1),void 0===e&&(e=.5);var t=a(n,1,10),r=a(e,.1,2);return function(n){return 0===n||1===n?n:-t*Math.pow(2,10*(n-1))*Math.sin((n-1-r/(2*Math.PI)*Math.asin(1/t))*(2*Math.PI)/r)}}},["Quad","Cubic","Quart","Quint","Expo"].forEach(function(n,e){d[n]=function(){return function(n){return Math.pow(n,e+2)}}}),Object.keys(d).forEach(function(n){var e=d[n];l["easeIn"+n]=e,l["easeOut"+n]=function(n,t){return function(r){return 1-e(n,t)(1-r)}},l["easeInOut"+n]=function(n,t){return function(r){return r<.5?e(n,t)(2*r)/2:1-e(n,t)(-2*r+2)/2}},l["easeOutIn"+n]=function(n,t){return function(r){return r<.5?(1-e(n,t)(1-2*r))/2:(e(n,t)(2*r-1)+1)/2}}}),l);function h(n,e){if(i.fnc(n))return n;var t=n.split("(")[0],r=v[t],a=c(n);switch(t){case"spring":return s(n,e);case"cubicBezier":return u(p,a);case"steps":return u(f,a);default:return u(r,a)}}function g(n){try{return document.querySelectorAll(n)}catch(n){return}}function m(n,e){for(var t=n.length,r=arguments.length>=2?arguments[1]:void 0,a=[],o=0;o<t;o++)if(o in n){var u=n[o];e.call(r,u,o,n)&&a.push(u)}return a}function y(n){return n.reduce(function(n,e){return n.concat(i.arr(e)?y(e):e)},[])}function b(n){return i.arr(n)?n:(i.str(n)&&(n=g(n)||n),n instanceof NodeList||n instanceof HTMLCollection?[].slice.call(n):[n])}function M(n,e){return n.some(function(n){return n===e})}function x(n){var e={};for(var t in n)e[t]=n[t];return e}function w(n,e){var t=x(n);for(var r in n)t[r]=e.hasOwnProperty(r)?e[r]:n[r];return t}function k(n,e){var t=x(n);for(var r in e)t[r]=i.und(n[r])?e[r]:n[r];return t}function O(n){return i.rgb(n)?(t=/rgb\((\d+,\s*[\d]+,\s*[\d]+)\)/g.exec(e=n))?"rgba("+t[1]+",1)":e:i.hex(n)?(r=n.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i,function(n,e,t,r){return e+e+t+t+r+r}),a=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(r),"rgba("+parseInt(a[1],16)+","+parseInt(a[2],16)+","+parseInt(a[3],16)+",1)"):i.hsl(n)?function(n){var e,t,r,a=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(n)||/hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g.exec(n),o=parseInt(a[1],10)/360,u=parseInt(a[2],10)/100,i=parseInt(a[3],10)/100,c=a[4]||1;function s(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+6*(e-n)*t:t<.5?e:t<2/3?n+(e-n)*(2/3-t)*6:n}if(0==u)e=t=r=i;else{var f=i<.5?i*(1+u):i+u-i*u,l=2*i-f;e=s(l,f,o+1/3),t=s(l,f,o),r=s(l,f,o-1/3)}return"rgba("+255*e+","+255*t+","+255*r+","+c+")"}(n):void 0;var e,t,r,a}function C(n){var e=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(n);if(e)return e[1]}function P(n,e){return i.fnc(n)?n(e.target,e.id,e.total):n}function I(n,e){return n.getAttribute(e)}function D(n,e,t){if(M([t,"deg","rad","turn"],C(e)))return e;var a=r.CSS[e+t];if(!i.und(a))return a;var o=document.createElement(n.tagName),u=n.parentNode&&n.parentNode!==document?n.parentNode:document.body;u.appendChild(o),o.style.position="absolute",o.style.width=100+t;var c=100/o.offsetWidth;u.removeChild(o);var s=c*parseFloat(e);return r.CSS[e+t]=s,s}function B(n,e,t){if(e in n.style){var r=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),a=n.style[e]||getComputedStyle(n).getPropertyValue(r)||"0";return t?D(n,a,t):a}}function T(n,e){return i.dom(n)&&!i.inp(n)&&(!i.nil(I(n,e))||i.svg(n)&&n[e])?"attribute":i.dom(n)&&M(t,e)?"transform":i.dom(n)&&"transform"!==e&&B(n,e)?"css":null!=n[e]?"object":void 0}function E(n){if(i.dom(n)){for(var e,t=n.style.transform||"",r=/(\w+)\(([^)]*)\)/g,a=new Map;e=r.exec(t);)a.set(e[1],e[2]);return a}}function F(n,e,t,r){var a,u=o(e,"scale")?1:0+(o(a=e,"translate")||"perspective"===a?"px":o(a,"rotate")||o(a,"skew")?"deg":void 0),i=E(n).get(e)||u;return t&&(t.transforms.list.set(e,i),t.transforms.last=e),r?D(n,i,r):i}function A(n,e,t,r){switch(T(n,e)){case"transform":return F(n,e,r,t);case"css":return B(n,e,t);case"attribute":return I(n,e);default:return n[e]||0}}function N(n,e){var t=/^(\*=|\+=|-=)/.exec(n);if(!t)return n;var r=C(n)||0,a=parseFloat(e),o=parseFloat(n.replace(t[0],""));switch(t[0][0]){case"+":return a+o+r;case"-":return a-o+r;case"*":return a*o+r}}function S(n,e){if(i.col(n))return O(n);if(/\s/g.test(n))return n;var t=C(n),r=t?n.substr(0,n.length-t.length):n;return e?r+e:r}function L(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function j(n){for(var e,t=n.points,r=0,a=0;a<t.numberOfItems;a++){var o=t.getItem(a);a>0&&(r+=L(e,o)),e=o}return r}function q(n){if(n.getTotalLength)return n.getTotalLength();switch(n.tagName.toLowerCase()){case"circle":return o=n,2*Math.PI*I(o,"r");case"rect":return 2*I(a=n,"width")+2*I(a,"height");case"line":return L({x:I(r=n,"x1"),y:I(r,"y1")},{x:I(r,"x2"),y:I(r,"y2")});case"polyline":return j(n);case"polygon":return t=(e=n).points,j(e)+L(t.getItem(t.numberOfItems-1),t.getItem(0))}var e,t,r,a,o}function H(n,e){var t=e||{},r=t.el||function(n){for(var e=n.parentNode;i.svg(e)&&i.svg(e.parentNode);)e=e.parentNode;return e}(n),a=r.getBoundingClientRect(),o=I(r,"viewBox"),u=a.width,c=a.height,s=t.viewBox||(o?o.split(" "):[0,0,u,c]);return{el:r,viewBox:s,x:s[0]/1,y:s[1]/1,w:u,h:c,vW:s[2],vH:s[3]}}function V(n,e,t){function r(t){void 0===t&&(t=0);var r=e+t>=1?e+t:0;return n.el.getPointAtLength(r)}var a=H(n.el,n.svg),o=r(),u=r(-1),i=r(1),c=t?1:a.w/a.vW,s=t?1:a.h/a.vH;switch(n.property){case"x":return(o.x-a.x)*c;case"y":return(o.y-a.y)*s;case"angle":return 180*Math.atan2(i.y-u.y,i.x-u.x)/Math.PI}}function $(n,e){var t=/[+-]?\d*\.?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?/g,r=S(i.pth(n)?n.totalLength:n,e)+"";return{original:r,numbers:r.match(t)?r.match(t).map(Number):[0],strings:i.str(n)||e?r.split(t):[]}}function W(n){return m(n?y(i.arr(n)?n.map(b):b(n)):[],function(n,e,t){return t.indexOf(n)===e})}function X(n){var e=W(n);return e.map(function(n,t){return{target:n,id:t,total:e.length,transforms:{list:E(n)}}})}function Y(n,e){var t=x(e);if(/^spring/.test(t.easing)&&(t.duration=s(t.easing)),i.arr(n)){var r=n.length;2===r&&!i.obj(n[0])?n={value:n}:i.fnc(e.duration)||(t.duration=e.duration/r)}var a=i.arr(n)?n:[n];return a.map(function(n,t){var r=i.obj(n)&&!i.pth(n)?n:{value:n};return i.und(r.delay)&&(r.delay=t?0:e.delay),i.und(r.endDelay)&&(r.endDelay=t===a.length-1?e.endDelay:0),r}).map(function(n){return k(n,t)})}function Z(n,e){var t=[],r=e.keyframes;for(var a in r&&(e=k(function(n){for(var e=m(y(n.map(function(n){return Object.keys(n)})),function(n){return i.key(n)}).reduce(function(n,e){return n.indexOf(e)<0&&n.push(e),n},[]),t={},r=function(r){var a=e[r];t[a]=n.map(function(n){var e={};for(var t in n)i.key(t)?t==a&&(e.value=n[t]):e[t]=n[t];return e})},a=0;a<e.length;a++)r(a);return t}(r),e)),e)i.key(a)&&t.push({name:a,tweens:Y(e[a],n)});return t}function G(n,e){var t;return n.tweens.map(function(r){var a=function(n,e){var t={};for(var r in n){var a=P(n[r],e);i.arr(a)&&1===(a=a.map(function(n){return P(n,e)})).length&&(a=a[0]),t[r]=a}return t.duration=parseFloat(t.duration),t.delay=parseFloat(t.delay),t}(r,e),o=a.value,u=i.arr(o)?o[1]:o,c=C(u),s=A(e.target,n.name,c,e),f=t?t.to.original:s,l=i.arr(o)?o[0]:f,d=C(l)||C(s),p=c||d;return i.und(u)&&(u=f),a.from=$(l,p),a.to=$(N(u,l),p),a.start=t?t.end:0,a.end=a.start+a.delay+a.duration+a.endDelay,a.easing=h(a.easing,a.duration),a.isPath=i.pth(o),a.isPathTargetInsideSVG=a.isPath&&i.svg(e.target),a.isColor=i.col(a.from.original),a.isColor&&(a.round=1),t=a,a})}var Q={css:function(n,e,t){return n.style[e]=t},attribute:function(n,e,t){return n.setAttribute(e,t)},object:function(n,e,t){return n[e]=t},transform:function(n,e,t,r,a){if(r.list.set(e,t),e===r.last||a){var o="";r.list.forEach(function(n,e){o+=e+"("+n+") "}),n.style.transform=o}}};function z(n,e){X(n).forEach(function(n){for(var t in e){var r=P(e[t],n),a=n.target,o=C(r),u=A(a,t,o,n),i=N(S(r,o||C(u)),u),c=T(a,t);Q[c](a,t,i,n.transforms,!0)}})}function _(n,e){return m(y(n.map(function(n){return e.map(function(e){return function(n,e){var t=T(n.target,e.name);if(t){var r=G(e,n),a=r[r.length-1];return{type:t,property:e.name,animatable:n,tweens:r,duration:a.end,delay:r[0].delay,endDelay:a.endDelay}}}(n,e)})})),function(n){return!i.und(n)})}function R(n,e){var t=n.length,r=function(n){return n.timelineOffset?n.timelineOffset:0},a={};return a.duration=t?Math.max.apply(Math,n.map(function(n){return r(n)+n.duration})):e.duration,a.delay=t?Math.min.apply(Math,n.map(function(n){return r(n)+n.delay})):e.delay,a.endDelay=t?a.duration-Math.max.apply(Math,n.map(function(n){return r(n)+n.duration-n.endDelay})):e.endDelay,a}var J=0;var K=[],U=function(){var n;function e(t){for(var r=K.length,a=0;a<r;){var o=K[a];o.paused?(K.splice(a,1),r--):(o.tick(t),a++)}n=a>0?requestAnimationFrame(e):void 0}return"undefined"!=typeof document&&document.addEventListener("visibilitychange",function(){en.suspendWhenDocumentHidden&&(nn()?n=cancelAnimationFrame(n):(K.forEach(function(n){return n._onDocumentVisibility()}),U()))}),function(){n||nn()&&en.suspendWhenDocumentHidden||!(K.length>0)||(n=requestAnimationFrame(e))}}();function nn(){return!!document&&document.hidden}function en(t){void 0===t&&(t={});var r,o=0,u=0,i=0,c=0,s=null;function f(n){var e=window.Promise&&new Promise(function(n){return s=n});return n.finished=e,e}var l,d,p,v,h,g,y,b,M=(d=w(n,l=t),p=w(e,l),v=Z(p,l),h=X(l.targets),g=_(h,v),y=R(g,p),b=J,J++,k(d,{id:b,children:[],animatables:h,animations:g,duration:y.duration,delay:y.delay,endDelay:y.endDelay}));f(M);function x(){var n=M.direction;"alternate"!==n&&(M.direction="normal"!==n?"normal":"reverse"),M.reversed=!M.reversed,r.forEach(function(n){return n.reversed=M.reversed})}function O(n){return M.reversed?M.duration-n:n}function C(){o=0,u=O(M.currentTime)*(1/en.speed)}function P(n,e){e&&e.seek(n-e.timelineOffset)}function I(n){for(var e=0,t=M.animations,r=t.length;e<r;){var o=t[e],u=o.animatable,i=o.tweens,c=i.length-1,s=i[c];c&&(s=m(i,function(e){return n<e.end})[0]||s);for(var f=a(n-s.start-s.delay,0,s.duration)/s.duration,l=isNaN(f)?1:s.easing(f),d=s.to.strings,p=s.round,v=[],h=s.to.numbers.length,g=void 0,y=0;y<h;y++){var b=void 0,x=s.to.numbers[y],w=s.from.numbers[y]||0;b=s.isPath?V(s.value,l*x,s.isPathTargetInsideSVG):w+l*(x-w),p&&(s.isColor&&y>2||(b=Math.round(b*p)/p)),v.push(b)}var k=d.length;if(k){g=d[0];for(var O=0;O<k;O++){d[O];var C=d[O+1],P=v[O];isNaN(P)||(g+=C?P+C:P+" ")}}else g=v[0];Q[o.type](u.target,o.property,g,u.transforms),o.currentValue=g,e++}}function D(n){M[n]&&!M.passThrough&&M[n](M)}function B(n){var e=M.duration,t=M.delay,l=e-M.endDelay,d=O(n);M.progress=a(d/e*100,0,100),M.reversePlayback=d<M.currentTime,r&&function(n){if(M.reversePlayback)for(var e=c;e--;)P(n,r[e]);else for(var t=0;t<c;t++)P(n,r[t])}(d),!M.began&&M.currentTime>0&&(M.began=!0,D("begin")),!M.loopBegan&&M.currentTime>0&&(M.loopBegan=!0,D("loopBegin")),d<=t&&0!==M.currentTime&&I(0),(d>=l&&M.currentTime!==e||!e)&&I(e),d>t&&d<l?(M.changeBegan||(M.changeBegan=!0,M.changeCompleted=!1,D("changeBegin")),D("change"),I(d)):M.changeBegan&&(M.changeCompleted=!0,M.changeBegan=!1,D("changeComplete")),M.currentTime=a(d,0,e),M.began&&D("update"),n>=e&&(u=0,M.remaining&&!0!==M.remaining&&M.remaining--,M.remaining?(o=i,D("loopComplete"),M.loopBegan=!1,"alternate"===M.direction&&x()):(M.paused=!0,M.completed||(M.completed=!0,D("loopComplete"),D("complete"),!M.passThrough&&"Promise"in window&&(s(),f(M)))))}return M.reset=function(){var n=M.direction;M.passThrough=!1,M.currentTime=0,M.progress=0,M.paused=!0,M.began=!1,M.loopBegan=!1,M.changeBegan=!1,M.completed=!1,M.changeCompleted=!1,M.reversePlayback=!1,M.reversed="reverse"===n,M.remaining=M.loop,r=M.children;for(var e=c=r.length;e--;)M.children[e].reset();(M.reversed&&!0!==M.loop||"alternate"===n&&1===M.loop)&&M.remaining++,I(M.reversed?M.duration:0)},M._onDocumentVisibility=C,M.set=function(n,e){return z(n,e),M},M.tick=function(n){i=n,o||(o=i),B((i+(u-o))*en.speed)},M.seek=function(n){B(O(n))},M.pause=function(){M.paused=!0,C()},M.play=function(){M.paused&&(M.completed&&M.reset(),M.paused=!1,K.push(M),C(),U())},M.reverse=function(){x(),M.completed=!M.reversed,C()},M.restart=function(){M.reset(),M.play()},M.remove=function(n){rn(W(n),M)},M.reset(),M.autoplay&&M.play(),M}function tn(n,e){for(var t=e.length;t--;)M(n,e[t].animatable.target)&&e.splice(t,1)}function rn(n,e){var t=e.animations,r=e.children;tn(n,t);for(var a=r.length;a--;){var o=r[a],u=o.animations;tn(n,u),u.length||o.children.length||r.splice(a,1)}t.length||r.length||e.pause()}return en.version="3.2.1",en.speed=1,en.suspendWhenDocumentHidden=!0,en.running=K,en.remove=function(n){for(var e=W(n),t=K.length;t--;)rn(e,K[t])},en.get=A,en.set=z,en.convertPx=D,en.path=function(n,e){var t=i.str(n)?g(n)[0]:n,r=e||100;return function(n){return{property:n,el:t,svg:H(t),totalLength:q(t)*(r/100)}}},en.setDashoffset=function(n){var e=q(n);return n.setAttribute("stroke-dasharray",e),e},en.stagger=function(n,e){void 0===e&&(e={});var t=e.direction||"normal",r=e.easing?h(e.easing):null,a=e.grid,o=e.axis,u=e.from||0,c="first"===u,s="center"===u,f="last"===u,l=i.arr(n),d=l?parseFloat(n[0]):parseFloat(n),p=l?parseFloat(n[1]):0,v=C(l?n[1]:n)||0,g=e.start||0+(l?d:0),m=[],y=0;return function(n,e,i){if(c&&(u=0),s&&(u=(i-1)/2),f&&(u=i-1),!m.length){for(var h=0;h<i;h++){if(a){var b=s?(a[0]-1)/2:u%a[0],M=s?(a[1]-1)/2:Math.floor(u/a[0]),x=b-h%a[0],w=M-Math.floor(h/a[0]),k=Math.sqrt(x*x+w*w);"x"===o&&(k=-x),"y"===o&&(k=-w),m.push(k)}else m.push(Math.abs(u-h));y=Math.max.apply(Math,m)}r&&(m=m.map(function(n){return r(n/y)*y})),"reverse"===t&&(m=m.map(function(n){return o?n<0?-1*n:-n:Math.abs(y-n)}))}return g+(l?(p-d)/y:d)*(Math.round(100*m[e])/100)+v}},en.timeline=function(n){void 0===n&&(n={});var t=en(n);return t.duration=0,t.add=function(r,a){var o=K.indexOf(t),u=t.children;function c(n){n.passThrough=!0}o>-1&&K.splice(o,1);for(var s=0;s<u.length;s++)c(u[s]);var f=k(r,w(e,n));f.targets=f.targets||n.targets;var l=t.duration;f.autoplay=!1,f.direction=t.direction,f.timelineOffset=i.und(a)?l:N(a,l),c(t),t.seek(f.timelineOffset);var d=en(f);c(d),u.push(d);var p=R(u,n);return t.delay=p.delay,t.endDelay=p.endDelay,t.duration=p.duration,t.seek(0),t.reset(),t.autoplay&&t.play(),t},t},en.easing=h,en.penner=v,en.random=function(n,e){return Math.floor(Math.random()*(e-n+1))+n},en});
;!function(e){"use strict";e(window).on("resize",function(){e(".sf-menu ul.tracked-pos").removeClass("tracked-pos")});var t,s,n,a,r,o,i,h,l,d,p,u,f,c,m,v,g=(s="sf-breadcrumb",n="sf-js-enabled",a="sf-with-ul",r="sf-arrows",o=function(){var t=/iPhone|iPad|iPod/i.test(navigator.userAgent);return t&&e("html").css("cursor","pointer").on("click",e.noop),t}(),i="behavior"in(t=document.documentElement.style)&&"fill"in t&&/iemobile/i.test(navigator.userAgent),h=function(e,t){var s=n;t.cssArrows&&(s+=" "+r),e.toggleClass(s)},l=function(e){e.children("a").toggleClass(a)},d=function(e){var t=e.css("ms-touch-action");t="pan-y"===t?"auto":"pan-y",e.css("ms-touch-action",t)},p=function(t){var s=e(this),n=s.siblings(t.data.popUpSelector);n.length>0&&n.is(":hidden")&&(s.one("click.superfish",!1),"MSPointerDown"===t.type?s.trigger("focus"):e.proxy(u,s.parent("li"))())},u=function(){var t=e(this),s=v(t);e(this).parents(".megamenu").length>0||(clearTimeout(s.sfTimer),t.siblings().superfish("hide").end().superfish("show"))},f=function(){var t=e(this),s=v(t);o?e.proxy(c,t,s)():(clearTimeout(s.sfTimer),s.sfTimer=setTimeout(e.proxy(c,t,s),s.delay))},c=function(t){t.retainPath=e.inArray(this[0],t.$path)>-1,this.superfish("hide"),this.parents("."+t.hoverClass).length||(t.onIdle.call(m(this)),t.$path.length&&e.proxy(u,t.$path)())},m=function(e){return e.closest("."+n)},v=function(e){return m(e).data("sf-options")},{hide:function(t){if(this.length){var s=v(o=this);if(!s)return this;if(e(this).hasClass("menu-item-over")&&e(this).hasClass("megamenu"))return!0;var n=!0===s.retainPath?s.$path:"",a=o.find("li."+s.hoverClass).add(this).not(n).removeClass(s.hoverClass).children(s.popUpSelector),r=s.speedOut;if(t&&(a.show(),r=0),s.retainPath=!1,s.onBeforeHide.call(a),"minimal"==s.dropdownStyle){var o=e(this);s.onHide.call(o)}else a.stop(!0,!0).animate(s.animationOut,r,function(){var t=e(this);s.onHide.call(t)});if(e(this).parents(".megamenu").length>0)return;e('#header-outer[data-megamenu-rt="1"]').length>0&&e('#header-outer[data-transparent-header="true"]').length>0&&(0==e("#header-outer.scrolled-down").length&&0==e("#header-outer.small-nav").length&&0==e("#header-outer.detached").length&&0==e("#header-outer.fixed-menu").length&&e("#header-outer").addClass("transparent"),e('#header-outer[data-permanent-transparent="1"][data-transparent-header="true"]').length>0&&e("#header-outer").addClass("transparent"))}return this},show:function(){if(!(e(this).parents(".megamenu").length>0)){var t=v(this);if(!t)return this;var s=this.addClass(t.hoverClass).children(t.popUpSelector);if(e('#header-outer[data-megamenu-rt="1"]').length>0&&e(this).hasClass("megamenu")&&!e(this).hasClass("width-75")&&!e(this).hasClass("width-50")&&"true"==e("#header-outer").attr("data-transparent-header")&&(e("#header-outer").addClass("no-transition"),e("#header-outer").removeClass("transparent")),t.onBeforeShow.call(s),!s.hasClass("tracked-pos")&&!e(s).parents("li").hasClass("megamenu")&&!e(s).parents("ul").hasClass("sub-menu")&&s.offset()){s.addClass("temp-hidden-display");var n=e("#top .container").width(),a=s;a.offset().left-(e(window).width()-n)/2+a.width()<=e(window).width()-100?s.parents("li").removeClass("edge"):s.parents("li").addClass("edge"),s.removeClass("temp-hidden-display")}return"minimal"==t.dropdownStyle?t.onShow.call(s):s.stop(!0,!0).animate(t.animation,t.speed,function(){t.onShow.call(s)}),s.hasClass("tracked-pos")||s.length>0&&s.parents(".sub-menu").length>0&&s.parents(".sf-menu").length>0&&s.offset().left+s.outerWidth()>e(window).width()&&(s.addClass("on-left-side"),s.find("ul").addClass("on-left-side")),s.addClass("tracked-pos"),this}},destroy:function(){return this.each(function(){var t,n=e(this),a=n.data("sf-options");if(!a)return!1;t=n.find(a.popUpSelector).parent("li"),clearTimeout(a.sfTimer),h(n,a),l(t),d(n),n.off(".superfish").off(".hoverIntent"),t.children(a.popUpSelector).attr("style",function(e,t){return t.replace(/display[^;]+;?/g,"")}),a.$path.removeClass(a.hoverClass+" "+s).addClass(a.pathClass),n.find("."+a.hoverClass).removeClass(a.hoverClass),a.onDestroy.call(n),n.removeData("sf-options")})},init:function(t){return this.each(function(){var n=e(this);if(n.data("sf-options"))return!1;var a=e.extend({},e.fn.superfish.defaults,t),r=n.find(a.popUpSelector).parent("li");a.$path=function(t,n){return t.find("li."+n.pathClass).slice(0,n.pathLevels).addClass(n.hoverClass+" "+s).filter(function(){return e(this).children(n.popUpSelector).hide().show().length}).removeClass(n.pathClass)}(n,a),n.data("sf-options",a),h(n,a),l(r),d(n),function(t,s){var n="li:has("+s.popUpSelector+")";e.fn.hoverIntent&&!s.disableHI?t.hoverIntent(u,f,n):t.on("mouseenter.superfish",n,u).on("mouseleave.superfish",n,f);var a="MSPointerDown.superfish";o||(a+=" touchend.superfish"),i&&(a+=" mousedown.superfish"),t.on("focusin.superfish","li",u).on("focusout.superfish","li",f).on(a,"a",s,p)}(n,a),r.not("."+s).superfish("hide",!0),a.onInit.call(this)})}});e.fn.superfish=function(t,s){return g[t]?g[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?e.error("Method "+t+" does not exist on jQuery.fn.superfish"):g.init.apply(this,arguments)},e.fn.superfish.defaults={popUpSelector:"ul,.sf-mega",hoverClass:"sfHover",pathClass:"overrideThisToUse",pathLevels:1,delay:800,animation:{opacity:"show"},animationOut:{opacity:"hide"},speed:"normal",speedOut:"fast",cssArrows:!0,disableHI:!1,onInit:e.noop,onBeforeShow:e.noop,onShow:e.noop,onBeforeHide:e.noop,onHide:e.noop,onIdle:e.noop,onDestroy:e.noop,dropdownStyle:e('body[data-dropdown-style="minimal"]').length>0?"minimal":"classic"},e.fn.extend({hideSuperfishUl:g.hide,showSuperfishUl:g.show})}(jQuery)
;!function(t,e,a){"use strict";var n,i,s=t(e),r=t("body"),o=t("#slide-out-widget-area"),l=t("#slide-out-widget-area-bg"),d=t("#header-outer"),c=t("#header-secondary-outer"),h=t("#header-outer #search-btn a"),u=t("#wpadminbar"),p=t("#ajax-loading-screen"),f=t(".body-border-top"),g=t("#page-header-bg"),m=t("#footer-outer"),v=t(".body-border-right").length>0?t(".body-border-right").width():0,b=d.is("[data-logo-height]")?parseInt(d.attr("data-logo-height")):30,w=d.is("[data-padding]")?parseInt(d.attr("data-padding")):28,y=d.is("[data-shrink-num]")?d.attr("data-shrink-num"):6,_=!!d.is('[data-condense="true"]'),C=!!d.is('[data-using-logo="1"]'),x=!!d.is('[data-header-resize="1"]'),k=!!d.is('[data-transparent-header="true"]'),$=(d.is('[data-mobile-fixed="1"]'),r.is("[data-header-format]")?r.attr("data-header-format"):"default"),T=r.is("[data-hhun]")?r.attr("data-hhun"):"",I=r.is("[data-cae]")&&"swing"!==r.attr("data-cae")?r.attr("data-cae"):"easeOutCubic",E=r.is("[data-cad]")?r.attr("data-cad"):"650",O=t('body[data-animated-anchors="true"]').length>0,z=!(r.is('[data-m-animate="1"]')||!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/)),H=e.nectarOptions&&e.nectarOptions.ocm_btn_position&&"left"===e.nectarOptions.ocm_btn_position?"left":"default",S=[],A=[],M=[],W=[],B=[],F=[],q=[],L=[],j=[],Y=[],P=[],R=[],V=[],X=[],N=[],D=[],Q=[],Z=[],G=[],U=[],J=[],K=[],tt=[],et=[],at=[],nt=[],it=[],st="",rt=!1,ot=!1,lt={},dt={animating:"false",perspect:"not-rolled",inUse:!1},ct={$usingFullScreenRows:!1};f.length>0&&("#ffffff"==f.css("background-color")&&"light"==r.attr("data-header-color")||"rgb(255, 255, 255)"==f.css("background-color")&&"light"==r.attr("data-header-color")||f.css("background-color")==d.attr("data-user-set-bg"))&&(ot=!0);var ht={usingMobileBrowser:!!navigator.userAgent.match(/(Android|iPod|iPhone|iPad|BlackBerry|IEMobile|Opera Mini)/),usingFrontEndEditor:void 0!==e.vc_iframe,getWindowSize:function(){ht.winH=e.innerHeight,ht.winW=e.innerWidth,ht.adminBarHeight=u.length>0?u.height():0,ht.secondaryHeaderHeight=c.length>0&&"none"!=c.css("display")?c.outerHeight():0,ht.footerOuterHeight=m.length>0?m.outerHeight():0},scrollTop:0,clientX:0,clientY:0,scrollPosMouse:function(){return e.scrollY||s.scrollTop()},scrollPosRAF:function(){ht.scrollTop=e.scrollY||s.scrollTop(),requestAnimationFrame(ht.scrollPosRAF)},bindEvents:function(){ht.usingMobileBrowser||(s.on("scroll",function(){ht.scrollTop=ht.scrollPosMouse()}),a.addEventListener("mousemove",function(t){ht.clientX=t.clientX,ht.clientY=t.clientY})),s.on("resize",ht.getWindowSize),e.addEventListener("orientationchange",ht.getWindowSize)},init:function(){u=t("#wpadminbar"),this.getWindowSize(),this.usingPhoneBrowser=!!(ht.usingMobileBrowser&&ht.winW<690),this.scrollTop=this.scrollPosMouse(),this.bindEvents(),this.usingFrontEndEditor=void 0!==e.vc_iframe}};e.nectarDOMInfo=ht,ht.init();var ut,pt={materialOffCanvasOpen:!1,materialSearchOpen:!1,permanentTransHeader:!!d.is('[data-permanent-transparent="1"]'),animatedScrolling:!1,preventScroll:!1,ocmOpen:!1,ocmAnimating:!1,ocmInit:!1,mobileHeader:""};function ft(){We(),ht.usingMobileBrowser||Ae(),pn(),Ea(),t("#header-outer .sf-menu > li:not(.megamenu) > ul > li > ul").each(function(){t(this).removeClass("on-left-side"),t(this).offset().left+t(this).outerWidth()>s.width()?(t(this).addClass("on-left-side"),t(this).find("ul").addClass("on-left-side")):(t(this).removeClass("on-left-side"),t(this).find("ul").removeClass("on-left-side"))}),Tt()}function gt(){setTimeout(function(){Ae()},100)}function mt(){ke(),We(),Et(),va(),ht.usingMobileBrowser||Ae()}function vt(){t(".flex-gallery").each(function(){if(t().flexslider){var a=t(this);imagesLoaded(t(this),function(){var n=!a.find("ul").is('[data-d-autorotate="true"]');a.flexslider({animation:"fade",smoothHeight:!1,animationSpeed:500,useCSS:!1,touch:!0,slideshow:n}),t(".flex-gallery .flex-direction-nav li a.flex-next").html('<i class="fa fa-angle-right"></i>'),t(".flex-gallery .flex-direction-nav li a.flex-prev").html('<i class="fa fa-angle-left"></i>'),t(e).trigger("salient-parallax-bg-recalculate"),Ee()})}})}function bt(t,e){this.lastX=ht.clientX,this.lastY=ht.clientY,this.$el=t,this.iconType=e,this.timeout=!1,this.overEl=!1,this.initialCalc=!1,this.styleType="default",this.bgElSelector="",this.$dragEl="",this.$innerParallaxEl="",this.parallaxLastX=0,this.parallaxLastY=0,this.$viewEl="",this.$closeEl="",this.lerpDamp=.18,this.createMarkup(),this.setup(),this.mouseBind()}function wt(){t('.wpb_gallery_slidesflickity_static_height_style .cell[data-lazy="true"]').each(function(){t(this).css({height:"",width:""});var e=parseInt(t(this).find("img").attr("height")),a=jt(parseInt(t(this).find("img").attr("width")),e,2e3,parseInt(t(this).find("img").height())),n=t(this).find(".item-meta").length>0?t(this).find(".item-meta").outerHeight():0;t(this).css({height:a.height+n+"px",width:a.width+"px"})})}function yt(){t('.wpb_gallery_slidesflickity_static_height_style .cell[data-lazy="true"]').length>0&&(wt(),s.on("smartresize",wt))}function _t(){if(0==t(".nectar-flickity:not(.masonry)").length)return!1;W=[],B=[],t(".nectar-flickity:not(.masonry)").each(function(e){W.push(new Ct(t(this),e))}),t(".nectar-carousel.nectar-flickity:not(.masonry)").length>0&&(ht.usingMobileBrowser?e.addEventListener("orientationchange",xt):s.on("resize",xt))}function Ct(t,e){this.$el=t,this.index=e,this.instance={},this.$freeScrollBool=!(!this.$el.is("[data-free-scroll]")||"true"!=this.$el.attr("data-free-scroll")),this.$groupCellsBool=!0,this.$flickContainBool=!0,this.$flcikAttr=.025,this.$paginationBool=!1,this.$nextPrevArrowBool=!0,this.$setGallerySizeBool=!0,this.$imagesLoaded=!0,this.$flickCellAlign="center",this.fadeBool=!1,this.setup()}function xt(){t('.nectar-carousel.nectar-flickity:not(.masonry):not([data-adaptive-height="true"])').each(function(){kt(t(this))})}function kt(e){var a=0;e.find(".flickity-slider > .cell").css("height","auto"),e.find(".flickity-slider > .cell").each(function(){t(this).height()>a&&(a=t(this).height())}),a<10&&(a="auto"),e.find(".flickity-slider > .cell").css("height",a+"px")}function $t(){t(".twentytwenty-container").each(function(){var e=t(this);0==e.find(".twentytwenty-handle").length&&t(this).imagesLoaded(function(){e.twentytwenty()})})}function Tt(){t("nav:not(.left-side):not(.right-side) .sf-menu > .nectar-megamenu-menu-item.align-left:not(.width-100)").each(function(){var e=t(this),a=t("header#top > .container > .row"),n=t(this).find("> ul.sub-menu");if(e){if(n.width()+e.offset().left>ht.winW)return t(this).addClass("align-middle"),!0;t(this).find("> ul.sub-menu").css({right:a.width()-(e.offset().left+e.width()-a.offset().left)-t(this).find("> ul.sub-menu").width()+e.width(),left:"auto"}),t(this).removeClass("align-middle")}}),t("nav:not(.left-side):not(.right-side) .sf-menu > .nectar-megamenu-menu-item.align-right:not(.width-100)").each(function(){var e=t(this),a=t("header#top > .container > .row"),n=t(this).find("> ul.sub-menu");if(e){if(e.offset().left+e.width()-n.width()<0)return t(this).addClass("align-middle"),!0;t(this).find("> ul.sub-menu").css({right:a.width()-(e.offset().left+e.width()-a.offset().left),left:"auto"}),t(this).removeClass("align-middle")}}),t("nav:not(.left-side):not(.right-side) .sf-menu > .nectar-megamenu-menu-item.align-middle:not(.width-100)").each(function(){var e=t(this),a=t("header#top > .container > .row"),n=t(this).find("> ul.sub-menu");if(e&&n.length>0){var i=a.width(),s=a.offset().left,r=e.offset().left,o=e.width(),l=n.width();n.css({right:i-(r+o-s)-l/2+o/2,left:"auto"});var d=n.offset();d.left<0?n.css({right:"auto",left:"0px"}):d.left+l>ht.winW&&n.css({right:"0px",left:"auto"})}})}function It(){var e=s.width(),a=t("header#top > .container").width();t("header#top nav:not(.left-side):not(.right-side) > ul > li.megamenu:not(.width-50):not(.width-75) > .sub-menu").css({"padding-left":(e-a)/2+"px","padding-right":(e+2-a)/2+"px",width:a,left:"-"+(e-a)/2+"px"})}function Et(){ht.winW<1e3&&"1"==r.attr("data-responsive")?(r.addClass("mobile"),t("header#top nav").css("display","none")):(r.removeClass("mobile"),t("header#top nav").css("display",""),t(".slide-out-widget-area-toggle #toggle-nav .lines-button").removeClass("close"))}function Ot(){0!=t(".carousel").length&&("undefined"!=typeof SalientRecentProjectsCarousel&&t("ul.carousel.portfolio-items").each(function(e){tt[e]=new SalientRecentProjectsCarousel(t(this))}),t('ul.carousel:not(".clients"):not(.portfolio-items)').each(function(){var a,n,i=t(this),s="true"==t(this).parents(".carousel-wrap").attr("data-full-width")?"auto":3,o="true"==t(this).parents(".carousel-wrap").attr("data-full-width")?"auto":"",l="true"==t(this).parents(".carousel-wrap").attr("data-full-width")?500:453,d="true"==t(this).attr("data-autorotate"),c=!0,h=!0;t("body.ascend").length>0&&"true"!=t(this).parents(".carousel-wrap").attr("data-full-width")||t("body.material").length>0&&"true"!=t(this).parents(".carousel-wrap").attr("data-full-width")?t(this).find("li").length%3==0?(c=!0,h=!0):(c=!1,h=!0):(c=!0,h=!0),a=parseInt(t(this).attr("data-scroll-speed"))?parseInt(t(this).attr("data-scroll-speed")):700,n=t(this).is("[data-easing]")?t(this).attr("data-easing"):"linear";var u=i;0==i.find("img").length&&(u=r),imagesLoaded(u,function(){i.carouFredSel({circular:c,infinite:h,height:"auto",responsive:!0,items:{width:l,visible:{min:1,max:s}},swipe:{onTouch:!0,onMouse:!0,options:{excludedElements:"button, input, select, textarea, .noSwipe",tap:function(a,n){!t(n).attr("href")||t(n).is('[target="_blank"]')||t(n).is('[rel^="prettyPhoto"]')||t(n).is(".magnific-popup")||t(n).is(".magnific")||e.open(t(n).attr("href"),"_self")}},onBefore:function(){i.find(".work-item").trigger("mouseleave"),i.find(".work-item .work-info a").trigger("mouseup")}},scroll:{items:o,easing:n,duration:a,onBefore:function(){(t("body.ascend").length>0&&"true"!=i.parents(".carousel-wrap").attr("data-full-width")||t("body.material").length>0&&"true"!=i.parents(".carousel-wrap").attr("data-full-width"))&&i.parents(".carousel-wrap").find(".item-count .total").html(Math.ceil(i.find("> li").length/i.triggerHandler("currentVisible").length))},onAfter:function(){(t("body.ascend").length>0&&"true"!=i.parents(".carousel-wrap").attr("data-full-width")||t("body.material").length>0&&"true"!=i.parents(".carousel-wrap").attr("data-full-width"))&&(i.parents(".carousel-wrap").find(".item-count .current").html(i.triggerHandler("currentPage")+1),i.parents(".carousel-wrap").find(".item-count .total").html(Math.ceil(i.find("> li").length/i.triggerHandler("currentVisible").length)))}},prev:{button:function(){return i.parents(".carousel-wrap").find(".carousel-prev")}},next:{button:function(){return i.parents(".carousel-wrap").find(".carousel-next")}},auto:{play:d}},{transition:!0}).animate({opacity:1},1300),i.parents(".carousel-wrap").wrap('<div class="carousel-outer">'),"true"==i.parents(".carousel-wrap").attr("data-full-width")&&i.parents(".carousel-outer").css("overflow","visible"),(t("body.ascend").length>0&&"true"!=i.parents(".carousel-wrap").attr("data-full-width")||t("body.material").length>0&&"true"!=i.parents(".carousel-wrap").attr("data-full-width"))&&t('<div class="item-count"><span class="current">1</span>/<span class="total">'+i.find("> li").length/i.triggerHandler("currentVisible").length+"</span></div>").insertAfter(i.parents(".carousel-wrap").find(".carousel-prev")),i.addClass("finished-loading"),Mt()})}),s.off("smartresize.carouselHeightCalcs"),s.on("smartresize.carouselHeightCalcs",Mt))}function zt(){0!==t(".owl-carousel[data-desktop-cols]").length&&t(".owl-carousel[data-desktop-cols]").each(function(){t(this).addClass("owl-theme");var e=t(this),a=e.attr("data-autorotate"),n=e.attr("data-autorotation-speed"),i=!!e.is('[data-loop="true"]'),s=!!r.hasClass("rtl");t(this).owlCarousel({responsive:{0:{items:t(this).attr("data-mobile-cols")},690:{items:t(this).attr("data-tablet-cols")},1000:{items:t(this).attr("data-desktop-small-cols")},1300:{items:t(this).attr("data-desktop-cols")}},autoplay:a,autoplayTimeout:n,loop:i,rtl:s,smartSpeed:350,onTranslate:function(){e.addClass("moving")},onTranslated:function(){e.removeClass("moving")}}),t(this).on("changed.owl.carousel",function(e){e.item.count-e.page.size==e.item.index&&t(e.target).find(".owl-dots div:last").addClass("active").siblings().removeClass("active")})})}function Ht(t){var e=t.data.wooFlickity.selectedIndex+1;t.data.wooFlickityCount.text(e+"/"+t.data.wooFlickity.slides.length)}function St(t,e,a){this.$el=t,this.index=a,this.type=e,this.instance={},this.setup()}function At(){0===t(".products-carousel").length&&0===t(".nectar-woo-flickity").length||(t(".products-carousel").each(function(e){new St(t(this),"legacy",e)}),N=[],t(".nectar-woo-flickity").each(function(e){N.push(new St(t(this),"flickity",e))}))}function Mt(){t('.carousel.finished-loading:not(".portfolio-items, .clients"), .caroufredsel_wrapper .products.finished-loading').each(function(){var e=0;t(this).find("> li").each(function(){t(this).height()>e&&(e=t(this).height())}),t(this).css("height",e+5),t(this).parents(".caroufredsel_wrapper").css("height",e+5),(t("body.ascend").length>0&&"true"!=t(this).parents(".carousel-wrap").attr("data-full-width")||t("body.material").length>0&&"true"!=t(this).parents(".carousel-wrap").attr("data-full-width"))&&(t(this).parents(".carousel-wrap").find(".item-count .current").html(Math.ceil((t(this).triggerHandler("currentPosition")+1)/t(this).triggerHandler("currentVisible").length)),t(this).parents(".carousel-wrap").find(".item-count .total").html(Math.ceil(t(this).find("> li").length/t(this).triggerHandler("currentVisible").length)))})}function Wt(){0!==t(".carousel.clients").length&&(t(".carousel.clients").each(function(){var e,a=t(this),n=!t(this).hasClass("disable-autorotate");e=parseInt(t(this).attr("data-max"))?parseInt(t(this).attr("data-max")):5,s.width()<690&&"1"==r.attr("data-responsive")&&(e=2,t(this).addClass("phone"));var i=a;0==a.find("img").length&&(i=r),imagesLoaded(i,function(){a.carouFredSel({circular:!0,responsive:!0,items:{height:a.find("> div:first").height(),width:a.find("> div:first").width(),visible:{min:1,max:e}},swipe:{onTouch:!0,onMouse:!0},scroll:{items:1,easing:"easeInOutCubic",duration:"800",pauseOnHover:!0},auto:{play:n,timeoutDuration:2700}}).animate({opacity:1},1300),a.addClass("finished-loading"),a.parents(".carousel-wrap").wrap('<div class="carousel-outer">'),s.trigger("resize")})}),s.off("smartresize.clientsCarouselHeight",Bt),s.on("smartresize.clientsCarouselHeight",Bt))}function Bt(){var e=0;t(".carousel.clients.finished-loading").each(function(){t(this).find("> div").each(function(){t(this).height()>e&&(e=t(this).height())}),t(this).css("height",e),t(this).parent().css("height",e)})}function Ft(){r.on("mousedown",'.caroufredsel_wrapper, .carousel-wrap[data-full-width="true"] .portfolio-items .col .work-info a, .woocommerce .products-carousel ul.products li.product a',function(){t(this).addClass("active")}),r.on("mouseup",'.caroufredsel_wrapper, .carousel-wrap[data-full-width="true"] .portfolio-items .col .work-info a, .woocommerce .products-carousel ul.products li.product a',function(){t(this).removeClass("active")}),t("body.ascend, body.material").on("mouseover",".carousel-next",function(){t(this).parent().find(".carousel-prev, .item-count").addClass("next-hovered")}),t("body.ascend, body.material").on("mouseleave",".carousel-next",function(){t(this).parent().find(".carousel-prev, .item-count").removeClass("next-hovered")})}function qt(t,e,a){return Math.max(Math.min(t,e),a)}function Lt(t,e,a){return(1-a)*t+a*e}function jt(t,e,a,n){var i=Math.min(a/t,n/e);return{width:t*i,height:e*i}}function Yt(e){if(e){var a=t(e.bold());return a.find("script").remove(),a.html()}return""}function Pt(){var e;if(r.is('[data-header-format="left-header"]')&&ht.winW>=1e3||r.is('[data-hhun="1"]')||t(".page-template-template-no-header-footer").length>0||t(".page-template-template-no-header").length>0)e=0;else{var a=w-w/1.8,n=d.outerHeight();(c.length>0&&r.is(".material")||c.length>0&&!r.is(".material")&&ht.winW<1e3)&&(n-=ht.secondaryHeaderHeight),e=d.is('[data-header-resize="1"]')&&!d.is(".small-nav")&&ht.winW>=1e3?n-(parseInt(y)+2*a):n}if(ht.winW>=1e3&&t('#header-outer[data-condense="true"]').length>0){var i=t('#header-outer[data-format="centered-menu-bottom-bar"] header#top .span_9');e=d.height()-(parseInt(i.position().top)-parseInt(d.find("#logo").css("margin-top")))-parseInt(ht.secondaryHeaderHeight)}return e}function Rt(t,e,n){var i=a.querySelector(t);i&&(i.onload=function(){e>0?setTimeout(n,e):n()})}function Vt(){ht.usingMobileBrowser||(this.state={ocmFocus:!1},this.init(),this.events())}function Xt(t){return("0"+parseInt(t).toString(16)).slice(-2)}function Nt(){return Math.floor(1e4*Math.random())}function Dt(t,n,i){var s=e.scrollY||a.documentElement.scrollTop,r=(t=t||0,n=n||2e3,i=i||"easeOutSine",0),o=Math.max(.1,Math.min(Math.abs(s-t)/n,.8)),l={easeInOutQuint:function(t){return(t/=.5)<1?.5*Math.pow(t,5):.5*(Math.pow(t-2,5)+2)}};!function a(){var n=(r+=1/60)/o,d=l[i](n);n<1?(requestAnimationFrame(a),e.scrollTo(0,s+(t-s)*d)):e.scrollTo(0,t)}()}function Qt(){var e=t("body[data-header-breakpoint]").length>0&&"1000"!=r.attr("data-header-breakpoint")?parseInt(r.attr("data-header-breakpoint")):1e3,a=!1;return 1e3!=e&&ht.winW>1e3&&ht.winW<=e&&(a=!0),a}function Zt(t){return t.replace(/"/g,"").replace(/url\(|\)$/gi,"")}e.nectarState=pt,bt.prototype.setup=function(){"post-grid-images"!==this.iconType&&"horizontal-movement"!==this.iconType&&"link-indicator"!==this.iconType&&"view-indicator"!==this.iconType||this.viewportTracking()},bt.prototype.viewportTracking=function(){var a=this;if("IntersectionObserver"in e){this.observer=new IntersectionObserver(function(e){e.forEach(function(e){e.isIntersecting?(a.$el.addClass("active").addClass("el-in-view"),a.$el.find(a.bgElSelector).css("visibility","visible"),a.activeViewRAF=!0):(a.$el.find(a.bgElSelector).css("visibility","hidden"),a.activeViewRAF=!1,a.$el.removeClass("el-in-view"),0==t(".el-in-view").length&&(a.$dragEl.length>0?a.$dragEl.removeClass("visible"):a.$viewEl.length>0&&a.$viewEl.removeClass("visible")))})},{rootMargin:"0px",threshold:0}),this.observer.observe(this.$el[0])}},bt.prototype.createMarkup=function(){var e=this;if("horizontal-movement"===this.iconType){if(this.$el.is("[data-indicator-bg]")&&(this.styleType="solid"),0==t(".nectar-drag-indicator").length){var a=t("body > #boxed").length>0?" in-boxed":"";t("body").append('<div class="nectar-drag-indicator'+a+'" data-type="'+this.styleType+'"><div class="color-circle"></div><span class="inner-layer"><i class="fa fa-angle-left"></i><i class="fa fa-angle-right"></i></span></div>'),this.$dragEl=t(".nectar-drag-indicator"),this.dragRAF()}else this.$dragEl=t(".nectar-drag-indicator");"default"!=this.styleType&&(this.$innerParallaxEl=t(".nectar-drag-indicator .inner-layer"))}if("view-indicator"===this.iconType||"link-indicator"===this.iconType){if(this.activeViewRAF=!0,0==t(".nectar-view-indicator").length){a=t("body > #boxed").length>0?" in-boxed":"";t("body").append('<div class="nectar-view-indicator'+a+'"><div class="color-circle"></div><span class="inner-layer"></span></div>'),"gallery-zoom-indicator"!==this.iconType&&t(".nectar-view-indicator span").text(t(".nectar-post-grid").attr("data-indicator-text")),this.$viewEl=t(".nectar-view-indicator"),setTimeout(function(){e.lastY=ht.clientY,e.lastX=ht.clientX,e.viewRAF()},100)}else this.$viewEl=t(".nectar-view-indicator");this.$innerParallaxEl=t(".nectar-view-indicator .inner-layer")}if("close-indicator"===this.iconType){if(0==t(".nectar-view-indicator").length){a=t("body > #boxed").length>0?" in-boxed":"";t("body").append('<div class="nectar-close-indicator'+a+'"><div class="inner"><div class="inner-layer"><i class="icon-salient-m-close"></i></div></div></div>'),this.$closeEl=t(".nectar-close-indicator"),this.closeRAF()}else this.$closeEl=t(".nectar-close-indicator");this.$innerParallaxEl=t(".nectar-close-indicator .inner-layer")}"post-grid-images"===this.iconType&&(this.activeViewRAF=!0,this.bgElSelector=this.$el.hasClass("nectar-category-grid")?".nectar-category-grid-item-bg":".nectar-post-grid-item-bg-wrap",this.$el.hasClass("mouse-move-bound")?(this.$viewEl=this.$el.find(this.bgElSelector),this.viewRAF()):(this.$viewEl=this.$el.find(this.bgElSelector),this.$el.addClass("mouse-move-bound"),this.viewRAF()))},bt.prototype.mouseBind=function(){var e=this;if("horizontal-movement"===this.iconType)e.$el.find(".flickity-viewport").on("mouseover",function(){e.$dragEl.attr("data-type",e.styleType),e.$dragEl.addClass("visible");var t=e.$el.is("[data-touch-icon-color]")?"color-"+e.$el.attr("data-touch-icon-color"):"";if(e.$dragEl.removeClass("color-dark").removeClass("color-light").removeClass("color-default"),"default"==e.styleType)e.$dragEl.addClass(t),e.$dragEl.find("> span, i").css("color",""),e.$dragEl.find(".color-circle").css("background-color","");else if("solid"==e.styleType){var a=e.$el.attr("data-indicator-bg");e.$dragEl.find(".color-circle").css("background-color",a),e.$dragEl.find("> span").css("color",a);var n=e.$el.attr("data-indicator-icon");e.$dragEl.find("i").css("color",n)}}),e.$el.find(".flickity-viewport").on("mouseleave",function(){e.$dragEl.removeClass("visible")}),e.$el.find(".product-add-to-cart a").on("mouseenter",function(){e.$dragEl.removeClass("visible")}),e.$el.find(".product-add-to-cart a").on("mouseleave",function(){e.$dragEl.addClass("visible")});else if("close-indicator"===this.iconType)t("body").on("click",'.team-member[data-style*="bio_fullscreen"]',function(){t(".nectar_team_member_overlay:not(.open)").length>0||(e.$closeEl.addClass("visible"),e.$closeEl.find(".inner").addClass("visible"))}),t("body").on("click",'.nectar_team_member_overlay:not(.animating) a[target="_blank"]',function(t){t.stopPropagation()}),t("body").on("click",".nectar_team_member_overlay:not(.animating)",function(){e.$closeEl.removeClass("visible"),e.$closeEl.find(".inner").removeClass("visible")}),t("body").on("mouseenter",".nectar_team_member_overlay .bio-inner a",function(){e.$closeEl.removeClass("visible")}),t("body").on("mouseleave",".nectar_team_member_overlay .bio-inner a",function(){e.$closeEl.addClass("visible")});else if("link-indicator"===this.iconType)e.$el.off(),e.$el.on("mouseenter",function(){e.$viewEl.addClass("visible"),e.$viewEl.attr("class",function(t,e){return e.replace(/(^|\s)style-\S+/g,"")});var t=e.$el.attr("data-indicator-bg"),a=e.$el.attr("data-indicator-icon");e.$viewEl.find(".color-circle").css("background-color",t);var n='<div class="nectar-cta loaded" data-style="arrow-animation"><span class="link_wrap" style="color: '+a+'"><svg class="next-arrow" width="20px" height="25px" viewBox="0 0 50 80"><polyline stroke-width="9" fill="none" stroke-linecap="round" stroke-linejoin="round" points="0, 0 45, 40 0, 80"></polyline></svg><span class="line" style="background-color: '+a+'"></span></span></div>';e.$viewEl.find("span").html(n),e.$el.is('[data-indicator-blur="true"]')&&e.$viewEl.addClass("blurred-bg")}),e.$el.on("mouseleave",function(){e.$viewEl.removeClass("visible").removeClass("blurred-bg")});else if("view-indicator"===this.iconType){var a=e.$el.is("[data-indicator-text-color]")?e.$el.attr("data-indicator-text-color"):"#fff",n=e.$el.attr("data-indicator-color"),i=e.$el.attr("data-indicator-style");e.$el.find(".nectar-post-grid-item").off(),e.$el.find(".nectar-post-grid-item").on("mouseenter",function(){e.activeViewRAF=!0,e.$viewEl.addClass("visible"),e.$viewEl.find("span").text(t(".nectar-post-grid").attr("data-indicator-text")),e.$viewEl.attr("class",function(t,e){return e.replace(/(^|\s)style-\S+/g,"")}),e.$viewEl.addClass("style-"+i),"see-through"!==i&&(e.$viewEl.find(".color-circle").css("background-color",n),e.$viewEl.find(".inner-layer").css("color",a)),e.$el.is('[data-indicator-blur="true"]')&&e.$viewEl.addClass("blurred-bg"),clearTimeout(e.timeout)}),e.$el.find(".nectar-post-grid-item").on("mouseleave",function(){e.timeout=setTimeout(function(){e.$viewEl.removeClass("visible"),e.$viewEl.removeClass("blurred-bg")},100)}),e.$el.find(".nectar-post-grid-item .meta-category a").on("mouseenter",function(){e.$viewEl.removeClass("visible")}),e.$el.find(".nectar-post-grid-item .meta-category a").on("mouseleave",function(){e.$viewEl.addClass("visible")})}else"post-grid-images"===this.iconType&&(e.$el.on("mouseenter",function(){t(this).addClass("mouse-over"),e.activeViewRAF=!0}),e.$el.on("mouseleave",function(){t(this).removeClass("mouse-over")}))},bt.prototype.updatePos=function(){this.lastY=Lt(this.lastY,ht.clientY,this.lerpDamp),this.lastX=Lt(this.lastX,ht.clientX,this.lerpDamp)},bt.prototype.parallaxIcon=function(){this.parallaxLastX=Lt(this.parallaxLastX,parseInt(ht.clientX)-parseInt(this.lastX),this.lerpDamp)/1.7,this.parallaxLastY=Lt(this.parallaxLastY,parseInt(ht.clientY)-parseInt(this.lastY),this.lerpDamp)/1.7,this.$innerParallaxEl.length>0&&(this.$innerParallaxEl[0].style.transform="translateX("+qt(this.parallaxLastX,10,-10)+"px) translateY("+qt(this.parallaxLastY,10,-10)+"px)")},bt.prototype.dragRAF=function(){this.updatePos(),this.$dragEl[0].style.transform="translateX("+this.lastX+"px) translateY("+this.lastY+"px)",this.parallaxIcon(),requestAnimationFrame(this.dragRAF.bind(this))},bt.prototype.viewRAF=function(){if(this.updatePos(),this.activeViewRAF||"view-indicator"===this.iconType||"link-indicator"===this.iconType){for(var t=0;t<this.$viewEl.length;t++)this.$viewEl[t].style.transform="translateX("+this.lastX+"px) translateY("+this.lastY+"px)";this.parallaxIcon()}requestAnimationFrame(this.viewRAF.bind(this))},bt.prototype.closeRAF=function(){this.updatePos(),this.$closeEl.css({transform:"translateX("+this.lastX+"px) translateY("+this.lastY+"px)"}),this.parallaxIcon(),requestAnimationFrame(this.closeRAF.bind(this))},Ct.prototype.setup=function(){this.$el.removeClass(function(t,e){return(e.match(/(^|\s)instance-\S+/g)||[]).join(" ")}),this.$el.addClass("instance-"+this.index);var e=this.$el.attr("data-controls").length>0?this.$el.attr("data-controls"):"";if(this.$el.is('[data-format="fixed_text_content_fullwidth"]')&&(this.$flickCellAlign="left",this.$groupCellsBool=!1,this.$flickContainBool=!1,this.$flcikAttr=.02,this.$el.parent().is('[data-alignment="right"]')&&(this.$flickCellAlign="right")),1==this.$freeScrollBool&&(this.$groupCellsBool=!1),this.$el.find(".nectar-el-parallax-scroll").length>0&&this.$el.parents('[class*="wpb_gallery_slidesflickity_"]').length>0&&(this.$groupCellsBool=!1),"next_prev_arrows"==e||"next_prev_arrows_overlaid"==e?(this.$paginationBool=!1,this.$nextPrevArrowBool=!0):(this.$paginationBool=!0,this.$nextPrevArrowBool=!1),"none"==e&&(this.$paginationBool=!1,this.$nextPrevArrowBool=!1),this.$wrapAround=!this.$el.is("[data-wrap]")||"no-wrap"!=this.$el.attr("data-wrap"),this.ticker=!!this.$el.is(".ticker-rotate"),this.tickerPaused=!1,this.ticker){var a=this.$el.is("[data-ticker-speed]")?this.$el.attr("data-ticker-speed"):"slow";this.tickerSpeed="slow"===a?.4:"medium"===a?1.2:2,this.$wrapAround=!0,this.$paginationBool=!1}this.$flickity_autoplay=!1,this.$flickity_stored_autoplay=!1,this.inView=!1,this.$el.is("[data-autoplay]")&&"true"==this.$el.attr("data-autoplay")&&!this.ticker&&(this.$flickity_autoplay=!0,this.$flickity_stored_autoplay=5e3,this.$el.is("[data-autoplay-dur]")&&this.$el.attr("data-autoplay-dur").length>0&&parseInt(this.$el.attr("data-autoplay-dur"))>100&&parseInt(this.$el.attr("data-autoplay-dur"))<3e4&&(this.$flickity_autoplay=parseInt(this.$el.attr("data-autoplay-dur")),this.$flickity_stored_autoplay=this.$flickity_autoplay)),this.$frontEndEditorDrag=!(t("body.vc_editor").length>0),this.$frontEndEditorPause=t("body.vc_editor").length>0,this.$arrowShape="",this.$el.is('[data-pause-on-hover="true"]')&&(this.$frontEndEditorPause=!0),this.$el.is('[data-centered-cells="true"]')&&(this.$groupCellsBool=1),this.$flickity_adaptive_height=!1,this.$el.is('[data-adaptive-height="true"]')&&(this.$flickity_adaptive_height=!0),this.$lazyload=this.$el.find("img[data-flickity-lazyload]").length>0&&1,this.$el.find("img[data-flickity-lazyload]").length>0&&this.$el.is('[data-overflow="visible"]')&&this.$el.is('[data-wrap="no-wrap"]')&&(this.$lazyload=2),this.$flickity_rtl=!!r.hasClass("rtl"),"next_prev_arrows_overlaid"==e||"touch_total"==e||this.$el.hasClass("nectar-simple-slider")?this.$arrowShape={x0:10,x1:60,y1:50,x2:70,y2:40,x3:30}:this.$arrowShape={x0:20,x1:70,y1:30,x2:70,y2:25,x3:70},this.$el.is('[data-format="fixed_text_content_fullwidth"]')&&this.$el.parents(".full-width-content.wpb_row").length>0&&this.$el.parents(".full-width-content.wpb_row").removeClass("full-width-content").addClass("full-width-section"),this.$el.hasClass("nectar-simple-slider")&&(this.$flickity_adaptive_height=!1,this.$paginationBool=!1,this.$nextPrevArrowBool=!1,this.$setGallerySizeBool=!1,this.$wrapAround=!1,this.$imagesLoaded=!1,this.$flcikAttr=.022,"true"==this.$el.attr("data-pagination")&&(this.$paginationBool=!0),"true"==this.$el.attr("data-wrap")&&(this.$wrapAround=!0),this.$el.is('[data-simple-slider-transition="fade"]')&&(this.fadeBool=!0)),ht.usingFrontEndEditor?this.init():this.lazyInit()},Ct.prototype.lazyInit=function(){var t=this;this.observer=new IntersectionObserver(function(e){e.forEach(function(e){e.isIntersecting&&(t.init(),t.observer.unobserve(e.target))})},{root:a,rootMargin:"400px 0px 400px 0px",threshold:0}),this.observer.observe(this.$el[0])},Ct.prototype.init=function(){this.instance=new Flickity(".nectar-flickity.instance-"+this.index,{setGallerySize:this.$setGallerySizeBool,contain:this.$flickContainBool,draggable:this.$frontEndEditorDrag,lazyLoad:this.$lazyload,imagesLoaded:this.$imagesLoaded,percentPosition:!0,adaptiveHeight:this.$flickity_adaptive_height,cellAlign:this.$flickCellAlign,groupCells:this.$groupCellsBool,prevNextButtons:this.$nextPrevArrowBool,freeScroll:this.$freeScrollBool,pageDots:this.$paginationBool,resize:!0,selectedAttraction:this.$flcikAttr,autoPlay:this.$flickity_autoplay,rightToLeft:this.$flickity_rtl,pauseAutoPlayOnHover:this.$frontEndEditorPause,wrapAround:this.$wrapAround,accessibility:!1,fade:this.fadeBool,arrowShape:this.$arrowShape}),this.events()},Ct.prototype.trackView=function(){var t=this;new IntersectionObserver(function(e){e.forEach(function(e){e.isIntersecting?t.inView=!0:t.inView=!1})},{root:a,rootMargin:"200px 0px 200px 0px",threshold:0}).observe(this.$el[0])},Ct.prototype.events=function(){this.$el.hasClass("nectar-simple-slider")?this.simpleSliderStyle():(this.$el.is('.nectar-carousel[data-wrap="no-wrap"]')&&this.$el.find('.nectar-fancy-box[data-n-parallax-bg="true"]').length>0||this.$el.parents('[class*="wpb_gallery_slidesflickity_"]').length>0&&this.$el.find(".nectar-el-parallax-scroll").length>0)&&this.galleryParallax(),(this.$el.is('[data-controls="touch_total"]')||this.$el.is('[data-touch-indicator="true"]'))&&this.visualizedTotalControls(),this.$el.is('[data-format="fixed_text_content_fullwidth"]')&&!ht.usingFrontEndEditor&&this.fixedContentStyle(),this.$el.parents(".wpb_gallery_slidesflickity_static_height_style").length>0&&this.$el.find(".item-meta").length>0&&(this.imageCaptionWidth(),s.on("resize",this.imageCaptionWidth.bind(this))),this.ticker&&(this.trackView(),this.tickerRotate(),this.instance.on("dragStart",function(){this.tickerPaused=!0}.bind(this)),this.$el[0].addEventListener("mouseleave",function(){this.tickerPaused=!1}.bind(this)),(this.$el.is('[data-pause-on-hover="true"]')||this.$nextPrevArrowBool||ht.usingFrontEndEditor)&&this.$el[0].addEventListener("mouseenter",function(){this.tickerPaused=!0}.bind(this))),this.sharedEvents()},Ct.prototype.sharedEvents=function(){var e,a,n=this.$el;this.instance.on("dragStart",function(){clearTimeout(e),clearTimeout(a),n.addClass("is-dragging"),n.addClass("is-moving"),n.find(".flickity-prev-next-button").addClass("hidden")}),this.instance.on("dragEnd",function(){n.removeClass("is-dragging"),e=setTimeout(function(){n.removeClass("is-moving"),n.find(".flickity-prev-next-button").removeClass("hidden")},600),a=setTimeout(function(){n.removeClass("is-moving")},300)}),t(".flickity-prev-next-button").on("click",function(){clearTimeout(e),t(this).parents(".nectar-flickity").find(".flickity-prev-next-button").addClass("hidden"),e=setTimeout(function(){n.find(".flickity-prev-next-button").removeClass("hidden")},600)}),n.hasClass("nectar-carousel")&&!n.is('[data-adaptive-height="true"]')&&imagesLoaded(n,function(){kt(n)})},Ct.prototype.tickerRotate=function(){this.tickerPaused||1!=this.inView||this.instance.slides&&(this.instance.x=(this.instance.x-this.tickerSpeed)%this.instance.slideableWidth,this.instance.selectedIndex=this.instance.dragEndRestingSelect(),this.instance.settle(this.instance.x)),e.requestAnimationFrame(this.tickerRotate.bind(this))},Ct.prototype.imageCaptionWidth=function(){this.$el.find(".item-meta").each(function(){t(this).css({width:t(this).parent().find("img").width()})})},Ct.prototype.simpleSlideBGConnection=function(){var e=t("body.vc_editor").length>0?$that.find(".is-selected > .cell"):$that.find(".is-selected");this.$rowBG&&e&&this.$rowBG.css({transition:"background-color 0.5s ease-out","background-color":e.is(".has-bg-color")?e.find(".bg-layer-wrap").css("background-color"):this.$rowBGStored})},Ct.prototype.simpleSliderStyle=function(){var e=this.$el,a=this;if("true"==this.$el.attr("data-arrows")&&0==this.$el.find(".flickity-prev-next-button").length&&(this.$el.append('<button class="flickity-button flickity-prev-next-button previous" aria-label="'+nectar_front_i18n.previous+'" type="button"><svg class="flickity-button-icon" viewBox="0 0 100 100"><path d="M 10,50 L 60,100 L 70,90 L 30,50 L 70,10 L 60,0 Z" class="arrow"></path></svg></button>'),this.$el.append('<button class="flickity-button flickity-prev-next-button next" aria-label="'+nectar_front_i18n.next+'" type="button"><svg class="flickity-button-icon" viewBox="0 0 100 100"><path d="M 10,50 L 60,100 L 70,90 L 30,50 L 70,10 L 60,0 Z" class="arrow" transform="translate(100, 100) rotate(180) "></path></svg></button>'),this.$el.find(".flickity-prev-next-button.previous").on("click",function(){if(!1===a.$wrapAround&&0==a.instance.selectedIndex&&(0==a.instance.isAnimating||void 0===a.instance.isAnimating)){var t=a.instance.x;anime({targets:a.instance,x:t+100,duration:350,easing:"easeOutCubic"}),a.instance.startAnimation()}a.instance.previous()}),this.$el.find(".flickity-prev-next-button.next").on("click",function(){if(!1===a.$wrapAround&&a.instance.selectedIndex==a.instance.slides.length-1&&0==a.instance.isAnimating){var t=a.instance.x;anime({targets:a.instance,x:t-100,duration:350,easing:"easeOutCubic"}),a.instance.startAnimation()}a.instance.next()})),this.$rowBG="",this.$rowBGStored="",t(this).is('.nectar-simple-slider[data-row-bg-connection="true"]')&&(this.$rowBG=this.$el.parents(".wpb_row"),this.$rowBG=this.$rowBG.find("> .row-bg-wrap .row-bg"),this.$rowBGStored=this.$rowBG.length>0?this.$rowBG.css("background-color"):"",this.instance.on("change",simpleSlideBGConnection.bind(this)),this.simpleSlideBGConnection()),this.$el.find(".bg-layer[data-nectar-img-src]").length>0)var n=new Waypoint({element:this.$el[0],handler:function(){e.find(".bg-layer[data-nectar-img-src]").each(function(){var e=t(this)[0],a=e.getAttribute("data-nectar-img-src");e.style.backgroundImage="url('"+a+"')",e.classList.add("loaded")}),n.destroy()},offset:"95%"});if(this.$el.is('[data-parallax="true"]')){var i=this.$el.find(".cell");!0===this.$wrapAround&&this.$el.find(".flickity-prev-next-button").on("click",function(){e.addClass("disabled-nav"),setTimeout(function(){e.removeClass("disabled-nav")},500)});var s=this.$flickity_rtl?1:-1;this.instance.on("scroll",function(){t.each(a.instance.slides,function(t,e){var n=i[t].querySelector(".bg-layer"),r=i[t].querySelector(".inner"),o=a.instance,l=0;l=0===t&&o.slides.length>2?Math.abs(o.x)>o.slidesWidth?o.slidesWidth+o.x+o.slides[o.slides.length-1].outerWidth+e.target:e.target+o.x:t===o.slides.length-1&&Math.abs(o.x)+o.slides[t].outerWidth<o.slidesWidth?e.target-o.slidesWidth+o.x-o.slides[t].outerWidth:e.target+o.x,n.style.transform="translate3d("+l*(s/2)+"px,0,0)",r.style.transform="translate3d("+l*(s/4)+"px,0,0)"})})}this.$el.hasClass("nectar-simple-slider")&&1==this.$paginationBool&&(this.$el.find(".flickity-page-dots li").append('<svg width="65px" height="65px" viewBox="0 0 72 72" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"><circle class="time" stroke-width="5" fill="none" stroke-linecap="round" cx="33" cy="33" r="28"></circle></svg>'),this.$flickity_stored_autoplay&&(this.$el.find(".flickity-page-dots li circle.time").css("transition","stroke-dashoffset "+(parseInt(this.$flickity_stored_autoplay)+100)+"ms linear, stroke 0.2s ease"),this.$el.find(".flickity-page-dots li:first").addClass("no-trans"),setTimeout(function(){e.find(".flickity-page-dots li:first").removeClass("no-trans")},60),this.instance.on("select",function(t){a.instance.playPlayer()}),this.instance.on("dragEnd",function(t){a.instance.playPlayer(),e.find(".flickity-page-dots .is-selected").removeClass("no-trans")}),this.instance.on("dragStart",function(t){e.find(".flickity-page-dots .is-selected").addClass("no-trans")})))},Ct.prototype.galleryParallax=function(){var e=this.$el.find(".cell"),a=this,n=this.$el.find(".nectar-fancy-box").length>0?".parallax-layer .box-bg":".nectar-el-parallax-scroll .img-wrap",i=!!this.$el.is('[data-wrap="wrap"]'),s=this.$flickity_rtl?1:-1;this.instance.on("scroll",function(){t.each(a.instance.slides,function(t,r){var o=e[t].querySelector(n),l=a.instance,d=0;d=0===t&&i?Math.abs(l.x)>l.slidesWidth?l.slidesWidth+l.x+l.slides[l.slides.length-1].outerWidth+r.target:r.target+l.x:1===t&&i?Math.abs(l.x)>l.slidesWidth?l.slidesWidth+l.x+l.slides[l.slides.length-2].outerWidth+r.target:r.target+l.x:t===l.slides.length-1&&i?Math.abs(l.x)+l.slides[t].outerWidth<l.slidesWidth?r.target-l.slidesWidth+l.x-l.slides[t].outerWidth:r.target+l.x:t===l.slides.length-2&&i&&Math.abs(l.x)+l.slides[t].outerWidth+l.slides[t+1].outerWidth<l.slidesWidth?r.target-l.slidesWidth+l.x-l.slides[t].outerWidth:r.target+l.x,o&&(o.style.transform="translate3d("+d*(s/11)+"px,0,0)",o.style.willChange="transform")})}),this.instance.reposition()},Ct.prototype.visualizedTotalControls=function(){var e=this.$el,a=!!(this.$el.hasClass("drag-indicator-only")||this.$el.is('[data-r-bottom-total="true"]')||this.ticker);0!=this.$el.find(".visualized-total").length||a||(this.$el.parents(".full-width-content").length>0&&this.$el.parents(".vc_col-sm-12").length>0?this.$el.append('<div class="container normal-container"><div class="visualized-total"><span></span></div></div>'):this.$el.append('<div class="visualized-total"><span></span></div>')),ht.usingMobileBrowser||(B[this.index]=new bt(this.$el,"horizontal-movement"),this.instance.on("dragMove",function(t,e){ht.clientY=e.clientY,ht.clientX=e.clientX}),this.instance.on("pointerDown",function(e,a){t(".nectar-drag-indicator").addClass("pointer-down")}),this.instance.on("pointerUp",function(e,a){t(".nectar-drag-indicator").removeClass("pointer-down")}));var n=this.$el.find(".flickity-page-dots li").length,i=this.$el.find(".visualized-total span"),r=1,o=this.$el.find(".visualized-total").width();a||(s.on("smartresize",function(){setTimeout(function(){n=e.find(".flickity-page-dots li").length,o=e.find(".visualized-total").width(),r=o/n*e.find(".flickity-page-dots .is-selected").index(),i.css("width",100/n+"%"),i.css({x:r+"px"})},200)}),setTimeout(function(){n=e.find(".flickity-page-dots li").length,o=e.find(".visualized-total").width(),i.css("width",100/n+"%")},200),this.instance.on("change",function(t,a){r=o/n*e.find(".flickity-page-dots .is-selected").index(),i.css({x:r+"px"})}))},Ct.prototype.fixedContentStyle=function(){var a=ht.usingMobileBrowser,n=this.$el,i=this;this.$flickity_stored_autoplay&&(t(e).on("nectar-material-ocm-open",function(){i.instance.stopPlayer()}),t(e).on("nectar-material-ocm-close",function(){i.instance.playPlayer()})),this.instance.on("scroll",function(){if(!a)if(1!=pt.materialOffCanvasOpen){var e=n.find(".cell").outerWidth()+25,r=t('body[data-header-format="left-header"]').length>0&&s.width()>1e3?275:0,o=(s.width()+r-n.parents(".main-content").width())/2;o+=parseInt(n.css("margin-left"))+2,i.instance.slides.forEach(function(a,n){var s=1,r=0,l=0,d=10,c=1,h=t(a.cells[0].element).offset().left,u=t(".nectar-flickity.instance-"+i.index+" .cell:nth-child("+(n+1)+")");h-o<0&&h-o>-1*e?(s=1+(h-o)/1500,c=1+(h-o+70)/550,r=-1*(h-o),l=(h-o)/25*-1):(s=1,c=1,r=0,l=0),d=h+5-o<0&&h-o>-1*e?5:10,u.css({"z-index":d}),u.find(".inner-wrap-outer").css({transform:"perspective(800px) translateX("+r+"px) rotateY("+l+"deg) translateZ(0)",opacity:c}),u.find(".inner-wrap").css({transform:"scale("+s+") translateZ(0)"})})}else i.instance.slides.forEach(function(t,e){var a=n.find(".cell:nth-child("+(e+1)+")");a.find(".inner-wrap-outer").css({transform:"perspective(800px) translateX(0) rotateY(0) translateZ(0)",opacity:"1"}),a.find(".inner-wrap").css({transform:"scale(1) translateZ(0)"})})})},St.prototype.setup=function(){ht.usingFrontEndEditor?this.init():this.lazyInit()},St.prototype.init=function(){"legacy"===this.type?this.legacyCarousel():this.flickityCarousel()},St.prototype.lazyInit=function(){var t=this;this.observer=new IntersectionObserver(function(e){e.forEach(function(e){e.isIntersecting&&(t.init(),t.observer.unobserve(e.target))})},{root:a,rootMargin:"400px 0px 400px 0px",threshold:0}),this.observer.observe(this.$el[0])},St.prototype.legacyCarousel=function(){var a=this.$el.find("ul.products"),n=this.$el.parents(".full-width-content ").length>0?400:353,i=a;0==a.find("img").length&&(i=r),this.$el.append('<a class="carousel-prev" href="#"><i class="icon-salient-left-arrow"></i></a> <a class="carousel-next" href="#"><i class="icon-salient-right-arrow"></i></a>'),imagesLoaded(i,function(){a.carouFredSel({circular:!0,responsive:!0,items:{width:n,visible:{min:1,max:"auto"}},swipe:{onTouch:!0,onMouse:!0,options:{excludedElements:"button, input, select, textarea, .noSwipe",tap:function(a,n){!t(n).attr("href")||t(n).is('[target="_blank"]')||t(n).hasClass("add_to_wishlist")||t(n).hasClass("add_to_cart_button")||t(n).is('[rel^="prettyPhoto"]')||e.open(t(n).attr("href"),"_self"),!t(n).parent().attr("href")||t(n).parent().is('[target="_blank"]')||t(n).parent().hasClass("add_to_wishlist")||t(n).parent().hasClass("add_to_cart_button")||t(n).parent().is('[rel^="prettyPhoto"]')||e.open(t(n).parent().attr("href"),"_self")}},onBefore:function(){a.find(".product-wrap").trigger("mouseleave"),a.find(".product a").trigger("mouseup")}},scroll:{items:"auto",easing:"easeInOutQuart",duration:800},prev:{button:function(){return a.parents(".carousel-wrap").find(".carousel-prev")}},next:{button:function(){return a.parents(".carousel-wrap").find(".carousel-next")}},auto:{play:!1}}).animate({opacity:1},1300),a.parents(".carousel-wrap").wrap('<div class="carousel-outer">'),a.addClass("finished-loading"),s.trigger("resize")})},St.prototype.flickityCarousel=function(){var a=this.$el;this.$el.find(".products > li").each(function(){t(this).wrap('<div class="flickity-cell"></div>')});var n=!!a.is('[data-controls="bottom-pagination"]'),i=!a.is('[data-controls="bottom-pagination"]'),s=!a.is('[data-wrap="no-wrap"]'),o=1!=s||n,l=a.is("[data-autorotate-speed]")&&parseInt(a.attr("data-autorotate-speed"))>800?parseInt(a.attr("data-autorotate-speed")):5e3;a.is('[data-autorotate="true"]')||(l=!1),this.$el.find("ul.products").addClass("generate-markup"),this.instance=this.$el.find("ul.products"),a.is('[data-controls="arrows-overlaid"]')&&(i=!0),1==i&&this.instance.on("ready.flickity",function(){var t=a.find(".flickity-prev-next-button.previous").detach(),e=a.find(".flickity-prev-next-button.next").detach();a.find(".nectar-woo-carousel-top").append(t).append(e)});var d=!1,c="center";r.hasClass("rtl")&&(d=!0,c="right"),a.is('[data-group-columns="no-overflow"]')?(o=!0,c="left"):a.is('[data-group-columns="overflow"]')&&(o=!1,c="center");var h=!1;if(e.nectarOptions&&e.nectarOptions.woo_related_upsell_carousel&&"true"==e.nectarOptions.woo_related_upsell_carousel&&this.$el.hasClass("related-upsell-carousel")&&(h=!0,s=!1,o=!0,"center"==c&&this.$el.find(".products > div").length<4&&(c="left"),this.$el.find(".products > div").length<5&&this.$el.addClass("desktop-controls-hidden")),this.instance.flickity({draggable:!0,contain:!0,lazyLoad:!1,imagesLoaded:!0,cellAlign:c,groupCells:o,prevNextButtons:i,pageDots:n,resize:!0,adaptiveHeight:!1,percentPosition:!0,setGallerySize:!0,rightToLeft:d,wrapAround:s,autoPlay:l,accessibility:!1}),this.$el.is('[data-controls="touch_indicator"]'))ht.usingMobileBrowser||(B.push(new bt(this.$el,"horizontal-movement")),this.instance.on("dragMove.flickity",function(t,e){ht.clientY=e.clientY,ht.clientX=e.clientX}),this.instance.on("pointerDown.flickity",function(e,a){t(".nectar-drag-indicator").addClass("pointer-down")}),this.instance.on("pointerUp.flickity",function(e,a){t(".nectar-drag-indicator").removeClass("pointer-down")}));else if(1==i){a.find(".flickity-prev-next-button").append('<svg width="65px" height="65px" viewBox="0 0 72 72" xmlns="http://www.w3.org/2000/svg"><circle stroke-width="3" fill="none" stroke-linecap="round" cx="33" cy="33" r="28"></circle> <circle class="time" stroke-width="3" fill="none" stroke-linecap="round" cx="33" cy="33" r="28"></circle></svg>');var u=t('<div class="woo-flickity-count" />');1==h?a.find("section > h2").append(u):a.append(u);var p=this.instance.data("flickity");Ht({data:{wooFlickity:p,wooFlickityCount:u}}),this.instance.on("select.flickity",{wooFlickity:p,wooFlickityCount:u},Ht)}this.$el.removeClass("animated-in"),oa()},s.on("orientationchange",function(){setTimeout(Bt,200)}),e.requestAnimationFrame=e.requestAnimationFrame||e.mozRequestAnimationFrame||e.webkitRequestAnimationFrame||e.msRequestAnimationFrame||function(t){setTimeout(t,1e3/60)},t(e).on("resize",function(){clearTimeout(ut),ut=setTimeout(function(){t(e).trigger("smartresize")},125)}),t.fn.smartresize=function(t){return t?this.on("smartresize",t):this.trigger("smartresize",["execAsap"])},Vt.prototype.init=function(){var t,e,n,i,s,r;e={hidden:!1},n=(t=a).createElement("STYLE"),i="addEventListener"in t,s=function(e,a){i?t.addEventListener(e,a):t.attachEvent("on"+e,a)},r=function(t){n.styleSheet?n.styleSheet.cssText=t:n.innerHTML=t},t.getElementsByTagName("HEAD")[0].appendChild(n),s("mousedown",function(){0==e.hidden&&(r(":focus{outline:0}::-moz-focus-inner{border:0;}"),e.hidden=!0)}),s("keydown",function(){r(""),e.hidden=!1})},Vt.prototype.events=function(){t(e).on("nectar-ocm-open",this.setFocus.bind(this)),t(e).on("nectar-ocm-close",this.releaseFocus.bind(this))},Vt.prototype.setFocus=function(){this.state.ocmFocus=!0,t("#slide-out-widget-area").attr("tabindex","-1").focus()},Vt.prototype.releaseFocus=function(){t("#slide-out-widget-area").attr("tabindex","")},jQuery.fn.setCursorPosition=function(e){return 0==this.length?this:t(this).setSelection(e,e)},jQuery.fn.setSelection=function(t,e){if(0==this.length)return this;var a=this[0];if(a.createTextRange){var n=a.createTextRange();n.collapse(!0),n.moveEnd("character",e),n.moveStart("character",t),n.select()}else a.setSelectionRange&&(a.focus(),a.setSelectionRange(t,e));return this},t.extend(jQuery.expr.pseudos,{transparent:function(e,a,n){return"0"===t(e).css("opacity")}}),t.cssHooks.color={get:function(t){var n;return t.currentStyle?n=t.currentStyle.color:e.getComputedStyle&&(n=a.defaultView.getComputedStyle(t,null).getPropertyValue("color")),-1==n.search("rgb")?n:(n=n.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/))?"#"+Xt(n[1])+Xt(n[2])+Xt(n[3]):void 0}},t.cssHooks.backgroundColor={get:function(t){var n;return t.currentStyle?n=t.currentStyle.backgroundColor:e.getComputedStyle&&(n=a.defaultView.getComputedStyle(t,null).getPropertyValue("background-color")),-1==n.search("rgb")?n:(n=n.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/))?"#"+Xt(n[1])+Xt(n[2])+Xt(n[3]):void 0}},function(t){function n(a,i){var s=t.proxy(this.process,this);this.$body=t("body"),this.$scrollElement=t(t(a).is("body")?e:a),this.options=t.extend({},n.DEFAULTS,i),this.selector=(this.options.target||"")+" ul li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",s),this.pageSubmenuHeight=0,this.calcPageSubemnu(),this.refresh(),this.process(),t(e).on("resize",this.calcPageSubemnu.bind(this))}n.VERSION="3.2.0",n.DEFAULTS={offset:10},n.prototype.calcPageSubemnu=function(){(t('.page-submenu[data-sticky="true"]').length>0&&0==t('body[data-hhun="1"]').length||t('.page-submenu[data-sticky="true"]').length>0&&t('#header-outer[data-remove-fixed="1"]').length>0)&&(this.pageSubmenuHeight=t(".page-submenu").height())},n.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,a.documentElement.scrollHeight)},n.prototype.refresh=function(){var e,a="offset",n=0;null!=(e=this.$scrollElement[0])&&e===e.window||(a="position",n=this.$scrollElement.scrollTop()),this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight();var i=this;this.$body.find(this.selector).map(function(){var e=t(this),i=e.data("target")||e.attr("href");"#%20"===i&&(i="");var s=/^#./.test(i)&&t(i);return s&&s.length&&s.is(":visible")&&[[s[a]().top+n,i]]||null}).sort(function(t,e){return t[0]-e[0]}).each(function(){i.offsets.push(this[0]),i.targets.push(this[1])})},n.prototype.process=function(){if(pt.preventScroll)return!0;var e,a=ht.scrollTop+this.options.offset+this.pageSubmenuHeight,n=this.getScrollHeight(),i=this.options.offset+n-this.$scrollElement.height()-this.pageSubmenuHeight,s=this.offsets,r=this.targets,o=this.activeTarget;if(this.activeTarget&&a<this.offsets[0]&&this.offsets[0]>0)return this.activeTarget=null,void t(this.selector).parentsUntil(this.options.target,".current-menu-item").removeClass("current-menu-item").removeClass("sfHover");if(this.scrollHeight!=n&&this.refresh(),a>=i)return o!=(e=r[r.length-1])&&this.activate(e);if(o&&a<=s[0])return o!=(e=r[0])&&this.activate(e);for(e=s.length;e--;)o!=r[e]&&a>=s[e]&&(!s[e+1]||a<=s[e+1])&&this.activate(r[e])},n.prototype.activate=function(e){this.activeTarget=e,t(this.selector).parentsUntil(this.options.target,".current-menu-item").removeClass("current-menu-item").removeClass("sfHover");var a=this.selector+'[data-target="'+e+'"],'+this.selector+'[href="'+e+'"]',n=t(a).parents("li").addClass("current-menu-item");n.parent(".dropdown-menu").length&&(n=n.closest("li.dropdown").addClass("current-menu-item")),n.trigger("activate.bs.scrollspy")};var i=t.fn.scrollspy;t.fn.scrollspy=function(e){return this.each(function(){var a=t(this),i=a.data("bs.scrollspy"),s="object"==typeof e&&e;i||a.data("bs.scrollspy",i=new n(this,s)),"string"==typeof e&&i[e]()})},t.fn.scrollspy.Constructor=n,t.fn.scrollspy.noConflict=function(){return t.fn.scrollspy=i,this}}(jQuery);var Gt,Ut,Jt=function(t){t=t.split("+").join(" ");for(var e,a={},n=/[?&]?([^=]+)=([^&]*)/g;e=n.exec(t);)a[decodeURIComponent(e[1])]=decodeURIComponent(e[2]);return a}(a.location.search);Gt=jQuery,Ut=Gt(e),Gt.fn.visible=function(t,e,a){if(!(this.length<1)){var n=this.length>1?this.eq(0):this,i=n.get(0),s=Ut.width(),r=Ut.height(),o=(a=a||"both",!0!==e||i.offsetWidth*i.offsetHeight);if("function"==typeof i.getBoundingClientRect){var l=i.getBoundingClientRect(),d=l.top>=0&&l.top<r,c=l.bottom>0&&l.bottom<=r,h=l.left>=0&&l.left<s,u=l.right>0&&l.right<=s,p=t?d||c:d&&c,f=t?h||u:h&&u;if("both"===a)return o&&p&&f;if("vertical"===a)return o&&p;if("horizontal"===a)return o&&f}else{var g=Ut.scrollTop(),m=g+r,v=Ut.scrollLeft(),b=v+s,w=n.offset(),y=w.top,_=y+n.height(),C=w.left,x=C+n.width(),k=!0===t?_:y,$=!0===t?y:_,T=!0===t?x:C,I=!0===t?C:x;if("both"===a)return!!o&&m>=$&&k>=g&&b>=I&&T>=v;if("vertical"===a)return!!o&&m>=$&&k>=g;if("horizontal"===a)return!!o&&b>=I&&T>=v}}};var Kt=function(t,n,i,s,r,o){for(var l=0,d=["webkit","moz","ms","o"],c=0;c<d.length&&!e.requestAnimationFrame;++c)e.requestAnimationFrame=e[d[c]+"RequestAnimationFrame"],e.cancelAnimationFrame=e[d[c]+"CancelAnimationFrame"]||e[d[c]+"CancelRequestAnimationFrame"];e.requestAnimationFrame||(e.requestAnimationFrame=function(t){var a=(new Date).getTime(),n=Math.max(0,16-(a-l)),i=e.setTimeout(function(){t(a+n)},n);return l=a+n,i}),e.cancelAnimationFrame||(e.cancelAnimationFrame=function(t){clearTimeout(t)});var h=this;for(var u in h.options={useEasing:!0,useGrouping:!0,separator:",",decimal:".",easingFn:null,formattingFn:null},o)o.hasOwnProperty(u)&&(h.options[u]=o[u]);""===h.options.separator&&(h.options.useGrouping=!1),h.options.prefix||(h.options.prefix=""),h.options.suffix||(h.options.suffix=""),h.d="string"==typeof t?a.getElementById(t):t,h.startVal=Number(n),h.endVal=Number(i),h.countDown=h.startVal>h.endVal,h.frameVal=h.startVal,h.decimals=Math.max(0,s||0),h.dec=Math.pow(10,h.decimals),h.duration=1e3*Number(r)||2e3,h.formatNumber=function(t){var e,a,n,i;if(t=t.toFixed(h.decimals),a=(e=(t+="").split("."))[0],n=e.length>1?h.options.decimal+e[1]:"",i=/(\d+)(\d{3})/,h.options.useGrouping)for(;i.test(a);)a=a.replace(i,"$1"+h.options.separator+"$2");return h.options.prefix+a+n+h.options.suffix},h.easeOutExpo=function(t,e,a,n){return a*(1-Math.pow(2,-10*t/n))*1024/1023+e},h.easingFn=h.options.easingFn?h.options.easingFn:h.easeOutExpo,h.formattingFn=h.options.formattingFn?h.options.formattingFn:h.formatNumber,h.version=function(){return"1.7.1"},h.printValue=function(t){var e=h.formattingFn(t);"INPUT"===h.d.tagName?this.d.value=e:"text"===h.d.tagName||"tspan"===h.d.tagName?this.d.textContent=e:this.d.innerHTML=e},h.count=function(t){h.startTime||(h.startTime=t),h.timestamp=t;var e=t-h.startTime;h.remaining=h.duration-e,h.options.useEasing?h.countDown?h.frameVal=h.startVal-h.easingFn(e,0,h.startVal-h.endVal,h.duration):h.frameVal=h.easingFn(e,h.startVal,h.endVal-h.startVal,h.duration):h.countDown?h.frameVal=h.startVal-(h.startVal-h.endVal)*(e/h.duration):h.frameVal=h.startVal+(h.endVal-h.startVal)*(e/h.duration),h.countDown?h.frameVal=h.frameVal<h.endVal?h.endVal:h.frameVal:h.frameVal=h.frameVal>h.endVal?h.endVal:h.frameVal,h.frameVal=Math.round(h.frameVal*h.dec)/h.dec,h.printValue(h.frameVal),e<h.duration?h.rAF=requestAnimationFrame(h.count):h.callback&&h.callback()},h.start=function(t){return h.callback=t,h.rAF=requestAnimationFrame(h.count),!1},h.pauseResume=function(){h.paused?(h.paused=!1,delete h.startTime,h.duration=h.remaining,h.startVal=h.frameVal,requestAnimationFrame(h.count)):(h.paused=!0,cancelAnimationFrame(h.rAF))},h.reset=function(){h.paused=!1,delete h.startTime,h.startVal=n,cancelAnimationFrame(h.rAF),h.printValue(h.startVal)},h.update=function(t){cancelAnimationFrame(h.rAF),h.paused=!1,delete h.startTime,h.startVal=h.frameVal,h.endVal=Number(t),h.countDown=h.startVal>h.endVal,h.rAF=requestAnimationFrame(h.count)},h.printValue(h.startVal)},te=function(t,e,a,n){return a*((t=t/n-1)*t*t+1)+e};function ee(e,n){if(e.length>0){var i=a.head||a.getElementsByTagName("head")[0],s=a.createElement("style");s.type="text/css",s.styleSheet?s.styleSheet.cssText=e:s.appendChild(a.createTextNode(e)),t(s).attr("id",n),t("head").find("#"+n).remove(),i.appendChild(s)}}function ae(){setTimeout(function(){t('body[data-ls="magnific"]').length>0||t('body[data-ls="pretty_photo"]').length>0?(t("a.pp").removeClass("pp").addClass("magnific-popup"),t("a[rel^='prettyPhoto']:not([rel*='_gal']):not([rel*='product-gallery']):not([rel*='prettyPhoto['])").removeAttr("rel").addClass("magnific-popup"),t(".wpb_gallery .wpb_gallery_slidesnectarslider_style").each(function(){t(this).find(".swiper-slide a:not(.ext-url-link)").addClass("pretty_photo")}),t('.wpb_gallery_slides.wpb_flexslider:not([data-onclick="custom_link"])').each(function(){t(this).find(".slides > li > a").addClass("pretty_photo")}),t(".wpb_gallery_slidesflickity_style, .wpb_gallery_slidesflickity_static_height_style").each(function(){t(this).find(".cell > a:not(.ext-url-link)").addClass("pretty_photo")}),t(".portfolio-items, .wpb_gallery .swiper-slide, .wpb_gallery_slidesflickity_style .cell, .wpb_gallery_slidesflickity_static_height_style .cell, .wpb_gallery_slides.wpb_flexslider ul > li, .wpb_gallery .parallax-grid-item, .nectar-post-grid-item").each(function(){t(this).find(".pretty_photo").length>0?t(this).find(".pretty_photo").removeClass("pretty_photo").addClass("gallery").addClass("magnific"):t(this).find('a[rel*="prettyPhoto["]').length>0&&t(this).find('a[rel*="prettyPhoto["]').removeAttr("rel").addClass("gallery").addClass("magnific")}),t("a[data-rel='prettyPhoto[product-gallery]']").each(function(){t(this).removeAttr("data-rel").addClass("magnific").addClass("gallery")}),r.hasClass("nectar-auto-lightbox")&&(t(".gallery").each(function(){0==t(this).find('.gallery-icon a[rel^="prettyPhoto"]').length&&t(this).find('.gallery-item .gallery-icon a[href*=".jpg"], .gallery-item .gallery-icon a[href*=".png"], .gallery-item .gallery-icon a[href*=".gif"], .gallery-item .gallery-icon a[href*=".jpeg"]').addClass("magnific").addClass("gallery").removeClass("pretty_photo")}),t(".main-content img").each(function(){t(this).parent().is("[href]")&&!t(this).parent().is(".magnific-popup")&&0==t(this).parents(".tiled-gallery").length&&0==t(this).parents(".product-image").length&&0==t(this).parents(".iosSlider.product-slider").length&&t(this).parent().attr("href").match(/\.(jpg|png|gif)\b/)&&t(this).parent().addClass("magnific-popup").addClass("image-link")})),t("a.magnific-popup:not(.gallery):not(.nectar_video_lightbox):not(.nectar_video_lightbox_trigger)").magnificPopup({type:"image",callbacks:{imageLoadComplete:function(){var t=this;setTimeout(function(){t.wrap.addClass("mfp-image-loaded")},10)},beforeOpen:function(){this.st.image.markup=this.st.image.markup.replace("mfp-figure","mfp-figure mfp-with-anim")},open:function(){t.magnificPopup.instance.next=function(){var e=this;this.wrap.removeClass("mfp-image-loaded"),setTimeout(function(){t.magnificPopup.proto.next.call(e)},100)},t.magnificPopup.instance.prev=function(){var e=this;this.wrap.removeClass("mfp-image-loaded"),setTimeout(function(){t.magnificPopup.proto.prev.call(e)},100)}}},fixedContentPos:!1,mainClass:"mfp-zoom-in",removalDelay:400}),t("a.magnific-popup.nectar_video_lightbox, .nectar_video_lightbox_trigger, .magnific_nectar_video_lightbox a.link_text, .swiper-slide a[href*=youtube], .swiper-slide a[href*=vimeo], .nectar-video-box a.full-link.magnific-popup").magnificPopup({type:"iframe",fixedContentPos:!1,mainClass:"mfp-zoom-in",removalDelay:400}),t("a.magnific.gallery").each(function(){var e=t(this).closest(".wpb_column").length>0?t(this).closest(".wpb_column"):t(this).parents(".row");e.length>0&&!e.hasClass("lightbox-col")&&(e.magnificPopup({type:"image",delegate:"a.magnific",mainClass:"mfp-zoom-in",fixedContentPos:!1,callbacks:{elementParse:function(e){t(e.el).is("[href]")&&-1!=t(e.el).attr("href").indexOf("iframe=true")||t(e.el).is("[href]")&&-1!=t(e.el).attr("href").indexOf("https://www.youtube.com/watch")?e.type="iframe":t(e.el).is("[href]")&&-1!=t(e.el).attr("href").indexOf("video-popup-")?e.type="inline":e.type="image"},imageLoadComplete:function(){var t=this;setTimeout(function(){t.wrap.addClass("mfp-image-loaded")},10)},beforeOpen:function(){this.st.image.markup=this.st.image.markup.replace("mfp-figure","mfp-figure mfp-with-anim")},open:function(){if(t(this.content).find(".mejs-video video").length>0&&t().mediaelementplayer){t(this.content).find(".mejs-video video")[0].player.remove();var e=this;setTimeout(function(){t(e.content).find("video").mediaelementplayer(),t(e.content).find(".mejs-video video")[0].player.play()},50)}t.magnificPopup.instance.next=function(){var e=this;this.wrap.removeClass("mfp-image-loaded"),setTimeout(function(){t.magnificPopup.proto.next.call(e),t(e.content).find(".mejs-video video").length>0&&t(e.content).find(".mejs-video video")[0].play()},100)},t.magnificPopup.instance.prev=function(){var e=this;this.wrap.removeClass("mfp-image-loaded"),setTimeout(function(){t.magnificPopup.proto.prev.call(e),t(e.content).find(".mejs-video video").length>0&&t(e.content).find(".mejs-video video")[0].play()},100)}},close:function(){t(this.content).find(".mejs-video video").length>0&&t(this.content).find(".mejs-video video")[0].load()}},removalDelay:400,gallery:{enabled:!0}}),e.addClass("lightbox-col"))})):t('body[data-ls="fancybox"]').length>0&&function(){t("a.pp").removeClass("pp").attr("data-fancybox",""),t("a[rel^='prettyPhoto']:not([rel*='_gal']):not([rel*='product-gallery']):not([rel*='prettyPhoto['])").removeAttr("rel").attr("data-fancybox","");var e=Nt();t(".wpb_gallery .wpb_gallery_slidesnectarslider_style").each(function(){e=Nt(),t(this).find(".swiper-slide a:not(.ext-url-link)").attr("data-fancybox","group_"+e)}),t('.wpb_gallery_slides.wpb_flexslider:not([data-onclick="custom_link"])').each(function(){e=Nt(),t(this).find(".slides > li > a").attr("data-fancybox","group_"+e)}),t(".wpb_gallery_slidesflickity_style, .wpb_gallery_slidesflickity_static_height_style").each(function(){e=Nt(),t(this).find(".cell > a:not(.ext-url-link)").attr("data-fancybox","group_"+e)}),t(".portfolio-items, .wpb_gallery_slidesparallax_image_grid, .nectar-post-grid-item").each(function(){e=Nt(),t(this).find(".pretty_photo").length>0?t(this).find(".pretty_photo").removeClass("pretty_photo").attr("data-fancybox","group_"+e):t(this).find('a[rel*="prettyPhoto["]').length>0&&t(this).find('a[rel*="prettyPhoto["]').removeAttr("rel").attr("data-fancybox","group_"+e)}),r.hasClass("nectar-auto-lightbox")&&(t(".gallery").each(function(){if(0==t(this).find('.gallery-icon a[rel^="prettyPhoto"]').length){var e=Nt();t(this).find('.gallery-item .gallery-icon a[href*=".jpg"], .gallery-item .gallery-icon a[href*=".png"], .gallery-item .gallery-icon a[href*=".gif"], .gallery-item .gallery-icon a[href*=".jpeg"]').attr("data-fancybox","group_"+e).removeClass("pretty_photo")}}),t(".main-content img").each(function(){t(this).parent().is("[href]")&&!t(this).parent().is(".magnific-popup")&&0==t(this).parents(".tiled-gallery").length&&0==t(this).parents(".product-image").length&&0==t(this).parents(".woocommerce-product-gallery").length&&0==t(this).parents(".wpb_gallery_slides.wpb_flexslider").length&&0==t(this).parents(".iosSlider.product-slider").length&&t(this).parent().attr("href").match(/\.(jpg|png|gif)\b/)&&t(this).parent().attr("data-fancybox","")}));var a=(t("body.admin-bar").length,[60,100]);ht.winW<1e3&&(a=[0,0]),t("[data-fancybox]").fancybox({animationEffect:"zoom-in-out",animationDuration:350,buttons:["fullScreen","zoom","close"],margin:a,backFocus:!1,loop:!0,caption:function(){return t(this).attr("title")},hash:!1,beforeLoad:function(e){"string"!=typeof e.current.src&&t.fancybox.close(!0)},mobile:{margin:0}})}()},60)}function ne(){t(st+" .wpb_animate_when_almost_visible").each(function(){var e=t(this),a=1==rt?"200%":"90%",n=new Waypoint({element:e[0],handler:function(){e.parents(".wpb_tab").length>0&&"hidden"==e.parents(".wpb_tab").css("visibility")||e.hasClass("animated")?n.destroy():(e.addClass("animated"),e.addClass("wpb_start_animation"),n.destroy(),e.is(".nectar-button")&&t('body[data-button-style*="rounded_shadow"]').length>0&&setTimeout(function(){e.removeClass("wpb_start_animation")},1100))},offset:a})})}function ie(t,e){this.$el=t,this.duration=e,this.interval="",this.words=[],this.state={activeIndex:0,sequenceStarted:0,visible:!1},this.setup()}function se(){t(st+".nectar-milestone").each(function(){var e=1==rt?"250%":"98%";ht.usingMobileBrowser&&"98%"==e&&(e="110%");var a=0;t(this).is("[data-animation-delay]")&&t(this).attr("data-animation-delay").length>0&&"false"!=t(this).attr("data-animation")&&(a=t(this).attr("data-animation-delay"));var n=t(this),i=new Waypoint({element:n[0],handler:function(){if(n.parents(".wpb_tab").length>0&&"hidden"==n.parents(".wpb_tab").css("visibility")||n.hasClass("animated-in"))i.destroy();else{var e=parseInt(n.find(".number span:not(.symbol)").text().replace(/,/g,""));setTimeout(function(){if(n.hasClass("motion_blur"))n.find("span").each(function(e){var a=t(this);setTimeout(function(){a.addClass("in-sight")},200*e)});else{var a={easingFn:te},i=n.find(".number span:not(.symbol)")[0];new Kt(i,0,e,0,2.2,a).start()}n.addClass("animated-in")},a),i.destroy()}},offset:e})})}function re(t){var e,a,n;(e=t.parent()).length?(a=e.position().left,n=e.width()):a=n=0,t.parent().parent().find(".magic-line").css("transform","translateX("+a+"px) scaleX("+n+")")}function oe(){r.on("click",".tabbed > ul li:not(.cta-button) a",function(a){if(function(a){var n=a.parents("li").index()+1,i=t("body.vc_editor").length>0?"> .wpb_tab ":"";if(a.parents('.tabbed[data-style="toggle_button"]').length>0&&3===n&&(n=2),!a.hasClass("active-tab")&&!a.hasClass("loading")){a.parents("ul").find("a").removeClass("active-tab"),a.parents("ul").find("li").removeClass("active-tab"),a.addClass("active-tab"),a.parent().addClass("active-tab"),a.parents(".tabbed").find("> div:not(.clear)"+i).css({visibility:"hidden",position:"absolute",opacity:"0",left:"-9999px",display:"none"}).removeClass("visible-tab");var o=a.parents('.tabbed[data-animation="none"]').length>0?0:400;if(t("body.vc_editor").length>0){var l=a.parent().is("[data-m-id]")?a.parent().attr("data-m-id"):"";a.parents('.tabbed[data-style="toggle_button"]').length>0&&a.parents("li").index()+1===3&&a.parents(".wpb_tabs_nav").find(".toggle-button[data-m-id]").length>0&&(l=a.parents(".wpb_tabs_nav").find(".toggle-button").attr("data-m-id")),a.parents(".tabbed").find('> div[data-model-id="'+l+'"]'+i).css({visibility:"visible",position:"relative",left:"0",display:"block"}).stop().transition({opacity:1},o).addClass("visible-tab"),r.is('[data-flex-cols="true"]')||ai()}else a.parents(".tabbed").find("> div:nth-of-type("+n+")"+i).css({visibility:"visible",position:"relative",left:"0",display:"block"}).stop().transition({opacity:1},o).addClass("visible-tab");var d=a.parents(".tabbed").find("> div:nth-of-type("+n+")");(d.find(".iframe-embed").length>0||d.find(".portfolio-items").length>0||d.find(".nectar-video-bg").length>0)&&setTimeout(function(){s.trigger("resize")},10)}var c=a.parents(".tabbed").find("> div:nth-of-type("+n+")"+i);c.find(".nectar-progress-bar").length>0&&Re(),(c.find('.divider-small-border [data-animate="yes"]').length>0||c.find('.divider-border [data-animate="yes"]').length>0)&&De(),(c.find("img.img-with-animation").length>0||c.find(".col.has-animation").length>0||c.find(".nectar_cascading_images").length>0||c.find(".wpb_column.has-animation").length>0)&&(Le(),je()),(c.find(".parallax-layer").length>0||c.parents(".nectar-parallax-enabled").length>0)&&Ae(),Ee(),c.find(".nectar-milestone").length>0&&se(),c.find('.nectar_image_with_hotspots[data-animation="true"]').length>0&&(Ge(),setTimeout(function(){s.trigger("resize")},100)),c.find(".nectar-fancy-ul").length>0&&ye(),c.find(".nectar-split-heading").length>0&&Pe(),c.find('.wpb_column[data-border-animation="true"]').length>0&&Ve(),c.find(".wpb_animate_when_almost_visible").length>0&&ne(),c.find(".nectar-animated-title").length>0&&sa(),c.find(".nectar-highlighted-text").length>0&&ra(),c.find(".nectar_food_menu_item").length>0&&Ne(),c.find('.nectar-post-grid:not([data-animation="none"])').length>0&&ia(),c.find(".nectar-waypoint-el").length>0&&Xe(),a.parents(".wpb_row").length>0&&((c.find(".vc_pie_chart").length>0||c.find(".wp-video-shortcode").length>0||c.find(".post-area.masonry .posts-container").length>0||c.find(".twentytwenty-container").length>0||a.parents('#nectar_fullscreen_rows[data-content-overflow="scrollbar"]').length>0||a.parents(".tabbed").find("> div:nth-of-type("+n+")").find(".wpb_gallery").length>0||a.parents(".tabbed").find("> div:nth-of-type("+n+")").find(".swiper-container").length>0||a.parents(".wpb_row").next().hasClass("parallax_section"))&&s.trigger("resize"),c.find(".nectar-flickity").length>0&&"undefined"!=typeof Flickity&&a.parents(".tabbed").find("> div:nth-of-type("+n+")").find(".nectar-flickity").each(function(){Flickity.data(t(this)[0]).resize()}),c.find(".nectar-woo-flickity").length>0&&"undefined"!=typeof Flickity&&(Flickity.data(a.parents(".tabbed").find("> div:nth-of-type("+n+")").find(".nectar-woo-flickity > ul")[0]).resize(),t(e).trigger("nectar-product-filters-layout"))),c.find(".svg-icon-holder").each(function(e){var a=t(this);setTimeout(function(){var t=0;a.is("[data-animation-delay]")&&a.attr("data-animation-delay").length>0&&"false"!=a.attr("data-animation")&&(t=a.attr("data-animation-delay")),clearTimeout(K[e]),"false"==a.attr("data-animation")?(a.css("opacity","1"),A[a.find("svg").attr("id").slice(-1)].finish()):(A[a.find("svg").attr("id").slice(-1)].reset(),K[e]=setTimeout(function(){A[a.find("svg").attr("id").slice(-1)].play()},t))},150)}),t(".nectar-cta .link_wrap, .nectar-cta .link_text").removeClass("hover"),a.parents(".tabbed").find(".wpb_row").each(function(){if(void 0!==t(this).find('[class*="vc_col-"]').first().offset()){var e=t(this).find('[class*="vc_col-"]').first().offset().left;t(this).find('[class*="vc_col-"]').each(function(){t(this).removeClass("no-left-margin"),t(this).offset().left<e+15?t(this).addClass("no-left-margin"):t(this).removeClass("no-left-margin")})}}),0,a.parent().parent().find(".magic-line").length>0&&re(a),t(e).trigger("nectar-tab-changed")}(t(this)),void 0!==a.originalEvent&&ht.winW<1e3&&0==ct.$usingFullScreenRows){var n=t(this).closest(".tabbed").find("> ul");if(n.height()>350){var i=n.offset().top+n.height()-ht.adminBarHeight;t('#header-outer[data-mobile-fixed="1"]').length>0&&(i=n.offset().top+n.height()-d.outerHeight()-ht.adminBarHeight),Dt(i,700,"easeInOutQuint")}}return!1}),t("body").on("click",".wpb_tabs_nav > .toggle-button",function(){t(this).parents(".wpb_tabs_nav").find("> li:not(.active-tab):not(.toggle-button) a").trigger("click")}),t('a[class*="nectar-tab-trigger"]').on("click",function(e){if(!t(this).is('[href*="#"]')||t(this).attr("href").length<1)return!0;var a=t(this).attr("href");a=(a=a.substr(1)).replace(/\s+/g,"-").replace(/</g,"<").replace(/"/g,""").toLowerCase(),t(".wpb_tabs_nav").each(function(){t(this).find("li").each(function(){var e=t(this).find("a").clone();e.find("svg").remove(),(e=(e=e.text()).replace(/\s+/g,"-").toLowerCase()).length>0&&"-"===e.substring(0,1)&&(e=e.substring(1)),e==a&&t(this).find("a").trigger("click")})}),e.preventDefault()}),t(".tabbed").each(function(){var e;t(this).find(".wpb_tab").each(function(e){if(t(this).is("[data-tab-icon]")&&t(this).attr("data-tab-icon").length>0&&0==t(this).find(".im-icon-wrap.tab-icon").length&&(t(this).parents(".tabbed").addClass("using-icons"),t(this).parents(".tabbed").find(".wpb_tabs_nav li:nth-child("+(e+1)+") > a").prepend('<i class="'+t(this).attr("data-tab-icon")+'"></i>')),t(this).find(".im-icon-wrap.tab-icon").length>0){var a=t(this).find(".im-icon-wrap.tab-icon").detach();t(this).parents(".tabbed").find(".wpb_tabs_nav li:nth-child("+(e+1)+") > a").prepend(a)}}),e=t(this),setTimeout(function(){e.is('[data-style="minimal_alt"]')&&(e.find("> ul").append('<li class="magic-line" />'),re(e.find("> ul > li:first-child > a")))},100)}),t('.tabbed[data-style="minimal_alt"]').length>0&&s.on("smartresize",function(){t('.tabbed[data-style="minimal_alt"]').each(function(){t(this).find("a.active-tab").length>0&&re(t(this).find("a.active-tab"))})}),void 0!==Jt.tab&&t(".wpb_tabs_nav").each(function(){t(this).find("li").each(function(){var e=t(this).find("a").clone(),a=Jt.tab,n=t(this);e.find("svg").remove(),(e=(e=e.text()).replace(/\s+/g,"-").toLowerCase()).length>0&&"-"===e.substring(0,1)&&(e=e.substring(1)),e==(a=a.replace(/\s+/g,"-").replace(/</g,"<").replace(/"/g,""").toLowerCase())&&(t(this).find("a").trigger("click"),setTimeout(function(){n.find("a").trigger("click")},501))})}),t(".nectar-scrolling-tabs").each(function(e){ht.usingFrontEndEditor||(at[e]=new le(t(this)))});var a=!1;r.on("click",".scrolling-tab-nav-current-item",function(){t(this).toggleClass("open"),t(this).siblings(".wpb_tabs_nav").toggle(),Ee()}),r.on("click",".nectar-sticky-tabs .wpb_tabs_nav li",function(e){var a=t(this).parents(".wpb_tabs_nav"),n=t(this).parents(".scrolling-tab-nav").find(".scrolling-tab-nav-current-item"),i=t(this).find(".tab-nav-heading").clone();n.html(i),void 0!==e.originalEvent&&(t(this).parents(".scrolling-tab-nav").find(".scrolling-tab-nav-current-item").toggleClass("open"),a.toggle())}),r.on("click",".nectar-sticky-tabs .wpb_tabs_nav a",function(n){var i=t(this),s=i.parents("li").index()+1,r=t("body.vc_editor").length>0?"> .wpb_tab ":"",o=i.parents(".nectar-sticky-tabs"),l=o.hasClass("content_animation_fade")?200:600;(i.parents("li").hasClass("active-tab")||a)&&o.hasClass("loaded")||(a=!0,o.find(".wpb_tabs_nav li").removeClass("active-tab"),i.parents("li").addClass("active-tab"),o.find(".scrolling-tab-content > div").removeClass("previously-active-tab"),o.find(".scrolling-tab-content > div.active-tab").addClass("previously-active-tab").removeClass("active-tab"),o.find(".scrolling-tab-content > div:nth-of-type("+s+")"+r).addClass("active-tab"),t(e).trigger("nectar-tab-changed"),setTimeout(function(){a=!1},l)),n.preventDefault()}),t(".tabbed .wpb_tab").first().addClass("visible-tab"),t(".nectar-sticky-tabs .wpb_tabs_nav > li:first-child").each(function(){t(this).find("a").first().trigger("click")}),a=!1,t(".nectar-sticky-tabs").addClass("loaded"),t(e).on("nectar-tab-changed",oa)}function le(t){this.$el=t,this.$tabContent=t.find(".scrolling-tab-content"),this.$lineEl=t.find(".scrolling-tab-nav .line"),this.observer=null,this.linkFunc=this.$el.hasClass("navigation_func_active_link_only")?"single_link":"default",this.domSetup(),this.highlightObserve(),this.events()}function de(){void 0!==Jt.toggle&&t(".toggles").each(function(){t(this).find(".toggle").each(function(){var e=t(this).find("h3 a").clone(),a=Jt.toggle;t(e).find("i").remove(),(e=(e=e.text()).replace(/\s+/g,"-").toLowerCase())==(a=a.replace(/\s+/g,"-").replace(/</g,"<").replace(/"/g,""").toLowerCase())&&t(this).find("h3 a").trigger("click")})})}function ce(){t(".toggles").each(function(){var e=t(this).find(".toggle.open");e.length>0&&e.each(function(){var e=t(this).find("> div")[0];e.style.maxHeight=e.scrollHeight+"px"})})}function he(){setTimeout(function(){t('.toggles.accordion:not([data-starting="closed"])').each(function(){if(0==t(this).find('.toggle[data-inner-wrap="true"]').length)t(this).find("> .toggle").first().addClass("open").find("> div").show();else if(!ht.usingFrontEndEditor){var e=t(this).find("> .toggle").first();e.addClass("open"),e.find("> div")[0].style.maxHeight=e.find("> div")[0].scrollHeight+"px"}t(this).find("> .toggle").first().find("a:not(.nectar-button) i").attr("class","fa fa-minus-circle")}),setTimeout(de,300)},60),t('.toggle[data-inner-wrap="true"]').length>0&&s.on("smartresize",ce),t(".toggle > h3:not(.toggle-title)").addClass("toggle-title")}function ue(t){this.$el=t,this.$innerEl=this.$el.find(" > .n-sticky > .vc_column-inner"),0!=this.$innerEl.length&&(this.topOffset=0,this.resizeEvent(),s.on("resize",this.resizeEvent.bind(this)))}function pe(t,e){(t=String(t).replace(/[^0-9a-f]/gi,"")).length<6&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]),e=e||0;var a,n,i="#";for(n=0;n<3;n++)a=parseInt(t.substr(2*n,2),16),i+=("00"+(a=Math.round(Math.min(Math.max(0,a+a*e),255)).toString(16))).substr(a.length);return i}function fe(){t(".nectar-3d-transparent-button").each(function(){if("visible"==t(this).css("visibility")){var e=t(this),a=0,n=1.7;if("extra_jumbo"==e.attr("data-size")){var i;ht.winW<1e3&&ht.winW>690?(a=64,i=34,e.find(".back-3d rect").attr("stroke-width","12"),n=1.7):ht.winW<=690?(a=46,i=16,e.find(".back-3d rect").attr("stroke-width","10"),n=1.7):(a=100,i=64,e.find(".back-3d rect").attr("stroke-width","20"),n=1.6),e.find("svg text").attr("font-size",i);var s=t(this).find(".back-3d .button-text")[0].getBoundingClientRect().width,r=1.5*i;e.css({width:s+1.5*a+"px",height:r+a+"px"}),e.find("> a").css({height:r+a+"px"}),e.find(".back-3d svg, .front-3d svg").css({width:s+1.5*a+"px",height:r+a+"px"}).attr("viewBox","0 0 "+(s+1.5*a)+" "+(r+a)),e.find("svg text").attr("transform","matrix(1 0 0 1 "+(s+1.6*a)/2+" "+(r+a)/n+")"),e.find(".front-3d ").css("transform-origin","50% 50% -"+(r+a)/2+"px"),e.find(".back-3d").css("transform-origin","50% 50% -"+(r+a)/2+"px")}}})}function ge(){if(ht.usingMobileBrowser||t('.nectar-cta[data-style="text-reveal-wave"], .menu-item-hover-text-reveal-wave').each(function(){t(this).find(".char").each(function(e){t(this).css("animation-delay",.015*e+"s")});var e=t(this).is('[data-using-bg="true"]')?".link_wrap":".link_text",a=!1;t(this).is('[class*="border_thickness_"]')&&!t(this).is('[class*="border_thickness_0px"]')&&(e=".link_wrap",a=!0),t(this).is(".menu-item-hover-text-reveal-wave")&&(e="a"),t(this).find(e).on("mouseenter",function(){if(ht.winW>999){var e=a?t(this).find(".link_text"):t(this);e.removeClass("hover"),setTimeout(function(){e.addClass("hover")},20)}})}),t(".nectar-link-underline-effect a").on("mouseenter",function(){t(this).addClass("accessed")}),t(".nectar-button.see-through[data-color-override], .nectar-button.see-through-2[data-color-override], .nectar-button.see-through-3[data-color-override]").each(function(){var e,a,n=t('body.material[data-button-style^="rounded"]').length>0;if(t(this).css("visibility","visible"),t(this).hasClass("see-through-3")&&"false"==t(this).attr("data-color-override"))return!0;e="false"!=t(this).attr("data-color-override")?t(this).attr("data-color-override"):t(this).parents(".dark").length>0?"#000000":"#ffffff",t(this).hasClass("see-through-3")||t(this).css("color",e),t(this).find("i").css("color",e);var i=parseInt(e.substring(1),16),s=t(this).has("[data-hover-color-override]")?t(this).attr("data-hover-color-override"):"no-override",r=t(this).has("[data-hover-text-color-override]")?t(this).attr("data-hover-text-color-override"):"#fff",o=(16711680&i)>>16,l=(65280&i)>>8,d=(255&i)>>0,c=t(this).hasClass("see-through-3")?"1":"0.75";t(this).css("border-color","rgba("+o+","+l+","+d+","+c+")"),n&&t(this).find("i").css({"background-color":"rgba("+o+","+l+","+d+",1)","box-shadow":"0px 8px 15px rgba("+o+","+l+","+d+",0.24)"}),t(this).hasClass("see-through")?(a=t(this),t(this).on("mouseenter touchstart",function(){a.css("border-color","rgba("+o+","+l+","+d+",1)")}),t(this).on("mouseleave touchtouchend",function(){a.css("border-color","rgba("+o+","+l+","+d+",1)"),c=t(this).hasClass("see-through-3")?"1":"0.75",a.css("border-color","rgba("+o+","+l+","+d+","+c+")")})):(t(this).find("i").css("color",r),"no-override"!=s?(a=t(this),t(this).on("mouseenter touchstart",function(){a.css({"border-color":s,"background-color":s,color:r}),n&&a.find("i").css({"background-color":"","box-shadow":""})}),t(this).on("mouseleave touchtouchend",function(){c=t(this).hasClass("see-through-3")?"1":"0.75",n&&a.find("i").css({"background-color":"rgba("+o+","+l+","+d+",1)","box-shadow":"0px 8px 15px rgba("+o+","+l+","+d+",0.24)"}),a.hasClass("see-through-3")?a.css({"border-color":"rgba("+o+","+l+","+d+","+c+")","background-color":"transparent"}):a.css({"border-color":"rgba("+o+","+l+","+d+","+c+")","background-color":"transparent",color:e})})):(a=t(this),t(this).on("mouseenter touchstart",function(){a.css({"border-color":s,color:r})}),t(this).on("mouseleave touchtouchend",function(){c=a.hasClass("see-through-3")?"1":"0.75",a.css({"border-color":"rgba("+o+","+l+","+d+","+c+")",color:r})})))}),t(".nectar-button:not(.see-through):not(.see-through-2):not(.see-through-3)[data-color-override]").each(function(){if(t(this).css("visibility","visible"),"false"!=t(this).attr("data-color-override")){var e=t(this).attr("data-color-override");t(this).removeClass("accent-color").removeClass("extra-color-1").removeClass("extra-color-2").removeClass("extra-color-3").css("background-color",e)}}),t(".swiper-slide .solid_color_2").length>0||t(".tilt-button-inner").length>0){var e,a="";t(".swiper-slide .solid_color_2 a").each(function(n){t(this).addClass("instance-"+n),e="false"!=t(this).attr("data-color-override")?t(this).attr("data-color-override"):t(this).parents(".dark").length>0?"#000000":"#ffffff",t(this).css("color",e),t(this).find("i").css("color",e);var i=t(this).css("background-color"),s=pe(i,.13),r=pe(i,-.15);a+=".swiper-slide .solid_color_2 a.instance-"+n+":after { background-color: "+s+"; } .swiper-slide .solid_color_2 a.instance-"+n+":before { background-color: "+r+"; } "}),t(".tilt-button-wrap a").each(function(e){t(this).addClass("instance-"+e);var n,i=t(this).css("background-color");"false"!=t(this).attr("data-color-override")&&(n=t(this).attr("data-color-override"),t(this).css("background-color",n),i=n);var s=pe(i,.13),r=pe(i,-.15);a+=".tilt-button-wrap a.instance-"+e+":after { background-color: "+s+"; } .tilt-button-wrap a.instance-"+e+":before { background-color: "+r+"; } "}),ee(a,"tilt-button")}if(t(".nectar-3d-transparent-button").length>0){var n="";t(".nectar-3d-transparent-button").each(function(e){t(this).on("mouseover",function(){t(this).find("*").css("display","");var e=t(this);setTimeout(function(){e.find("*").css("display","block")},60)}),t(this).on("mouseleave",function(){t(this).find("*").css("display","block");var e=t(this);setTimeout(function(){e.find("*").css("display","")},60)});var a,i=t(this),s=i.attr("data-size"),r=0,o=1.5,l=1.65;"large"==s?(r=46,a=16,o=1.5,l=1.7):"medium"==s?(r=30,a=16):"small"==s?(r=20,a=12):"jumbo"==s?(r=54,a=24,o=1.5,l=1.68):"extra_jumbo"==s&&(r=100,a=64,o=1.6,l=1.6),i.find("svg text").attr("font-size",a);var d=t(this).find(".back-3d .button-text")[0].getBoundingClientRect().width,c=1.5*a;i.css({width:d+1.5*r+"px",height:c+r+"px"}),i.find("> a").css({height:c+r+"px"}),i.find(".back-3d svg, .front-3d svg").css({width:d+1.5*r+"px",height:c+r+"px"}).attr("viewBox","0 0 "+(d+1.5*r)+" "+(c+r)),i.find("svg text").attr("transform","matrix(1 0 0 1 "+(d+r*o)/2+" "+(c+r)/l+")"),i.find(".front-3d, .back-3d").css("transform-origin","50% 50% -"+(c+r)/2+"px"),t(this).find(".front-3d svg > rect").attr("id","masked-rect-id-"+e),t(this).find(".front-3d defs mask").attr("id","button-text-mask-"+e),i.css("visibility","visible"),n+="#masked-rect-id-"+e+" { mask: url(#button-text-mask-"+e+"); -webkit-mask: url(#button-text-mask-"+e+")} "}),fe(),s.on("smartresize",fe),ee(n,"nectar-td-button")}setTimeout(function(){t('.nectar-button[class*="color-gradient"] .start').removeClass("loading")},150),(navigator.userAgent.toLowerCase().indexOf("firefox")>-1||navigator.userAgent.indexOf("MSIE ")>-1||navigator.userAgent.match(/Trident\/7\./))&&t('.nectar-button[class*="color-gradient"] .start').addClass("no-text-grad")}function me(){t(".icon-3x").each(function(){t(this).closest(".col").on("mouseenter",function(){t(this).find(".icon-3x").addClass("hovered")}),t(this).closest(".col").on("mouseleave",function(){t(this).find(".icon-3x").removeClass("hovered")})}),(navigator.userAgent.indexOf("MSIE ")>-1||navigator.userAgent.match(/Trident\/7\./))&&t('[class^="icon-"][class*="color-gradient"], .nectar_icon_wrap[data-color*="extra-color-gradient"] .nectar_icon, .nectar-gradient-text').addClass("no-grad")}function ve(){var e=t('body[data-header-format="left-header"]').length>0&&s.width()>1e3?275:0;t(".nectar_team_member_overlay").css({width:s.width()-e,left:e})}function be(){var e="";t(".wpb_column").each(function(a){t(this).removeClass(function(t,e){return(e.match(/(^|\s)instance-\S+/g)||[]).join(" ")}),("true"==t(this).attr("data-has-bg-color")||t(this).is('[data-hover-bg^="#"]'))&&t(this).addClass("instance-"+a);var n=t(this).find("> .vc_column-inner > .column-bg-overlay-wrap").length>0||t(this).find("> .vc_column-inner > .column-bg-overlay").length>0?" > .vc_column-inner ":"",i=t(this).find(n+" > .column-bg-overlay-wrap").length>0?"> .column-bg-overlay-wrap ":"";"true"==t(this).attr("data-has-bg-color")&&(e+=".wpb_column.instance-"+a+n+i+" > .column-bg-overlay { background-color:"+t(this).attr("data-bg-color")+"; opacity: "+t(this).attr("data-bg-opacity")+"; }"),t(this).is('[data-hover-bg^="#"]')&&(e+=".wpb_column.instance-"+a+":hover "+n+i+" > .column-bg-overlay { background-color: "+t(this).attr("data-hover-bg")+"!important; opacity: "+t(this).attr("data-hover-bg-opacity")+"!important; }")}),ee(e,"column-bg-colors")}function we(){if(t(".morphing-outline").length>0){var e="",a=t("body.vc_editor").length>0?"":">";t(".morphing-outline").each(function(n){t(this).removeClass(function(t,e){return(e.match(/(^|\s)instance-\S+/g)||[]).join(" ")}),t(this).addClass("instance-"+n).css({visibility:"visible"});var i=t(this).find(".inner").width(),s=t(this).find(".inner").height(),r=parseInt(t(this).attr("data-border-thickness")),o=t('body[data-button-style*="rounded"]').length>0?":hover":"",l=t('body[data-button-style*="rounded"]').length>0?"":":hover";e+="body .morphing-outline.instance-"+n+" .inner > * { color: "+t(this).attr("data-starting-color")+"; } ",e+="body .morphing-outline.instance-"+n+" .inner:after { border-width:"+t(this).attr("data-border-thickness")+"px ; border-color: "+t(this).attr("data-starting-color")+"; } ",e+="body .wpb_column:hover > .wpb_wrapper "+a+" .morphing-outline.instance-"+n+" .inner > *, body .wpb_column:hover > .vc_column-inner > .wpb_wrapper "+a+" .morphing-outline.instance-"+n+" .inner > * { color: "+t(this).attr("data-hover-color")+"; } ",e+="body .wpb_column:hover > .wpb_wrapper "+a+" .morphing-outline.instance-"+n+" .inner:after, body .wpb_column:hover > .vc_column-inner > .wpb_wrapper "+a+" .morphing-outline.instance-"+n+" .inner:after { border-color: "+t(this).attr("data-hover-color")+"; } ",e+="body .wpb_column"+l+" > .wpb_wrapper "+a+" .morphing-outline.instance-"+n+" .inner:after, body .wpb_column"+l+" > .vc_column-inner > .wpb_wrapper "+a+" .morphing-outline.instance-"+n+" .inner:after { padding: "+((i+100+2*r-s)/2-r)+"px 50px}",e+=".morphing-outline.instance-"+n+" { padding: "+(30+(i+80+2*r-s)/2-r)+"px 50px}",e+="body .wpb_column"+l+" > .wpb_wrapper "+a+" .morphing-outline.instance-"+n+" .inner:after, body .wpb_column"+l+" > .vc_column-inner > .wpb_wrapper "+a+" .morphing-outline.instance-"+n+" .inner:after { top: -"+parseInt((i+100+2*r-s)/2-r+r)+"px }",e+="body .wpb_column > .wpb_wrapper "+a+" .morphing-outline.instance-"+n+" .inner:after, body .wpb_column > .vc_column-inner > .wpb_wrapper "+a+" .morphing-outline.instance-"+n+" .inner:after { left: -"+parseInt(50+r)+"px }",e+="body .wpb_column"+o+" > .wpb_wrapper "+a+" .morphing-outline.instance-"+n+" .inner:after, body .wpb_column"+o+" > .vc_column-inner > .wpb_wrapper "+a+" .morphing-outline.instance-"+n+" .inner:after { padding: 50px 50px}",e+="body .wpb_column"+o+" > .wpb_wrapper "+a+" .morphing-outline.instance-"+n+" .inner:after, body .wpb_column"+o+" > .vc_column-inner > .wpb_wrapper "+a+" .morphing-outline.instance-"+n+" .inner:after { top: -"+parseInt(50+r)+"px }"}),ee(e,"morphing-outlines")}}function ye(){t(st+".nectar-fancy-ul").each(function(){var e=t(this).attr("data-animation"),a=0;if(t(this).is("[data-animation-delay]")&&t(this).attr("data-animation-delay").length>0&&"false"!=t(this).attr("data-animation")&&(a=t(this).attr("data-animation-delay")),"true"==e)var n=t(this),i=new Waypoint({element:n[0],handler:function(){n.parents(".wpb_tab").length>0&&"hidden"==n.parents(".wpb_tab").css("visibility")||n.hasClass("animated-in")?i.destroy():(setTimeout(function(){n.find("li").each(function(e){t(this).delay(220*e).transition({opacity:"1",left:"0"},220,"easeOutCubic")})},a),n.addClass("animated-in"),i.destroy())},offset:"bottom-in-view"})})}function _e(){t('.nectar-fancy-ul:not([data-list-icon="dot"]):not([data-list-icon="none"])').each(function(){var e=t(this).attr("data-list-icon"),a=t(this).attr("data-color");t(this).find("li").each(function(){t(this).find("> i").remove(),t(this).prepend('<i class="icon-default-style '+e+" "+a+'"></i> ')})})}function Ce(){t(".nectar-flip-box").each(function(){var e=parseInt(t(this).attr("data-min-height")),a=t(this).find(".flip-box-front .inner").height();t(this).find(".flip-box-back .inner").height()>t(this).find(".flip-box-front .inner").height()&&(a=t(this).find(".flip-box-back .inner").height()),a>=e-80?t(this).find("> div").css("height",a+80):t(this).find("> div").css("height","auto"),t(this).parent().hasClass("wpb_wrapper")&&t(this).parent().css("transform","translateZ(0)")})}function xe(){t('.wpb_row .vc_col-sm-12 .nectar-slider-wrap[data-full-width="true"]').each(function(){0==t(this).parents(".wpb_row.full-width-section").length&&0==t(this).parents(".wpb_row.full-width-content").length&&t(this).parents(".wpb_row").addClass("full-width-section")}),!ht.usingMobileBrowser&&t('body[data-boxed-style="1"]').length>0&&t("#boxed").length>0&&t("#boxed").length>0&&t(".full-width-section[data-top-percent], .full-width-section[data-bottom-percent], .full-width-content[data-top-percent], .full-width-content[data-bottom-percent]").each(function(){var e=t(this).attr("data-top-percent")?t(this).attr("data-top-percent"):"skip",a=t(this).attr("data-bottom-percent")?t(this).attr("data-bottom-percent"):"skip";"skip"!=e&&t(this).css("padding-top",e),"skip"!=a&&t(this).css("padding-bottom",a)})}function ke(){if(0!=t('.carousel-wrap[data-full-width="true"], .portfolio-items[data-col-num="elastic"]:not(.fullwidth-constrained), #boxed .full-width-content').length){var e,a,n,i=ht.winW,r=t(".body-border-right").length>0&&i>1e3?2*parseInt(t(".body-border-right").width()):0,o=t(".container-wrap").length>0?parseInt(t(".container-wrap").outerWidth()):s.width(),l=t("body[data-ext-padding]").length>0?2*parseInt(t("body").attr("data-ext-padding")):180;if(1==t("#boxed").length)a=(parseInt(t(".container-wrap").width())-parseInt(t(".main-content").width()))/2+4;else{var d=t('body[data-ext-responsive="true"]').length>0&&i>=1e3?l:0;e=o-r<=parseInt(t(".main-content").css("max-width"))?parseInt(t(".main-content").css("max-width")):o-r;var c=parseInt(t(".main-content").css("max-width"));t('body.single-post[data-ext-responsive="true"]').length>0&&t(".container-wrap.no-sidebar").length>0&&(c=t(".post-area").width(),d=0),a=Math.ceil((e+d-c)/2)}t(".carousel-outer").has('.carousel-wrap[data-full-width="true"]').css("overflow","visible"),t('.carousel-wrap[data-full-width="true"], .portfolio-items[data-col-num="elastic"]:not(.fullwidth-constrained), #boxed .full-width-content').each(function(){var s=t('#header-outer[data-format="left-header"]').length>0&&i>=1e3?parseInt(t('#header-outer[data-format="left-header"]').width()):0,r=t(".body-border-right").length>0&&i>1e3?2*parseInt(t(".body-border-right").width())-2:0;if(1==t("#boxed").length)n=0==t("#nectar_fullscreen_rows").length?parseInt(t(".main-content").width()):parseInt(t(this).parents(".container").width()),t('body.single-post[data-ext-responsive="true"]').length>0&&t(".container-wrap.no-sidebar").length>0&&t(this).parents(".post-area").length>0?(c=t(".post-area").width(),d=0,e=o-r,a=Math.ceil((e+d-c)/2)):a=t(this).parents(".page-submenu").length>0?(parseInt(t(".container-wrap").width())-n)/2:(parseInt(t(".container-wrap").width())-n)/2+4;else{if(t('body.single-post[data-ext-responsive="true"]').length>0&&t(".container-wrap.no-sidebar").length>0&&t(this).parents(".post-area").length>0)c=t(".post-area").width(),d=0,e=o-r;else{var h=0==t("#nectar_fullscreen_rows").length?parseInt(t(".main-content").css("max-width")):parseInt(t(this).parents(".container").css("max-width"));o-r<=h&&(e=h),c=h,d=t('body[data-ext-responsive="true"]').length>0&&ht.winW>=1e3?l:0,s>0&&(d=t('body[data-ext-responsive="true"]').length>0&&ht.winW>=1e3?120:0)}a=Math.ceil((e+d-c)/2)}var u=0;t(this).hasClass("carousel-wrap")&&(u=1),t(this).hasClass("portfolio-items")&&(u=5);var p=1==t("#boxed").length?n+parseInt(2*a):o-r+u;if(0==t("#boxed").length&&t(this).hasClass("portfolio-items")&&t(this).is('[data-gutter*="px"]')&&t(this).attr("data-gutter").length>0&&"none"!=t(this).attr("data-gutter")&&(p=o>1e3?o-r+3:o-r),t(this).parent().hasClass("default-style"))n=0==t("#nectar_fullscreen_rows").length?parseInt(t(".main-content").width()):parseInt(t(this).parents(".container").width()),0!=t("#boxed").length?p=1==t("#boxed").length?n+parseInt(2*a):o+u:(p=1==t("#boxed").length?n+parseInt(2*a):o-r-.025*(o-r)+u,e=o-r<=n?n:o-r-.025*(o-r),a=Math.ceil((e-n)/2));else if(t(this).parent().hasClass("spaced"))if(n=0==t("#nectar_fullscreen_rows").length?parseInt(t(".main-content").width()):parseInt(t(this).parents(".container").width()),0!=t("#boxed").length)p=1==t("#boxed").length?n+parseInt(2*a)-.02*o:o+u;else{p=1==t("#boxed").length?n+parseInt(2*a):o-r-Math.ceil(.02*(o-r))+u;var f=o-r<=n?n:o-r-.02*(o-r);a=Math.ceil((f-n)/2+2)}!t(this).parents(".span_9").length>0&&!t(this).parent().hasClass("span_3")&&"sidebar-inner"!=t(this).parent().attr("id")&&!t(this).find(".nectar-carousel-flickity-fixed-content").length>0&&"portfolio-extra"!=t(this).parent().attr("id")?t(".single-product").length>0&&t(this).parents("#tab-description").length>0&&0==t(this).parents(".full-width-tabs").length?t(this).css({visibility:"visible"}):t(this).hasClass("portfolio-items")?0==t(this).parents(".full-width-content").length&&t(this).css({"margin-left":-a,left:0,width:p,visibility:"visible"}):t("#nectar_fullscreen_rows").length>0&&t(this).hasClass("wpb_row")?t(this).css({"margin-left":-a,width:p,visibility:"visible"}):0==t(this).parents(".full-width-content").length&&t(this).css({left:0,"margin-left":-a,width:p,visibility:"visible"}):"portfolio-extra"==t(this).parent().attr("id")&&0!=t("#full_width_portfolio").length?!t(this).find(".nectar-carousel-flickity-fixed-content").length>0&&t(this).css({left:0,"margin-left":-a,width:p,visibility:"visible"}):t(this).css({"margin-left":0,width:"auto",left:"0",visibility:"visible"})})}}function $e(){t(".full-width-section.wpb_row, .full-width-content.wpb_row").each(function(){var e=t(this).parent();if(!e.hasClass("span_9")&&!e.hasClass("span_3")&&"sidebar-inner"!=e.attr("id")){if(t(this).parents("#portfolio-extra").length>0&&0==t("#full_width_portfolio").length)return!1;"0"==t(this).index()&&0==g.length&&0==t(".page-header-no-bg").length&&0==t(".project-title").length&&0==t("body.single").length&&(t(this).addClass("first-section"),t(this).addClass("loaded"))}})}function Te(t){if(this.$element=t,this.$elementInner=t.find("> .vc_column-inner"),this.inView=!1,this.topLevel=!1,this.lastY=0,this.lerp=t.data("scroll-animation-lerp")?parseFloat(t.data("scroll-animation-lerp")):.28,this.intensity=t.data("scroll-animation-intensity")?Math.max(Math.min(parseFloat(t.data("scroll-animation-intensity")),8),-8):3,this.intensity=this.intensity/10,this.storedWinH=ht.winH,this.intensity<-.29&&(this.lerp=1),this.type="translateY",this.persistOnMobile=!(!t.is("[data-scroll-animation-mobile]")||"true"!=t.attr("data-scroll-animation-mobile")),this.$element.hasClass("wpb_column")||0!=this.$element.parents(".cell").length||(this.$elementInner=t),!ht.usingMobileBrowser||0!=this.persistOnMobile){this.setType(),this.calculatePos(),this.trackView(),this.animate(),0==this.$element.parents(".wpb_column.has-animation").length&&setInterval(this.calculatePos.bind(this),1e3),s.on("resize",this.calculatePos.bind(this));var a=this;e.addEventListener("orientationchange",function(){this.setTimeout(function(){a.orientationChange()},80)})}}function Ie(t,e,a,n){this.$el=t,this.$parallaxEl=this.$el.find(e),this.firstSection=!1,this.nestedParallax=!1,this.type=n,this.speed=a,this.storedWinH=ht.winH,t.parents(".nectar-sticky-tabs").length>0||t.parents(".nectar-sticky-column-css").length>0||(this.setup(),this.update())}function Ee(){for(var t=0;t<Y.length;t++)Y[t].resize();for(t=0;t<V.length;t++)V[t].resize();for(t=0;t<R.length;t++)R[t].calculatePos();for(t=0;t<P.length;t++)P[t].calculatePos()}function Oe(t){this.$el=t,this.animations={},this.offsets={},this.topLevel=!1,this.timelines={},this.devices={desktop:{min:1e3,max:1e7},tablet:{min:691,max:999},phone:{min:0,max:690}},this.needsReset=!0,this.activeDevice="desktop",this.storedWinH=ht.winH,this.setupProps(),this.lazyInit()}function ze(){V=[],t("[data-nectar-animate-settings]").each(function(){V.push(new Oe(t(this)))})}function He(t){var e;switch(t){case"slow":e=.6;break;case"medium":e=.4;break;case"medium_fast":e=.28;break;case"fast":e=.2;break;case"mid_subtle":e=.15;break;case"subtle":e=.13;break;case"very_subtle":e=.12;break;case"minimum":e=.09}return e}function Se(){if(!(ht.usingMobileBrowser&&t('body[data-remove-m-parallax="1"]').length>0)){R=[],t('.wpb_column[data-scroll-animation="true"], .nectar-el-parallax-scroll[data-scroll-animation="true"]').each(function(e){imagesLoaded(t(this),function(a){t(a.elements[0]).is('[data-scroll-animation="true"]')&&0==t("#nectar_fullscreen_rows").length&&(R[e]=new Te(t(a.elements[0])))})}),Ae();var e=0;t('.nectar-recent-posts-single_featured, [data-n-parallax-bg="true"], .wpb_row.parallax_section, #page-header-bg[data-parallax="1"] .page-header-bg-image-wrap, #page-header-bg[data-parallax="1"] .nectar-video-wrap, .parallax_slider_outer .nectar-slider-wrap').each(function(){t(this).is("[data-n-parallax-bg][data-parallax-speed]")?(Y[e]=new Ie(t(this),".parallax-layer",He(t(this).attr("data-parallax-speed")),"regular"),e++):0==t(this).find('[data-parallax-speed="fixed"]').length&&(t(this).hasClass("nectar-slider-wrap")?Y[e]=new Ie(t(this),".video-wrap, .image-bg",.25,"nectar-slider"):t(this).hasClass("page-header-bg-image-wrap")?Y[e]=new Ie(t(this),".page-header-bg-image",.25,"page-header"):t(this).hasClass("nectar-video-wrap")&&t(this).parents("#page-header-bg").length>0?Y[e]=new Ie(t(this),".nectar-video-bg",.25,"page-header"):Y[e]=new Ie(t(this),".row-bg.using-image",He(t(this).find(".row-bg").attr("data-parallax-speed")),"regular"),e++),t(this).addClass("nectar-parallax-enabled")}),t(".woocommerce-tabs .wc-tabs li").on("click",function(){setTimeout(Ae,100)})}}function Ae(){ht.usingMobileBrowser&&t('body[data-remove-m-parallax="1"]').length>0||t('.nectar-recent-posts-single_featured, [data-n-parallax-bg="true"], .wpb_row.parallax_section, #page-header-bg[data-parallax="1"] .page-header-bg-image-wrap, .parallax_slider_outer .nectar-slider-wrap .slide-bg-wrap').each(function(){var e;if(t(this).parents(".wpb_tab:not(.visible-tab)").length>0&&0==t(this).parents(".nectar-scrolling-tabs").length||t(this).parents(".wc-tab").length>0&&"block"!==t(this).parents(".wc-tab").css("display"))return!0;if(0==t(this).find(".row-bg").length&&t(this).find(".page-header-bg-image").length>0);else if(0==t(this).find(".row-bg").length&&t(this).find(".image-bg").length>0)e=!1,0==t(".wpb_row").length&&t(this).parents('.nectar-slider-wrap[data-full-width="true"]').length>0&&t(this).parents(".parallax_slider_outer").length>0&&"1"==t(this).parents(".parallax_slider_outer").index()&&(e=!0),t("#portfolio-extra").length>0&&t(this).parents(".wpb_row").length>0&&t(this).parents(".parallax_slider_outer").length>0&&"0"==t(this).parents(".wpb_row").index()&&(e=!0),t(this).parents(".top-level").length>0&&!ht.usingFrontEndEditor||e&&!ht.usingFrontEndEditor?t(this).find(".image-bg").css({height:Math.ceil(.25*t(this).parent().offset().top)+t(this).outerHeight(!0)}):t(this).find(".image-bg").css({height:Math.ceil(.25*s.height())+t(this).outerHeight(!0)});else if(0==t(this).find(".row-bg").length&&t(this).find(".video-wrap").length>0){e=!1,0==t(".wpb_row").length&&t(this).parents('.nectar-slider-wrap[data-full-width="true"]').length>0&&t(this).parents(".parallax_slider_outer").length>0&&"1"==t(this).parents(".parallax_slider_outer").index()&&(e=!0),t("#portfolio-extra").length>0&&t(this).parents(".wpb_row").length>0&&t(this).parents(".parallax_slider_outer").length>0&&"0"==t(this).parents(".wpb_row").index()&&(e=!0),t(this).parents(".top-level").length>0&&!ht.usingFrontEndEditor||e&&!ht.usingFrontEndEditor?t(this).find(".video-wrap").css({height:Math.ceil(.25*t(this).parent().offset().top)+t(this).outerHeight(!0)}):t(this).find(".video-wrap").css({height:Math.ceil(.25*ht.winH)+t(this).outerHeight(!0)});var a=t(this).find(".video-wrap video"),n=a.parent().width()/1280,i=a.parent().height()/720,r=n>i?n:i;a.width(1280*r),a.height(720*r)}else if(t(this).is(".nectar-recent-posts-single_featured")&&t(this).parents(".top-level").length>0&&!ht.usingFrontEndEditor);else if(t(this).is(".nectar-simple-slider")&&t(this).parents(".top-level").length>0&&!ht.usingFrontEndEditor);else if(t(this).is(".column-image-bg-wrap")&&t(this).parents(".top-level").length>0&&t(this).parent().parent().is(".vc_col-sm-12:not(.child_column)"));else if(!t(this).hasClass("top-level")||ht.usingFrontEndEditor||t(this).find(".parallax-layer").length>0){var o=".row-bg",l=t(this).find(".row-bg").attr("data-parallax-speed");t(this).find(".parallax-layer").length>0&&!t(this).hasClass("wpb_row")&&(o=".parallax-layer",l=t(this).attr("data-parallax-speed"));var d=t(this).find(o+'[data-parallax-speed="fast"]').length>0?60:0;t(this).find(o).css({height:Math.ceil(ht.winH*He(l))+t(this).outerHeight(!0)+d})}})}function Me(){t('.wpb_wrapper > .nectar-slider-wrap[data-full-width="true"]').each(function(){t(this).parent().hasClass("span_9")||t(this).parent().hasClass("span_3")||"sidebar-inner"==t(this).parent().attr("id")||"0"==t(this).parents(".wpb_row").index()&&t(this).addClass("first-nectar-slider")});var e=0==t("#portfolio-extra").length?t(".main-content > .row > *").length:t(".main-content > .row #portfolio-extra > *").length;e=0==t("#portfolio-extra").length?t(".main-content > .row > .wpb_row").length>0?t(".main-content > .row > .wpb_row").length:t(".main-content > .row > *").length:t(".main-content > .row #portfolio-extra > *").length,t('.container-wrap .full-width-section, .container-wrap .full-width-content:not(.page-submenu .full-width-content):not(.blog-fullwidth-wrap), .row > .nectar-slider-wrap[data-full-width="true"], .wpb_wrapper > .nectar-slider-wrap[data-full-width="true"], .portfolio-items[data-col-num="elastic"]').each(function(){if(t(this).parents(".nectar-global-section.before-footer").length>0)return!0;if(!t(this).parent().hasClass("span_9")&&!t(this).parent().hasClass("span_3")&&"sidebar-inner"!=t(this).parent().attr("id"))if(t(this).parents(".wpb_row").length>0){t(this).parent();var a=t(this).parents(".wpb_row").index();if(t(this).parents("#portfolio-extra").length>0&&0==t("#full_width_portfolio").length)return!1;"0"==a&&0!=g.length||"0"==a&&0==g.length&&0==t(".page-header-no-bg").length&&0==t(".project-title").length&&"0"==a&&0==t(".project-title").length&&0==t('body[data-bg-header="true"]').length&&(0==t(".single").length?t(".container-wrap").css("padding-top","0px"):t(this).addClass("first-section")),a==e-1&&0==t("#respond").length&&"portfolio-filters-inline"!=t(this).attr("id")&&(t(".container-wrap").css("padding-bottom","0px"),t("#call-to-action .triangle").remove())}else{if(t(this).parents("#portfolio-extra").length>0&&0==t("#full_width_portfolio").length)return!1;0==t(this).find(".portfolio-filters-inline").length&&"post-area"!=t(this).attr("id")&&("0"==t(this).index()&&0!=g.length||"0"!=t(this).index()||0!=g.length||"0"!=t(this).index()||0!=t(".page-header-no-bg").length||"0"!=t(this).index()||t(this).hasClass("blog_next_prev_buttons")||t(this).hasClass("nectar-shop-outer")||0!=t(this).parents(".pum-container").length||(1==t('body[data-header-resize="0"]').length&&0==t(".single").length||t("body.material").length>0&&0==t(".single").length?!t("body.blog .blog-fullwidth-wrap > .masonry:not(.meta-overlaid)").length>0&&t(".container-wrap").css("padding-top","0px"):t(this).addClass("first-section")),t(this).index()==e-1&&0==t("#respond").length&&0==t("body.woocommerce-checkout").length&&(t(".container-wrap").css("padding-bottom","0px"),t(".bottom_controls").css("margin-top","0px"),t("#call-to-action .triangle").remove()))}}),t('#portfolio-extra > .nectar-slider-wrap[data-full-width="true"], .portfolio-wrap').each(function(){t(this).index()==e-1&&0==t("#commentform").length&&0==t("#pagination").length&&(parseInt(t(".container-wrap").css("padding-bottom"))>0&&t(this).css("margin-bottom","-40px"),t("#call-to-action .triangle").remove())}),t(".portfolio-filters").each(function(){"0"==t(this).index()&&0!=g.length||"0"==t(this).index()?t(this).addClass("first-section nder-page-header"):("0"==t(this).index()&&0==g.length||"0"==t(this).index())&&t(this).css({"margin-top":"0px"}).addClass("first-section")}),t(".portfolio-filters-inline").each(function(){t(this).parents(".wpb_row").length>0||("0"==t(this).index()&&0!=g.length||"0"==t(this).index()?t(this).addClass("first-section nder-page-header"):("0"==t(this).index()&&0==g.length||"0"==t(this).index())&&t(this).css({"margin-top":"-30px","padding-top":"50px"}).addClass("first-section"))})}function We(){var e=t("body.vc_editor").length>0?".vc_element > ":"",a=r.is('[data-flex-cols="true"]');t(".main-content > .row > "+e+" .full-width-content, #portfolio-extra > "+e+" .full-width-content, .woocommerce-tabs #tab-description > .full-width-content, .post-area.span_12 article .content-inner > .full-width-content").each(function(){if(t(this).find("> .span_12 > "+e+" .col").length>1){var n,i=0,s=0;t(this).find("> .span_12 > "+e+" .col").each(function(){n=t(this).find("> .vc_column-inner > .wpb_wrapper").length>0?".vc_column-inner":".column-inner-wrap > .column-inner";var s=a?parseInt(t(this).find("> .vc_column-inner").css("padding-top")):parseInt(t(this).css("padding-top")),r=e.length>2&&t(this).find("> .vc_column-inner").length>0?parseInt(t(this).find("> .vc_column-inner").css("padding-top")):0,o=t(this).find("> "+n+" > .wpb_wrapper").height();o+2*s+r>i&&(i=o+2*s+r)}),t(this).find("> .span_12 > "+e+" .col").each(function(){n=t(this).find("> .vc_column-inner > .wpb_wrapper").length>0?".vc_column-inner":".column-inner-wrap > .column-inner",t(this).find("> "+n+" > .wpb_wrapper > *").length>0?e.length<2&&!t(this).parent().parent().hasClass("vc_row-o-equal-height")?(t(this).css("height",i),a&&t(this).find("> .vc_column-inner").css("height",i)):e.length>2&&!t(this).parent().parent().parent().hasClass("vc_row-o-equal-height")&&(t(this).css("height",i),a&&t(this).find("> .vc_column-inner").css("height",i)):t(this).is('[data-using-bg="true"]')&&0==t(this).parents(".vc_row-o-content-top").length&&(t(this).css("min-height",i),r.is('[data-flex-cols="true"]')&&t(this).find("> .vc_column-inner").css("min-height",i),t(this).is('[data-animation*="reveal"]')&&t(this).find(".column-inner").css("min-height",i))}),ht.winW<1e3&&t(this).find("> .span_12 > "+e+" .col .wpb_row .col").css("min-height","0px"),t(this).hasClass("vertically-align-columns")&&ht.winW>1e3&&!t(this).hasClass("vc_row-o-equal-height")&&t(this).find("> .span_12 > "+e+" .col").each(function(){n=t(this).find("> .vc_column-inner > .wpb_wrapper").length>0?".vc_column-inner":".column-inner-wrap > .column-inner",s=t(this).find("> "+n+" > .wpb_wrapper").height();var e=t(this).height()/2-s/2;e<=0&&(e=0),t(this).find("> "+n+" > .wpb_wrapper").css("margin-top",e).css("margin-bottom",e)})}}),0==t('body[data-flex-cols="true"]').length&&(t(".main-content > .row > .wpb_row:not(.full-width-content).vc_row-o-equal-height").each(function(){if(t(this).find(">.span_12 > "+e+' .wpb_column[data-animation*="reveal"]').length>0){var a=0;t(this).find("> .span_12 > "+e+" .col").each(function(){var e=parseInt(t(this).find("> .column-inner-wrap > .column-inner").css("padding-top"));t(this).find("> .column-inner-wrap > .column-inner").height()+2*e>a&&(a=t(this).find("> .column-inner-wrap > .column-inner").height()+2*e)}),t(this).find("> .span_12 > "+e+" .col").each(function(){t(this).find("> .column-inner-wrap > .column-inner .wpb_wrapper > *").length>0?t(this).find("> .column-inner-wrap").css("height",a):(t(this).css("min-height",a),t(this).is('[data-animation*="reveal"]')&&t(this).find(".column-inner").css("min-height",a))})}}),t(".wpb_row.vc_row-o-equal-height>.span_12> "+e+'.wpb_column[class*="padding-"][data-padding-pos="all"]').each(function(){0==t(this).parents(".tabbed").length&&t(this).css({"padding-top":t(this).css("padding-left"),"padding-bottom":t(this).css("padding-left")})}))}function Be(){t(".wpb_row:has(.nectar-parallax-scene)").each(function(e){var a=parseInt(t(this).find(".nectar-parallax-scene").attr("data-scene-strength"));Z[e]=t(this).find(".nectar-parallax-scene").parallax({scalarX:a,scalarY:a});var n=t(this).find(".nectar-parallax-scene li");t.each(n,function(){if(t(this).find("div").length>0){var e=t(this).find("div").css("background-image").replace(/"/g,"").replace(/url\(|\)$/gi,"");e&&""!==e&&"none"!==e&&(n=n.add(t("<img>").attr("src",e)))}})})}function Fe(){t("ul.checks li").each(function(){0==t(this).find("i.fa-check-circle").length&&t(this).prepend('<i class="fa fa-check-circle"></i>')})}function qe(){t('.nectar-cta[data-style="arrow-animation"]').addClass("loaded")}function Le(){var a=1==rt?"500%":"88%",n=1==rt?"500%":"70%",i=1==rt?"500%":"70%";t(st+".img-with-animation").each(function(e){var n=t(this),i=n.is("[data-animation]")?n.attr("data-animation"):"fade-in";("ro-reveal-from-right"==i&&"88%"==a||"ro-reveal-from-left"==i&&"88%"==a)&&(a="75%"),"slide-up"==i&&"88%"==a&&(a="99%");var s=I;t(this)[0].hasAttribute("data-animation-easing")&&(s=t(this).attr("data-animation-easing"));var r=parseInt(E);(n.parents(".row_position_absolute").length>0||n.hasClass("position_desktop_absolute"))&&(r=500);var o=new Waypoint({element:n[0],handler:function(){if(n.parents(".wpb_tab").length>0&&"hidden"==n.parents(".wpb_tab").css("visibility")||n.hasClass("animated-in"))o.destroy();else{if(!z||t('body[data-responsive="0"]').length>0){var e=n.is("[data-delay]")?n.attr("data-delay"):0,a=n.parents(".hover-wrap").length>0?n.parents(".hover-wrap"):n,l=E;n.parents(".nectar-disable-mobile-animation").length>0&&ht.winW<1e3&&(l=0,r=0,e=0),"fade-in-from-left"==i||"fade-in-from-right"==i?a.delay(e).transition({opacity:1,x:"0px"},l,s):"fade-in-from-bottom"==i?J.push(anime({targets:a[0],translateY:[100,0],translateZ:0,opacity:{value:[0,1],duration:r},delay:e,easing:s,duration:l})):"slide-up"==i?J.push(anime({targets:a[0],translateY:[150,0],translateZ:0,delay:e,easing:s,duration:l})):"fade-in"==i?a.delay(e).transition({opacity:1},l,s):"grow-in"==i?setTimeout(function(){a.transition({scale:1,opacity:1},l,s)},e):"flip-in"==i?setTimeout(function(){a.transition({rotateY:0,opacity:1},l,s)},e):"flip-in-vertical"==i?setTimeout(function(){a.transition({rotateX:0,opacity:1},l,s)},e):"ro-reveal-from-left"!=i&&"ro-reveal-from-right"!=i&&"ro-reveal-from-bottom"!=i&&"ro-reveal-from-top"!=i||n.parents(".img-with-aniamtion-wrap").addClass("animated-in"),"none"!=i&&n.addClass("animated-in")}o.destroy()}},offset:a})}),t(st+".nectar_cascading_images").each(function(){var e=t(this),a=t(this).is("[data-animation-timing]")?t(this).attr("data-animation-timing"):175;a=parseInt(a);var i=new Waypoint({element:e[0],handler:function(){e.parents(".wpb_tab").length>0&&"hidden"==e.parents(".wpb_tab").css("visibility")||e.hasClass("animated-in")?i.destroy():((!z||t('body[data-responsive="0"]').length>0)&&(e.find(".cascading-image").each(function(e){var n=t(this);"flip-in"==n.attr("data-animation")||"flip-in-vertical"==n.attr("data-animation")?setTimeout(function(){n.find(".inner-wrap").css({opacity:1,transform:"rotate(0deg) translateZ(0px)"})},e*a):"grow-in-reveal"==n.attr("data-animation")?setTimeout(function(){n.find(".inner-wrap").css({opacity:1,transform:"translateX(0px) translateY(0px) scale(1,1) translateZ(0px)"}),n.find(".inner-wrap img").css({transform:"translateX(0px) translateY(0px) scale(1,1) translateZ(0px)"})},e*a):setTimeout(function(){n.find(".inner-wrap").css({opacity:1,transform:"translateX(0px) translateY(0px) scale(1,1) translateZ(0px)"})},e*a)}),e.addClass("animated-in")),i.destroy())},offset:n})}),t(st+'.col.has-animation:not([data-animation*="reveal"]), '+st+'.wpb_column.has-animation:not([data-animation*="reveal"]), '+st+".nectar-fancy-box.has-animation").each(function(n){var i=t(this),s=a;t(this)[0].hasAttribute("data-animation-offset")&&(s=parseInt(t(this).attr("data-animation-offset"))+"%");var r=I;t(this)[0].hasAttribute("data-animation-easing")&&(r=t(this).attr("data-animation-easing"));var o=parseInt(E);i.parents(".row_position_absolute").length>0&&(o=500);var l=new Waypoint({element:i[0],handler:function(){if(i.parents(".wpb_tab").length>0&&"hidden"==i.parents(".wpb_tab").css("visibility")||i.hasClass("animated-in"))l.destroy();else{if(!z||t('body[data-responsive="0"]').length>0){i.addClass("triggered-animation"),t(e).trigger("nectar-column-animation-start");var a=i.attr("data-delay"),s=E;if(i.hasClass("mobile-disable-entrance-animation")&&ht.winW<1e3&&(s=0,o=0,a=0),"fade-in-from-left"==i.attr("data-animation")||"fade-in-from-right"==i.attr("data-animation"))U[n]=setTimeout(function(){i.transition({opacity:1,x:"0px"},s,r)},a);else if("fade-in-from-bottom"==i.attr("data-animation")||"slight-fade-in-from-bottom"==i.attr("data-animation")){var d="fade-in-from-bottom"==i.attr("data-animation")?100:50;J.push(anime({targets:i[0],translateY:[d,0],translateZ:0,opacity:{value:[0,1],duration:o},delay:a,easing:r,duration:s}))}else"fade-in"==i.attr("data-animation")?U[n]=setTimeout(function(){i.transition({opacity:1},s,r)},a):"grow-in"==i.attr("data-animation")||"zoom-out"==i.attr("data-animation")?U[n]=setTimeout(function(){i.transition({scale:1,opacity:1},s,r)},a):"flip-in"==i.attr("data-animation")?U[n]=setTimeout(function(){i.transition({rotateY:"0",opacity:1},s,r)},a):"flip-in-vertical"==i.attr("data-animation")?U[n]=setTimeout(function(){i.transition({rotateX:"0",y:"0",opacity:1},s,r)},a):"slight-twist"==i.attr("data-animation")&&(U[n]=setTimeout(function(){J.push(anime({targets:i[0],rotateY:[20,0],rotateZ:[-4,0],opacity:1,easing:r,duration:s}))},a));i.hasClass("boxed")&&(i.addClass("no-pointer-events"),setTimeout(function(){i.removeClass("no-pointer-events")},parseInt(E)+parseInt(a)+30)),i.find('.nectar-post-grid-wrap[data-style="mouse_follow_image"]')&&setTimeout(function(){i[0].style.transform="none"},parseInt(E)+parseInt(a)+30),i.addClass("animated-in")}l.destroy()}},offset:s})}),t(st+'.wpb_column.has-animation[data-animation*="reveal"]').each(function(){var e=I;t(this)[0].hasAttribute("data-animation-easing")&&(e=t(this).attr("data-animation-easing"));var a=t(this).is('[data-animation="mask-reveal"]')?"88%":i;t(this)[0].hasAttribute("data-animation-offset")&&(a=parseInt(t(this).attr("data-animation-offset"))+"%");var n=t(this),s=new Waypoint({element:n[0],handler:function(){if(n.parents(".wpb_tab").length>0&&"hidden"==n.parents(".wpb_tab").css("visibility")||n.hasClass("animated-in"))s.destroy();else{var a=n.attr("data-delay");if(!z||t('body[data-responsive="0"]').length>0){var i=n.find("> .vc_column-inner").length>0;"reveal-from-bottom"==n.attr("data-animation")||"reveal-from-top"==n.attr("data-animation")?setTimeout(function(){1==i?n.find("> .vc_column-inner").transition({y:0},E,e):n.find(".column-inner-wrap, .column-inner").transition({y:0},E,e,function(){n.find(".column-inner-wrap, .column-inner").addClass("no-transform")}),n.addClass("animated-in")},a):"reveal-from-right"!=n.attr("data-animation")&&"reveal-from-left"!=n.attr("data-animation")||setTimeout(function(){1==i?n.find("> .vc_column-inner").transition({x:0},E,e):n.find(".column-inner-wrap, .column-inner").transition({x:0},E,e,function(){n.find(".column-inner-wrap, .column-inner").addClass("no-transform")}),n.addClass("animated-in")},a),setTimeout(function(){n.addClass("animated-in")},a)}s.destroy()}},offset:a})})}function je(){t(".nectar_cascading_images").each(function(){var e=!!t(this).hasClass("forced-aspect");t(this).parents(".vc_row-o-equal-height").length>0&&t(this).parents(".wpb_column").length>0&&t(this).css("max-width",t(this).parents(".wpb_column").width()),t(this).find(".bg-color").each(function(){if(1==e&&0==t(this).parents(".cascading-image").index())return!0;var a=0,n=0;if(0==t(this).parent().find(".img-wrap").length){var i=t(this).parents(".cascading-image").siblings('.cascading-image[data-has-img="true"]').first();a=i.find(".img-wrap").height(),n=i.find(".img-wrap").width()}else a=t(this).parent().find(".img-wrap").height(),n=t(this).parent().find(".img-wrap").width();t(this).css({height:a,width:n}).addClass("calculated")})})}function Ye(e,a){switch(this.$element=e,this.inView=!1,this.topLevel=!1,this.lastY=0,this.layer1Parallax=!!this.$element.is('[data-layer-1-parallax="yes"]'),a){case"subtle":this.intensity=.09;break;case"medium":this.intensity=.15;break;case"high":this.intensity=.25}this.calculatePos(),this.trackView(),this.animate(),(t(".portfolio-filters").length>0||t(".portfolio-filters-inline").length>0)&&setInterval(this.calculatePos.bind(this),700),s.on("resize",this.calculatePos.bind(this))}function Pe(){t(st+".nectar-split-heading").each(function(e){var a=1==rt?"500%":"bottom-in-view";t(this)[0].hasAttribute("data-animation-offset")&&1!=rt&&t(this).attr("data-animation-offset").length>0&&(a=parseInt(t(this).attr("data-animation-offset"))+"%");var n=t(this),i=n.is("[data-animation-delay]")?parseInt(n.attr("data-animation-delay")):0,s=new Waypoint({element:n[0],handler:function(){if(n.parents(".wpb_tab").length>0&&"hidden"==n.parents(".wpb_tab").css("visibility")||n.hasClass("animated-in"))s.destroy();else{var e;if(!z||t('body[data-responsive="0"]').length>0)setTimeout(function(){if(n.is('[data-animation-type="line-reveal-by-space"]:not([data-text-effect*="letter-reveal"])')){var a=0;n.is('[data-stagger="true"]')&&(a=500/n.find("> * > span").length,a=Math.min(Math.max(a,15),50)),e=parseInt(E)<1100?E:"1100",n.is('[data-m-rm-animation="true"]')&&ht.winW<1e3?n.find("> * > span .inner").css({transform:"translateY(0)",opacity:"1"}):n.find("> * > span").each(function(n){if(0==a)t(this).find("> .inner").delay(n*a).transition({y:"0px",opacity:"1"},e,I);else{var i=t(this).find("> .inner");setTimeout(function(){i[0].style.transform="translateY(0em)",i[0].style.opacity="1"},n*a)}})}else if(n.is('[data-animation-type="line-reveal-by-space"][data-text-effect*="letter-reveal"]')){e=parseInt(E)<1e3?E:"1000";a=0;var i=n.find("> * > span span"),s=n.is('[data-text-effect="letter-reveal-top"]')?["-1.3em","0em"]:["1.3em","0em"];a=400/i.length,a=Math.min(Math.max(a,20),50),i.length>0&&J.push(anime({targets:n.find("> * > span span").toArray(),translateY:s,delay:anime.stagger(a),duration:1200,easing:"cubicBezier(0.25,1,0.5,1)"}))}else n.find(".heading-line").each(function(e){t(this).find("> div").delay(70*e).transition({y:"0px"},E,I)});n.addClass("animated-in")},i);s.destroy()}},offset:a})})}function Re(){var e=1==rt?"500%":"bottom-in-view",a=t('#nectar_fullscreen_rows[data-mobile-disable="on"]').length>0&&ht.usingMobileBrowser?".nectar-progress-bar":st+".nectar-progress-bar";ht.usingMobileBrowser&&"bottom-in-view"==e&&(e="70%"),t(a).each(function(){var a=t(this),n=new Waypoint({element:a[0],handler:function(){if(a.parents(".wpb_tab").length>0&&"hidden"==a.parents(".wpb_tab").css("visibility")||a.hasClass("completed"))n.destroy();else{"100%"==e&&a.find(".bar-wrap").css("opacity","1");var t=a.find("span").attr("data-width"),i=parseInt(a.find("span strong i").text());a.find("span").transition({width:parseInt(t)+"%"},800,"easeInOutCubic");var s=a.find("span strong i")[0];new Kt(s,0,i,0,1,{useEasing:!1}).start(),a.find("span strong").transition({opacity:1},550,"easeInCirc"),"100"==t&&a.find("span strong").addClass("full"),a.addClass("completed"),n.destroy()}},offset:e})})}function Ve(){var e=1==rt?"500%":"75%";t(st+'.wpb_column[data-border-animation="true"]').each(function(){var a=t(this),n=new Waypoint({element:a[0],handler:function(){if(a.parents(".wpb_tab").length>0&&"hidden"==a.parents(".wpb_tab").css("visibility")||a.hasClass("completed"))n.destroy();else{var t=a.attr("data-border-animation-delay").length>0?parseInt(a.attr("data-border-animation-delay")):0;setTimeout(function(){a.find(".border-wrap").addClass("animation"),a.find(".border-wrap").addClass("completed")},t),n.destroy()}},offset:e})})}function Xe(){t(st+".nectar-waypoint-el").each(function(){var e=!!t(this).is("[data-nectar-waypoint-el-stagger]")&&t(this).attr("data-nectar-waypoint-el-stagger"),a=t(this).is("[data-nectar-waypoint-el-delay]")?parseInt(t(this).attr("data-nectar-waypoint-el-delay")):0,n=t(this).is("[data-nectar-waypoint-el-offset]")?parseInt(t(this).attr("data-nectar-waypoint-el-offset"))+"%":"90%";1==rt&&(n="500%");var i=t(this),s=new Waypoint({element:i[0],handler:function(){i.parents(".wpb_tab").length>0&&"hidden"==i.parents(".wpb_tab").css("visibility")||i.hasClass("completed")?s.destroy():(setTimeout(function(){e?i.find("."+e).each(function(e){var a=t(this);setTimeout(function(){a.addClass("animated-in")},100*e)}):i.addClass("animated-in")},a),s.destroy())},offset:n})})}function Ne(){var e=1==rt?"500%":"80%";t(st+".nectar_food_menu_item").parent().each(function(){var a=t(this),n=new Waypoint({element:a[0],handler:function(){a.parents(".wpb_tab").length>0&&"hidden"==a.parents(".wpb_tab").css("visibility")||a.hasClass("completed")?n.destroy():(a.find(".nectar_food_menu_item").each(function(e){var a=t(this);setTimeout(function(){a.addClass("animated-in")},150*e)}),n.destroy())},offset:e})})}function De(){var e=1==rt?"500%":"bottom-in-view";t(st+'.divider-small-border[data-animate="yes"], '+st+'.divider-border[data-animate="yes"]').each(function(){var a=t(this).hasClass("divider-small-border")?1300:1500,n=t(this),i=new Waypoint({element:n[0],handler:function(){n.parents(".wpb_tab").length>0&&"hidden"==n.parents(".wpb_tab").css("visibility")||n.hasClass("completed")?i.destroy():(n.each(function(){t(this).css({transform:"scale(0,1)",visibility:"visible"});var e=t(this);e.delay(e.attr("data-animation-delay")).transition({transform:"scale(1, 1)"},a,"cubic-bezier(.18,0.75,.25,1)")}),n.addClass("completed"),i.destroy())},offset:e})})}function Qe(){t(".nectar_image_with_hotspots").each(function(){t(this).find(".nectar_hotspot_wrap").each(function(){if(ht.winW>690){t(this).parents('.nectar_image_with_hotspots[data-tooltip-func="hover"]').length>0&&(t(this).find(".nectar_hotspot").removeClass("click"),t(this).find(".nttip").removeClass("open")),t(this).find(".nttip .inner a.tipclose").remove(),t(".nttip").css("height","auto"),t(this).css({width:"auto",height:"auto"}),t(this).find(".nttip").removeClass("force-right").removeClass("force-left").removeClass("force-top").css("width","auto");var e=t(this).find(".nttip").offset();e.left>t(this).parents(".nectar_image_with_hotspots").width()-200?t(this).find(".nttip").css("width","250px"):t(this).find(".nttip").css("width","auto"),e.left<0?t(this).find(".nttip").addClass("force-right"):e.left+t(this).find(".nttip").outerWidth(!0)>ht.winW?t(this).find(".nttip").addClass("force-left").css("width","250px"):e.top+t(this).find(".nttip").height()+35>s.height()&&t("#nectar_fullscreen_rows").length>0&&t(this).find(".nttip").addClass("force-top"),0==t(this).find("> .open").length&&t(this).css({width:"30px",height:"30px"})}else t(this).find(".nttip").removeClass("force-left").removeClass("force-right").removeClass("force-top"),t(this).find(".nectar_hotspot").addClass("click"),0==t(this).find(".nttip a.tipclose").length&&t(this).find(".nttip .inner").append('<a href="#" class="tipclose"><span></span></a>'),t(".nttip").css("height",s.height())})})}function Ze(){0!=t(".nectar_image_with_hotspots").length&&(!function(){t('.nectar_image_with_hotspots[data-hotspot-icon="numerical"]').each(function(){t(this).find(".nectar_hotspot_wrap").each(function(e){var a=t(this);setTimeout(function(){a.find(".nectar_hotspot").addClass("pulse")},300*e)})});var e=[];t('.nectar_image_with_hotspots:not([data-tooltip-func="click"]) .nectar_hotspot').each(function(a){e[a]="",t(this).on("mouseover",function(){clearTimeout(e[a]),t(this).parent().css({"z-index":"400",height:"auto",width:"auto"})}),t(this).on("mouseleave",function(){var n=t(this);n.parent().css({"z-index":"auto"}),e[a]=setTimeout(function(){n.parent().css({height:"30px",width:"30px"})},300)})})}(),r.on("click",".nectar_hotspot.click",function(){if(t(this).parents(".nectar_image_with_hotspots").find(".nttip").removeClass("open"),t(this).parent().find(".nttip").addClass("open"),t(this).parents(".nectar_image_with_hotspots").find(".nectar_hotspot").removeClass("open"),t(this).parent().find(".nectar_hotspot").addClass("open"),ht.winW>690){t(this).parent().css({"z-index":"120",height:"auto",width:"auto"});var e=t(this);setTimeout(function(){e.parents(".nectar_image_with_hotspots").find(".nectar_hotspot_wrap").each(function(){0==t(this).find("> .open").length&&t(this).css({height:"30px",width:"30px","z-index":"auto"})})},300)}return ht.winW<=690&&(t("body.nectar_box_roll").length>0&&t(".container-wrap").addClass("hotspot-open"),t(this).parents('.wpb_row, [class*="vc_col-"]').css("z-index","200")),!1}),r.on("click",".nectar_hotspot.open",function(){return t(this).parent().find(".nttip").removeClass("open"),t(this).parent().find(".nectar_hotspot").removeClass("open"),t(this).parents(".wpb_row").css("z-index","auto"),!1}),r.on("click",".nttip.open",function(e){if(ht.winW<690){if(e.target&&t(e.target).is("a"))return;return t("body.nectar_box_roll").length>0&&t(".container-wrap").removeClass("hotspot-open"),t(this).parents(".nectar_image_with_hotspots").find(".nttip").removeClass("open"),t(this).parents(".nectar_image_with_hotspots").find(".nectar_hotspot").removeClass("open"),t(this).parents(".wpb_row").css("z-index","auto"),!1}}),Qe(),s.on("resize",Qe))}function Ge(){var e=1==rt?"500%":"50%";t(st+'.nectar_image_with_hotspots[data-animation="true"]').each(function(){var a=t(this),n=new Waypoint({element:a[0],handler:function(){a.parents(".wpb_tab").length>0&&"hidden"==a.parents(".wpb_tab").css("visibility")||a.hasClass("completed")?n.destroy():(a.addClass("completed"),a.find(".nectar_hotspot_wrap").each(function(e){var a=t(this),n=a.parents(".col.has-animation").length>0?1:0;setTimeout(function(){a.addClass("animated-in")},175*(e+n))}),n.destroy())},offset:e})})}function Ue(){[].slice.call(a.querySelectorAll("[data-nectar-img-src]")).forEach(function(t){var e=t.getAttribute("data-nectar-img-src");e&&Je(t,e,lt)})}function Je(a,n,i){if(a.classList.contains("nectar-lazy")){a.addEventListener("load",function(){a.classList.contains("keep-calculated-size")||(a.style.height="",a.style.width=""),a.classList.add("loaded"),a.removeAttribute("data-nectar-img-src"),"undefined"!=typeof SalientPortfolio&&a.classList.contains("image-gallery-portfolio-item")&&t(e).trigger("salient-portfolio-recalculate"),ht.usingMobileBrowser||Waypoint.refreshAll(),i.unobserve(a)}),a.src=n;var s=a.getAttribute("data-nectar-img-srcset");s&&(a.setAttribute("srcset",s),a.removeAttribute("data-nectar-img-srcset")),a.parentNode.classList.add("img-loaded")}else a.style.backgroundImage="url('"+n+"')",a.classList.add("loaded"),a.removeAttribute("data-nectar-img-src"),i.unobserve(a)}function Ke(){var t=[].slice.call(a.querySelectorAll("[data-nectar-img-src]")),n=[].slice.call(a.querySelectorAll(".nectar-lazy-video"));if("IntersectionObserver"in e){s.off("resize.nectarLazySizing",ta),s.on("resize.nectarLazySizing",ta),lt=new IntersectionObserver(function(t){t.forEach(function(t){if(t.isIntersecting){var e=t.target,a=e.getAttribute("data-nectar-img-src");a&&Je(e,a,lt)}})},{rootMargin:"450px"}),t.forEach(function(t){lt.observe(t)});var i=new IntersectionObserver(function(t,e){t.forEach(function(t){if(t.isIntersecting){for(var e in t.target.children){var a=t.target.children[e];"string"==typeof a.tagName&&"SOURCE"===a.tagName&&(a.src=a.dataset.nectarVideoSrc)}t.target.load(),t.target.classList.remove("lazy"),t.target.classList.add("loaded"),i.unobserve(t.target)}})},{root:a,rootMargin:"125px"});n.forEach(function(t){i.observe(t)})}else t.forEach(function(t){if(t.classList.contains("nectar-lazy")){t.classList.contains("keep-calculated-size")||(t.style.height="",t.style.width=""),t.src=t.getAttribute("data-nectar-img-src");var e=t.getAttribute("data-nectar-img-srcset");e&&(t.setAttribute("srcset",e),t.removeAttribute("data-nectar-img-srcset")),t.parentNode.classList.add("img-loaded"),t.classList.add("loaded"),t.removeAttribute("data-nectar-img-src")}else t.style.backgroundImage="url('"+t.getAttribute("data-nectar-img-src")+"')",t.classList.add("loaded"),t.removeAttribute("data-nectar-img-src")})}function ta(){t("img.nectar-lazy:not(.loaded):not(.image-gallery-portfolio-item)").each(function(){if(t(this).hasClass("attachment-shop_thumbnail")||t(this).hasClass("attachment-woocommerce_thumbnail"))return!0;t(this).css({height:"",width:""});var e=parseInt(t(this).attr("height")),a=parseInt(t(this).attr("width")),n=t(this).parents(".nectar_cascading_images").length>0?t(this).parents(".bg-layer").width():t(this).width();t(this).parents(".img-with-aniamtion-wrap.custom-size").length>0&&n>a&&(n=a),t(this).parents('.img-with-aniamtion-wrap[data-shadow*="depth"]').length>0&&(n=t(this).parents(".img-with-aniamtion-wrap").width()),t(this).parents(".nectar-post-grid-item-bg-wrap-inner").length>0&&!t(this).hasClass("nectar-post-grid-item__overlaid-img")&&(n=t(this).parents(".nectar-post-grid-item-bg-wrap-inner").width());var i=jt(a,e,n,2e3);t(this).css({height:i.height+"px",width:i.width+"px"})})}function ea(){F=[],j=[],ht.usingMobileBrowser||(t('.nectar-post-grid[data-indicator="yes"]').each(function(e){F[e]=new bt(t(this),"view-indicator")}),t('.nectar-post-grid-wrap[data-style="mouse_follow_image"] .nectar-post-grid').each(function(e){j[e]=new bt(t(this),"post-grid-images")}),t('.nectar-category-grid[data-style="mouse_follow_image"]').each(function(e){j[e]=new bt(t(this),"post-grid-images")}))}function aa(){et=[],ea(),t(".nectar-post-grid-wrap").each(function(e){et[e]=new na(t(this))})}function na(t){this.el=t,this.currentPage=0,this.activeFilter=1,this.activeCatTotal=0,this.settingsData=JSON.parse(this.el.attr("data-el-settings")),this.queryData=JSON.parse(this.el.attr("data-query")),this.sortable=this.el.find(".nectar-post-grid-filters").attr("data-sortable"),this.gridStyle=this.el.attr("data-style"),this.initialMarkup(),this.clickEvents(),this.deepLinking(),this.lightboxGroups(),this.externalProjectLinks()}function ia(){var e=1==rt?"200%":"75%";t(st+".nectar-post-grid-wrap").each(function(){var a=t(this),n=new Waypoint({element:a[0],handler:function(){a.parents(".wpb_tab").length>0&&"hidden"==a.parents(".wpb_tab").css("visibility")||a.hasClass("completed")?n.destroy():(a.find(".nectar-post-grid-filters").addClass("animated-in"),a.find(".nectar-post-grid-item").each(function(e){var a=t(this);setTimeout(function(){a.addClass("animated-in")},90*e)}),setTimeout(function(){a.addClass("finished-animating")},950),n.destroy())},offset:e})})}function sa(){var e=1==rt?"500%":"bottom-in-view";t(st+".nectar-animated-title").each(function(){var a=t(this),n=new Waypoint({element:a[0],handler:function(){a.parents(".wpb_tab").length>0&&"hidden"==a.parents(".wpb_tab").css("visibility")||a.hasClass("completed")?n.destroy():(a.addClass("completed"),n.destroy())},offset:e})})}function ra(){var e=1==rt?"500%":"bottom-in-view";ht.usingMobileBrowser&&"bottom-in-view"==e&&(e="85%"),t(st+".nectar-highlighted-text").each(function(a){var n=0;if(t(this).find("i").each(function(){t(this).replaceWith(function(){return t("<em />").append(t(this).html())})}),t(this).is("[data-id]")){var i=t(this);t(this).find("em").each(function(e){e>0?t(this).attr("id",i.attr("data-id")+"-"+e):t(this).attr("id",i.attr("data-id"))})}if(t(this).is("[data-animation-delay]")&&t(this).attr("data-animation-delay").length>0&&"false"!=t(this).attr("data-animation")&&(n=t(this).attr("data-animation-delay")),t(this).find("em:has(a)").addClass("has-link"),z&&t(this).find("em").addClass("animated"),t(this).is('[data-style="none"]'))return!0;i=t(this);var s=new Waypoint({element:i[0],handler:function(){i.parents(".wpb_tab").length>0&&"hidden"==i.parents(".wpb_tab").css("visibility")||i.hasClass("animated")?s.destroy():(setTimeout(function(){i.find("em").each(function(e){var a=t(this);setTimeout(function(){a.addClass("animated")},300*e)})},n),s.destroy())},offset:e})})}function oa(){var e=1==rt?"500%":"75%";t(st+'.nectar-woo-flickity[data-animation*="fade-in"]').each(function(){var a=t(this),n=new Waypoint({element:a[0],handler:function(){a.parents(".wpb_tab").length>0&&"hidden"==a.parents(".wpb_tab").css("visibility")||a.hasClass("animated-in")?n.destroy():(a.addClass("animated-in"),a.find(".flickity-cell").each(function(e){var a=t(this);setTimeout(function(){a.find("> .product").css({transform:"translate3d(0,0,0)",opacity:"1"})},100*e)}),n.destroy())},offset:e})})}function la(){var e;t('.pricing-table[data-style="default"]').each(function(){e=0,t(this).find("> div ul").each(function(){t(this).height()>e&&(e=t(this).height())}),0==e&&(e="auto"),t(this).find("> div ul").css("height",e)})}function da(){Q=[],"undefined"!=typeof NectarTestimonialSlider?t(".testimonial_slider").each(function(e){var a=t(this),n=t(this).is("[data-style]")?t(this).attr("data-style"):"none";Q[e]=new NectarTestimonialSlider(a,n,wa,We),t(this).is('.disable-height-animation:not([data-style*="multiple_visible"])')&&(Q[e].testimonialSliderHeight(),setTimeout(Q[e].testimonialSliderHeight.bind(Q[e]),700)),t(this).is('.testimonial_slider[data-style="multiple_visible_minimal"]')&&Q[e].testimonialSliderHeightMinimalMult()}):Rt("#nectar-testimonial-sliders-js",0,da)}function ca(){s.off("smartresize.nectarTestimonials"),s.off("resize.nectarTestimonialsMin"),Q.length>0&&s.on("smartresize.nectarTestimonials",ha),t('.testimonial_slider[data-style="multiple_visible_minimal"]').length>0&&s.on("resize.nectarTestimonialsMin",ua)}function ha(){for(var t=0;t<Q.length;t++)Q[t].testimonialSliderHeight(),Q[t].testimonialHeightResize()}function ua(){for(var t=0;t<Q.length;t++)Q[t].testimonialSliderHeightMinimalMult()}function pa(e){return e.parents('.wpb_column[data-bg-color*="#"]').length>0&&e.parents('.wpb_column[data-bg-opacity="1"]').length>0?e.parents(".wpb_column").attr("data-bg-color"):e.parents(".wpb_row").length>0&&e.parents(".wpb_row").find(".row-bg.using-bg-color").length>0||e.parents(".wpb_row").length>0&&e.parents(".wpb_row").find(".row-bg.using-bg-color-excluded").length>0?e.parents(".wpb_row").find(".row-bg").css("background-color"):t("#nectar_fullscreen_rows").length>0?t("#nectar_fullscreen_rows > .wpb_row .full-page-inner-wrap").css("background-color"):t(".container-wrap").css("background-color")}function fa(){var e="";t('.nectar-icon-list[data-icon-style="border"], .nectar_icon_wrap[data-style="border-animation"][data-color*="extra-color-gradient-"]').each(function(a){var n=pa(t(this));t(this).hasClass("nectar-icon-list")?t(this).find(".list-icon-holder").css("background-color",n):(t(this).removeClass(function(t,e){return(e.match(/(^|\s)instance-\S+/g)||[]).join(" ")}),t(this).addClass("instance-"+a),e+=".nectar_icon_wrap.instance-"+a+" .nectar_icon:before { background-color: "+n+"!important; }")}),t('body.material .nectar-button.see-through[class*="m-extra-color-gradient"]').each(function(a){var n=pa(t(this));t(this).removeClass(function(t,e){return(e.match(/(^|\s)instance-\S+/g)||[]).join(" ")}),t(this).addClass("instance-"+a),e+=".nectar-button.see-through.instance-"+a+":after { background-color: "+n+"!important; }"}),ee(e,"nectaricon-color-match")}function ga(){t(".col.span_3, .vc_span3, .vc_col-sm-3").each(function(){if(!t(this).is('[data-t-w-inherits="small_desktop"]')){var e=t(this),a=t(this).next("div");(a.hasClass("span_3")&&!e.hasClass("one-fourths")||a.hasClass("vc_span3")&&!e.hasClass("one-fourths")||a.hasClass("vc_col-sm-3")&&!e.hasClass("one-fourths"))&&(e.addClass("one-fourths clear-both"),a.addClass("one-fourths right-edge"))}}),t(".span_12 .col.span_6").each(function(){t(this).next("div").hasClass("span_6")&&0==t.trim(t(this).next("div").html()).length&&t(this).addClass("empty-second")})}function ma(){t("iframe").each(function(){if(void 0!==t(this).attr("src")&&!t(this).hasClass("skip-nectar-video-size")&&!t(this).hasClass("iframe-embed")&&0==t(this).parents(".ult_modal").length&&0==t(this).parents(".ls-slide").length&&0==t(this).parents(".woo-variation-product-gallery").length&&0==t(this).parents(".esg-entry-media").length&&0==t(this).parents(".wpb_video_widget.wpb_content_element").length){if(t(this).parents(".woocommerce-product-gallery").length>0&&(!t(this).is('[width="100%"]')||!t(this).is('[height="100%"]')))return!0;var e=t(this).attr("src").toLowerCase();(e.indexOf("youtube")>=0||e.indexOf("vimeo")>=0||e.indexOf("twitch.tv")>=0||e.indexOf("kickstarter")>=0||e.indexOf("embed-ssl.ted")>=0||e.indexOf("dailymotion")>=0)&&(t(this).addClass("iframe-embed"),t(this).width()<t(this).parent().width()?t(this).attr("data-aspectRatio",t(this).height()/t(this).width()).removeAttr("height").removeAttr("width"):t(this).attr("data-aspectRatio","0.56").removeAttr("height").removeAttr("width"),t(this).parents(".post-area.masonry.classic").length>0&&t(this).attr("data-aspectRatio","0.56").removeAttr("height").removeAttr("width"))}})}function va(){t("iframe[data-aspectRatio]").each(function(){var e=t(this),a=e.parent().width();t(this).parents(".swiper-slide").length>0?t(this).is(":visible")&&e.width(a).height(a*e.attr("data-aspectRatio")):e.width(a).height(a*e.attr("data-aspectRatio"))})}function ba(){t(".video-wrap iframe").unwrap(),t("#sidebar iframe[src]").unwrap(),t("audio").attr("width","100%").attr("height","100%").css("visibility","visible"),t("video").css("visibility","visible"),t(".wp-video").each(function(){t(this).find("video").get(0).addEventListener("loadeddata",function(){s.trigger("resize")},!1)}),t(".main-content iframe[src]").each(function(){t(this).css({opacity:"1",visibility:"visible"})})}function wa(){var e=1200;t(".nectar-video-wrap").each(function(){var a,n;if(0!=t(this).find("video").length){if(t(this).parents("#page-header-bg").length>0){if(t(".container-wrap.auto-height").length>0)return!1;a=t(this).parents("#page-header-bg").outerHeight(),n=t(this).parents("#page-header-bg").outerWidth()}else if(t(this).hasClass("column-video"))if(r.is('[data-flex-cols="true"]')){var i=t(this).parents(".vc_column-inner");a=i.outerHeight(),n=i.outerWidth()}else a=t(this).parents(".wpb_column").outerHeight(),n=t(this).parents(".wpb_column").outerWidth();else{var s=t(this).parents(".wpb_row");a=s.outerHeight(),n=t(this).parents(".full-width-section").length>0?ht.winW:s.outerWidth()}t(this).width(n),t(this).parents("#page-header-bg").length>0&&t(this).height(a);var o=n/1280,l=(a-a)/720,d=o>l?o:l;1280*d<(e=1280/720*(a+40))&&(d=e/1280),t(this).find("video, .mejs-overlay, .mejs-poster").width(Math.ceil(1280*d+0)),t(this).find("video, .mejs-overlay, .mejs-poster").height(Math.ceil(720*d+0)),t(this).scrollLeft((t(this).find("video").width()-n)/2),t(this).scrollTop((t(this).find("video").height()-a)/2),t(this).find(".mejs-overlay, .mejs-poster").scrollTop((t(this).find("video").height()-a)/2),"center bottom"==t(this).attr("data-bg-alignment")||"bottom"==t(this).attr("data-bg-alignment")?t(this).scrollTop(t(this).find("video").height()-(a+6)):"center top"!=t(this).attr("data-bg-alignment")&&"top"!=t(this).attr("data-bg-alignment")||t(this).scrollTop(0),t(this).addClass("position-loaded")}})}function ya(){function a(t){var e,a,n,i,s=t.innerWidth(),r=t.innerHeight();16/9>s/r?(e=r*(16/9),a=r,n=-Math.round((e-s)/2)+"px",i=-Math.round((a-r)/2)+"px",e+="px",a+="px"):(e=s,a=s*(9/16),i=-Math.round((a-r)/2)+"px",n=-Math.round((e-s)/2)+"px",e+="px",a+="px"),t.find(".vc_video-bg iframe").css({maxWidth:"1000%",marginLeft:n,marginTop:i,width:e,height:a})}0==t(".nectar-video-wrap").length&&0==t(".nectar-youtube-bg").length||(setTimeout(function(){wa(),s.on("resize",wa),e.addEventListener("orientationchange",function(){this.setTimeout(function(){wa()},100)}),t(".video-color-overlay").each(function(){t(this).css("background-color",t(this).attr("data-color"))}),t(".nectar-video-wrap").each(function(){if(0!=t(this).find("video").length){var e=t(this).parents("#page-header-bg").length>0,a=t(this);if(0===t(this).find("video.nectar-lazy-video").length)var n=setInterval(function(){a.find("video").get(0).readyState>3&&(ht.usingMobileBrowser||(a.transition({opacity:"1"},400),a.find("video").transition({opacity:"1"},400),a.parent().find(".video-color-overlay").transition({opacity:"0.7"},400),1==e&&Pa()),p.addClass("loaded"),setTimeout(function(){p.addClass("hidden")},1e3),clearInterval(n))},60);ht.usingMobileBrowser&&(a.parents(".full-width-section").length>0&&0==a.parents("#nectar_fullscreen_rows").length&&!a.hasClass("column-video")?a.css("left","50%"):a.css("left","0px"),1==e&&Pa(),a.find("video")[0].onplay=function(){a.transition({opacity:"1"},400),a.find("video").transition({opacity:"1"},400),a.parent().find(".video-color-overlay").transition({opacity:"0.7"},400)})}})},300),ht.usingMobileBrowser&&t(".nectar-video-wrap").each(function(){t(this).find("video").is("[muted]")||(t(this).parent().find(".mobile-video-image").show(),t(this).remove())}),t('.wpb_row:has(".nectar-video-wrap"):not(.fp-section)').each(function(e){t(this).css("z-index",100+e)}),t(".vc_row").each(function(){var t,n=jQuery(this);n.find(".nectar-youtube-bg").length>0?(t=function(t){if(void 0===t)return!1;var e=t.match(/(?:https?:\/{2})?(?:w{3}\.)?youtu(?:be)?\.(?:com|be)(?:\/watch\?v=|\/)([^\s&]+)/);return null!==e&&e[1]}(n.find(".nectar-youtube-bg span").text()))&&(n.find(".vc_video-bg").remove(),function t(n,i,s){if("undefined"==typeof YT||void 0===YT.Player)return 100<(s=void 0===s?0:s)?void console.warn("Too many attempts to load YouTube api"):void setTimeout(function(){t(n,i,s++)},100);var r=n.prepend('<div class="vc_video-bg"><div class="inner"></div></div>').find(".inner");var o;o=new YT.Player(r[0],{width:"100%",height:"100%",videoId:i,playerVars:{playlist:i,iv_load_policy:3,enablejsapi:1,disablekb:1,autoplay:1,controls:0,showinfo:0,rel:0,loop:1},events:{onStateChange:function(t){-1===t.data&&(o.mute(),o.playVideo())},onReady:function(t){o.mute(),o.playVideo(),a(n)}}}),a(n),jQuery(e).on("resize",function(){a(n)});setTimeout(function(){a(n)},100)}(n.find(".nectar-youtube-bg"),t)):n.find(".nectar-youtube-bg").remove(),n.find(".nectar-youtube-bg span").remove(),ht.usingMobileBrowser||n.find(".nectar-video-wrap, .nectar-youtube-bg").css({opacity:"1",width:"100%",height:"100%"}),n.find(".video-color-overlay").transition({opacity:"0.7"},400)}))}function _a(){if(r.hasClass("single-post")&&t(".content-inner[data-has-gallery]").length>0&&(t(".wp-block-gallery").length>0?t(".content-inner").find(".wp-block-gallery").each(function(e){0!==e&&t(this).css("display","flex")}):t(".content-inner").find(".gallery").each(function(e){0!==e&&t(this).css("display","block")})),r.hasClass("single-post")&&t(".nectar-social.vertical").length>0){var e=t(".nectar-social.vertical");new Waypoint({element:t(".post-area")[0],handler:function(t){pt.materialOffCanvasOpen||("down"===t?e.addClass("visible"):e.removeClass("visible"))},offset:"70%"})}}function Ca(){if(t('body.material[data-slide-out-widget-area-style="slide-out-from-right"]').length>0&&(ka(),u.length>0)){var a=u.detach();t(".ocm-effect-wrap-inner").append(a)}!function(){if(t("body.material").length>0&&0==t('body[data-slide-out-widget-area-style="slide-out-from-right-hover"]').length){if(0==t("#mobile-menu").length){var e=t("header#top ul .slide-out-widget-area-toggle:first a > span > i").clone();e.addClass("hover-effect"),t("header#top ul .slide-out-widget-area-toggle a > span").append(e);var a=t("header#top .slide-out-widget-area-toggle.mobile-icon a > span > i").clone();a.addClass("hover-effect"),t("header#top .slide-out-widget-area-toggle.mobile-icon a > span").append(a)}t('body:not([data-slide-out-widget-area-style="slide-out-from-right"]) header#top .slide-out-widget-area-toggle a > span').append(t('<span class="close-wrap"> <span class="close-line close-line1"></span> <span class="close-line close-line2"></span> </span>')),setTimeout(function(){t("header#top .slide-out-widget-area-toggle a > span .close-wrap").addClass("loaded")},200)}t("body.material #boxed").length>0&&t('body[data-slide-out-widget-area-style="slide-out-from-right-hover"]').length>0&&t(".ocm-effect-wrap").length>0&&t("#ajax-content-wrap > .slide-out-widget-area-toggle.slide-out-hover-icon-effect").insertAfter(".ocm-effect-wrap");t("body.material").length>0&&0==t('body[data-slide-out-widget-area-style*="fullscreen"]').length&&t(".ocm-effect-wrap").length>0&&(t("body.material #slide-out-widget-area.slide-out-from-right .slide_out_area_close").insertAfter(".ocm-effect-wrap"),t("#slide-out-widget-area-bg").insertAfter(".ocm-effect-wrap"),o.insertAfter(".ocm-effect-wrap"))}(),function(){if(t('body.material[data-header-search="true"]').length>0||t("body.material .ocm-effect-wrap").length>0){var a,n=!1,i=0,r=ht.winW,o=ht.winH;e.addEventListener("orientationchange",function(){i=1}),s.on("resize",function(){ht.usingMobileBrowser?(s.width()!=r&&s.height!=o||1===i)&&(r=ht.winW,o=ht.winH,i=0,n=!0):n=!0,n&&(clearTimeout(a),t('body[data-slide-out-widget-area-style="slide-out-from-right"] > a.slide_out_area_close, .material #header-outer, .ocm-effect-wrap, .ocm-effect-wrap-shadow').addClass("no-material-transition"),a=setTimeout(function(){t('body[data-slide-out-widget-area-style="slide-out-from-right"] > a.slide_out_area_close, .material #header-outer, .ocm-effect-wrap, .ocm-effect-wrap-shadow').removeClass("no-material-transition")},250),ka(),n=!1)})}}(),s.on("resize",$a)}function xa(){var e,a=0;t("#slide-out-widget-area > .widget").each(function(){a+=t(this).height()}),e=o.height()-25-t(".bottom-meta-wrap").outerHeight(!0)-a>t("#slide-out-widget-area .off-canvas-menu-container:last-child").height()?o.height()-25-t(".bottom-meta-wrap").outerHeight(!0)-a:t("#slide-out-widget-area .off-canvas-menu-container:last-child").height(),t("#slide-out-widget-area .inner").css({height:"auto","min-height":e})}function ka(){t("#slide-out-widget-area.slide-out-from-right").css({"padding-top":.1*s.height(),"padding-bottom":.1*s.height()}),Ea()}function $a(){t(".ocm-effect-wrap.material-ocm-open").length>0&&(t(".ocm-effect-wrap").css({height:s.height()}),t(".ocm-effect-wrap-inner").css({"padding-top":ht.adminBarHeight}))}function Ta(){t('#slide-out-widget-area[class*="slide-out-from-right"] .off-canvas-menu-container li.menu-item-has-children').each(function(){t(this).find(".ocm-dropdown-arrow").css({top:t(this).find("a").height()/2})}),t("#slide-out-widget-area.fullscreen-split .off-canvas-menu-container li.menu-item-has-children").each(function(){t(this).find(".ocm-dropdown-arrow").css({top:t(this).find("a").height()/2})})}function Ia(){e.nectarOptions&&e.nectarOptions.ocm_remove_ext_menu_items&&"remove_images"==e.nectarOptions.ocm_remove_ext_menu_items&&!1===pt.ocmInit&&(t('.off-canvas-menu-container .title[class*="inherit-h"], #mobile-menu .title[class*="inherit-h"]').removeClass(function(t,e){return(e.match(/(^|\s)inherit-h\S+/g)||[]).join(" ")}),t(".off-canvas-menu-container .nectar-ext-menu-item .image-layer-outer, #mobile-menu .nectar-ext-menu-item .image-layer-outer").remove(),t(".off-canvas-menu-container .nectar-ext-menu-item .menu-item-desc").removeClass("menu-item-desc").addClass("item_desc"),t(".off-canvas-menu-container .nectar-ext-menu-item .inner-content > .title").each(function(){0==t(this).find(".menu-title-text").length&&t(this).removeClass("title").addClass("menu-title-text")}),t(".off-canvas-menu-container .item_desc").each(function(){"none"!==t(this).css("display")&&t(this).parents(".menu-item").addClass("nectar-extra-menu-item-spacing")}),Ta(),pt.ocmInit=!0)}function Ea(){ht.winW<1e3||t("body > #boxed").length>0||t(".ocm-effect-wrap-inner > #boxed").length>0?(t("#slide-out-widget-area.fullscreen .off-canvas-social-links, #slide-out-widget-area.fullscreen-alt .off-canvas-social-links").appendTo("#slide-out-widget-area .inner"),t("#slide-out-widget-area.fullscreen .bottom-text, #slide-out-widget-area.fullscreen-alt .bottom-text").appendTo("#slide-out-widget-area .inner")):(t("#slide-out-widget-area.fullscreen .off-canvas-social-links,#slide-out-widget-area.fullscreen-alt .off-canvas-social-links").appendTo("#slide-out-widget-area .inner-wrap"),t("#slide-out-widget-area.fullscreen .bottom-text, #slide-out-widget-area.fullscreen-alt .bottom-text").appendTo("#slide-out-widget-area .inner-wrap")),t(".slide-out-from-right.open .off-canvas-menu-container.mobile-only").length>0&&0==t("body.mobile").length&&t("#slide-out-widget-area .slide_out_area_close").trigger("click"),Ta()}function Oa(){if(xa(),ht.usingMobileBrowser&&t("#slide-out-widget-area.open").length>0)return Ha(),!1;ht.usingMobileBrowser&&(t(".slide-out-widget-area-toggle a").attr("aria-expanded","true"),l.css({height:"100%",width:"100%"})),o.css({transform:"translate3d(0,0,0)"}).addClass("open"),Ia();var a=Qt();ht.winW<1e3&&(a=!0);var n=e.nectarOptions&&e.nectarOptions.mobile_header_format&&"centered-menu"===e.nectarOptions.mobile_header_format&&a?"left":"right";if(t("header#top .container .span_9 > .slide-out-widget-area-toggle").length>0){var i,c=t(".slide-out-hover-icon-effect"),h=ht.secondaryHeaderHeight,u=Qt();if(t('#header-outer[data-format="centered-menu-bottom-bar"]').length>0&&(u=!1),t("body.mobile").length>0||u||"left"===H)c.css({top:t("header#top .span_9 > .slide-out-widget-area-toggle a").offset().top-ht.scrollTop}),"left"===n||"left"===H?c.css({left:parseInt(t("#header-outer header > .container").css("padding-right"))+1,right:""}):c.css({right:parseInt(t("#header-outer header > .container").css("padding-right"))+1,left:""});else if(ot){var p=t('#header-outer[data-has-menu="false"]').length>0?2:1;c.css({top:ht.adminBarHeight+h+parseInt(t("header#top nav >ul .slide-out-widget-area-toggle a").css("padding-top")),right:29+p})}else t('#header-outer[data-format="centered-menu-bottom-bar"]').length>0?(i="flex"==t("header#top .span_9 > .slide-out-widget-area-toggle").css("display")?t("header#top .span_9 > .slide-out-widget-area-toggle.mobile-icon a").offset():t("header#top .span_3 .right-side .slide-out-widget-area-toggle > div").offset(),"flex"==t("#top .span_3 .slide-out-widget-area-toggle.mobile-icon").css("display")&&(i=t("#top .span_3 .slide-out-widget-area-toggle.mobile-icon a").offset()),c.css({top:parseInt(i.top)-ht.scrollTop,right:parseInt(t("#header-outer header >.container").css("padding-right"))+2,left:""})):(i=r.hasClass("ascend")?"block"==t("header#top .span_9 > .slide-out-widget-area-toggle").css("display")?t("header#top .span_9 > .slide-out-widget-area-toggle.mobile-icon").position():t("header#top nav .buttons .slide-out-widget-area-toggle > div a > span:not(.screen-reader-text)").position():"block"==t("header#top .span_9 > .slide-out-widget-area-toggle").css("display")?t("header#top .span_9 > .slide-out-widget-area-toggle.mobile-icon").position():t("header#top nav .buttons .slide-out-widget-area-toggle > div").position(),t("#header-secondary-outer.hide-up").length>0&&(h=0),c.css({top:ht.adminBarHeight+h+parseInt(i.top),right:parseInt(t("#header-outer header >.container").css("padding-right"))+2,left:""}))}if(t(".slide-out-hover-icon-effect .lines-button").removeClass("no-delay").addClass("unhidden-line"),0==t('#header-outer[data-permanent-transparent="1"]').length&&0==t("#nectar_fullscreen_rows").length&&!ht.usingFrontEndEditor&&ht.winW>1e3&&(0==ht.scrollTop&&t("#header-outer.transparent").length>0||0==t("body.mobile").length&&ot&&(d.attr("data-transparent","true").addClass("no-bg-color").addClass("slide-out-hover"),t("#header-outer header, #header-outer > .cart-outer").addClass("all-hidden")),0==t('#header-outer[data-remove-fixed="1"]').length&&0==t("body.mobile").length&&ot&&(1==x?(s.off("scroll",on),s.off("scroll",rn)):(s.off("scroll",ln),s.off("scroll",dn)))),ht.usingMobileBrowser)return!1;s.on("mousemove.rightOffsetCheck",za)}function za(a){var n=s.width(),i=o.outerWidth(),r=Qt();ht.winW<1e3&&(r=!0);("left"!==(e.nectarOptions&&e.nectarOptions.mobile_header_format&&"centered-menu"===e.nectarOptions.mobile_header_format&&r?"left":"right")&&"left"!==H?a.clientX<n-parseInt(i)-v:a.clientX>parseInt(i)+v)&&o.hasClass("mouse-accessed")&&(o.removeClass("mouse-accessed"),s.off("mousemove.rightOffsetCheck",za),o.css({transform:""}).removeClass("open"),d.removeClass("style-slide-out-from-right"),t(".slide-out-hover-icon-effect .lines-button").removeClass("unhidden-line").addClass("no-delay"),0==t('#header-outer[data-permanent-transparent="1"]').length&&(0==t('#header-outer[data-remove-fixed="1"]').length&&0==t("body.mobile").length&&ot&&0==t("body.mobile").length&&(d.removeClass("no-bg-color"),t("#header-outer header, #header-outer > .cart-outer").removeClass("all-hidden")),0==t('#header-outer[data-remove-fixed="1"]').length&&0==t("body.mobile").length&&ot&&(1==x?(s.off("scroll.headerResizeEffect"),0==ht.scrollTop?(s.on("scroll.headerResizeEffect",rn),t('#header-outer[data-full-width="true"][data-transparent-header="true"]').length>0&&f.length>0&&1==ot&&t("#header-outer.pseudo-data-transparent").length>0&&t('#header-outer[data-full-width="true"] header > .container').stop(!0,!0).animate({padding:"0"},{queue:!1,duration:250,easing:"easeOutCubic"})):s.on("scroll.headerResizeEffect",on)):(s.off("scroll.headerResizeEffectOpaque"),s.on("scroll.headerResizeEffectOpaque",ln)))))}function Ha(){ht.usingMobileBrowser&&(t(".slide-out-widget-area-toggle a").attr("aria-expanded","false"),l.css({height:"1px",width:"1px"})),o.css({transform:""}).removeClass("open"),d.removeClass("style-slide-out-from-right"),t(".slide-out-hover-icon-effect .lines-button").removeClass("unhidden-line").addClass("no-delay"),0==t('#header-outer[data-permanent-transparent="1"]').length&&(d.removeClass("no-bg-color"),t("#header-outer header").removeClass("all-hidden")),0==t('#header-outer[data-remove-fixed="1"]').length&&0==t("body.mobile").length&&ot&&(1==x?(s.off("scroll.headerResizeEffect"),0==ht.scrollTop?(s.on("scroll.headerResizeEffect",rn),t('#header-outer[data-full-width="true"][data-transparent-header="true"]').length>0&&f.length>0&&1==ot&&t("#header-outer.pseudo-data-transparent").length>0&&t('#header-outer[data-full-width="true"] header > .container').stop(!0,!0).animate({padding:"0"},{queue:!1,duration:250,easing:"easeOutCubic"})):s.on("scroll.headerResizeEffect",on)):(s.off("scroll.headerResizeEffectOpaque"),s.on("scroll.headerResizeEffectOpaque",ln)))}function Sa(){t(".slide-out-from-right-hover.open").length>0&&(t(".slide-out-widget-area-toggle:not(.std-menu) a").first().addClass("non-human-allowed").trigger("click"),setTimeout(function(){t(".slide-out-widget-area-toggle:not(.std-menu) a").removeClass("non-human-allowed")},100))}function Aa(e){t("#mobile-menu").show(),t("header#top").find("."+e+":not(.std-menu) .lines-button").addClass("close"),t("body.material").length>0&&t("header#top").find("."+e+" a").addClass("menu-push-out"),setTimeout(function(){t("header#top").find("."+e+" > div > a").removeClass("animating")},100)}function Ma(e){t("#mobile-menu").hide(),t("body").find("."+e+":not(.std-menu) .lines-button").removeClass("close"),setTimeout(function(){t("body.material").length>0&&t("header#top ."+e+" a").removeClass("menu-push-out"),t("body").find("."+e+" a").removeClass("animating")},350)}function Wa(){if(r.on("click",".slide-out-widget-area-toggle:not(.std-menu) a.closed.animating",function(){return!1}),r.on("click",".slide-out-widget-area-toggle:not(.std-menu) a.closed:not(.animating), .nectar-ocm-trigger-open",function(){if(pt.ocmAnimating||"true"==dt.animating||t(".slide-out-from-right-hover").length>0)return!1;var a,n=700;return pt.ocmOpen=!0,Ia(),d.removeClass("no-transition"),t(this).hasClass("simple-mobile-menu")?(Aa("simple-mobile-menu"),t(this).find("a").addClass("open"),!1):(o.hasClass("slide-out-from-right")?function(){var a=f.length>0&&0==t("body.mobile").length?f.height():0,n=Qt();ht.winW<1e3&&(n=!0);var i=e.nectarOptions&&e.nectarOptions.mobile_header_format&&"centered-menu"===e.nectarOptions.mobile_header_format&&n?"left":"right";if(0==t("body.material").length){if(t("#slide-out-widget-area .inner").css({height:"auto","min-height":o.height()-25-t(".bottom-meta-wrap").height()}),t('#slide-out-widget-area[data-dropdown-func="separate-dropdown-parent-link"] .inner > div:first-of-type > .menu > li:first-child').length>0&&t("#slide-out-widget-area .inner > div:first-of-type > .menu > li:first-child").hasClass("menu-item-has-children")&&t("#slide-out-widget-area .inner > div:first-of-type").css({"margin-top":"50px"}),0==t("#boxed").length){t(".container-wrap, .home-wrap, #footer-outer:not(#nectar_fullscreen_rows #footer-outer), .nectar-box-roll, #page-header-wrap .page-header-bg-image, #page-header-wrap .nectar-video-wrap, #page-header-wrap .mobile-video-image, #page-header-wrap #page-header-bg > .container, .page-header-no-bg, div:not(.container) > .project-title").stop(!0).transition({x:"left"===i||"left"===H?"300px":"-300px"},700,"easeInOutCubic");var h=Qt();0==t('#header-outer[data-format="centered-logo-between-menu"]').length||h?0==t('#header-outer[data-transparency-option="1"]').length||t('#header-outer[data-transparency-option="1"]').length>0&&0==t('#header-outer[data-full-width="true"]').length||t("body.mobile").length>0?d.stop(!0).css("transform","translateY(0)").transition({x:"left"===i||"left"===H?300+a+"px":"-"+(300+a)+"px"},700,"easeInOutCubic"):d.stop(!0).css("transform","translateY(0)").transition({x:"left"===i||"left"===H?300+a+"px":"-"+(300+a)+"px","background-color":"transparent","border-bottom":"1px solid rgba(255,255,255,0.22)"},700,"easeInOutCubic"):t('#header-outer header#top nav > ul.buttons, body:not(.material) #header-outer:not([data-format="centered-logo-between-menu"]) .cart-outer .cart-menu-wrap').transition({x:"left"===i||"left"===H?"300px":"-300px"},700,"easeInOutCubic")}if(o.stop(!0).transition({x:"left"===i||"left"===H?a+"px":"-"+a+"px"},700,"easeInOutCubic").addClass("open"),0==t("#boxed").length&&t('#header-outer[data-full-width="true"]').length>0&&!r.hasClass("mobile")&&(d.addClass("highzI"),t("#ascrail2000").addClass("z-index-adj"),0==t('#header-outer[data-format="centered-logo-between-menu"]').length&&0==v&&("left"===H||t("header#top #logo").stop(!0).transition({x:300+a+"px"},700,"easeInOutCubic")),t("header#top .slide-out-widget-area-toggle .lines-button:not(.legacy-double)").addClass("close"),t("body #header-outer nav > ul > li > a").css({"margin-bottom":"0"})),d.addClass("style-slide-out-from-right"),l.css({height:"100%",width:"100%"}).stop(!0).transition({opacity:1},700,"easeInOutCubic",function(){t(".slide-out-widget-area-toggle:not(.std-menu) > div > a").removeClass("animating")}),0==t('#header-outer[data-format="centered-logo-between-menu"]').length){var u=t("#logo img:visible").length>0?t("#logo img:visible").width():t("#logo").width();t("header#top nav > .sf-menu").offset().left-u-300<20&&d.addClass("hidden-menu")}else d.addClass("hidden-menu-items");0==t('#header-outer[data-remove-fixed="1"]').length&&ht.winW>1e3&&(1==ot&&1==x&&"true"==d.attr("data-transparent-header")?(d.stop(!0).transition({y:"0"},0).addClass("transparent").css("transition","transform"),s.off("scroll",on),s.off("scroll",rn)):1==ot&&"true"==d.attr("data-transparent-header")&&(d.addClass("transparent"),s.off("scroll",ln),s.off("scroll",dn)))}else t("body.material").length>0&&(p.length>0&&t(".ocm-effect-wrap #ajax-loading-screen").length>0&&p.insertBefore(".ocm-effect-wrap"),ht.scrollTop>40&&t('body[data-hhun="1"] #header-secondary-outer').addClass("hidden"),setTimeout(function(){t(".slide-out-widget-area-toggle:not(.std-menu) > div > a").removeClass("animating")},300),t("#slide-out-widget-area, #slide-out-widget-area-bg, #header-outer .slide-out-widget-area-toggle").addClass("material-open"),t('body:not(.mobile) #header-outer[data-format="centered-menu-bottom-bar"][data-condense="true"]').length>0&&"none"!=t('#header-outer[data-format="centered-menu-bottom-bar"] .span_9').css("display")&&(t("#header-outer:not(.fixed-menu)").css("top",ht.adminBarHeight-ht.scrollTop+"px"),c.length>0&&t("#header-outer.fixed-menu").length>0&&c.css("visibility","hidden")),t("#ajax-content-wrap").css({position:"relative",top:"-"+ht.scrollTop+"px"}),t(".ocm-effect-wrap-inner").css({"padding-top":ht.adminBarHeight}),t("#fp-nav").addClass("material-ocm-open"),pt.materialOffCanvasOpen=!0,r.addClass("material-ocm-open"),r.addClass("nectar-no-flex-height"),t(".ocm-effect-wrap").css({height:ht.winH}),setTimeout(function(){t(".ocm-effect-wrap").addClass("material-ocm-open")},40),t("body > .slide_out_area_close").addClass("follow-body"),t('#header-outer:not([data-format="left-header"]) header#top .slide-out-widget-area-toggle a').addClass("effect-shown"),t('body[data-hhun="1"]:not(.no-scroll):not(.mobile) #header-outer[data-permanent-transparent="false"]:not(.detached):not(.parallax-contained):not(.at-top-before-box)').css({transition:"none",transform:"translateY("+ht.adminBarHeight+"px)"}),setTimeout(function(){t("body > .slide_out_area_close").addClass("material-ocm-open"),t("body > .slide_out_area_close").removeClass("hide_until_rendered")},350));t(e).trigger("nectar-material-ocm-open")}():o.hasClass("fullscreen")?function(){t("body.material").length>0&&t("header#top .slide-out-widget-area-toggle a").addClass("menu-push-out");var e=0,a=0;ht.scrollTop+s.height()>t(".blurred-wrap").height()&&0==t("#nectar_fullscreen_rows").length&&(t("body,html").stop().animate({scrollTop:t(".blurred-wrap").height()-s.height()},600,"easeInOutCubic"),e=550,a=200),t("header#top .slide-out-widget-area-toggle:not(.std-menu) .lines-button:not(.legacy-double)").addClass("close"),setTimeout(function(){t(".blurred-wrap").addClass("blurred")},e),t("#slide-out-widget-area.fullscreen").show().addClass("open"),0==t(".nectar-social.fixed").length&&Bn(),t(".container-wrap").addClass("no-shadow"),d.stop(!0).css("transform","translateY(0)"),setTimeout(function(){t(".off-canvas-menu-container .menu > li").each(function(e){t(this).delay(50*e).transition({y:0,opacity:1},800,"easeOutExpo")}),t("#slide-out-widget-area.fullscreen .widget").each(function(e){t(this).delay(100*e).transition({y:0,opacity:1},800,"easeOutExpo")})},370+a),setTimeout(function(){t("#slide-out-widget-area .off-canvas-social-links").addClass("line-shown"),t("#slide-out-widget-area .off-canvas-social-links li").each(function(e){t(this).delay(50*e).transition({scale:1},400,"easeOutCubic")}),t("#slide-out-widget-area .bottom-text").transition({opacity:.7},400,"easeOutCubic")},750+a),setTimeout(function(){var e=t("body.mobile").length>0?"easeOutCubic":"easeInOutQuint";l.css({height:"100%",width:"100%"}).show().stop(!0).transition({y:"0%"},920,e,function(){t(".slide-out-widget-area-toggle > div > a").removeClass("animating")})},50+a),Ea(),t('.mobile #header-outer[data-permanent-transparent="false"]').length>0&&t(".container-wrap").hasClass("no-scroll")&&t("#ajax-content-wrap").addClass("at-content");var n=d.offset().top-ht.scrollTop+ht.secondaryHeaderHeight;t("#slide-out-widget-area.fullscreen .inner-wrap").css("padding-top",d.outerHeight()+n)}():o.hasClass("fullscreen-alt")||o.hasClass("fullscreen-split")?function(){var e=".fullscreen-alt";o.hasClass("fullscreen-split")&&(e=".fullscreen-split"),t("body.material").length>0&&t("header#top .slide-out-widget-area-toggle a").addClass("menu-push-out"),t("header#top .slide-out-widget-area-toggle:not(.std-menu) .lines-button:not(.legacy-double)").addClass("close"),".fullscreen-alt"===e?t("#slide-out-widget-area"+e).show().addClass("open"):t("#slide-out-widget-area"+e).addClass("open").removeClass("hidden"),l.addClass("open").removeClass("hidden"),t('body > div[class*="body-border"]').css("z-index","9995"),".fullscreen-alt"===e&&t(".off-canvas-menu-container .menu").transition({y:"0px",opacity:1},0),0==t(".nectar-social.fixed").length&&Bn(),t("#header-outer.transparent").length>0&&f.length>0&&(t(".admin-bar #slide-out-widget-area-bg"+e).css({"padding-top":f.outerHeight(!0)+32+"px"}),t("body:not(.admin-bar) #slide-out-widget-area-bg"+e).css({"padding-top":f.outerHeight(!0)+"px"})),d.stop(!0).css("transform","translateY(0)"),s.width()>1e3&&0==t('#header-outer[data-format="centered-menu-bottom-bar"].fixed-menu').length&&0==t('body.material #header-outer[data-condense="true"]').length&&"true"==d.attr("data-transparent-header")&&!ht.usingFrontEndEditor&&(t("#logo .starting-logo").length>0||t("#logo.no-image").length>0)&&d.stop(!0).css("transform","translateY(0)").addClass("transparent"),t(".off-canvas-menu-container .clip-wrap").css("transition-duration","0s"),".fullscreen-alt"===e&&(setTimeout(function(){t(".off-canvas-menu-container .menu > li").each(function(e){t(this).delay(50*e).transition({y:0,opacity:1},750,"easeOutCubic").addClass("no-pointer-events")}),setTimeout(function(){t(".off-canvas-menu-container .menu > li").removeClass("no-pointer-events"),t(".off-canvas-menu-container .clip-wrap").css("transition-duration",".45s")},500),t("#slide-out-widget-area.fullscreen-alt .widget").each(function(e){t(this).delay(100*e).transition({y:0,opacity:1},650,"easeOutCubic")})},200),setTimeout(function(){t("#slide-out-widget-area .off-canvas-social-links").addClass("line-shown"),t("#slide-out-widget-area .off-canvas-social-links li").css("opacity","1").each(function(e){t(this).delay(50*e).transition({scale:1},400,"easeOutCubic")}),t("#slide-out-widget-area .bottom-text").transition({opacity:1},600,"easeOutCubic")},200));var a=.4;if(l.hasClass("solid")&&(a=1),l.hasClass("dark")&&(a=.97),l.hasClass("medium")&&(a=.6),l.hasClass("light")&&(a=.4),l.removeClass("no-transition"),".fullscreen-alt"===e&&(l.addClass("padding-removed").css({height:"100%",width:"100%",left:"0",opacity:a}),Ea()),setTimeout(function(){t(".slide-out-widget-area-toggle > div > a").removeClass("animating")},600),t('.mobile #header-outer[data-permanent-transparent="false"]').length>0&&t(".container-wrap").hasClass("no-scroll")&&t("#ajax-content-wrap").addClass("at-content"),".fullscreen-alt"===e){var n=d.offset().top-ht.scrollTop+ht.secondaryHeaderHeight;t("#slide-out-widget-area"+e+" .inner-wrap").css("padding-top",d.outerHeight()+n)}else t("#slide-out-widget-area"+e+" .inner-wrap").css("padding-top",d.outerHeight())}():o.hasClass("fullscreen-inline-images")?(a=ht.winW<ht.winH,d.css({"z-index":"9990",transition:"transform 0.3s ease"}),0==t(".nectar-social.fixed").length&&Bn(),t("body.material").length>0&&t("header#top .slide-out-widget-area-toggle a").addClass("menu-push-out"),t("header#top .slide-out-widget-area-toggle:not(.std-menu) .lines-button:not(.legacy-double)").addClass("close"),t("#slide-out-widget-area.fullscreen-inline-images").addClass("open").removeClass("hidden"),l.addClass("open").removeClass("hidden"),t('body > div[class*="body-border"]').css("z-index","9995"),setTimeout(function(){d.removeClass("side-widget-closed").addClass("side-widget-open"),k||(d.attr("data-transparent-header","true"),d.addClass("lighten-logo")),ht.usingFrontEndEditor||d.stop(!0).css("transform","translateY(0)").addClass("transparent"),t("#header-outer.dark-slide.transparent").length>0&&0==t("#boxed").length&&d.removeClass("dark-slide").addClass("temp-removed-dark-slide"),setTimeout(function(){anime({targets:"#header-outer #top > .container",opacity:[0,1],duration:900,easing:"easeOutQuad"}),d.css({"z-index":"",transition:""})},50)},a?350:425),t(".off-canvas-menu-container .clip-wrap").css("transition-duration","0s"),l.removeClass("no-transition"),setTimeout(function(){t(".slide-out-widget-area-toggle > div > a").removeClass("animating")},600),t('.mobile #header-outer[data-permanent-transparent="false"]').length>0&&t(".container-wrap").hasClass("no-scroll")&&t("#ajax-content-wrap").addClass("at-content"),t("#slide-out-widget-area.fullscreen-inline-images .inner-wrap").css("padding-top",d.outerHeight()),n=1100):t("#header-outer #mobile-menu").length>0&&Aa("slide-out-widget-area-toggle"),pt.ocmAnimating=!0,setTimeout(function(){pt.ocmAnimating=!1},n),0!=t("#header-outer #mobile-menu").length||o.hasClass("fullscreen-inline-images")||(d.removeClass("side-widget-closed").addClass("side-widget-open"),t('#header-outer[data-transparency-option="1"]').length>0&&0==t("#boxed").length&&t('#header-outer[data-full-width="true"]').length>0&&!ht.usingFrontEndEditor&&0==t('body.material[data-slide-out-widget-area-style="slide-out-from-right"]').length&&0==t('body.material #header-outer[data-condense="true"]').length&&d.addClass("transparent"),t("#header-outer.dark-slide.transparent").length>0&&0==t("#boxed").length&&0==t("body.material-ocm-open").length&&d.removeClass("dark-slide").addClass("temp-removed-dark-slide")),t(".slide-out-widget-area-toggle:not(.simple-mobile-menu) > div > a").removeClass("closed").addClass("open").attr("aria-expanded","true"),t(".slide-out-widget-area-toggle:not(.simple-mobile-menu) > div > a").addClass("animating"),t(e).trigger("nectar-ocm-open"),!1)}),r.on("click",".slide-out-widget-area-toggle:not(.std-menu) a.open.animating",function(){return!1}),r.on("click",".slide-out-widget-area-toggle:not(.std-menu) a.open:not(.animating), .nectar-ocm-trigger-open a.open, #slide-out-widget-area .slide_out_area_close, > .slide_out_area_close, #slide-out-widget-area-bg.slide-out-from-right, .material-ocm-open #ajax-content-wrap",function(a){var n;if(null!=a.originalEvent||0!=t(".slide_out_area_close.non-human-allowed").length||0!=t(".slide-out-widget-area-toggle.mobile-icon a.non-human-allowed").length)return!(pt.ocmAnimating||t(".slide-out-widget-area-toggle:not(.std-menu) a.animating").length>0)&&(pt.ocmOpen=!1,d.removeClass("no-transition"),t(this).parents(".simple-mobile-menu").length>0?(Ma("simple-mobile-menu"),t(this).removeClass("open"),!1):(t(".slide-out-widget-area-toggle:not(.std-menu):not(.simple-mobile-menu) a").removeClass("open").addClass("closed").attr("aria-expanded","false"),t(".slide-out-widget-area-toggle:not(.simple-mobile-menu):not(.std-menu) a").addClass("animating"),o.hasClass("slide-out-from-right")?function(){if(0==t("body.material").length){var a=Qt();ht.winW<1e3&&(a=!0);var n=e.nectarOptions&&e.nectarOptions.mobile_header_format&&"centered-menu"===e.nectarOptions.mobile_header_format&&a?"left":"right";if(t(".container-wrap, .home-wrap, #footer-outer:not(#nectar_fullscreen_rows #footer-outer), .nectar-box-roll, #page-header-wrap .page-header-bg-image, #page-header-wrap .nectar-video-wrap, #page-header-wrap .mobile-video-image, #page-header-wrap #page-header-bg > .container, .page-header-no-bg, div:not(.container) > .project-title").stop(!0).transition({x:"0px"},700,"easeInOutCubic"),t('#header-outer[data-transparency-option="1"]').length>0&&0==t("#boxed").length){var i=t("#header-outer[data-current-row-bg-color]").length>0?d.attr("data-current-row-bg-color"):d.attr("data-user-set-bg");d.stop(!0).transition({x:"0px","background-color":i},700,"easeInOutCubic")}else d.stop(!0).transition({x:"0px"},700,"easeInOutCubic");o.stop(!0).transition({x:"left"===n||"left"===H?"-301px":"301px"},700,"easeInOutCubic").removeClass("open"),0==t("#boxed").length&&t('#header-outer[data-full-width="true"]').length>0&&(d.removeClass("highzI"),t("header#top #logo").stop(!0).transition({x:"0px"},700,"easeInOutCubic"),t(".lines-button").removeClass("close")),t('#header-outer[data-format="centered-logo-between-menu"]').length>0&&t("#header-outer header#top nav > ul.buttons, #header-outer .cart-outer .cart-menu-wrap").stop(!0).transition({x:"0px"},700,"easeInOutCubic"),l.stop(!0).transition({opacity:0},700,"easeInOutCubic",function(){t(".slide-out-widget-area-toggle a").removeClass("animating"),t(this).css({height:"1px",width:"1px"}),0==t('#header-outer[data-remove-fixed="1"]').length&&(d.hasClass("parallax-contained")&&ht.scrollTop>0&&0==t('#header-outer[data-permanent-transparent="1"]').length?d.removeClass("parallax-contained").addClass("detached").removeClass("transparent"):(0==ht.scrollTop&&t('body[data-hhun="1"]').length>0&&t('#page-header-bg[data-parallax="1"]').length>0||0==ht.scrollTop&&t('body[data-hhun="1"]').length>0&&t(".parallax_slider_outer").length>0)&&t('#header-outer[data-transparency-option="1"]').length>0&&d.addClass("transparent")),t(".container-wrap").css("transform","none")}),d.removeClass("style-slide-out-from-right"),0==t('#header-outer[data-remove-fixed="1"]').length&&(1==ot&&1==x&&ht.winW>1e3?(s.off("scroll.headerResizeEffect"),0==ht.scrollTop?(s.on("scroll.headerResizeEffect",rn),t('#header-outer[data-full-width="true"][data-transparent-header="true"]').length>0&&f.length>0&&1==ot&&t("#header-outer.pseudo-data-transparent").length>0&&t('#header-outer[data-full-width="true"] header > .container').stop(!0,!0).animate({padding:"0"},{queue:!1,duration:250,easing:"easeOutCubic"})):s.on("scroll.headerResizeEffect",on),d.hasClass("pseudo-data-transparent")&&d.attr("data-transparent-header","false").removeClass("pseudo-data-transparent").removeClass("transparent"),d.css("transition","transform")):1==ot&&ht.winW>1e3&&(s.off("scroll.headerResizeEffectOpaque"),s.on("scroll.headerResizeEffectOpaque",ln),d.css("transition","transform"),d.hasClass("pseudo-data-transparent")&&d.attr("data-transparent-header","false").removeClass("pseudo-data-transparent").removeClass("transparent")))}else t("body.material").length>0&&(o.removeClass("open"),t("#slide-out-widget-area, #slide-out-widget-area-bg, #header-outer .slide-out-widget-area-toggle").removeClass("material-open"),t(".ocm-effect-wrap, .ocm-effect-wrap-shadow, body > .slide_out_area_close, #fp-nav").removeClass("material-ocm-open"),t("body > .slide_out_area_close").removeClass("follow-body"),setTimeout(function(){t(".slide-out-widget-area-toggle a").removeClass("animating"),r.removeClass("material-ocm-open"),r.removeClass("nectar-no-flex-height"),t(".ocm-effect-wrap").css({height:"100%"}),t(".ocm-effect-wrap-inner").css({"padding-top":"0"}),s.scrollTop(Math.abs(parseInt(t("#ajax-content-wrap").css("top")))),t("#ajax-content-wrap").css({position:"",top:""}),t('#header-outer[data-format="centered-menu-bottom-bar"]').length>0&&"none"!=t('#header-outer[data-format="centered-menu-bottom-bar"] .span_9').css("display")&&0==t("body.mobile").length&&(t("#header-outer:not(.fixed-menu)").css("top",""),c.css("visibility","")),t('body[data-hhun="1"]:not(.no-scroll) #header-outer[data-permanent-transparent="false"]:not(.detached):not(.parallax-contained):not(.at-top-before-box)').css({transform:""}),setTimeout(function(){t('body[data-hhun="1"]:not(.no-scroll) #header-outer[data-permanent-transparent="false"]:not(.detached):not(.parallax-contained):not(.at-top-before-box)').css({transition:""})},30),t('body[data-hhun="1"] #header-secondary-outer.hidden').removeClass("hidden"),pt.materialOffCanvasOpen=!1,t(e).trigger("nectar-material-ocm-close")},900),setTimeout(function(){t('#header-outer:not([data-format="left-header"]) header#top .slide-out-widget-area-toggle a').addClass("no-trans").removeClass("effect-shown")},200),setTimeout(function(){t('#header-outer:not([data-format="left-header"]) header#top .slide-out-widget-area-toggle a').removeClass("no-trans")},500))}():o.hasClass("fullscreen")?(t("body.material").length>0&&setTimeout(function(){t("header#top .slide-out-widget-area-toggle a").removeClass("menu-push-out")},350),t(".slide-out-widget-area-toggle:not(.std-menu) .lines-button:not(.legacy-double)").removeClass("close"),t(".blurred-wrap").removeClass("blurred"),t("#slide-out-widget-area.fullscreen").transition({opacity:0},700,"easeOutQuad",function(){t("#slide-out-widget-area.fullscreen").hide().css("opacity","1")}).removeClass("open"),t("#slide-out-widget-area.fullscreen .widget").transition({opacity:0},700,"easeOutQuad",function(){t(this).transition({y:"110px"},0)}),setTimeout(function(){t(".off-canvas-menu-container .menu > li").transition({y:"80px",opacity:0},0),t("#slide-out-widget-area .off-canvas-social-links li").transition({scale:0},0),t("#slide-out-widget-area .off-canvas-social-links").removeClass("line-shown"),t("#slide-out-widget-area .bottom-text").transition({opacity:0},0),t("#slide-out-widget-area .menuwrapper .menu").removeClass("subview"),t("#slide-out-widget-area .menuwrapper .menu li").removeClass("subview subviewopen"),t("#slide-out-widget-area.fullscreen .inner .menu-wrap").css("height","auto")},800),setTimeout(function(){0==t(".nectar-social.fixed").length&&Wn(),t(".container-wrap").removeClass("no-shadow")},500),l.stop(!0).transition({opacity:0},900,"easeOutQuad",function(){t('.mobile #header-outer[data-permanent-transparent="false"]').length>0&&t(".container-wrap").hasClass("no-scroll")&&t("#ajax-content-wrap").removeClass("at-content"),0==t('.mobile #header-outer[data-permanent-transparent="false"]').length&&t("#slide-out-widget-area.fullscreen .inner-wrap").css("padding-top","0"),t(".slide-out-widget-area-toggle a").removeClass("animating");var e=.4;l.hasClass("solid")&&(e=1),l.hasClass("dark")&&(e=.93),l.hasClass("medium")&&(e=.6),l.hasClass("light")&&(e=.4),t(this).css({height:"1px",width:"1px",opacity:e}).transition({y:"-100%"},0)})):o.hasClass("fullscreen-alt")||o.hasClass("fullscreen-split")||o.hasClass("fullscreen-inline-images")?(n=".fullscreen-alt",o.hasClass("fullscreen-inline-images")?(n=".fullscreen-inline-images",d.css({"z-index":"9990",transition:"transform 0.3s ease"}),setTimeout(function(){d.css({"z-index":"",transition:""})},450),k||(d.removeClass("lighten-logo"),d.attr("data-transparent-header","").removeClass("transparent"))):o.hasClass("fullscreen-split")&&(n=".fullscreen-split"),t("body.material").length>0&&setTimeout(function(){t("header#top .slide-out-widget-area-toggle a").removeClass("menu-push-out")},350),t(".slide-out-widget-area-toggle:not(.std-menu) .lines-button:not(.legacy-double)").removeClass("close"),l.removeClass("open"),".fullscreen-split"!==n&&".fullscreen-inline-images"!==n||setTimeout(function(){l.addClass("hidden"),t("#slide-out-widget-area"+n).addClass("hidden")},550),".fullscreen-alt"===n&&(t(".blurred-wrap").removeClass("blurred"),t("#slide-out-widget-area.fullscreen-alt .widget").transition({opacity:0},500,"easeOutQuad",function(){t(this).transition({y:"40px"},0)}),t("#slide-out-widget-area .bottom-text, #slide-out-widget-area .off-canvas-social-links li").transition({opacity:0},250,"easeOutQuad"),t("#slide-out-widget-area .off-canvas-social-links").removeClass("line-shown"),t(".off-canvas-menu-container .menu").transition({y:"-13px",opacity:0},400)),setTimeout(function(){".fullscreen-alt"===n&&(t(".off-canvas-menu-container .menu > li").stop(!0,!0).transition({y:"40px",opacity:0},0),t("#slide-out-widget-area .off-canvas-social-links li").transition({scale:0},0),t("#slide-out-widget-area .off-canvas-social-links").removeClass("line-shown"),t("#slide-out-widget-area .menuwrapper .menu").removeClass("subview"),t("#slide-out-widget-area .menuwrapper .menu li").removeClass("subview subviewopen"),t("#slide-out-widget-area.fullscreen-alt .inner .menu-wrap").css("height","auto"),l.css({height:"1px",width:"1px",left:"-100%"})),t('.mobile #header-outer[data-permanent-transparent="false"]').length>0&&t(".container-wrap").hasClass("no-scroll")&&t("#ajax-content-wrap").removeClass("at-content"),0==t('.mobile #header-outer[data-permanent-transparent="false"]').length&&t("#slide-out-widget-area"+n+" .inner-wrap").css("padding-top","0"),t(".slide-out-widget-area-toggle a").removeClass("animating"),".fullscreen-alt"===n&&t("#slide-out-widget-area"+n).hide().removeClass("open")},550),".fullscreen-split"!==n&&".fullscreen-inline-images"!==n||t("#slide-out-widget-area"+n).removeClass("open"),setTimeout(function(){0==t(".nectar-social.fixed").length&&Wn()},600),setTimeout(function(){l.removeClass("padding-removed")},50),setTimeout(function(){".fullscreen-alt"===n&&l.stop(!0).css({opacity:0}),t('#header-outer[data-transparent-header="true"]').length>0&&t('body > div[class*="body-border"]').css("z-index","10000")},1==ot?150:50),setTimeout(function(){t('#header-outer:not([data-permanent-transparent="1"]).transparent.small-nav, body[data-hhun="1"] #header-outer:not([data-permanent-transparent="1"]).transparent.scrolling, #header-outer:not([data-permanent-transparent="1"]).transparent.scrolled-down').removeClass("transparent"),d.hasClass("pseudo-data-transparent")&&d.attr("data-transparent-header","false").removeClass("pseudo-data-transparent").removeClass("transparent")},".fullscreen-inline-images"==n?0:100)):t("#header-outer #mobile-menu").length>0&&Ma("slide-out-widget-area-toggle"),0==t("#header-outer #mobile-menu").length&&(t("#header-outer.temp-removed-dark-slide.transparent").length>0&&0==t("#boxed").length&&d.removeClass("temp-removed-dark-slide").addClass("dark-slide"),0==t('#header-outer[data-permanent-transparent="1"]').length&&0==t("#slide-out-widget-area.fullscreen-alt").length&&(0==t(".nectar-box-roll").length?(t("#header-outer.small-nav").length>0||t("#header-outer.scrolled-down").length>0)&&d.removeClass("transparent"):(t("#header-outer.small-nav").length>0||t("#header-outer.scrolled-down").length>0||t(".container-wrap.auto-height").length>0)&&d.removeClass("transparent")),d.removeClass("hidden-menu"),d.removeClass("side-widget-open").addClass("side-widget-closed")),t(e).trigger("nectar-ocm-close"),!1))}),o.hasClass("fullscreen-inline-images")){var a=t('#slide-out-widget-area .off-canvas-menu-container .menu > li[class*="current"][id]').attr("id");t(".nectar-ocm-image."+a).length>0&&(t(".nectar-ocm-image.default").remove(),t(".nectar-ocm-image."+a).addClass("current")),t("#slide-out-widget-area .off-canvas-menu-container li[id]").on("mouseenter",function(){var e=t(this).attr("id");t(".nectar-ocm-image."+e).addClass("active"),t(".nectar-ocm-image."+e).length>0&&t(".nectar-ocm-image.current:not(.active)").addClass("hidden")}),t("#slide-out-widget-area .off-canvas-menu-container li").on("mouseleave",function(){t(".nectar-ocm-image.active").removeClass("active"),t(".nectar-ocm-image.current").removeClass("hidden")})}}function Ba(){t("#slide-out-widget-area.slide-out-from-right-hover").length>0?function(){if(0==t("#ajax-content-wrap > .slide-out-widget-area-toggle").length){var e=t('.slide-out-widget-area-toggle[data-custom-color="true"]').length>0?"#slide-out-widget-area > div":"#slide-out-widget-area";t('<div class="slide-out-widget-area-toggle slide-out-hover-icon-effect" data-icon-animation="simple-transform"><div> <a href="#sidewidgetarea" class="closed"> <span> <i class="lines-button x2"> <i class="lines"></i> </i> </span> </a> </div> </div>').insertAfter(e),(t('#header-outer[data-has-menu="true"]').length>0||t('body[data-header-search="true"]').length>0||t(".slide-out-widget-area-toggle a.using-label").length>0||t('.slide-out-widget-area-toggle[data-custom-color="true"]').length>0)&&t(".slide-out-widget-area-toggle").addClass("small")}ht.usingMobileBrowser?(r.on("click",".slide-out-widget-area-toggle:not(.std-menu) a",Oa),r.on("click","#slide-out-widget-area-bg",Sa)):(r.on("mouseenter","#header-outer .slide-out-widget-area-toggle:not(.std-menu) a",Oa),o.on("mouseenter",function(){t(this).addClass("mouse-accessed")})),s.on("smartresize",xa)}():(Wa(),0!=t("#header-outer #mobile-menu").length&&(t("#header-outer #mobile-menu li.megamenu").removeClass("megamenu"),t("#header-outer #mobile-menu ul li a").each(function(){t(this).hasClass("nectar-widget-link")||0!=t(this).find(".nectar-ext-menu-item").length||t(this).wrapInner("<span></span>")}),t("#header-outer #mobile-menu ul li").each(function(){t(this).find("> ul").length>0&&t(this).find("> a").append('<span class="sf-sub-indicator"><i class="fa fa-angle-down"></i></span>')}),t("#header-outer #mobile-menu").on("click",".sf-sub-indicator",function(){console.log("effe");var e=t(this).parent().parent();return e.toggleClass("current-open-item"),e.hasClass("current-open-item")?(e.find("> ul").show(),setTimeout(function(){e.addClass("visible")},30)):(e.find("ul").hide(),e.find("li").removeClass("visible").removeClass("current-open-item"),e.removeClass("visible")),!1}),s.on("smartresize",function(){(ht.winW>1e3&&t(".slide-out-widget-area-toggle.mobile-icon a.open").length>0||ht.winW>1e3&&t(".nectar-ocm-trigger-open.simple-mobile-menu a.open").length>0)&&(t(".slide-out-widget-area-toggle.mobile-icon a, .nectar-ocm-trigger-open.simple-mobile-menu a").addClass("non-human-allowed"),t(".slide-out-widget-area-toggle.mobile-icon a.open, .nectar-ocm-trigger-open.simple-mobile-menu a.open").trigger("click"),setTimeout(function(){t(".slide-out-widget-area-toggle.mobile-icon a, .nectar-ocm-trigger-open.simple-mobile-menu a").removeClass("non-human-allowed")},100))}))),t("#slide-out-widget-area").hasClass("fullscreen-inline-images")&&0==t(".off-canvas-menu-container .menu > li > a span.wrap").length&&t(".off-canvas-menu-container .menu > li a").wrapInner('<span class="wrap"></span>'),0==t("#slide-out-widget-area.fullscreen-split").length&&0==t('body.material[data-slide-out-widget-area-style*="slide-out-from-right"]').length&&0==t('#slide-out-widget-area[data-dropdown-func="separate-dropdown-parent-link"]').length?function(){t("#slide-out-widget-area .off-canvas-menu-container .menu").wrap('<div class="menu-wrap menuwrapper" />'),t("#slide-out-widget-area .off-canvas-menu-container .menu").addClass("menuopen");var e=t("#slide-out-widget-area.fullscreen-alt").length>0||t("#slide-out-widget-area.fullscreen-inline-images").length>0?"4":"5";t("#slide-out-widget-area .off-canvas-menu-container .menu-wrap").dlmenu({animationClasses:{classin:"dl-animate-in-"+e,classout:"dl-animate-out-"+e}})}():t('body.using-mobile-browser[data-slide-out-widget-area-style="slide-out-from-right-hover"]').length>0&&t('body #slide-out-widget-area .inner .off-canvas-menu-container li a[href*="#"]').on("click",function(){"#"!=t(this).attr("href")&&Fa(t(this).parent())}),t("#nectar_fullscreen_rows").length>0&&(t('body[data-slide-out-widget-area-style*="fullscreen"]').length>0||t('body[data-slide-out-widget-area-style="slide-out-from-right"]:not(.material)').length>0)&&t("body #slide-out-widget-area .inner .off-canvas-menu-container li a[href]").on("click",function(){var e=t(this).is('[href*="#"]')?t(this).attr("href"):"";"#"!=e&&t('div[data-fullscreen-anchor-id="'+e.substr(e.indexOf("#")+1)+'"]').length>0&&(setTimeout(function(){t("#slide-out-widget-area .slide_out_area_close").addClass("non-human-allowed").trigger("click")},100),setTimeout(function(){t("#slide-out-widget-area .slide_out_area_close").removeClass("non-human-allowed")},150))}),r.on("mouseover","#slide-out-widget-area .off-canvas-menu-container .menuwrapper > .sub-menu li > a",function(){var e=t(this).text();t(".off-canvas-menu-container .menuwrapper .menu li > a").removeClass("hovered"),t(".off-canvas-menu-container .menuwrapper .menu li > a:contains("+e+")").addClass("hovered")}),r.on("mouseover",".off-canvas-menu-container .menuwrapper .menu li > a",function(){t(".off-canvas-menu-container .menuwrapper .menu li > a").removeClass("hovered")})}function Fa(a){t("#slide-out-widget-area.open").length>0&&((e.location.href.split("#")[0]==a.find("> a").attr("href").split("#")[0]||a.find('a[href^="#"]').length>0)&&(a.parents(".slide-out-from-right-hover").length>0?t(".slide-out-widget-area-toggle.slide-out-hover-icon-effect a").trigger("click"):(t(".slide-out-widget-area-toggle a").addClass("non-human-allowed").trigger("click"),setTimeout(function(){t(".slide-out-widget-area-toggle a").removeClass("non-human-allowed")},100))))}ie.prototype.setup=function(){var a=this;this.$el.find(".dynamic-words > span").each(function(e){a.words[e]=t(this)}),this.viewportTracking(),this.$el.hasClass("element_stagger_words")?(this.staggerWaypoint(),t(e).on("nectar-waypoints-reinit nectar-tab-changed",this.staggerWaypoint.bind(this))):(clearInterval(this.interval),this.interval=setInterval(this.sequence.bind(this),this.duration)),ht.usingMobileBrowser?e.addEventListener("orientationchange",this.calcWidth.bind(this)):t(e).on("resize",this.calcWidth.bind(this))},ie.prototype.viewportTracking=function(){var t=this;if("IntersectionObserver"in e){this.observer=new IntersectionObserver(function(e){e.forEach(function(e){e.isIntersecting?t.state.visible=!0:t.state.visible=!1})},{rootMargin:"0px",threshold:0}),this.observer.observe(this.$el[0])}else this.state.visible=!0},ie.prototype.calcWidth=function(){var t=this,e=this.$el.find(".dynamic-words").width();this.$el.find(".dynamic-words").css({width:""});var a=this.words[this.state.activeIndex].find("span").width();this.$el.find(".dynamic-words").css({width:e}),setTimeout(function(){t.$el.find(".dynamic-words").css({width:a})},30)},ie.prototype.sequence=function(){if(this.$el.find(".dynamic-words > span").length<2||0==this.state.visible)return!0;var t,e;this.state.activeIndex=(t=this.words.length,(e=this.state.activeIndex+1)>=0?e%t:(e%t+t)%t),this.calcWidth(),this.$el.find(".dynamic-words > span").removeClass("active"),this.words[this.state.activeIndex].addClass("active")},ie.prototype.staggerWaypoint=function(){var e=this;if(1==rt&&0==this.$el.parents(".active").length)return!0;var a=t(this).hasClass("animated-in")?" animated":"";this.$el.find(".beginning-text, .ending-text").each(function(){var e=t(this).text();e=(e=e.trim()).split(" "),t(this)[0].innerHTML="";for(var n=0;n<e.length;n++)t(this)[0].innerHTML+='<span class="text-wrap"><span class="inner'+a+'">'+e[n]+"</span></span> "}),this.$el.hasClass("animated-in")&&this.$el.find(".beginning-text .inner, .ending-text .inner").css({transform:"translateY(0)"}),this.$el.addClass("markup-generated");var n=1==rt?"500%":"bottom-in-view",i=this.$el,s=i.is("[data-delay]")?parseInt(i.attr("data-delay")):0,r=new Waypoint({element:i[0],handler:function(){if(i.parents(".wpb_tab").length>0&&"hidden"==i.parents(".wpb_tab").css("visibility")||i.hasClass("animated-in"))r.destroy();else{if(!z||t('body[data-responsive="0"]').length>0)setTimeout(function(){var e=0;e=500/i.find(".text-wrap").length,e=Math.min(Math.max(e,15),50),parseInt(E)<1100?E:"1100";var a=0;i.find(".text-wrap").each(function(){var n=t(this);if(t(this).parents(".dynamic-words").length>0&&!t(this).hasClass("active"))return n.find("> span").css({transform:"translate3d(0,0,0)"}),!0;setTimeout(function(){n.find("> span").css({transform:"translate3d(0,0,0)"})},a*e),a++}),i.addClass("animated-in")},s);1!=e.state.sequenceStarted&&(clearInterval(e.interval),e.interval=setInterval(e.sequence.bind(e),e.duration)),e.state.sequenceStarted=!0,r.destroy()}},offset:n})},le.prototype.events=function(){var a=this;"single_link"==this.linkFunc&&(t(e).on("resize",this.setVertCenter.bind(this)),this.setVertCenter(),this.$el.find(".wpb_tabs_nav li").on("click",function(e){if(ht.winW<1e3){var n=a.$el.find(".wpb_tabs_nav");void 0!==e.originalEvent&&(a.$el.find(".scrolling-tab-nav .scrolling-tab-nav-current-item").toggleClass("open"),n.toggle(),Ee()),a.$el.find(".scrolling-tab-nav li").removeClass("active"),t(this).addClass("active"),a.updateActiveTitle()}}))},le.prototype.setVertCenter=function(){var t=(ht.winH-this.$el.find(".scrolling-tab-nav").height())/2;a.documentElement.style.setProperty("--nectar-sticky-tabs-vert-y",t+"px")},le.prototype.updateActiveTitle=function(){var t=this.$el.find(".scrolling-tab-nav .scrolling-tab-nav-current-item"),e=this.$el.find(".scrolling-tab-nav .menu-item.active .tab-nav-heading").clone(),a=this.$el.find(".scrolling-tab-nav .menu-item.active").index();this.$el.find(".scrolling-tab-content > div").removeClass("active"),this.$el.find(".scrolling-tab-content > div:eq("+a+")").addClass("active"),this.$el.find(".scrolling-tab-nav .scrolling-tab-nav-total .inner").css("transform","translateY(-"+100*a+"%)"),t.html(e)},le.prototype.domSetup=function(){var e=this,a="";this.$el.find(".wpb_tab").each(function(n){if(t(this).is("[data-tab-icon]")&&t(this).attr("data-tab-icon").length>0&&0===t(this).find(".im-icon-wrap.tab-icon").length&&(e.$el.addClass("using-icons"),a=e.$el.find(".wpb_tabs_nav li:nth-child("+(n+1)+") a").attr("href"),e.$el.find(".wpb_tabs_nav li:nth-child("+(n+1)+")").addClass("has-icon").prepend('<a class="skip-hash" href="'+a+'"><i class="'+t(this).attr("data-tab-icon")+'"></i></a>')),t(this).find(".im-icon-wrap.tab-icon").length>0){a=e.$el.find(".wpb_tabs_nav li:nth-child("+(n+1)+") a").attr("href");var i=t(this).find(".im-icon-wrap.tab-icon").detach();e.$el.find(".wpb_tabs_nav li:nth-child("+(n+1)+")").addClass("has-icon").prepend('<a class="skip-hash svg-icon-link" href="'+a+'"></a>'),e.$el.find(".wpb_tabs_nav li:nth-child("+(n+1)+") .svg-icon-link").append(i)}}),this.$el.find(".scrolling-tab-nav .menu-item:first").addClass("active"),this.lineAnimation(),"single_link"==e.linkFunc&&this.updateActiveTitle(),1==this.$el.find(".scrolling-tab-nav .menu-item").length&&this.$el.find(".scrolling-tab-nav").addClass("single-tab");var n=this.$el.find(".scrolling-tab-content");this.$el.find(".scrolling-tab-nav .menu-item").each(function(a){a+=1;var i=n.find("> div:nth-child("+a+")");if("default"==e.linkFunc){var s=t(this).html();if(i.prepend('<div class="scrolling-tab-mobile-title"><div class="inner">'+Yt(s)+"</div></div>"),i.find(".scrolling-tab-mobile-title a").contents().unwrap(),i){var r=t(this).find("a").attr("href");r=r.substr(1),i.find("> .scrolling-tab-mobile-title").attr("id",r),i.removeAttr("id")}}}),this.$el.addClass("initalized")},le.prototype.highlightObserve=function(){var n=this;if(!(ht.usingMobileBrowser&&ht.winW<1e3)&&"IntersectionObserver"in e){var i=d.is('[data-remove-fixed="1"]')?"100px 0px 0px 0px":"5px 0px 0px 0px",s={root:a,rootMargin:i,threshold:1};this.observer=new IntersectionObserver(function(e){e.forEach(function(e){var a="#"+t(e.target).attr("id"),i=n.$el.find('.scrolling-tab-nav a[href="'+a+'"]');e.isIntersecting&&e.intersectionRatio>=1?i.parents(".menu-item").addClass("visible"):i.parents(".menu-item").removeClass("visible");var s=n.$el.find(".scrolling-tab-nav .menu-item.visible:first");s.length>0&&(n.$el.find(".scrolling-tab-nav .menu-item").removeClass("active"),s.addClass("active"),n.lineAnimation())})},s),this.$tabContent.find("> div > .scrolling-tab-mobile-title[id]").each(function(){n.observer.observe(t(this)[0])}),this.tabs=Array.from(this.$tabContent.find("> div")),this.scrollDir="up",this.prevScroll=0,this.prevIndex=0,this.observer=new IntersectionObserver(function(e){e.forEach(function(e){if(!(ht.winW<1e3)){ht.scrollTop>n.prevScroll?n.scrollDir="down":n.scrollDir="up";var a="down"===n.scrollDir?n.getTargetSection(e):e.target;if(n.shouldUpdate(e)){var i=t(a).index();i<n.prevIndex?n.$el.addClass("scrolling-up"):n.$el.removeClass("scrolling-up"),n.$el.find(".scrolling-tab-nav .ui-tabs-nav > .menu-item").removeClass("prev-active"),n.$el.find(".scrolling-tab-nav .ui-tabs-nav > .menu-item.active").addClass("prev-active"),n.$el.find(".scrolling-tab-nav .ui-tabs-nav > .menu-item").removeClass("active"),n.$el.find(".scrolling-tab-nav .ui-tabs-nav > .menu-item:eq("+i+")").addClass("active"),n.updateActiveTitle(),n.prevIndex=i}n.prevScroll=ht.scrollTop}})},{root:a,rootMargin:"-40% 0% -40% 0%",threshold:0}),this.$tabContent.find("> div").each(function(){n.observer.observe(t(this)[0])})}},le.prototype.getTargetSection=function(t){var e=this.tabs.findIndex(function(e){return e==t.target});return e>=this.tabs.length-1?t.target:this.tabs[e+1]},le.prototype.shouldUpdate=function(t){return"down"===this.scrollDir&&!t.isIntersecting&&0!=this.prevScroll||!("up"!==this.scrollDir||!t.isIntersecting||0==this.prevScroll)},le.prototype.lineAnimation=function(){var t=this.$el.find(".scrolling-tab-nav .active");if(0!=t.length){var e=parseInt(t.position().top),a=parseInt(t.height());this.$lineEl.css({"max-height":a+"px",transform:"translate3d(0px, "+e+"px, 0px)"})}},ue.prototype.calcTopOffset=function(){this.topOffset=(ht.winH-this.$innerEl.height())/2},ue.prototype.resizeEvent=function(){ht.winW>1e3?(this.calcTopOffset(),this.$innerEl.css({top:this.topOffset})):this.$innerEl.css({top:""})},Te.prototype.setType=function(){this.$element.is("[data-scroll-animation-movement]")&&("transform_x"==this.$element.attr("data-scroll-animation-movement")&&(this.type="translateX"))},Te.prototype.calculatePos=function(){1!=pt.materialOffCanvasOpen&&1!=pt.ocmAnimating&&(this.offsetTop=this.$element.offset().top,this.height=this.$element.outerHeight(),this.vertCenter=this.storedWinH/2-this.height/2),ht.usingMobileBrowser||(this.storedWinH=ht.winH)},Te.prototype.orientationChange=function(){ht.usingMobileBrowser&&(this.offsetTop=this.$element.offset().top,this.height=this.$element.outerHeight(),this.storedWinH=ht.winH)},Te.prototype.trackView=function(){var t=this;(this.$element.parents(".top-level").length>0&&(this.topLevel=!0,this.offsetTop>ht.winH&&(this.topLevel=!1)),"IntersectionObserver"in e)&&new IntersectionObserver(function(e){e.forEach(function(e){var a=e.isIntersecting;t.inView=!!a})},{root:a,rootMargin:"250px"}).observe(this.$element[0])},Te.prototype.animate=function(){if(1!=pt.materialOffCanvasOpen){if(1==this.lerp?this.lastY=ht.scrollTop:this.lastY=parseInt(Lt(this.lastY,ht.scrollTop,this.lerp)),1==pt.animatedScrolling&&(this.inView=!0),this.inView){var t=this.intensity;ht.winW<1025&&(t/=1.2),ht.winW<690&&(t/=1.35),!0===this.topLevel&&ht.winW>1e3||!0===this.topLevel&&this.persistOnMobile?this.$elementInner[0].style.transform=this.type+"("+-this.lastY*t+"px) translateZ(0)":ht.winW>1e3||this.persistOnMobile?this.$elementInner[0].style.transform=this.type+"("+-(this.lastY-this.offsetTop+this.vertCenter)*t+"px) translateZ(0)":this.$elementInner[0].style.transform=this.type+"(0px) translateZ(0)"}e.requestAnimationFrame(this.animate.bind(this))}else e.requestAnimationFrame(this.animate.bind(this))},Ie.prototype.setup=function(){var a=this;(this.$el.parents("#page-header-bg").length>0||this.$el.parents(".featured-media-under-header").length>0)&&(this.type="page-header"),(this.$el.parents(".top-level").length>0&&this.$el.parents(".parallax_slider_outer").length>0||this.$el.parents(".top-level").length>0&&this.$el.hasClass("nectar-simple-slider")||this.$el.parents(".top-level").length>0&&this.$el.hasClass("nectar-recent-posts-single_featured")||this.$el.parents(".top-level").length>0&&this.$el.hasClass("column-image-bg-wrap")&&this.$el.parent().parent().is(".vc_col-sm-12:not(.child_column)")||this.$el.is(".wpb_row.top-level")||"page-header"==this.type||0==t(".wpb_row").length&&!this.$el.is(".blog_next_prev_buttons"))&&(this.firstSection=!0),(0==t(".wpb_row").length&&this.$el.parents(".parallax_slider_outer").length>0&&this.$el.is('[data-full-width="true"]')||t("#portfolio-extra").length>0&&this.$el.parents(".parallax_slider_outer").length>0&&this.$el.parents(".wpb_row").length>0&&"0"==this.$el.parents(".wpb_row").index())&&(this.firstSection=!0),ht.usingFrontEndEditor&&"page-header"!=this.type&&(this.firstSection=!1),this.$parallaxEl.addClass("translate"),this.nestedParallax=this.$parallaxEl.parents('[data-scroll-animation="true"]').length>0,this.nestedParallax||setInterval(function(){1!=pt.materialOffCanvasOpen&&1!=pt.ocmAnimating&&(a.offsetTop=a.$el.offset().top,a.height=a.$el.outerHeight(!0))},800),t(e).on("nectar-column-animation-start",this.checkColumnAnimation.bind(this)),t(e).on("resize load",this.resize.bind(this)),e.addEventListener("orientationchange",function(){this.setTimeout(function(){a.orientationChange()},110)}),this.offsetTop=this.$el.offset().top,this.height=this.$el.outerHeight(!0)},Ie.prototype.checkColumnAnimation=function(){this.$parallaxEl.parents(".col.has-animation.triggered-animation:not(.animated-in)").length>0&&this.realtimeOffsetUpdate()},Ie.prototype.realtimeOffsetUpdate=function(){var t=this,e=setInterval(function(){1!=pt.materialOffCanvasOpen&&(t.offsetTop=t.$el.offset().top,t.height=t.$el.outerHeight(!0))},30);setTimeout(function(){clearInterval(e)},2e3)},Ie.prototype.resize=function(){ht.usingMobileBrowser?this.nestedParallax||(this.offsetTop=this.$el.offset().top,this.height=this.$el.outerHeight(!0)):(this.storedWinH=ht.winH,this.offsetTop=this.$el.offset().top,this.height=this.$el.outerHeight(!0))},Ie.prototype.orientationChange=function(){ht.usingMobileBrowser&&(this.offsetTop=this.$el.offset().top,this.height=this.$el.outerHeight(!0),this.storedWinH=ht.winH)},Ie.prototype.update=function(){if(this.offsetTop+150+this.height<ht.scrollTop||this.offsetTop-150>ht.scrollTop+this.storedWinH||1==pt.materialOffCanvasOpen){for(var t=0;t<this.$parallaxEl.length;t++)this.$parallaxEl[t].style.willChange="auto";requestAnimationFrame(this.update.bind(this))}else{for(t=0;t<this.$parallaxEl.length;t++)!0===this.firstSection?this.$parallaxEl[t].style.transform="translate3d(0, "+parseInt(ht.scrollTop*this.speed)+"px, 0)":this.$parallaxEl[t].style.transform="translate3d(0, "+parseInt((this.storedWinH+ht.scrollTop-this.offsetTop)*this.speed)+"px, 0) scale(1.005)",this.$parallaxEl[t].style.willChange="transform";requestAnimationFrame(this.update.bind(this))}},t(e).on("salient-parallax-el-recalculate",Ee),Oe.prototype.setupProps=function(){var t=JSON.parse(this.$el[0].getAttribute("data-nectar-animate-settings"));Object.assign(this.animations,t.animations),Object.assign(this.offsets,t.offsets),Object.assign(this,t.config),(this.$el.is(".top-level")||this.$el.parents(".top-level").length>0)&&(this.topLevel=!0)},Oe.prototype.lazyInit=function(){var t=this;if(ht.usingFrontEndEditor)this.init();else{t=this;var e=new IntersectionObserver(function(a){a.forEach(function(a){a.isIntersecting&&(t.init(),e.unobserve(a.target))})},{root:a,rootMargin:"400px 0px 400px 0px",threshold:0});e.observe(this.$el[0])}},Oe.prototype.init=function(){this.createTimeline(),this.events(),this.update()},Oe.prototype.events=function(){var a=this;t(e).on("resize load",this.resize.bind(this)),e.addEventListener("orientationchange",function(){this.setTimeout(function(){a.orientationChange()},110)}),this.resize()},Oe.prototype.resize=function(){ht.usingMobileBrowser||(this.storedWinH=ht.winH);var t=this.$el[0].getBoundingClientRect();this.offsetTop=t.top+ht.scrollTop,this.elHeight=this.$el[0].offsetHeight,this.setActiveDevice()},Oe.prototype.orientationChange=function(){if(ht.usingMobileBrowser){var t=this.$el[0].getBoundingClientRect();this.offsetTop=t.top+ht.scrollTop,this.elHeight=this.$el[0].offsetHeight,this.storedWinH=ht.winH}},Oe.prototype.setActiveDevice=function(){for(var t of Object.keys(this.devices))ht.winW>=this.devices[t].min&&ht.winW<=this.devices[t].max&&(this.activeDevice=t,void 0!==this.timelines[t]&&this.timelines[t].reset())},Oe.prototype.createTimeline=function(){for(var t of Object.keys(this.devices))if(void 0!==this.animations[t]){this.timelines[t]=anime.timeline({autoplay:!1});var e={},a={};for(var n of Object.keys(this.animations[t]))a[n]=this.animations[t][n].start,e[n]=[this.animations[t][n].start,this.animations[t][n].end];this.setActiveDevice();var i={targets:void 0!==this.inner_selector?this.$el[0].querySelectorAll(this.inner_selector):this.$el[0],duration:1e3,easing:"linear"};Object.assign(i,e),this.timelines[t].add(i,0)}},Oe.prototype.progressValues=function(){if(void 0!==this.timelines[this.activeDevice]){var t=ht.scrollTop,e=this.storedWinH,a=parseInt(this.offsets.start)/100,n=e-a*e;"bottom"===this.offsets.origin&&(n-=this.elHeight);var i=(t-(this.offsetTop-n))/e;this.topLevel&&(n=0,i=(t-this.offsetTop)/e);var s=Math.max(Math.min(i,1),0),r=parseInt(this.offsets.end)/100,o=2+-1*r,l=r-a-.01;o>1&&(o*=1/Math.min(2*l,.9)),s>0?(this.needsReset=!0,this.timelines[this.activeDevice].seek(this.timelines[this.activeDevice].duration*s*o)):this.needsReset&&(this.timelines[this.activeDevice].reset(),this.needsReset=!1)}},Oe.prototype.update=function(){1!=pt.materialOffCanvasOpen&&1!=pt.ocmAnimating&&this.progressValues(),requestAnimationFrame(this.update.bind(this))},t(e).on("salient-parallax-bg-recalculate",Ae),Ye.prototype.calculatePos=function(){1!=pt.materialOffCanvasOpen&&1!=pt.ocmAnimating&&(this.offsetTop=this.$element.offset().top,this.height=this.$element.outerHeight(),this.vertCenter=ht.winH/2-this.height/2)},Ye.prototype.trackView=function(){var t=this;(this.$element.parents(".top-level").length>0&&(this.topLevel=!0),"IntersectionObserver"in e)&&new IntersectionObserver(function(e){e.forEach(function(e){var a=e.isIntersecting;t.inView=!!a})},{root:a,rootMargin:"250px"}).observe(this.$element[0])},Ye.prototype.animate=function(){if(1!=pt.materialOffCanvasOpen){if(1==pt.animatedScrolling&&(this.inView=!0),this.lastY=Lt(this.lastY,ht.scrollTop,.2),this.inView){var a=this;this.$element.find(".bg-layer").each(function(e){var n=t(this).data("scale");a.layer1Parallax&&(e=e/1.5+1),!0===a.topLevel&&ht.winW>1e3?t(this)[0].style.transform="translateY("+-a.lastY*a.intensity*e+"px) translateZ(0) scale("+n+")":t(this)[0].style.transform="translateY("+-(a.lastY-a.offsetTop+a.vertCenter)*a.intensity*e+"px) translateZ(0) scale("+n+")"})}e.requestAnimationFrame(this.animate.bind(this))}else e.requestAnimationFrame(this.animate.bind(this))},t(e).on("salient-lazyloading-image-reinit",Ke),t(e).on("salient-lazyloading-image-reinit",ta),na.prototype.initialMarkup=function(){0==this.el.find(".nectar-post-grid-filters a.active").length&&this.el.find(".nectar-post-grid-filters a:first-child").addClass("active"),"load-more"===this.settingsData.pagination&&0==this.el.find(".load-more-wrap").length&&(this.el.find(".active.all-filter").length>0&&(this.activeFilter=this.el.find(".active.all-filter").index()+1),this.activeCatTotal=parseInt(this.el.find(".nectar-post-grid-filters a:nth-child("+this.activeFilter+")").attr("data-total-count")),this.el.find(".nectar-post-grid-item").length>=this.activeCatTotal?(this.el.addClass("all-loaded"),this.el.append('<div class="load-more-wrap inactive"><a href="#" class="load-more">'+this.el.attr("data-load-more-text")+"</a></div>")):(this.el.removeClass("all-loaded"),this.el.append('<div class="load-more-wrap"><a href="#" class="load-more">'+this.el.attr("data-load-more-text")+"</a></div>")))},na.prototype.lightboxGroups=function(){var e=Nt(),a=this.el.find(".nectar-post-grid-link.pretty_photo").length>0;t('body[data-ls="magnific"]').length>0?this.el.find(".nectar-post-grid-link.pretty_photo").addClass("magnific").addClass("gallery").removeClass("pretty_photo"):t('body[data-ls="fancybox"]').length>0&&(this.el.find(".nectar-post-grid-link.pretty_photo").attr("data-fancybox","group_"+e).removeClass("pretty_photo"),this.el.find(".nectar-post-grid-link[data-fancybox]").attr("data-fancybox","group_"+e)),a&&ae()},na.prototype.externalProjectLinks=function(){this.el.hasClass("target-blank-external-urls")&&(this.el.find(".nectar-post-grid-item a[href*='http://']:not([href*='"+e.location.hostname+"'])").attr("target","_blank"),this.el.find(".nectar-post-grid-item a[href*='https://']:not([href*='"+e.location.hostname+"'])").attr("target","_blank"))},na.prototype.clickEvents=function(){this.el.find(".nectar-post-grid-filters h4").on("click",function(){t(this).parent().find("div").toggleClass("visible"),t(this).toggleClass("visible")}),"content_under_image"==this.gridStyle&&this.el.find(".nectar-post-grid-link.pretty_photo").length>0&&this.el.on("click",".bg-wrap-link",function(){if(t(this).parents(".nectar-post-grid-item").find(".nectar-post-grid-link").length>0)return t(this).parents(".nectar-post-grid-item").find(".nectar-post-grid-link")[0].click(),!1});var a=this.settingsData,n=this.queryData,i=this;this.el.find(".nectar-post-grid-filters a, .load-more-wrap .load-more").on("click",function(r){var o=t(this);if(o.parents(".nectar-post-grid-wrap.loading").length>0||t(this).hasClass("active")||t(this).hasClass("inactive"))return!1;t(this).parents(".nectar-post-grid-filters").length>0?(o.parent().find("a").removeClass("active"),o.addClass("active"),i.currentPage=0,i.activeFilter=o.index()+1):i.currentPage++;var l=o.parents(".nectar-post-grid-wrap").find(".nectar-post-grid"),d=a.pagination,c=o.hasClass("load-more")&&"load-more"===d?"load-more":"filter",h="",u="";if("yes"===i.sortable)h=o.parents(".nectar-post-grid-wrap").find(".nectar-post-grid-filters a.active").attr("data-filter"),u=o.parents(".nectar-post-grid-wrap").find(".nectar-post-grid-filters a.active").attr("data-filter");else{var p=o.parents(".nectar-post-grid-wrap").find(".nectar-post-grid-filters a").length>1?":not(.all-filter)":"";o.parents(".nectar-post-grid-wrap").find(".nectar-post-grid-filters a"+p).each(function(){h+=t(this).attr("data-filter")+", ",u+=t(this).attr("data-filter")+", "}),h=h.substring(0,h.length-2),u=u.substring(0,u.length-2)}var f={action:"nectar_get_post_grid_segment",post_type:n.post_type,cpt_name:n.cpt_name,custom_query_tax:u,category:h,posts_per_page:n.posts_per_page,current_page:i.currentPage,offset:n.offset,order:n.order,orderby:n.orderby,load_action:c,ignore_sticky_posts:n.ignore_sticky_posts,settings:{pagination:d,post_type:a.post_type,image_size:a.image_size,aspect_ratio_image_size:a.aspect_ratio_image_size,card_bg_color:a.card_bg_color,display_categories:a.display_categories,display_excerpt:a.display_excerpt,display_date:a.display_date,color_overlay:a.color_overlay,color_overlay_opacity:a.color_overlay_opacity,color_overlay_hover_opacity:a.color_overlay_hover_opacity,grid_style:a.grid_style,hover_effect:a.hover_effect,heading_tag:a.heading_tag,post_title_overlay:a.post_title_overlay,enable_gallery_lightbox:a.enable_gallery_lightbox,overlay_secondary_project_image:a.overlay_secondary_project_image,vertical_list_hover_effect:a.vertical_list_hover_effect,vertical_list_read_more:a.vertical_list_read_more}};"rand"==n.orderby&&"load-more"==c&&(f.posts_shown="",l.find(".nectar-post-grid-item[data-post-id]").each(function(){f.posts_shown+=t(this).attr("data-post-id")+", "}),f.posts_shown=f.posts_shown.substring(0,f.posts_shown.length-2)),o.parents(".nectar-post-grid-wrap").addClass("loading"),t.post(e.nectarLove.ajaxurl,f,function(a){if("load-more"===c)l.append(a);else if(l.html(a),l.parent().hasClass("nectar-post-grid-wrap--fl-sidebar_left")||l.parent().hasClass("nectar-post-grid-wrap--fl-sidebar_right")){var n=l.parent().offset().top,r=0;0==t(".page-template-template-no-header-footer").length&&0==t(".page-template-template-no-header").length&&0==t('body[data-header-format="left-header"]').length&&(r=t("#header-outer").height()),ht.winW>999&&ht.scrollTop>n+200&&e.scrollTo(0,n-r)}l.is('[data-animation="fade-in-from-bottom"]')&&(o.parents(".nectar-post-grid-wrap").removeClass("finished-animating"),l.find(".nectar-post-grid-item:not(.animated-in)").each(function(e){var a=t(this);setTimeout(function(){a.addClass("animated-in")},90*e)}),setTimeout(function(){o.parents(".nectar-post-grid-wrap").addClass("finished-animating")},950)),"load-more"===d&&(i.activeCatTotal=parseInt(i.el.find(".nectar-post-grid-filters a:nth-child("+i.activeFilter+")").attr("data-total-count")),l.find(".nectar-post-grid-item").length>=i.activeCatTotal?(i.el.find(".load-more-wrap").addClass("inactive"),i.el.addClass("all-loaded")):(i.el.find(".load-more-wrap").removeClass("inactive"),i.el.removeClass("all-loaded"))),i.lightboxGroups(),i.externalProjectLinks(),o.parents(".nectar-post-grid-wrap").removeClass("loading"),s.trigger("resize"),ea()}),r.preventDefault()})},na.prototype.deepLinking=function(){void 0!==Jt["grid-filter"]&&this.el.find(".nectar-post-grid-filters a").each(function(){var e=t(this).clone(),a=Jt["grid-filter"];t(this);(e=(e=e.text()).replace(/\s+/g,"-").toLowerCase()).length>0&&"-"===e.substring(0,1)&&(e=e.substring(1)),e==(a=a.replace(/\s+/g,"-").replace(/</g,"<").replace(/"/g,""").toLowerCase())&&t(this).trigger("click")})},t.DLMenu=function(e,a){this.$el=t(a),this._init(e)},t.DLMenu.defaults={animationClasses:{classin:"dl-animate-in-1",classout:"dl-animate-out-1"},onLevelClick:function(){return!1},onLinkClick:function(){return!1}},t.DLMenu.prototype={_init:function(e){this.options=t.extend(!0,{},t.DLMenu.defaults,e),this._config();this.animEndEventName="animationend.menu",this.transEndEventName="transitionend.menu",this.supportAnimations=!0,this.supportTransitions=!0,this._initEvents()},_config:function(){this.open=!1,this.$trigger=this.$el.children(".trigger"),this.$menu=this.$el.children("ul.menu"),this.$menuitems=this.$menu.find("li:not(.back) > a"),this.$el.find("ul.sub-menu").prepend('<li class="back"><a href="#"> '+o.attr("data-back-txt")+" </a></li>"),this.$back=this.$menu.find("li.back")},_initEvents:function(){var e=this;this.$trigger.on("click.menu",function(){return e.open?e._closeMenu():e._openMenu(),!1}),this.$menuitems.on("click.menu",function(a){var n=t(this).parent("li"),i=n.children("ul.sub-menu");if(t(".fullscreen-alt .off-canvas-menu-container .clip-wrap, .fullscreen-alt .off-canvas-menu-container .clip-wrap span").css("transition-duration","0s"),i.length>0){var s=i.clone().css("opacity",0).insertAfter(e.$menu),r=function(){e.$menu.off(e.animEndEventName).removeClass(e.options.animationClasses.classout).addClass("subview"),n.addClass("subviewopen").parents(".subviewopen:first").removeClass("subviewopen").addClass("subview"),s.remove(),setTimeout(function(){t(".off-canvas-menu-container .menu > li").removeClass("no-pointer-events"),t(".off-canvas-menu-container .clip-wrap, .off-canvas-menu-container .clip-wrap span").css("transition-duration",".45s")},300)};return setTimeout(function(){s.addClass(e.options.animationClasses.classin),e.$menu.addClass(e.options.animationClasses.classout),e.supportAnimations?e.$menu.on(e.animEndEventName,r):r.call(),e.options.onLevelClick(n,n.children("a:first").text())}),n.parents(".menu-wrap").css("height",n.parents(".off-canvas-menu-container").find(".menuwrapper .menu").height()).transition({height:s.height()},500,"easeInOutQuad"),setTimeout(Ea,600),!1}e.options.onLinkClick(n.find("> a"),a),Fa(n)}),this.$back.on("click.menu",function(){var a=t(this),n=a.parents("ul.sub-menu:first"),i=n.parent(),s=n.clone().insertAfter(e.$menu),r=function(){e.$menu.off(e.animEndEventName).removeClass(e.options.animationClasses.classin),s.remove()};return setTimeout(function(){s.addClass(e.options.animationClasses.classout),e.$menu.addClass(e.options.animationClasses.classin),e.supportAnimations?e.$menu.on(e.animEndEventName,r):r.call(),i.removeClass("subviewopen");var t=a.parents(".subview:first");t.is("li")&&t.addClass("subviewopen"),t.removeClass("subview")}),setTimeout(function(){i.parents(".menu-wrap").transition({height:i.parent().height()},500,"easeInOutQuad"),setTimeout(Ea,600)},50),!1})},closeMenu:function(){this.open&&this._closeMenu()},_closeMenu:function(){var t=this,e=function(){t.$menu.off(t.transEndEventName),t._resetMenu()};this.$menu.removeClass("menuopen"),this.$menu.addClass("menu-toggle"),this.$trigger.removeClass("active"),this.supportTransitions?this.$menu.on(this.transEndEventName,e):e.call(),this.open=!1},openMenu:function(){this.open||this._openMenu()},_openMenu:function(){var e=this;r.off("click").on("click.menu",function(){e._closeMenu()}),this.$menu.addClass("menuopen menu-toggle").on(this.transEndEventName,function(){t(this).removeClass("menu-toggle")}),this.$trigger.addClass("active"),this.open=!0},_resetMenu:function(){this.$menu.removeClass("subview"),this.$menuitems.removeClass("subview subviewopen")}};var qa=function(t){e.console&&e.console.error(t)};function La(){var e=parseInt(g.height());t('body[data-aie="slide-down"] #page-header-wrap:not(.fullscreen-header):not([data-responsive="true"])').css("height",e+"px")}function ja(){0!=t("#ajax-content-wrap").length&&r.hasClass("ajax-loaded")?1==t("#ajax-content-wrap").length&&t('#page-header-bg[data-parallax="1"]').css({opacity:1}):t('#page-header-bg[data-parallax="1"]').animate({opacity:1},350,"easeInCubic"),t('#page-header-bg[data-parallax="1"] .nectar-particles').append('<div class="fade-out" />')}function Ya(){var a={inView:!0},n=t("#page-header-bg .span_6 .inner-wrap"),i=t("#page-header-bg #canvas");if(t('#page-header-bg[data-parallax="1"]').length>0){var r=new Image,o=parseInt(g.height()),l=t("#header-space").height(),d=t(".nectar-global-section.after-nav").length>0?t(".nectar-global-section.after-nav").height():0,c=Zt(t('#page-header-bg[data-parallax="1"]').css("background-image"));c&&-1!==c.indexOf(".")?(r.onload=function(){ja()},r.src=Zt(t('#page-header-bg[data-parallax="1"]').css("background-image"))):ja(),ht.winW>1e3&&p(),e.addEventListener("scroll",function(){ht.winW>1e3&&e.requestAnimationFrame(p)},!1)}var h=t('body[data-ajax-transitions="true"]').length>0&&t('#page-header-bg[data-animate-in-effect="slide-down"]').length>0?350:0;if(g.length>0){setTimeout(function(){La()},h),t('#page-header-bg[data-animate-in-effect="fade-in"]').addClass("loaded");var u=Zt(g.css("background-image"));u&&-1!==u.indexOf(".")&&g.addClass("has-bg"),s.on("smartresize",La)}function p(){ht.winW>=1e3&&null==navigator.userAgent.match(/iPad/i)&&1!=pt.materialOffCanvasOpen&&(1==a.inView&&(n.css({transform:"translateY("+.15*ht.scrollTop+"px)",opacity:1-ht.scrollTop/(.7*(d+o))}),i&&i.css({transform:"translateY("+.15*ht.scrollTop*2+"px)"})),ht.scrollTop/(o+l+ht.adminBarHeight)>1?(a.inView=!1,t(".nectar-particles, #page-header-bg .fade-out").css("visibility","hidden").addClass("out-of-sight"),t("#page-header-bg").addClass("out-of-sight")):(a.inView=!0,t("#page-header-bg, .nectar-particles, #page-header-bg .fade-out").css("visibility","visible").removeClass("out-of-sight")))}g.length>0&&((-1!=navigator.userAgent.indexOf("Safari")&&-1==navigator.userAgent.indexOf("Chrome")||navigator.userAgent.match(/(iPod|iPhone|iPad)/))&&(e.onunload=function(){Ya(),t('#page-header-bg[data-parallax="1"] .span_6').css({opacity:1})}),0==t(".nectar-box-roll").length&&Ra())}function Pa(){if(0==t("#page-header-bg .nectar-particles").length&&0==t('#page-header-bg[data-text-effect="none"]').length||t(".nectar-box-roll").length>0&&0==t("#page-header-bg .nectar-particles").length){var e=0==t(".nectar-box-roll").length?"#page-header-bg .span_6":".nectar-box-roll .overlaid-content .span_6";t(e).find(".wraped").each(function(e){t(this).find("span").delay(370*e).transition({rotateX:"0",opacity:1,y:0},400,"easeOutQuad")}),setTimeout(function(){t(e).find(".inner-wrap > *:not(.top-heading)").each(function(e){t(this).delay(370*e).transition({rotateX:"0",opacity:1,y:0},650,"easeOutQuad")}),t(".scroll-down-wrap, .scroll-down-wrap .section-down-arrow").removeClass("hidden")},370*t(e).find(".wraped").length)}}function Ra(){g.each(function(){if("rotate_in"==t(this).attr("data-text-effect")){var e="none";if(t(this).find(".span_6 h1").length>0&&(e="h1"),"none"!=e){var a=t(this).find(".nectar-particles").length>0?".inner-wrap.shape-1":".span_6";t(this).find(a).find(e).addClass("top-heading").contents().filter(function(){return 3===this.nodeType&&void 0!==this.data&&this.data.replace(/\s+/,"")}).wrap('<span class="wraped"></span>'),t(this).find(a).find(".wraped").each(function(){var e=t(this),a=e.text().split(" "),n="";t.each(a,function(t,e){e.replace(/\s+/,"")&&(n+='<span class="wraped"><span>'+e+"</span></span> ")}),e.replaceWith(t(n))})}}});var e=p.length>0?800:0;0==t("#page-header-bg .nectar-video-wrap video").length&&setTimeout(Pa,e)}function Va(){if(t('#header-outer[data-permanent-transparent="1"]').length>0&&t('body[data-bg-header="true"]').length>0){0==t(".container-wrap div[data-midnight]").length&&t(".container-wrap").attr("data-midnight","dark");var e=[];t("div[data-midnight]:not(.has-global-section)").each(function(){("light"==t(this).attr("data-midnight")&&0==t(this).parents(".pum-content").length||"dark"==t(this).attr("data-midnight")&&0==t(this).parents(".pum-content").length)&&(t(this).is("#page-header-bg")&&t(this).parents("#page-header-wrap[data-midnight]").length>0||e.push(t(this)))}),e.length>0&&t.each(e,function(a,n){if("light"==n.attr("data-midnight")||"dark"==n.attr("data-midnight")){var i=n;new Waypoint({element:i[0],handler:function(n){var s;t("body.material-ocm-open").length>0||t("#slide-out-widget-area.open").length>0||"none"==i.css("display")||("down"==n?(s="light"==i.attr("data-midnight")?"":"dark-slide",d.removeClass("dark-slide").addClass(s)):(s="light"==e[a-1>=0?a-1:a].attr("data-midnight")?"":"dark-slide",d.removeClass("dark-slide").addClass(s)))},offset:d.height()})}})}}function Xa(){t(".nectar-box-roll").length>0&&"undefined"!=typeof NectarBoxRoll&&(Ra(),t(e).on("nectar-box-roll-scroll-disabled",function(){pt.preventScroll=!0}),t(e).on("nectar-box-roll-scroll-enabled",function(){pt.preventScroll=!1}),(dt=new NectarBoxRoll(ht,Na,Va,Ln,wa)).inUse=!0)}function Na(){var e,a,i,o,l,c,h,u,p;a=1==rt?"500%":"93%",i=1==rt?"500%":"95%",t(st+'.row-bg-wrap[data-bg-animation]:not([data-bg-animation="none"]) .row-bg').each(function(){var n=t(this).parents(".row-bg-wrap").attr("data-bg-animation"),s=t(this).parents(".row-bg-wrap[data-bg-animation-delay]").length>0?t(this).parents(".row-bg-wrap").attr("data-bg-animation-delay"):0;e="zoom-out-reveal"!=n&&-1==n.indexOf("reveal-from-")?a:i;var r=t(this),o=new Waypoint({element:r.parents(".row-bg-wrap")[0],handler:function(){r.parents(".wpb_tab").length>0&&"hidden"==r.parents(".wpb_tab").css("visibility")||r.hasClass("animated-in")?o.destroy():(setTimeout(function(){r.parents(".inner-wrap").addClass("animated-in"),("zoom-out-reveal"==n||n.indexOf("reveal-from-")>-1||r.parents(".nectar-scrolling-text").length>0)&&r.parents(".row-bg-wrap").addClass("animated-in"),"clip-path"==n&&r.parents(".wpb_row ").addClass("animated-in")},s),o.destroy())},offset:e})}),l=1==rt?"500%":"93%",c=1==rt?"500%":"80%",t(st+'.column-image-bg-wrap[data-bg-animation]:not([data-bg-animation="none"]) .column-image-bg').each(function(){var e=t(this).parents(".column-image-bg-wrap").attr("data-bg-animation");o="zoom-out-reveal"!=e&&-1==e.indexOf("reveal-from-")?l:"ro-reveal-from-bottom"==e&&0==rt?"95%":"ro-reveal-from-top"==e&&0==rt?"65%":c;var a=t(this),n=new Waypoint({element:a.parents(".column-image-bg-wrap")[0],handler:function(){a.parents(".wpb_tab").length>0&&"hidden"==a.parents(".wpb_tab").css("visibility")||a.hasClass("animated-in")?n.destroy():(a.parents(".inner-wrap").addClass("animated-in"),("zoom-out-reveal"==e||e.indexOf("reveal-from-")>-1)&&(a.parents(".column-image-bg-wrap").addClass("animated-in"),a.parents(".column-image-bg-wrap").siblings(".column-bg-overlay-wrap").addClass("animated-in"),a.parents(".vc_column-inner").addClass("revealed-bg")),"mask-reveal"==e&&a.parents(".vc_column-inner").find(".column-bg-layer").addClass("animated-in"),n.destroy())},offset:o})}),t(st+".column-bg-overlay-wrap[data-bg-animation]").each(function(){o=c;var e=t(this),a=t(this).attr("data-bg-animation");if(("zoom-out-reveal"==a||"mask-reveal"==a||a.indexOf("reveal-from-")>0)&&0==e.parent().find(".column-image-bg-wrap").length)var n=new Waypoint({element:e[0],handler:function(){e.hasClass("animated-in")?n.destroy():(e.addClass("animated-in"),e.parents(".vc_column-inner").addClass("revealed-bg"),n.destroy())},offset:o})}),Le(),Re(),De(),h=1==rt?"250%":"75%",t(st+'.nectar-icon-list[data-animate="true"]').each(function(){var e=t(this),a=new Waypoint({element:e[0],handler:function(){e.parents(".wpb_tab").length>0&&"hidden"==e.parents(".wpb_tab").css("visibility")||e.hasClass("completed")?a.destroy():(e.each(function(){var a=e.is('[data-direction="horizontal"]')?100:300;t(this).find(".nectar-icon-list-item").each(function(e){var n=t(this);setTimeout(function(){n.addClass("animated")},e*a)})}),e.addClass("completed"),a.destroy())},offset:h})}),sa(),ra(),Ge(),u=1==rt?"200%":"95%",t(st+".clients.fade-in-animation").each(function(){var e=t(this),a=new Waypoint({element:e[0],handler:function(){e.parents(".wpb_tab").length>0&&"hidden"==e.parents(".wpb_tab").css("visibility")||e.hasClass("animated-in")?a.destroy():(e.find("> div").each(function(e){t(this).delay(80*e).transition({opacity:"1"},450)}),setTimeout(function(){e.addClass("completed")},80*e.find("> div").length+450),e.addClass("animated-in"),a.destroy())},offset:u})}),Pe(),p=1==rt?"500%":"bottom-in-view",0==A.length||ht.usingFrontEndEditor&&t("#nectar_fullscreen_rows").length>0?(t(".svg-icon-holder:not(.animated-in)").has("svg").each(function(e){var a=t(this);z&&a.attr("data-animation","false"),a.find("svg").css({height:parseInt(a.attr("data-size"))+"px",width:parseInt(a.attr("data-size"))+"px"}),t(this).find("svg").attr("id","nectar-svg-animation-instance-"+e);var n=a.is("[data-animation-speed]")&&a.attr("data-animation-speed").length>0?a.attr("data-animation-speed"):200;if("false"==a.attr("data-animation")&&(n=1,a.css("opacity","1")),a.hasClass("bound")||(A[e]=new Vivus(a.find("svg").attr("id"),{type:"delayed",pathTimingFunction:Vivus.EASE_OUT,animTimingFunction:Vivus.LINEAR,duration:n,onReady:function(){a.css({height:parseInt(a.attr("data-size"))+"px",width:parseInt(a.attr("data-size"))+"px"})}})),1!==n)var i=new Waypoint({element:a[0],handler:function(){a.hasClass("animated-in")?i.destroy():(s(),a.addClass("animated-in"),i.destroy())},offset:p});else s();function s(){var t=0;a.is("[data-animation-delay]")&&a.attr("data-animation-delay").length>0&&"false"!=a.attr("data-animation")&&(t=a.attr("data-animation-delay"));var e=a.find("svg").attr("id").replace(/[^0-9]/g,"");1==A[e].isReady?setTimeout(function(){a.css("opacity","1"),A[e].reset().play()},t):setTimeout(s,50)}a.addClass("bound")}),t('.vc_row-o-equal-height .svg-icon-holder[data-animation="true"]').length>0&&0==t("#nectar_fullscreen_rows").length&&s.on("smartresize",function(){clearTimeout(n),n=setTimeout(function(){A.length>0&&t(".svg-icon-holder.animated-in").each(function(){if(t(this).css("opacity","1"),t(this).is("[id]")){var e=t(this).attr("id").replace(/[^0-9]/g,"");A[e].finish()}})},300)})):t(".svg-icon-holder").addClass("animated-in").css("opacity","1"),t("#nectar_fullscreen_rows .svg-icon-holder.animated-in").has("svg").each(function(e){var a=0;t(this).is("[data-animation-delay]")&&t(this).attr("data-animation-delay").length>0&&"false"!=t(this).attr("data-animation")&&(a=t(this).attr("data-animation-delay"));var n=t(this),i=n.find("svg").attr("id").replace(/[^0-9]/g,"");clearTimeout(K[e]),"false"==n.attr("data-animation")?(n.css("opacity","1"),A[i].finish()):t(this).parents(".active").length>0||t(this).parents("#footer-outer").length>0||t("body.mobile").length>0?(A[i].reset(),K[e]=setTimeout(function(){A[i].play()},a)):A[i].reset().stop()}),function(){if(t(".nectar-milestone").each(function(){var e;t(this).is("[data-symbol]")&&(0==t(this).find(".symbol-wrap").length&&("before"==t(this).attr("data-symbol-pos")?t(this).find(".number").prepend('<div class="symbol-wrap"><span class="symbol">'+t(this).attr("data-symbol")+"</span></div>"):t(this).find(".number").append('<div class="symbol-wrap"><span class="symbol">'+t(this).attr("data-symbol")+"</span></div>")),e=t(this).attr("data-symbol-size")==t(this).find(".number").attr("data-number-size")&&"superscript"==t(this).attr("data-symbol-alignment")?32:parseInt(t(this).attr("data-symbol-size")),t(this).find(".symbol-wrap").css({"font-size":e+"px","line-height":e+"px"})),t(this).find(".number").css({"font-size":t(this).find(".number").attr("data-number-size")+"px","line-height":t(this).find(".number").attr("data-number-size")+"px"})}),!z&&t(".nectar-milestone").length>0||r.hasClass("rtl")&&t(".nectar-milestone").length>0){var e="";t(st+".nectar-milestone.motion_blur").each(function(a){t(this).removeClass(function(t,e){return(e.match(/(^|\s)instance-\S+/g)||[]).join(" ")}),t(this).addClass("instance-"+a);var n=t(this).find(".number").css("color"),i=parseInt(n.substring(1),16),s=(16711680&i)>>16,r=(65280&i)>>8,o=(255&i)>>0,l="rgba("+s+","+r+","+o+",0.2)",d="rgba("+s+","+r+","+o+",1)",c=parseInt(t(this).find(".number").attr("data-number-size"));if(e+="@keyframes motion-blur-number-"+a+" { 0% { opacity: 0;color: "+l+"; text-shadow: 0 "+c/20+"px 0 "+l+", 0 "+c/10+"px 0 "+l+", 0 "+c/6+"px 0 "+l+", 0 "+c/5+"px 0 "+l+", 0 "+c/4+"px 0 "+l+", 0 -"+c/20+"px 0 "+l+", 0 -"+c/10+"px 0 "+l+", 0 -"+c/6+"px 0 "+l+", 0 -"+c/5+"px 0 "+l+", 0 -"+c/4+"px 0 "+l+"; transform: translateZ(0px) translateY(-100%); -webkit-transform: translateZ(0px) translateY(-100%); } 33% { opacity: 1 }100% { color: "+d+"; text-shadow: none; transform: translateZ(0px) translateY(0px); -webkit-transform: translateZ(0px) translateY(0px); } } @-webkit-keyframes motion-blur-number-"+a+" { 0% { opacity: 0;color: "+l+"; text-shadow: 0 "+c/20+"px 0 "+l+", 0 "+c/10+"px 0 "+l+", 0 "+c/6+"px 0 "+l+", 0 "+c/5+"px 0 "+l+", 0 "+c/4+"px 0 "+l+", 0 -"+c/20+"px 0 "+l+", 0 -"+c/10+"px 0 "+l+", 0 -"+c/6+"px 0 "+l+", 0 -"+c/5+"px 0 "+l+", 0 -"+c/4+"px 0 "+l+"; transform: translateZ(0px) translateY(-100%); -webkit-transform: translateZ(0px) translateY(-100%); } 33% { opacity: 1 }100% { color: "+d+"; text-shadow: none; transform: translateZ(0px) translateY(0px); -webkit-transform: translateZ(0px) translateY(0px); } } .nectar-milestone.motion_blur.instance-"+a+" .number span.in-sight { animation: 0.65s cubic-bezier(0, 0, 0.17, 1) 0s normal backwards 1 motion-blur-number-"+a+"; -webkit-animation: 0.65s cubic-bezier(0, 0, 0.17, 1) 0s normal backwards 1 motion-blur-number-"+a+"; } ",0!=ct.$usingFullScreenRows||0==t(this).find(".number > span").length){var h=t(this).find(".symbol-wrap").clone();t(this).find(".symbol-wrap").remove();var u=t(this).find(".number").text().split(""),p=t(this).find(".number");p.empty(),t.each(u,function(t,e){p.append("<span>"+e+"</span")}),t(this).has("[data-symbol]")&&("after"==t(this).attr("data-symbol-pos")?p.append(h):p.prepend(h))}}),ee(e,"milestone-blur"),se()}}(),ye(),t(st+'.owl-carousel[data-enable-animation="true"]').each(function(){var e=1==rt?"200%":"bottom-in-view",a=0;t(this).is("[data-animation-delay]")&&t(this).attr("data-animation-delay").length>0&&"false"!=t(this).attr("data-animation")&&(a=t(this).attr("data-animation-delay"));var n=t(this),i=new Waypoint({element:n[0],handler:function(){n.parents(".wpb_tab").length>0&&"hidden"==n.parents(".wpb_tab").css("visibility")||n.hasClass("animated-in")?i.destroy():(setTimeout(function(){n.find(".owl-stage > .owl-item").each(function(e){t(this).delay(200*e).transition({opacity:"1",y:"0"},600,"easeOutQuart")}),n.addClass("animated-in")},a),i.destroy())},offset:e})}),function(){if(t('body[data-header-inherit-rc="true"]').length>0&&0==t(".mobile").length&&t('#header-outer[data-transparent-header="true"]').length>0){var e=b/2+w+ht.adminBarHeight;0==t('#header-outer[data-permanent-transparent="1"]').length&&(e=b-y+Math.ceil(2*w/1.8)+ht.adminBarHeight),t(".main-content > .row > .wpb_row").each(function(){var a,n=t(this);new Waypoint({element:n[0],handler:function(e){"down"==e?n.find(".row-bg.using-bg-color").length>0?(a=n.find("> .col.span_12.light").length>0?"light-text":"dark-text",d.css("background-color",n.find(".row-bg").css("background-color")).removeClass("light-text").removeClass("dark-text").addClass(a),d.attr("data-current-row-bg-color",n.find(".row-bg").css("background-color")),t("body.material #header-outer .bg-color-stripe").css("background-color",n.find(".row-bg").css("background-color"))):(d.css("background-color",d.attr("data-user-set-bg")).removeClass("light-text").removeClass("dark-text"),d.attr("data-current-row-bg-color",d.attr("data-user-set-bg")),t("body.material #header-outer .bg-color-stripe").css("background-color","")):n.prev("div.wpb_row").find(".row-bg.using-bg-color").length>0?(a=n.prev("div.wpb_row").find("> .col.span_12.light").length>0?"light-text":"dark-text",d.css("background-color",n.prev("div.wpb_row").find(".row-bg").css("background-color")).removeClass("light-text").removeClass("dark-text").addClass(a),d.attr("data-current-row-bg-color",n.prev("div.wpb_row").find(".row-bg").css("background-color")),t("body.material #header-outer .bg-color-stripe").css("background-color",n.prev("div.wpb_row").find(".row-bg").css("background-color"))):(d.css("background-color",d.attr("data-user-set-bg")).removeClass("light-text").removeClass("dark-text"),d.attr("data-current-row-bg-color",d.attr("data-user-set-bg")),t("body.material #header-outer .bg-color-stripe").css("background-color",""))},offset:e})})}}(),we(),Ve(),Ne(),ne(),ia(),function(){if(nt.length>0)for(var e=0;e<nt.length;e++)clearInterval(nt[e].interval);nt=[],t(".nectar-rotating-words-title").each(function(e){var a=parseInt(t(this).attr("data-rotation"));nt[e]=new ie(t(this),a)})}(),Xe()}function Da(){var a;vt(),yt(),setTimeout(_t,100),$t(),Ot(),At(),Wt(),Ft(),he(),r.on("click",".toggle > h3 a, .toggle > .toggle-title a",function(){if(!t(this).parents(".toggles").hasClass("accordion")){if(0==t(this).parents('.toggle[data-inner-wrap="true"]').length)t(this).parents(".toggle").find("> div").slideToggle(300);else{var e=t(this).parents(".toggle").find("> div")[0];e.style.maxHeight?e.style.maxHeight=null:e.style.maxHeight=e.scrollHeight+"px"}if(t(this).parents(".toggle").toggleClass("open"),t(this).parents(".toggle").hasClass("open")?t(this).find("i").attr("class","fa fa-minus-circle"):t(this).find("i").attr("class","fa fa-plus-circle"),t(this).parents(".toggle").find("> div .iframe-embed").length>0&&"0"==t(this).parents(".toggle").find("> div iframe.iframe-embed").height()&&va(),t(this).parents(".toggle").find("> div img").length>0&&t(this).parents(".toggle").is('[data-inner-wrap="true"]'))for(var a=1;a<10;a++)setTimeout(ce,100*a);return t(this).parents(".full-width-content").length>0&&setTimeout(function(){We()},300),t("#nectar_fullscreen_rows").length>0&&setTimeout(function(){s.trigger("smartresize")},300),!1}}),r.on("click",".toggles.accordion .toggle > h3 a, .toggles.accordion .toggle > .toggle-title a",function(e){var a,n=t(this).parents(".toggles"),i=t(this).parents(".toggle");if(t(this).parents(".toggle").hasClass("open"))return n.find(".toggle > div").each(function(){t(this)[0].style.maxHeight=null}),n.find(".toggle h3 a i").attr("class","fa fa-plus-circle"),n.find(".toggle").removeClass("open"),!1;if(0==t(this).parents('.toggle[data-inner-wrap="true"]').length)n.find(".toggle > div").slideUp(300),n.find(".toggle h3 a i").attr("class","fa fa-plus-circle"),n.find(".toggle").removeClass("open"),i.find("> div").slideDown(300),i.addClass("open");else{void 0!==e.originalEvent&&ht.winW<1e3&&n.find(".toggle.open").length>0&&0==ct.$usingFullScreenRows&&(n.find(".toggle.open"),setTimeout(function(){var e=i.offset().top-ht.adminBarHeight;t('#header-outer[data-mobile-fixed="1"]').length>0&&(e=i.offset().top-d.outerHeight()-ht.adminBarHeight),Dt(e,500,"easeInOutQuint")},50));var r=i.find("> div")[0];n.find(".toggle > div").each(function(){t(this)[0].style.maxHeight=null}),n.find(".toggle h3 a i").attr("class","fa fa-plus-circle"),n.find(".toggle").removeClass("open"),r.style.maxHeight=r.scrollHeight+"px",i.addClass("open")}return i.hasClass("open")?t(this).find("i").attr("class","fa fa-minus-circle"):t(this).find("i").attr("class","fa fa-plus-circle"),t(this).parents(".full-width-content").length>0&&(clearTimeout(a),a=setTimeout(function(){We()},400)),t("#nectar_fullscreen_rows").length>0&&(clearTimeout(a),a=setTimeout(function(){s.trigger("smartresize")},400)),!1}),me(),fa(),ge(),r.on("click",'.nectar-cta:not([data-style="material"]) .link_wrap',function(e){(t(this).parents('[data-using-bg="true"]').length>0||t(this).parents('[class*="border_thickness"]').length>0)&&(t(e.target).is("a")||0!=t(e.target).parents("a").length||t(this).find("a.link_text")[0].click())}),0!==t(".team-member").length&&(r.on("click",'.team-member[data-style="bio_fullscreen"], .team-member[data-style="bio_fullscreen_alt"]',function(){if(!(t(".nectar_team_member_overlay").length>0)){var a=t("body > #boxed").length>0?"in-boxed":"",n=t(this).find(".nectar_team_bio").html(),i=t(this).is('[data-style="bio_fullscreen_alt"]')?t(this).find(".team-meta h5").html():t(this).find(".team-meta p").html(),o=t(this).find(".nectar_team_bio_img[data-img-src]").length>0?t(this).find(".nectar_team_bio_img").attr("data-img-src"):"",l=t(this).is('[data-style="bio_fullscreen_alt"]')?"bio-fullscreen-alt":"bio-fullscreen",c="";if(c=t(this).is('[data-style="bio_fullscreen_alt"]')?'<div class="title">'+Yt(i)+"</div><h2>"+t(this).find(".team-meta h3").text()+"</h2>":"<h2>"+t(this).find(".team-meta h3").text()+'</h2><div class="title">'+Yt(i)+"</div>",r.append('<div class="nectar_team_member_overlay '+a+'" data-style="'+l+'"><div class="inner-wrap"><div class="team_member_details"><div class="bio-inner"><span class="mobile-close"></span>'+c+'<div class="team-desc">'+Yt(n)+'</div></div></div><div class="team_member_picture"><div class="team_member_image_bg_cover"></div><div class="team_member_picture_wrap"><div class="team_member_image"></div></div></div></div></div>'),o.length>0){var h=new Image;h.src=o,h.onload=function(){t(".nectar_team_member_overlay .team_member_image").css("opacity","1")},t(".nectar_team_member_overlay .team_member_image").css({"background-image":'url("'+o+'")'})}var u=t('body[data-header-format="left-header"]').length>0&&s.width()>1e3?0:d.height();t(".nectar_team_member_overlay .inner-wrap").css({"padding-top":u}),t(".using-mobile-browser").length>0&&t("body,html").addClass("nectar-no-scrolling"),ve(),t(".nectar_team_member_overlay").addClass("open").addClass("animating"),setTimeout(function(){t(".nectar_team_member_close").addClass("visible"),t(".nectar_team_member_overlay").removeClass("animating")},500),t('.team-member[data-style="bio_fullscreen"]').length>0&&ht.usingMobileBrowser&&t(".nectar_team_member_overlay").addClass("on-mobile"),va(),t(e).trigger("nectar-team-member-opened")}}),r.on("click",".nectar_team_member_overlay",function(e){if(t(e.target).is("a")||t(e.target).parents("a").length>0||t(e.target).is(".skip-team-member-close")||t(e.target).parents(".skip-team-member-close").length>0)return!0;t(this).hasClass("animating")||(t(".nectar_team_member_overlay").removeClass("open"),t(".nectar_team_member_close").removeClass("visible"),t(".using-mobile-browser").length>0&&t("body,html").removeClass("nectar-no-scrolling"),setTimeout(function(){t(".nectar_team_member_overlay, .nectar_team_member_close").remove()},820))}),(t('.team-member[data-style="bio_fullscreen"]').length>0||t('.team-member[data-style="bio_fullscreen_alt"]').length>0)&&(s.on("resize",ve),!ht.usingMobileBrowser))&&new bt("","close-indicator"),t(".nectar-flip-box").length>0&&(ht.usingMobileBrowser&&r.on("click",".nectar-flip-box",function(){t(this).toggleClass("flipped")}),Ce(),s.on("smartresize",Ce)),zt(),Be(),Fe(),_e(),On(),Hn(),qe(),t(".morphing-outline").length>0&&(setTimeout(we,100),setTimeout(We,125),s.on("smartresize",we)),q=[],ht.usingMobileBrowser||t("[data-nectar-link-indicator]").each(function(e){q[e]=new bt(t(this),"link-indicator")}),aa(),t(".nectar_cascading_images").length>0&&(P=[],t(".nectar_cascading_images").each(function(e){imagesLoaded(t(this),function(a){je(),t(a.elements[0]).is('[data-parallax="yes"]')&&!ht.usingMobileBrowser&&0==t("#nectar_fullscreen_rows").length&&(P[e]=new Ye(t(a.elements[0]),t(a.elements[0]).attr("data-parallax-intensity")))})}),s.on("resize",je)),Ze(),la(),function(){t('.page-submenu[data-sticky="true"]').length>0&&0==t("#nectar_fullscreen_rows").length&&(!function(){var t=e.jQuery,a=e.Waypoint,n=Pt();Pt();function i(e){this.options=t.extend({},a.defaults,i.defaults,e),this.element=this.options.element,this.$element=t(this.element),this.createWrapper(),this.topLevel=t(this.element).parents(".top-level").length>0,this.createWaypoint()}s.on("smartresize",function(){if(n=Pt(),u.length>0&&"fixed"==u.css("position")&&(n+=u.height()),f.length>0&&s.width()>1e3&&t('body[data-hhun="1"]').length>0&&(n+=f.height()),t(".page-submenu.stuck").length>0){if(t(".page-submenu.stuck").addClass("no-trans").css("top",n).css("transform","translateY(0)").addClass("stuck"),setTimeout(function(){t(".page-submenu.stuck").removeClass("no-trans")},50),t(".page-submenu.stuck").parents(".wpb_row").css("z-index",1e4),t("#boxed").length>0){var e=s.width()>1e3?.04*t(".container-wrap").width():39;t(".page-submenu.stuck").css({"margin-left":"-"+e+"px",width:t(".container-wrap").width()})}}else t(".page-submenu.stuck").css("top","0").removeClass("stuck"),t(".page-submenu.stuck").parents(".wpb_row").css("z-index","auto"),t("#boxed").length>0&&t(".page-submenu.stuck").css({"margin-left":"0px",width:"100%"})}),i.prototype.createWaypoint=function(){var e=this.options.handler;n=Pt(),this.topLevel&&t('body[data-hhun="1"] #header-outer.detached:not(.invisible)').length>0&&(n+=1,this.$element.css({"margin-top":"-1px"})),u.length>0&&"fixed"==u.css("position")&&(n+=u.height()),f.length>0&&s.width()>1e3&&t('body[data-hhun="1"]').length>0&&(n+=f.height()),this.waypoint=new a(t.extend({},this.options,{element:this.wrapper,handler:t.proxy(function(a){var i=this.options.direction.indexOf(a)>-1,r=i?this.$element.outerHeight(!0):"";if(this.$wrapper.height(r),i){var o=0;if(this.topLevel&&t('body[data-hhun="1"] #header-outer.detached:not(.invisible)').length>0){var l=d.outerHeight(),h=0;c.length>0&&(l-=ht.secondaryHeaderHeight),f.length>0&&0==t("body.mobile").length&&(h=ot?f.height():0),o=l-h}this.$element.addClass("no-trans").css("top",n).css("transform","translateY("+o+"px)").addClass("stuck");var u=this;if(setTimeout(function(){u.$element.removeClass("no-trans")},50),this.$element.parents(".wpb_row").css("z-index",1e4),t("#boxed").length>0){var p=s.width()>1e3?.04*t(".container-wrap").width():39;this.$element.css({"margin-left":"-"+p+"px",width:t(".container-wrap").width()})}}else this.$element.css("top","0").removeClass("stuck"),t("#boxed").length>0&&this.$element.css({"margin-left":"0px",width:"100%"});e&&e.call(this,a)},this),offset:n}));var i=this;setInterval(function(){if(t('body[data-hhun="1"] #header-outer.detached:not(.invisible)').length>0){var e=d.outerHeight();c.length>0&&(e-=ht.secondaryHeaderHeight),i.waypoint.options.offset=n+e}else i.waypoint.options.offset=n;a.refreshAll()},100)},i.prototype.createWrapper=function(){this.options.wrapper&&this.$element.wrap(this.options.wrapper),this.$wrapper=this.$element.parent(),this.wrapper=this.$wrapper[0]},i.prototype.destroy=function(){this.$element.parent()[0]===this.wrapper&&(this.waypoint.destroy(),this.$element.removeClass(this.options.stuckClass),this.options.wrapper&&this.$element.unwrap())},i.defaults={wrapper:'<div class="sticky-wrapper" />',stuckClass:"stuck",direction:"down right"},a.Sticky=i}(),t('.page-submenu[data-sticky="true"]').each(function(){var e=t(this)[0];if(t(this).parents(".span_12").find("> .wpb_column").length>1){var a=t(this).clone(),n=t(this).parents(".wpb_row");t(this).parents(".wpb_row.has-global-section").length>0&&(n=t(this).parents(".wpb_row.has-global-section")),t(this).remove(),n.before(a),e=a[0]}new Waypoint.Sticky({element:e})}));0==t("#nectar_fullscreen_rows").length&&t(".page-submenu").parents(".wpb_row").css("z-index",1e4);t(".page-submenu .mobile-menu-link").on("click",function(){return t(this).parents(".page-submenu").find("ul").stop(!0).slideToggle(350),!1}),t(".page-submenu ul li a").on("click",function(){t("body.mobile").length>0&&t(this).parents(".page-submenu").find("ul").stop(!0).slideToggle(350)})}(),D=[],"undefined"==typeof NectarLiquid||ht.usingFrontEndEditor||t('.row-bg-wrap[data-bg-animation*="displace-filter"] .row-bg.using-image, .column-image-bg-wrap[data-bg-animation*="displace-filter"] .column-image-bg').each(function(e){var a,n,i=t(this);t(this).is(".row-bg")?(a=t(this).parents(".row-bg-wrap").attr("data-bg-animation"),n="row"):t(this).is(".column-image-bg")&&(a=t(this).parents(".column-image-bg-wrap").attr("data-bg-animation"),n="col"),D[e]=new NectarLiquid(i,a,n)}),da(),function(){function e(){t('.blog-recent[data-style="title_only"]').each(function(){if(t(this).find("> .col").length>1)return!1;var e=t(this).parent().parent().parent();if(e.hasClass("vc_col-sm-3")||e.hasClass("vc_col-sm-4")||e.hasClass("vc_col-sm-6")||e.hasClass("vc_col-sm-8")||e.hasClass("vc_col-sm-9"))if(0==t("body.mobile").length&&0==t(this).next("div").length){var a=0;t(this).find("> .col").css("padding","50px 20px"),t(this).parents(".span_12").find(" > .wpb_column").each(function(){Math.floor(t(this).height())>a&&(a=Math.floor(t(this).height()))}),Math.floor(t(this).find("> .col").outerHeight(!0))<Math.floor(t(this).parents(".wpb_row").height())-1&&(t(this).find("> .col").css("padding-top",(a-t(this).find("> .col").height())/2+"px"),t(this).find("> .col").css("padding-bottom",(a-t(this).find("> .col").height())/2+"px"))}else t(this).find("> .col").css("padding","50px 20px")})}t('.blog-recent[data-style="title_only"]').length>0&&(e(),s.on("smartresize",e))}(),In(),En(),An(),r.on("mouseover",'.post-area.featured_img_left .grav-wrap .text a, .masonry.material .masonry-blog-item .grav-wrap .text a, .blog-recent[data-style="material"] .grav-wrap .text a',function(){t(this).parents(".grav-wrap").find("img").addClass("hovered")}),r.on("mouseleave",'.post-area.featured_img_left .grav-wrap .text a, .masonry.material .masonry-blog-item .grav-wrap .text a, .blog-recent[data-style="material"] .grav-wrap .text a',function(){t(this).parents(".grav-wrap").find("img").removeClass("hovered")}),r.on("mouseleave",'.container-wrap[data-nav-pos="after_project_2"] #portfolio-nav ul li, .blog_next_prev_buttons[data-style="fullwidth_next_prev"] ul li',function(){t(this).addClass("mouse-leaving")}),Yn(),Xn(),function(){if(0==t(".portfolio-items .col").length)return;if(t(".portfolio-items .col .style-3-alt").length>0||t(".portfolio-items .col .style-3").length>0||t(".portfolio-items .col .style-2").length>0||t(".portfolio-items .col .style-5").length>0){var e="";t(".portfolio-items .col").each(function(){var a=t(this).attr("data-title-color"),n=t(this).attr("data-subtitle-color");a.length>0&&(e+='.col[data-title-color="'+a+'"] .vert-center h3, .portfolio-items[data-ps="6"] .col[data-title-color="'+a+'"] .work-meta h4 { color: '+a+"!important; } ",e+=' .portfolio-items[data-ps="8"] .col[data-title-color="'+a+'"] .line { background-color: '+a+"; }",e+='.portfolio-items[data-ps="8"] .col[data-title-color="'+a+'"] .next-arrow line { stroke: '+a+"; } "),n.length>0&&(e+='.col[data-subtitle-color="'+n+'"] .vert-center p, .portfolio-items[data-ps="6"] .col[data-title-color="'+a+'"] .work-meta p { color: '+n+"!important; } ")}),ee(e,"nectar-portfolio-colors")}}(),t("body.search-results").length>0&&t("#search-results article").length>0&&0==t('#search-results[data-layout="list-no-sidebar"]').length&&0==t('#search-results[data-layout="list-with-sidebar"]').length&&((a=t("#search-results")).is('[data-layout="masonry-no-sidebar"]'),a.imagesLoaded(function(){a.isotope({itemSelector:".result",layoutMode:"packery",packery:{gutter:0}}),a.find("article").css("opacity","1")}),s.on("resize",function(){a.isotope({layoutMode:"packery",packery:{gutter:0}})})),function(){t(".single-portfolio #sidebar").attr("data-follow-on-scroll");if(0==t("body.single-portfolio").length||0==t("#sidebar[data-follow-on-scroll]").length)return;if(1==t(".single-portfolio #sidebar").attr("data-follow-on-scroll")&&!r.hasClass("mobile")&&parseInt(t("#sidebar").height())+50<=parseInt(t(".post-area").height())){var e=Nn();t(".single-portfolio #sidebar").theiaStickySidebar({additionalMarginTop:e,updateSidebarHeight:!1})}}(),xn(),oe()}function Qa(){this.$toggleBtn=t(".nectar-shop-filters .nectar-shop-filter-trigger"),this.$sidebar=t("#sidebar"),this.sidebarPos=this.$sidebar.hasClass("col_last")?"right":"left",this.state={open:this.getLS()?this.getLS():"true"},this.setup(),this.events()}function Za(){this.$qty="",this.step=1,this.ajaxTimeout="",this.ajaxTimeoutDur=500,this.state={max:1e5,min:0,currentVal:1,key:0,removeFlag:!1},this.events()}function Ga(){this.state={processing:!1,productID:!1,type:"regular"},this.events()}function Ua(){var n;r.on("click",".product .add_to_cart_button",function(){var e=t(this).parents("li").find("h2").length>0?"h2":"h3",a=t(this).parents("li").find(e).text();t("#header-outer .cart-notification span.item-name").html(a)}),r.on("mouseenter","#header-outer .cart-notification",function(){t(this).hide(),t("#header-outer .widget_shopping_cart").addClass("open").stop(!0,!0).show(),t("#header-outer .cart_list").stop(!0,!0).show(),clearTimeout(n)});var i,o;function l(){!t(".widget_shopping_cart .widget_shopping_cart_content .cart_list .empty").length&&t(".widget_shopping_cart .widget_shopping_cart_content .cart_list").length>0&&(t(".cart-menu-wrap").addClass("has_products"),t("header#top nav > ul, #search-outer #search #close a, header#top .span_9 >.slide-out-widget-area-toggle").addClass("product_added"),t(".cart-menu-wrap").hasClass("static")||t(".cart-menu-wrap, #mobile-cart-link").addClass("first-load"))}function d(){t("#header-outer .cart-notification").stop(!0,!0).fadeOut()}if(t("#header-outer .nectar-woo-cart").length>0&&t("#header-outer .nectar-woo-cart").hoverIntent(function(){t("#header-outer .widget_shopping_cart").addClass("open").stop(!0,!0).show(),t("#header-outer .cart_list").stop(!0,!0).show(),clearTimeout(n),t("#header-outer .cart-notification").hide()}),r.on("mouseleave","#header-outer .nectar-woo-cart",function(){var e=t(this);setTimeout(function(){e.is(":hover")||(t("#header-outer .widget_shopping_cart").removeClass("open").stop(!0,!0).fadeOut(300),t("#header-outer .cart_list").stop(!0,!0).fadeOut(300))},200)}),0==t('#header-outer[data-cart="false"]').length&&(r.on("added_to_cart",function(e){if(clearTimeout(n),!t(".widget_shopping_cart .widget_shopping_cart_content .cart_list .empty").length&&t(".widget_shopping_cart .widget_shopping_cart_content .cart_list").length>0&&void 0!==e.type){if(t("#header-outer .cart-notification .item-name").length>0&&0==t("#header-outer .cart-notification .item-name").text().length)return;t("#header-outer .cart-menu-wrap").hasClass("has_products")?t("#header-outer .cart-notification").is(":visible")?t("#header-outer .cart-notification").show():t("#header-outer .cart-notification").fadeIn(400):setTimeout(function(){t("#header-outer .cart-notification").fadeIn(400)},400),t('body #header-outer [data-cart-style="slide_in_click"] .cart-menu-wrap').trigger("click"),n=setTimeout(d,2700)}}),r.on("added_to_cart",l)),0==t('#header-outer[data-cart="false"]').length&&(i=setInterval(l,250),setTimeout(function(){clearInterval(i)},4500)),function(){if(0!=t("body.woocommerce-account #customer_login").length){t(".woocommerce-account .woocommerce > #customer_login").prepend('<div class="nectar-form-controls" />'),t(".woocommerce-account .woocommerce > #customer_login > div:not(.nectar-form-controls)").each(function(){var e=t(this).find("> h2").text();t("#customer_login .nectar-form-controls").append('<div class="control">'+e+"</div>")}),t(".woocommerce-account .woocommerce > #customer_login .nectar-form-controls .control").on("click",function(){t(".woocommerce-account .woocommerce > #customer_login .nectar-form-controls .control").removeClass("active"),t(this).addClass("active");var e=t(this).index()+1;t('#customer_login div[class*="u-column"]').hide(),t('#customer_login div[class*="u-column"].col-'+e).show(),setTimeout(function(){t('#customer_login div[class*="u-column"]').removeClass("visible"),t('#customer_login div[class*="u-column"].col-'+e).addClass("visible")},30)});var a="1";if(void 0!==Jt.tab&&"2"===Jt.tab&&(a="2",e.history&&e.history.replaceState&&"function"==typeof URL)){var n=new URL(location);n.searchParams.delete("tab"),history.replaceState(null,null,n)}t(".woocommerce-account .woocommerce > #customer_login .nectar-form-controls .control:nth-child("+a+")").trigger("click")}}(),!(t('.products[data-rm-m-hover="1"]').length>0&&ht.usingMobileBrowser)&&(r.on("mouseover",".text_on_hover .product-wrap, .text_on_hover > a:first-child",function(){t(this).parent().addClass("hovered")}),r.on("mouseout",".text_on_hover .product-wrap, .text_on_hover > a:first-child",function(){t(this).parent().removeClass("hovered")})),t(".material.product").length>0||t(".minimal.product").length>0||t('.nectar-fancy-box[data-style="parallax_hover"]').length>0||t('.nectar-category-grid[data-shadow-hover="yes"]').length>0||t('.nectar-post-grid[data-shadow-hover="yes"]').length>0){var c=101;r.on("mouseenter",'.material.product, .nectar-fancy-box[data-style="parallax_hover"], .nectar-post-grid[data-shadow-hover="yes"] .nectar-post-grid-item, .nectar-category-grid[data-shadow-hover="yes"] .nectar-category-grid-item',function(){c++,t(this).css("z-index",c+1)}),r.on("mouseleave",'.material.product, .nectar-fancy-box[data-style="parallax_hover"], .nectar-post-grid[data-shadow-hover="yes"] .nectar-post-grid-item, .nectar-category-grid[data-shadow-hover="yes"] .nectar-category-grid-item',function(){var e=t(this);setTimeout(function(){e.is(":hover")||e.css("z-index",100)},350)}),e.nectarOptions&&e.nectarOptions.woo_minimal_product_effect&&"default"===e.nectarOptions.woo_minimal_product_effect&&(r.on("mouseenter",".minimal.product",function(){c++,t(this).css("z-index",c+1)}),r.on("mouseleave",".minimal.product",function(){var e=t(this);setTimeout(function(){e.is(":hover")||e.css("z-index",100)},350)})),setInterval(function(){t('.nectar-fancy-box[data-style="parallax_hover"]:hover').length>0||t(".minimal.product:hover").length>0||(t('.material.product:not(:hover), .minimal.product:not(:hover), .nectar-fancy-box[data-style="parallax_hover"]:not(:hover), .nectar-post-grid[data-shadow-hover="yes"] .nectar-post-grid-item:not(:hover), .nectar-category-grid[data-shadow-hover="yes"] .nectar-category-grid-item:not(:hover)').css("z-index",100),c=101)},1e4)}function h(e){var a=s.width();e.clientX<a-370-v&&t(".nectar-slide-in-cart").hasClass("mouse-accessed")&&(s.off("mousemove.rightCartOffsetCheck",h),t(".nectar-slide-in-cart").removeClass("open").removeClass("mouse-accessed"))}if(t(".products .classic .product-wrap .add_to_cart_button").wrapInner("<span />"),t(".products .classic .product-wrap .add_to_cart_button").prepend('<i class="normal icon-salient-cart"></i>'),!(t('.products[data-rm-m-hover="1"]').length>0&&ht.usingMobileBrowser)&&e.nectarOptions&&e.nectarOptions.woo_minimal_product_effect&&"default"===e.nectarOptions.woo_minimal_product_effect&&(r.on("mouseover",".products .minimal.product",function(){var e,a,n,i,s,r;e=t(this),n=(a=e).width(),i=a.height(),s=(parseInt(n)+40)/parseInt(n),r=(parseInt(i)+40)/parseInt(i),a.addClass("hover-bound"),a.find(".background-color-expand").css({transform:"scale("+s+","+r+") translateY(0px) translateZ(0px)"})}),r.on("mouseleave",".products .minimal.product",function(){t(this).find(".background-color-expand").css({transform:"scale(1, 1) translateY(0) translateZ(0px)"})})),t(".products .minimal.product").each(function(){t(this).is(":hover")&&t(this).trigger("mouseover")}),t(".woocommerce #sidebar .widget.woocommerce").each(function(){0==t(this).find("> h4").length&&t(this).addClass("no-widget-title")}),r.on("click","#sidebar .widget.woocommerce:not(.widget_price_filter) h4",function(){e.nectarOptions&&"false"!==e.nectarOptions.woo_sidebar_toggles&&s.width()<1e3&&(t(this).parent().is(".widget_product_tag_cloud")&&t(this).parent().find("> div").slideToggle(),t(this).parent().is(".woocommerce-widget-layered-nav")&&t(this).parent().find("> .woocommerce-widget-layered-nav-dropdown").length>0&&t(this).parent().find("> .woocommerce-widget-layered-nav-dropdown").slideToggle(),t(this).parent().find("> ul").slideToggle(),t(this).parent().toggleClass("open-filter"))}),r.on("mouseenter",'#header-outer [data-cart-style="slide_in"] .cart-menu-wrap',function(){t(".nectar-slide-in-cart ul.cart_list li:not(.empty)").length>0&&(t(".nectar-slide-in-cart").addClass("open"),s.on("mousemove.rightCartOffsetCheck",h))}),r.on("mouseenter",".nectar-slide-in-cart",function(){t(this).addClass("mouse-accessed")}),r.on("click",'#header-outer [data-cart-style="slide_in_click"] .cart-menu-wrap, #mobile-cart-link[data-cart-style="slide_in_click"]',function(){if(r.is(".woocommerce-checkout")||r.is(".woocommerce-cart"))return!0;return t(".nectar-slide-in-cart, .nectar-slide-in-cart-bg").addClass("open"),t(".nectar-slide-in-cart-bg").addClass("revealed"),clearTimeout(o),t(".style_slide_in_click div.quantity").each(function(){t(this).find(".minus").length>1&&t(this).find(".minus").first().remove(),t(this).find(".plus").length>1&&t(this).find(".plus").first().remove()}),!1}),r.on("click",".nectar-slide-in-cart.style_slide_in_click .close-cart, .nectar-slide-in-cart-bg",function(){return t(".nectar-slide-in-cart, .nectar-slide-in-cart-bg").removeClass("open"),o=setTimeout(function(){t(".nectar-slide-in-cart-bg").removeClass("revealed")},400),!1}),new Za,e.nectarOptions&&"1"===e.nectarOptions.ajax_add_to_cart)new Ga;if(e.nectarOptions&&"1"===e.nectarOptions.woo_product_filter_toggle&&r.is(".archive.woocommerce"))new Qa;t(a).on("yith-wcan-ajax-filtered",Ke)}function Ja(){this.$el=t("#search-outer #search .container #s"),this.$container="",this.$parent="",this.$searchEl=t("#search-outer"),this.request="",this.timeout="",this.setup(),this.events(),this.state={requesting:!1,open:!1,prevResults:""},this.minChars=2}function Ka(){t('#header-outer[data-format="centered-menu-bottom-bar"]').length>0&&function(){var e=d,a=t('#header-outer[data-format="centered-menu-bottom-bar"] header#top .span_9'),n=t('#header-outer[data-format="centered-menu-bottom-bar"] header#top .span_3'),i=c,r=n.find("nav >ul.buttons"),o=parseInt(t("body.material #header-outer").attr("data-padding")),l=parseInt(t("body.material #header-outer").attr("data-logo-height")),h=parseInt(n.css("margin-bottom")),u=o+h+l+parseInt(ht.secondaryHeaderHeight);function p(){Qt()?d.addClass("within-custom-breakpoint"):d.removeClass("within-custom-breakpoint")}function g(){if(!(ht.winW<1e3||t("body.page-template-template-no-header").length>0||t("body.page-template-template-no-header-footer").length>0||t("body.material-ocm-open").length>0||"none"==t('#header-outer[data-has-menu="true"][data-format="centered-menu-bottom-bar"] .span_9').css("display")||"none"==t('#header-outer[data-has-menu="true"][data-format="centered-menu-bottom-bar"] .span_9 > nav').css("display")))if(f=f.length>0&&ht.secondaryHeaderHeight>0?f.height():0,e.hasClass("force-condense")||!e.hasClass("fixed-menu")&&ht.scrollTop>=u){var n=parseInt(a.position().top)-o-parseInt(ht.adminBarHeight)+parseInt(ht.secondaryHeaderHeight)-f;if(t('#header-outer[data-megamenu-rt="1"]').length>0&&t("#header-outer .megamenu").length>0&&t('#header-outer[data-transparent-header="true"]').length>0&&d.removeClass("no-transition"),e.addClass("fixed-menu").removeClass("transparent").css({top:"-"+n+"px",position:"fixed"}),!e.is('[data-menu-bottom-bar-align="left"]')){var i=t("header#top .span_9 nav > ul .menu-title-text").length>0?t("header#top .span_9 nav > ul .menu-title-text").offset().top:0,s=r.find("li:first-child > *").length>0?r.find("li:first-child > *").offset().top:0,l=a.find("nav .sf-menu > li > a .menu-title-text").length>0?(20-parseInt(a.find("nav .sf-menu > li > a .menu-title-text").height()))/2:2;r.css("transform","translateY("+Math.ceil(parseInt(i)-parseInt(s)-l)+"px)"),r.find(".nectar-woo-cart").css("height",e.height()+parseInt(e.css("top"))-parseInt(ht.adminBarHeight))}}else(e.hasClass("force-condense-remove")||e.hasClass("fixed-menu")&&ht.scrollTop<u)&&(e.removeClass("fixed-menu").css({top:"0",position:"absolute"}),r.css("transform","translateY(0px)"),r.find(".nectar-woo-cart").css("height",""),0==t("#header-outer.transparent").length&&(t('#header-outer[data-megamenu-rt="1"]').length>0&&t("#header-outer .megamenu").length>0&&d.removeClass("no-transition"),t('#header-outer[data-megamenu-rt="1"]').length>0&&t('#header-outer[data-transparent-header="true"]').length>0&&t("#header-outer .megamenu").length>0?"true"==d.attr("data-transparent-header")&&0==t(".nectar-box-roll").length&&0==t(".megamenu.sfHover:not(.width-75):not(.width-50)").length?(d.addClass("transparent"),d.removeClass("no-transition")):"true"==d.attr("data-transparent-header")&&0==t(".nectar-box-roll").length&&t(".megamenu.sfHover").length>0&&d.addClass("no-transition"):"true"==d.attr("data-transparent-header")&&0==t(".nectar-box-roll").length&&d.addClass("transparent")))}i.length>0&&0==t('#header-outer[data-remove-fixed="1"]').length&&t('#header-outer[data-condense="true"]').length>0&&setTimeout(function(){"none"!=c.css("display")&&(ht.secondaryHeaderHeight=c.outerHeight())},50),t('#header-outer[data-condense="true"]').length>0&&(s.on("scroll.centeredNavCondense",g),s.trigger("scroll"),s.on("resize",function(){(ht.winW<1e3||Qt())&&(e.addClass("force-condense-remove"),s.off("scroll.centeredNavCondense"))}),s.on("smartresize",function(){p(),ht.winW>=1e3&&0==Qt()&&e.hasClass("force-condense-remove")&&(g(),e.removeClass("force-condense-remove"),setTimeout(function(){ht.scrollTop>=u&&(e.addClass("force-condense"),g(),e.removeClass("force-condense")),s.on("scroll.centeredNavCondense",g)},200))}),p())}()}function tn(){if(ht.winW>1e3){var e,a,n=t('#header-outer[data-format="centered-logo-between-menu"] #top nav > .sf-menu:not(.buttons) > li').length;t("#header-outer #social-in-menu").length>0&&n--,e=0==t("#header-outer #top .row .col.span_3 #logo img:visible").length?parseInt(t("#header-outer #top .row .col.span_3").width()):parseInt(t("#header-outer #top .row .col.span_3 img:visible").width()),a=t('#header-outer[data-lhe="animated_underline"]').length>0?parseInt(t("header#top nav > ul > li:first-child > a").css("margin-right")):parseInt(t("header#top nav > ul > li:first-child > a").css("padding-right")),a+=a>30?45:a>20?40:30,r.hasClass("rtl")?t('#header-outer[data-format="centered-logo-between-menu"] #top nav > .sf-menu:not(.buttons) > li:nth-child('+Math.floor(n/2)+")").css({"margin-left":e+a+"px"}).addClass("menu-item-with-margin"):t('#header-outer[data-format="centered-logo-between-menu"] #top nav > .sf-menu:not(.buttons) > li:nth-child('+Math.floor(n/2)+")").css({"margin-right":e+a+"px"}).addClass("menu-item-with-margin");var i=0,s=0;t('#header-outer[data-format="centered-logo-between-menu"] #top nav > .sf-menu:not(.buttons) > li:not(#social-in-menu)').each(function(e){e+1<=Math.floor(n/2)?i+=t(this).width():s+=t(this).width()});var o=Math.abs(s-i);i>s||r.hasClass("rtl")&&i<s?t("#header-outer #top .row > .col.span_9").css("padding-right",o):t("#header-outer #top .row > .col.span_9").css("padding-left",o),t('#header-outer[data-format="centered-logo-between-menu"] nav').css("visibility","visible")}else t('#header-outer[data-format="centered-logo-between-menu"]').length>0&&ht.winW<1e3&&t("#header-outer .row > .col.span_9").css({"padding-right":"0","padding-left":"0"})}function en(){if(t('#header-outer[data-format="centered-logo-between-menu"]').length>0){if(C){if(C&&t('#header-outer[data-format="centered-logo-between-menu"]').length>0&&t("header#top #logo img:first[src]").length>0){var e=new Image;e.src=t("header#top #logo img:first").attr("src"),e.onload=function(){tn()}}}else tn();s.on("smartresize",tn)}}function an(){t("#nectar_fullscreen_rows").length>0&&1==rt&&d.attr("data-permanent-transparent","false"),ht.usingMobileBrowser&&t('#header-outer[data-mobile-fixed="1"]').length>0&&0==t('#header-outer[data-transparent-header="true"]').length&&t("#header-space").css("height",d.outerHeight()),e.nectarOptions&&e.nectarOptions.header_entrance&&"true"==e.nectarOptions.header_entrance&&(0==ht.scrollTop?t("#header-outer").addClass("entrance-animation"):t("#header-outer").css("opacity","1")),0==t("#nectar_fullscreen_rows").length&&0==t(".nectar-box-roll").length?Va():t("#nectar_fullscreen_rows").length>0&&0==rt&&Va()}t.fn.dlmenu=function(e){if("string"==typeof e){var a=Array.prototype.slice.call(arguments,1);this.each(function(){var n=t.data(this,"menu");n?t.isFunction(n[e])&&"_"!==e.charAt(0)?n[e].apply(n,a):qa("no such method '"+e+"' for menu instance"):qa("cannot call methods on menu prior to initialization; attempted to call method '"+e+"'")})}else this.each(function(){var a=t.data(this,"menu");a?a._init():a=t.data(this,"menu",new t.DLMenu(e,this))});return this},Qa.prototype.events=function(){this.$toggleBtn.on("click",this.toggle.bind(this)),this.$sidebar.find(".nectar-close-btn-wrap").on("click",this.mobileToggle.bind(this)),t(e).on("smartresize",this.mobileToggleResize.bind(this))},Qa.prototype.mobileToggleResize=function(){this.$sidebar.hasClass("open")&&ht.winW>999&&(this.$sidebar.removeClass("open"),this.$sidebar.find(".nectar-close-btn-wrap").removeClass("open"),t(".container-wrap").css("z-index","11"))},Qa.prototype.mobileToggle=function(){return this.$sidebar.hasClass("open")?(this.$sidebar.removeClass("open"),this.$sidebar.find(".nectar-close-btn-wrap").removeClass("open"),t(".container-wrap").css("z-index","11")):(t(".container-wrap").css("z-index","10000"),this.$sidebar.addClass("open"),this.$sidebar.find(".nectar-close-btn-wrap").addClass("open")),!1},Qa.prototype.toggle=function(){if(ht.winW<1e3)return this.mobileToggle(),!1;var a="";return"true"==this.state.open?(this.state.open="false",a="false",this.$toggleBtn.find(".hide").hide(),this.$toggleBtn.find(".show").show(),this.$toggleBtn.find(".top-line, .bottom-line").css({transform:"translateX(0)"}),"left"==this.sidebarPos?this.$sidebar.css({"margin-right":"-25%",opacity:"0"}):this.$sidebar.css({"margin-left":"-25%",opacity:"0"}),this.$sidebar.find("> .inner").css({transform:"left"==this.sidebarPos?"translateX(-100%)":"translateX(100%)"})):(this.state.open="true",a="true",this.$toggleBtn.find(".show").hide(),this.$toggleBtn.find(".hide").show(),this.$toggleBtn.find(".top-line").css({transform:"translateX(10px)"}),this.$toggleBtn.find(".bottom-line").css({transform:"translateX(-10px)"}),"left"==this.sidebarPos?this.$sidebar.css({"margin-right":"0",opacity:"1"}):this.$sidebar.css({"margin-left":"0",opacity:"1"}),this.$sidebar.find("> .inner").css({transform:"translateX(0)"})),setTimeout(function(){t(e).trigger("nectar-product-filters-layout")},425),"undefined"!=typeof Storage&&localStorage.setItem("nectar_product_filters_vis",a),!1},Qa.prototype.setup=function(){if(this.$sidebar.find(".widget.woocommerce").addClass("open-filter").find("ul").css({display:"block"}),this.$sidebar.find(".widget.woocommerce.widget_product_tag_cloud").find("div.tagcloud").css({display:"block"}),t(".nectar-active-product-filters").length>0){var e=t(".nectar-active-product-filters").clone();this.$sidebar.find("> .inner").prepend(e)}},Qa.prototype.getLS=function(){return"undefined"!=typeof Storage?localStorage.getItem("nectar_product_filters_vis"):null},Za.prototype.updateState=function(t){var e=0;!0===this.checkMiniCart(this.$qty)&&(e=this.$qty.attr("name").match(/cart\[(\w+)\]/)[1]);var a=parseFloat(this.$qty.val());a&&""!==a&&"NaN"!==a||(a=0);var n=parseFloat(this.$qty.attr("max")),i=parseFloat(this.$qty.attr("min"));(""===n||"NaN"===n||isNaN(n))&&(n=""),(""===i||"NaN"===i||isNaN(i))&&(i=0),this.state={currentVal:a,max:n,min:i,key:e}},Za.prototype.events=function(){var e=this;t("body").on("click",".quantity .plus",function(){0==t(this).parents(".auction_form").length&&(e.$qty=t(this).closest(".quantity").find(".qty"),e.setStep(),e.updateState(),e.increment(t(this)))}),t("body").on("click",".quantity .minus",function(){0==t(this).parents(".auction_form").length&&(e.$qty=t(this).closest(".quantity").find(".qty"),e.setStep(),e.updateState(),e.decrement(t(this)))}),t("body").on("keyup",".woocommerce-mini-cart .quantity .qty",function(a){e.$qty=t(this),e.updateState(),e.state.max&&e.$qty.val()>e.state.max&&e.$qty.val(e.state.max),e.state.min&&(e.state.min==e.state.currentVal||e.state.currentVal<e.state.min)&&(e.state.removeFlag=!0),t(this).trigger("change")}),t("body").on("change",".woocommerce-mini-cart .quantity .qty",function(t){t.originalEvent||!0!==e.checkMiniCart(e.$qty)||e.updateCart(e.$qty.val())})},Za.prototype.setStep=function(){if(this.$qty.is("[step]")){var t=parseInt(this.$qty.attr("step"));isNaN(t)||""==t||0==t||(this.step=t)}},Za.prototype.increment=function(){this.state.max&&(this.state.max==this.state.currentVal||this.state.currentVal>this.state.max)?this.$qty.val(this.state.max):this.$qty.val(this.state.currentVal+parseFloat(this.step)),this.$qty.trigger("change")},Za.prototype.decrement=function(){this.state.min&&(this.state.min==this.state.currentVal||this.state.currentVal<this.state.min)?(this.$qty.val(0),this.state.removeFlag=!0):this.state.currentVal>0&&this.$qty.val(this.state.currentVal-parseFloat(this.step)),this.$qty.trigger("change")},Za.prototype.checkMiniCart=function(t){return t.parents(".woocommerce-mini-cart").length>0},Za.prototype.updateCart=function(n){var i=this;clearTimeout(this.ajaxTimeout),this.ajaxTimeout=setTimeout(function(){i.$qty.closest(".widget_shopping_cart_content").addClass("loading"),i.$qty.closest(".woocommerce-mini-cart-item").addClass("blockUI").addClass("blockOverlay"),t.ajax({type:"POST",url:e.nectarLove.ajaxurl,data:{action:"nectar_minicart_update_quantity",quantity:n,item_key:i.state.key},cache:!1,success:function(e){if(e){i.$qty.closest(".widget_shopping_cart_content").removeClass("loading"),i.$qty.closest(".woocommerce-mini-cart-item").removeClass("blockUI").removeClass("blockOverlay");var n=i.$qty.closest(".widget_shopping_cart_content").find(".woocommerce-mini-cart__total");n.find(".woocommerce-Price-amount, .tax_label").remove(),n.append(e.subtotal),!0===i.state.removeFlag&&(i.$qty.closest(".woocommerce-mini-cart-item").remove(),i.state.removeFlag=!1,t(a.body).trigger("updated_wc_div")),t("#header-outer a.cart-contents .cart-wrap span").length>0&&t("#header-outer a.cart-contents .cart-wrap span").text(e.item_count)}}})},this.ajaxTimeoutDur)},Ga.prototype.events=function(){t("body").on("click","form.cart .single_add_to_cart_button",this.addToCartAJAX.bind(this))},Ga.prototype.addNotices=function(e){var a=t(".nectar-slide-in-cart.style_slide_in_click .widget_shopping_cart_content");t.each(e,function(t,e){a.prepend('<div class="nectar-notice">'+e.notice+"</div>")}),setTimeout(function(){a.find(".nectar-notice").slideUp(function(){t(this).remove()})},6e3)},Ga.prototype.addToCartAJAX=function(a){var n=this,i=t(a.currentTarget).parents("form.cart");if(!(i.closest(".product").hasClass("product-type-external")||wc_add_to_cart_params&&"yes"===wc_add_to_cart_params.cart_redirect_after_add)&&(a.preventDefault(),1!=n.state.processing)){n.state.processing=!0,n.state.productID=!1,n.state.type="regular",i.parents(".nectar-quick-view-box").length>0&&(n.state.type="quickview");var s=i.closest(".product"),r=i.find("button.single_add_to_cart_button"),o=i.serializeArray(),l=0;s.is('[id*="product-"]')&&(l=s.attr("id").match(/\d+/))&&l[0]&&(n.state.productID=l[0]),!1===n.state.productID&&r.length>0&&(l=r.val().match(/\d+/))&&l[0]&&(n.state.productID=l[0]),!1!==n.state.productID?("quickview"===n.state.type&&(r=t(".single_add_to_cart_button_wrap .single_add_to_cart_button")),r.prepend('<div class="loading-wrap"><div class="loading" /></div></div>'),setTimeout(function(){r.addClass("processing")},50),o.push({name:"action",value:"nectar_ajax_add_to_cart"},{name:"add-to-cart",value:n.state.productID}),t.ajax({type:"POST",url:e.nectarLove.ajaxurl,data:o,cache:!1,success:function(e){setTimeout(function(){n.state.processing=!1,r.removeClass("processing"),r.find(".loading-wrap").remove()},300),e&&e.fragments&&(t("body").trigger("added_to_cart",[e.fragments,e.cart_hash]),e.notices&&e.notices.length>0&&setTimeout(function(){n.addNotices(e.notices)},100),"quickview"===n.state.type&&t(".nectar-quick-view-box .close").trigger("click"))}})):console.log("Error: no product ID found.")}},Ja.prototype.setup=function(){this.$container=t('<div class="inner"></div>'),t("#search-outer").append(t('<div class="nectar-ajax-search-results"><div class="container"></div></div>')),this.$parent=t("#search-outer .nectar-ajax-search-results"),t("#search-outer .nectar-ajax-search-results .container").append(this.$container)},Ja.prototype.events=function(){var a,n,i,s=this;this.throttled=(a=this.getResults.bind(this),n=350,i=!1,function(){i||(a.call(),i=!0,setTimeout(function(){i=!1},n))}),this.$el.on("keyup",this.keyHandle.bind(this)),t(e).on("resize",this.resize.bind(this)),t(e).on("nectar-search-close",function(){s.resetHeight(),s.requestCheck()})},Ja.prototype.keyHandle=function(t){-1==[16,91,32,37,39,17].indexOf(t.keyCode)&&(this.throttled(),this.debouncedSearch())},Ja.prototype.debouncedSearch=function(){var t=this;clearTimeout(this.timeout),this.timeout=setTimeout(function(){t.state.requesting||t.getResults()},400)},Ja.prototype.resize=function(){this.$parent.css({"max-height":""}),!0===this.state.open&&this.$parent.css({"max-height":parseInt(this.$container.outerHeight())+"px"})},Ja.prototype.resetHeight=function(){this.$parent.css({"max-height":""}),setTimeout(function(){d.removeClass("results-shown")},400),this.state.prevResults="",this.state.open=!1},Ja.prototype.requestCheck=function(){!0===this.state.requesting&&(this.request.abort(),this.state.requesting=!1)},Ja.prototype.getResults=function(){var a=this,n=this.$el.val();if(0==n.length||n.length<this.minChars)return d.removeClass("results-shown"),this.requestCheck(),void this.resetHeight();this.request=t.ajax({type:"POST",url:e.nectarLove.ajaxurl,data:{action:"nectar_ajax_ext_search_results",search:n},cache:!1,success:function(e){a.state.requesting=!1,e||a.resetHeight(),e&&e.content&&e.content!==a.state.prevResults&&a.$searchEl.hasClass("material-open")&&(a.$container.html(e.content),a.$parent.css({"max-height":parseInt(a.$container.outerHeight())+"px"}),setTimeout(function(){d.addClass("results-shown")},200),ht.winW>=1e3&&!d.hasClass("results-shown")&&(a.$container.find(".product, .search-post-item").css({opacity:"0",transform:"translateY(25px)",transition:"none"}),setTimeout(function(){a.$container.find(".product, .search-post-item").css({transition:"box-shadow 0.25s ease, opacity 0.55s cubic-bezier(0.2, 0.6, 0.4, 1), transform 0.55s cubic-bezier(0.2, 0.6, 0.4, 1)"})},50),a.$container.find(".product, .search-post-item").each(function(e){var a=t(this);setTimeout(function(){a.css({opacity:"1",transform:"translateY(0)"})},50+60*e)})),a.state.open=!0,a.state.prevResults=e.content)}}),this.state.requesting=!0};var nn={timeoutQueued:!1,visible:!0,init:!1,raf:"",bodyOffsetHeight:1e4};function sn(){var e=0,n=0==k&&t('#page-header-bg[data-parallax="1"]').length>0?200:60,s=3,r=t('.page-submenu[data-sticky="true"]').length>0;nn.bodyOffsetHeight=a.body.offsetHeight,0==nn.init&&setInterval(function(){1!=pt.materialOffCanvasOpen&&(nn.bodyOffsetHeight=a.body.offsetHeight)},1500),nn.raf=requestAnimationFrame(function a(){d[0].classList.add("detached");var o=ht.scrollTop,l=Math.abs(o-e);if(1==pt.animatedScrolling||1==pt.preventScroll||1==pt.ocmOpen)return o>n&&(1==pt.animatedScrolling&&1==k&&0==pt.permanentTransHeader&&d.removeClass("transparent").addClass("scrolling"),e=ht.scrollTop,o=ht.scrollTop),void(nn.raf=requestAnimationFrame(a));if(1==pt.materialOffCanvasOpen||1==pt.materialSearchOpen)return 1==pt.materialSearchOpen&&1==k&&(0==pt.permanentTransHeader&&o>n?d.removeClass("transparent").addClass("scrolling"):d.addClass("transparent").removeClass("scrolling")),void(nn.raf=requestAnimationFrame(a));if(!d.hasClass("side-widget-open")&&!t("#header-outer .slide-out-widget-area-toggle a").hasClass("animating")){var h;if(c.length>0&&(o>n?(c.addClass("hide-up"),d.css("transform","translateY(-"+ht.secondaryHeaderHeight+"px)")):(c.removeClass("hide-up"),d.css("transform","0px)"))),o>n)0==pt.permanentTransHeader&&(0==nn.timeoutQueued&&setTimeout(function(){0==pt.ocmOpen&&(d.removeClass("transparent"),d.addClass("scrolling")),nn.timeoutQueued=!1},400),nn.timeoutQueued=!0),d.removeClass("no-transition"),l>=s&&(o>e?(d.hasClass("invisible")||(d.addClass("invisible").removeClass("at-top"),ht.winW>1e3&&t(".sf-menu").length>0&&t().superfish&&(t(".sf-menu").superfish("hide"),t("header#top nav > ul.sf-menu > li.menu-item-over").removeClass("menu-item-over"))),1==r&&t(".page-submenu.stuck").css("transform","translateY(0px)").addClass("header-not-visible")):(d.hasClass("invisible")&&d.removeClass("invisible"),1==r&&(h=d.outerHeight(),c.length>0&&(h-=ht.secondaryHeaderHeight),f.length>0&&ht.winW>999?(i=ot?f.height():0,t(".page-submenu.stuck").css("transform","translateY("+(h-i)+"px)").removeClass("header-not-visible")):t(".page-submenu.stuck").css("transform","translateY("+h+"px)").removeClass("header-not-visible"))));else{var u=c.length>0?32:0;f.length>0&&(u=c.length>0?32+f.height():f.height()),o<=u&&(d.addClass("at-top").removeClass("invisible").removeClass("scrolling"),ht.winW>999&&t('#header-outer[data-megamenu-rt="1"]').length>0&&1==k&&t("#header-outer .megamenu").length>0?0==t(".nectar-box-roll").length&&0==t(".megamenu.sfHover:not(.width-75):not(.width-50)").length?d.addClass("transparent").css("transform","translateY(0)").removeClass("no-transition"):t(".nectar-box-roll").length>0&&d.css("transform","translateY(0)").addClass("at-top-before-box"):1==k&&0==dt.inUse?d.addClass("transparent").css("transform","translateY(0)"):1==dt.inUse&&d.css("transform","translateY(0)").addClass("at-top-before-box"))}ht.winH+ht.scrollTop+30>=nn.bodyOffsetHeight&&(d.removeClass("invisible"),1==r&&(h=d.outerHeight(),c.length>0&&(h-=ht.secondaryHeaderHeight),f.length>0&&ht.winW>999?(i=ot?f.height():0,t(".page-submenu.stuck").css("transform","translateY("+(h-i)+"px)").removeClass("header-not-visible")):t(".page-submenu.stuck").css("transform","translateY("+h+"px)").removeClass("header-not-visible")))}e=o,nn.raf=requestAnimationFrame(a)}),0==nn.init&&(nn.init=!0)}function rn(){var e=ht.scrollTop,a=ht.winW,n=30;1!=k||ht.usingMobileBrowser||(n=0),e>n&&a>=1e3&&0==t("body.material-ocm-open").length&&(r.is(".material")&&(0==t("#search-outer.material-open").length&&t('#header-outer[data-transparent-header="true"] .bg-color-stripe').css("transition","none"),c.length>0&&(c.addClass("hide-up"),d.css("transform","translateY(-"+ht.secondaryHeaderHeight+"px)"))),t('#header-outer[data-megamenu-rt="1"]').length>0&&t('#header-outer[data-transparent-header="true"]').length>0&&t("#header-outer .megamenu").length>0?"true"==d.attr("data-transparent-header")&&0==t("#header-outer.side-widget-open").length&&0==t('#header-outer[data-permanent-transparent="1"]').length&&0==t(".megamenu.sfHover:not(.width-75):not(.width-50)").length&&(d.removeClass("transparent"),d.removeClass("no-transition")):"true"==d.attr("data-transparent-header")&&0==t("#header-outer.side-widget-open").length&&0==t('#header-outer[data-permanent-transparent="1"]').length&&d.removeClass("transparent"),t("#header-outer:not(.small-nav) header#top nav > ul > li.menu-item-with-margin").stop(!0,!0).animate({"margin-right":parseInt(t("header#top nav > ul > li.menu-item-with-margin").css("margin-right"))-3*parseInt(y)+"px"},{queue:!1,duration:250,easing:"easeOutCubic"}),t("#header-outer, #search-outer").addClass("small-nav"),t('#header-outer[data-full-width="true"][data-transparent-header="true"]').length>0&&f.length>0&&1==ot&&t('#header-outer[data-full-width="true"] header > .container').stop(!0,!0).animate({padding:"0"},{queue:!1,duration:250,easing:"easeOutCubic"}),t(".nectar-box-roll").length>0&&0==t('#header-outer[data-permanent-transparent="1"]').length&&t("#ajax-content-wrap").animate({"margin-top":Math.floor(b-y+2*w/1.8+ht.adminBarHeight+ht.secondaryHeaderHeight)},{queue:!1,duration:250,easing:"easeOutCubic"}),s.off("scroll.headerResizeEffect",rn),s.on("scroll.headerResizeEffect",on),t('#header-outer[data-transparent-header="true"]').css("transition","transform 0.3s ease, background-color 0.30s ease, opacity 0.3s ease, box-shadow 0.30s ease, margin 0.25s ease-out, backdrop-filter 0.25s ease"),t('#header-outer[data-transparent-header="true"] .cart-menu').css("transition","none"),setTimeout(function(){t('#header-outer[data-transparent-header="true"]').css("transition","transform 0.3s ease, background-color 0.30s ease, opacity 0.3s ease, box-shadow 0.30s ease, border-color 0.30s ease, margin 0.25s ease-out, backdrop-filter 0.25s ease"),t('#header-outer[data-transparent-header="true"] .cart-menu').css("transition","border-color 0.30s ease")},300))}function on(){var e=ht.scrollTop,a=ht.winW,n=30;if(r.is(".material-ocm-open"))return!1;1!=k||ht.usingMobileBrowser||(n=0),(e<=n&&a>=1e3||t(".small-nav").length>0&&t("#ajax-content-wrap.no-scroll").length>0)&&(t("#header-outer, #search-outer").removeClass("small-nav"),t('#header-outer[data-megamenu-rt="1"]').length>0&&t('#header-outer[data-transparent-header="true"]').length>0&&t("#header-outer .megamenu").length>0?"true"==d.attr("data-transparent-header")&&0==t(".nectar-box-roll").length&&0==t(".megamenu.sfHover:not(.width-75):not(.width-50)").length&&(d.addClass("transparent"),d.removeClass("no-transition")):"true"==d.attr("data-transparent-header")&&0==t(".nectar-box-roll").length&&d.addClass("transparent"),t('#header-outer[data-full-width="true"][data-transparent-header="true"]').length>0&&f.length>0&&1==ot&&t('#header-outer[data-full-width="true"] header > .container').stop(!0,!0).animate({padding:"0 28px"},{queue:!1,duration:250,easing:"easeOutCubic"}),t("header#top nav > ul > li.menu-item-with-margin").stop(!0,!0).animate({"margin-right":parseInt(t("header#top nav > ul > li.menu-item-with-margin").css("margin-right"))+3*parseInt(y)+"px"},{queue:!1,duration:150,easing:"easeOutCubic"}),c.length>0&&(c.removeClass("hide-up"),d.removeClass("hide-up").css("transform","translateY(0%)")),t(".nectar-box-roll").length>0&&0==t('#header-outer[data-permanent-transparent="1"]').length&&t("#ajax-content-wrap").animate({"margin-top":Math.floor(b+2*w+ht.adminBarHeight+ht.secondaryHeaderHeight)},{queue:!1,duration:250,easing:"easeOutCubic"}),s.off("scroll.headerResizeEffect",on),s.on("scroll.headerResizeEffect",rn),t('#header-outer[data-transparent-header="true"]').css("transition","transform 0.3s ease, background-color 0.30s ease, opacity 0.3s ease, box-shadow 0.30s ease, margin 0.25s ease-out, backdrop-filter 0.25s ease"),t('#header-outer[data-transparent-header="true"] .cart-menu').css("transition","none"),setTimeout(function(){t('#header-outer[data-transparent-header="true"]').css("transition","transform 0.3s ease, background-color 0.30s ease, opacity 0.3s ease, box-shadow 0.30s ease, border-color 0.30s ease, margin 0.25s ease-out, backdrop-filter 0.25s ease"),t('#header-outer[data-transparent-header="true"] .cart-menu').css("transition","border-color 0.30s ease")},300))}function ln(){t('#header-outer[data-format="centered-menu-bottom-bar"][data-condense="true"]').length>0&&!d.hasClass("within-custom-breakpoint")||ht.scrollTop>0&&(t("body.material").length>0&&(d.addClass("scrolled-down"),c.length>0&&ht.winW>1e3&&(c.addClass("hide-up"),d.css("transform","translateY(-"+ht.secondaryHeaderHeight+"px)"))),"true"==d.attr("data-transparent-header")&&0==t('#header-outer[data-permanent-transparent="1"]').length&&d.removeClass("transparent").addClass("scrolled-down"),s.off("scroll.headerResizeEffectOpaque",ln),s.on("scroll.headerResizeEffectOpaque",dn))}function dn(){t('#header-outer[data-format="centered-menu-bottom-bar"][data-condense="true"]').length>0&&!d.hasClass("within-custom-breakpoint")||0==ht.scrollTop&&0==t("body.material-ocm-open").length&&(t('#header-outer[data-megamenu-rt="1"]').length>0&&t('#header-outer[data-transparent-header="true"]').length>0&&t("#header-outer .megamenu").length>0?"true"==d.attr("data-transparent-header")&&0==t(".megamenu.sfHover:not(.width-75):not(.width-50)").length?(d.addClass("transparent").removeClass("scrolled-down"),d.removeClass("no-transition")):"true"==d.attr("data-transparent-header")&&d.removeClass("scrolled-down"):"true"==d.attr("data-transparent-header")&&d.addClass("transparent").removeClass("scrolled-down"),t("body.material").length>0&&(d.removeClass("scrolled-down"),c.length>0&&ht.winW>1e3&&(c.removeClass("hide-up"),d.removeClass("hide-up").css("transform","translateY(0%)"))),s.off("scroll.headerResizeEffectOpaque",dn),s.on("scroll.headerResizeEffectOpaque",ln))}function cn(){1!=pt.materialOffCanvasOpen?(ht.scrollTop>5?"scrolled"!=pt.mobileHeader&&(0==pt.permanentTransHeader&&d.removeClass("transparent"),ht.secondaryHeaderHeight>0?(c.addClass("hide-up"),d.css("transform","translateY(-"+ht.secondaryHeaderHeight+"px)").addClass("hidden-secondary")):d.removeClass("hidden-secondary"),d.addClass("scrolled-down"),pt.mobileHeader="scrolled"):"at-top"!=pt.mobileHeader&&("true"==d.attr("data-transparent-header")&&d.addClass("transparent"),ht.secondaryHeaderHeight>0&&(c.removeClass("hide-up"),d.css("transform","translateY(0px)")),d.removeClass("hidden-secondary").removeClass("scrolled-down"),pt.mobileHeader="at-top"),ht.winW<1e3&&requestAnimationFrame(cn)):requestAnimationFrame(cn)}function hn(){ht.winW>999||(pt.mobileHeader="",s.off("scroll.headerResizeEffect"),s.off("scroll.headerResizeEffectOpaque"),"1"==T&&0==t('#header-outer[data-remove-fixed="1"]').length?t('#header-outer[data-mobile-fixed="1"]').length>0?(t(".nectar-box-roll").length>0&&d.addClass("at-top-before-box"),cancelAnimationFrame(nn.raf),sn()):(cancelAnimationFrame(nn.raf),d.removeClass("scrolled-down").removeClass("detached").removeClass("invisible").removeClass("at-top").css("transform","none")):t('#header-outer[data-mobile-fixed="1"]').length>0?requestAnimationFrame(cn):"true"==d.attr("data-transparent-header")&&d.addClass("transparent"),s.off("smartresize.nectarNavScrollEffects"),s.on("smartresize.nectarNavScrollEffects",un))}function un(){ht.winW<1e3||(1==x&&"1"!=T?(s.off("scroll.headerResizeEffect"),0==t("#nectar_fullscreen_rows").length?s.on("scroll.headerResizeEffect",rn):t('#nectar_fullscreen_rows[data-mobile-disable="on"]').length>0&&ht.usingMobileBrowser&&s.on("scroll.headerResizeEffect",rn)):"1"!=T?(s.off("scroll.headerResizeEffectOpaque"),s.on("scroll.headerResizeEffectOpaque",ln)):"1"==T&&(t(".nectar-box-roll").length>0&&d.addClass("at-top-before-box"),0==t('#header-outer[data-remove-fixed="1"]').length&&(cancelAnimationFrame(nn.raf),sn())),t('#header-outer[data-format="centered-menu-bottom-bar"][data-condense="true"]').length>0&&(c.length>0&&d.css("transform",""),ht.scrollTop>200&&!d.hasClass("fixed-menu")&&d.addClass("fixed-menu")),s.off("smartresize.nectarNavScrollEffects"),s.on("smartresize.nectarNavScrollEffects",hn))}function pn(){if(t(".mobile").length>0)ht.winH<ht.winW&&ht.winW>1e3?0==t("#header-outer.small-nav").length&&t("#header-space").css("height",d.outerHeight()):t("#header-space").css("height",d.outerHeight());else if(0==t(".nectar-parallax-scene.first-section").length){var e=w-w/1.8,a=t('#header-outer[data-header-resize="1"]').length>0&&t(".small-nav").length>0?d.outerHeight()+(parseInt(y)+2*e):d.outerHeight();Math.abs(a-t("#header-space").height())>7&&t("#header-space").css("height",a)}}function fn(){var e=-1,a=ht.scrollTop;function n(){if(!r.hasClass("compose-mode")){if(a=ht.scrollTop,e==a)return requestAnimationFrame(n),!1;e=a,i(),requestAnimationFrame(n)}}function i(){var e=0;if(ht.winW<1e3||1==_&&"none"==t("#header-outer .span_9").css("display")||1==_&&"none"==t("#header-outer .span_9 > nav").css("display")){e=0;var n="fixed"==u.css("position")?u.height():0;(e+=ht.adminBarHeight)-a>n?d.css("top",e-a+"px"):d.css("top",n)}else 0==_&&(e=0,d.is('[data-remove-fixed="1"]')||(e+=ht.adminBarHeight),d.css("top",e+"px"))}t('#header-outer[data-mobile-fixed="1"]').length>0&&u.length>0&&(0==t("#nectar_fullscreen_rows").length?requestAnimationFrame(n):t("#nectar_fullscreen_rows").length>0&&ht.usingMobileBrowser&&requestAnimationFrame(n),s.on("smartresize",i))}function gn(){var e=0,a=0;if(d.is("[data-logo-height]")&&d.is("[data-padding]")?d.hasClass("transparent")||(e=d.find("#logo.no-image").length>0?"left-header"==$&&ht.winW>1e3?0:parseInt(d.find("#logo.no-image").height())+parseInt(2*d.attr("data-padding")):"left-header"==$&&ht.winW>1e3?0:parseInt(d.attr("data-logo-height"))+parseInt(2*d.attr("data-padding"))):e="left-header"==$&&ht.winW>1e3?0:d.outerHeight(),g.length>0&&(a+=g.height()),t(".page-header-no-bg").length>0&&(a+=t(".page-header-no-bg").height()),ht.winH-ht.adminBarHeight-e-ht.footerOuterHeight-1-a>0){var n=t('body:not(.material) #header-outer[data-header-resize="1"]').length>0?55:0;t('body[data-footer-reveal="1"]:not(.nectar_using_pfsr) .container-wrap').css({"margin-bottom":ht.footerOuterHeight}),t(".container-wrap").css({"min-height":ht.winH-ht.adminBarHeight-e-ht.footerOuterHeight-a+n})}else t('body[data-footer-reveal="1"]:not(.nectar_using_pfsr) .container-wrap').css({"margin-bottom":ht.footerOuterHeight});ht.winW<1e3?m.attr("data-midnight","light"):m.removeAttr("data-midnight")}function mn(){(t('body[data-footer-reveal="1"]').length>0||t('body.material[data-slide-out-widget-area-style="slide-out-from-right"]').length>0)&&(setTimeout(gn,60),gn(),s.on("resize",gn),t('body[data-footer-reveal="1"][data-footer-reveal-shadow="large_2"]').length>0&&t(".container-wrap").css({boxShadow:"0 70px 110px -30px "+m.css("backgroundColor")}))}function vn(t){this.$el=t,this.offsetTop=0,this.fullHeight=100,this.storedWinH=ht.winH,this.events(),this.calculate()}function bn(){it=[],t(".vc_row-o-full-height").each(function(e){it[e]=new vn(t(this))})}function wn(){var a=e.navigator.userAgent.indexOf("MSIE ");(a>0||navigator.userAgent.match(/Trident.*rv\:11\./))&&t(".vc_row-o-full-height").each(function(){"flex"===t(this).find("> .span_12").css("display")&&t(this).wrap('<div class="vc_ie-flexbox-fixer"></div>')}),(a>0||navigator.userAgent.match(/Trident.*rv\:11\./))&&(yn(),t(e).on("resize",yn))}function yn(){t(".img-with-aniamtion-wrap img.img-with-animation").each(function(){if(0==t(this).parents(".tabbed").length&&0==t(this).parents(".toggle").length){var e=t(this).parents(".img-with-aniamtion-wrap");e.css({height:""});var a=t(this).height();e.css({height:a})}})}function _n(){t(".nectar-recent-posts-slider").each(function(){var e=parseInt(t(this).attr("data-height")),a=t('body[data-ext-responsive="true"]').length>0?s.width()/1400:s.width()/1100,n=t(this).find(".nectar-recent-post-slide, .flickity-viewport");if(ht.winW>1e3&&0==t("#boxed").length)0==t(this).parents(".full-width-content").length?t('body[data-ext-responsive="true"]').length>0&&ht.winW>=1400?n.css("height",Math.ceil(e)):0==t('body[data-ext-responsive="true"]').length&&ht.winW>=1100?n.css("height",Math.ceil(e)):n.css("height",Math.ceil(e*a)):n.css("height",Math.ceil(e*a));else{var i=t(this).parents(".wpb_column").length>0?t(this).parents(".wpb_column"):t(this).parents(".col");if(0==i.length&&(i=t(".main-content")),i.hasClass("vc_span12")||i.hasClass("main-content")||i.hasClass("span_12")||i.hasClass("vc_col-sm-12"))e*a<=250?n.css("height",250):n.css("height",Math.ceil(e*a));else{var r=e/function(e){var a=1100,n=t(e).attr("class").match(/\d+/);"2"==n?a=170:"3"==n?a=260:"4"==n?a=340:"6"==n?a=530:"8"==n?a=700:"9"==n?a=805:"10"==n?a=916.3:"12"==n&&(a=1100);return a}(i);r*i.width()<=250?n.css("height",250):n.css("height",r*i.width())}}})}function Cn(){t(".nectar-recent-posts-single_featured.multiple_featured").each(function(){var e=t(this).find(".project-slides").length>0?".project-slide":".nectar-recent-post-slide",a=t(this).find(".project-slides").length>0?".project-info h1":".inner-wrap h2 a";t(this).find(e).each(function(){t(this).find(a).each(function(){var e=t(this).text();e=(e=e.trim()).split(" "),t(this)[0].innerHTML="";for(var a=0;a<e.length;a++)t(this)[0].innerHTML+="<span>"+e[a]+"</span> "}),t(this).find(a+" > span").wrapInner('<span class="inner" />')})})}function xn(){(t('.nectar-split-heading[data-animation-type="line-reveal-by-space"]').length>0||t('.nectar-split-heading[data-animation-type="letter-fade-reveal"]').length>0)&&(t('.nectar-split-heading[data-animation-type="line-reveal-by-space"]:not([data-text-effect="none"])').each(function(){var e=t(this).hasClass("animated-in")?" animated":"";t(this).find("> *").each(function(){var a=t(this).text();a=(a=a.trim()).split(" "),t(this)[0].innerHTML="";for(var n=0;n<a.length;n++)t(this)[0].innerHTML+='<span><span class="inner'+e+'">'+a[n]+"</span></span> "}),t(this).addClass("markup-generated")}),t('.nectar-split-heading[data-animation-type="line-reveal-by-space"][data-text-effect*="letter-reveal"]').each(function(){if(t(this).is('[data-m-rm-animation="true"]')&&ht.winW<1e3)return!0;var e=t(this).hasClass("animated-in")?' style="transform: none;"':"";t(this).find("> *").each(function(){var e=t(this).text();e=(e=e.trim()).split(" "),t(this)[0].innerHTML="";for(var a=0;a<e.length;a++)t(this)[0].innerHTML+="<span>"+e[a]+"</span> "}),t(this).find("span").each(function(){var a=t(this),n=t(this).text().split("");a.empty(),t.each(n,function(t,n){a.append('<span class="inner"'+e+">"+n+"</span>")})}),t(this).addClass("markup-generated")}))}function kn(){if(t(".nectar-recent-posts-slider-inner").length>0){var e=t(".nectar-recent-posts-slider_multiple_visible").length>0&&"90%",a=t(".nectar-recent-posts-slider-inner").flickity({contain:!0,groupCells:e,draggable:!0,lazyLoad:!1,imagesLoaded:!0,percentPosition:!0,prevNextButtons:!1,pageDots:!0,resize:!0,setGallerySize:!0,wrapAround:!0,accessibility:!1});setTimeout(function(){t(".nectar-recent-posts-slider-inner").addClass("loaded")},1150);var n;a.data("flickity");a.on("dragStart.flickity",function(){t(".flickity-viewport").addClass("is-moving")}),a.on("dragEnd.flickity",function(){t(".flickity-viewport").removeClass("is-moving")}),a.on("select.flickity",function(){t(".flickity-viewport").addClass("no-hover"),clearTimeout(n),n=setTimeout(function(){t(".flickity-viewport").removeClass("no-hover")},400)}),_n(),s.on("resize",_n),ht.usingMobileBrowser||ht.usingFrontEndEditor||s.on("resize",Tn)}t(".nectar-recent-posts-single_featured.multiple_featured").each(function(e){t(this).find("> .normal-container").length>0&&t(this).find("> .normal-container").remove(),t(this).append('<div class="normal-container container"> <ul class="controls" data-color="'+t(this).attr("data-button-color")+'" data-num="'+t(this).find(".nectar-recent-post-slide").length+'"></ul> </div>');var a,n=t(this),i=0;M[e]={autorotate:""},t(this).find(".nectar-recent-post-slide").each(function(e){t(this).find(".recent-post-container").height()>i&&(t(this).siblings().removeClass("tallest"),t(this).addClass("tallest"),i=t(this).find(".recent-post-container").height());var a=0==e&&t(this).parents('.nectar-recent-posts-single_featured.multiple_featured[data-autorotate="none"]').length>0?'class="active"':"";n.find(".controls").append("<li "+a+'><span class="title">'+t(this).find("h2").text()+"</span></li>")}),t(this).addClass("js-loaded"),t(this).find(".controls li").on("click",function(n){if(!t(this).hasClass("active")){void 0!==n.originalEvent&&t(this).parent().find(".active").addClass("trans-out");var i=t(this).index(),s=t(this).parent().find(".active").index(),r=t(this);clearTimeout(a),t(this).siblings().removeClass("active"),t(this).addClass("active"),a=setTimeout(function(){r.parents(".multiple_featured").find(".nectar-recent-post-slide:not(:eq("+i+"))").css("opacity","0").removeClass("active"),r.parent().find(".trans-out").removeClass("trans-out")},300),r.parents(".multiple_featured").find(".nectar-recent-post-slide:not(:eq("+i+"))").css("z-index","10"),r.parents(".multiple_featured").find(".nectar-recent-post-slide:eq("+s+")").css("z-index","15"),t(this).parents(".multiple_featured").find(".nectar-recent-post-slide").eq(i).css({opacity:"1","z-index":"20"}).addClass("active"),"none"!=t(this).parents(".multiple_featured").attr("data-autorotate")&&function(t,e){if(clearInterval(M[e].autorotate),t.attr("data-autorotate").length>0){var a=parseInt(t.attr("data-autorotate"))<100?4e3:parseInt(t.attr("data-autorotate"));M[e].autorotate=setInterval(function(){Sn(t)},a)}}(r.parents(".nectar-recent-posts-single_featured.multiple_featured"),e)}}),n=t(this),t(this).attr("data-autorotate").length>0&&"none"!=t(this).attr("data-autorotate")&&0==t("body.vc_editor").length&&setTimeout(function(){var t=parseInt(n.attr("data-autorotate"))<100?4e3:parseInt(n.attr("data-autorotate"));M[e].autorotate=setInterval(function(){Sn(n)},t),n.find(".controls > li:first-child").addClass("active")},30)}),Cn(),s.on("resize",Cn)}function $n(){t(".nectar-recent-posts-slider").each(function(){var e=parseInt(t(this).find(".flickity-slider").position().left),a=t(this).find(".nectar-recent-post-slide"),n=a.length,i=a.width(),s=t(this).find(".nectar-recent-post-slide:last-child").index(),r=t(this).find(".nectar-recent-post-slide:first-child .nectar-recent-post-bg"),o=t(this).find(".nectar-recent-post-slide:last-child .nectar-recent-post-bg");e>=-3?o.css("margin-left",parseInt(Math.ceil(i/3.5))+"px"):o.css("margin-left","-"+parseInt(Math.ceil(i/3.5*s))+"px"),Math.abs(e)>=(n-1)*i?r.css("margin-left","-"+parseInt(Math.ceil(i/3.5*n))+"px"):r.css("margin-left","0px"),t(this).find(".nectar-recent-post-bg").css("transform","translateX("+Math.ceil(t(this).find(".flickity-slider").position().left/-3.5)+"px)")}),requestAnimationFrame($n)}function Tn(){t(".nectar-recent-posts-slider").each(function(){var e=t(this).find(".nectar-recent-post-slide").width();t(this).find(".nectar-recent-post-slide").each(function(a){t(this).find(".nectar-recent-post-bg").css("margin-left","-"+parseInt(Math.ceil(e/3.5)*a)+"px")})})}function In(){kn(),t('.blog-recent[data-style="classic_enhanced_alt"] .inner-wrap').each(function(){t(this).find(".post-featured-img").each(function(){var e=t(this).find("img").attr("src");t(this).css("background-image","url("+e+")")})}),t('.blog-recent[data-style="classic_enhanced"]').each(function(){0==t(this).find(".inner-wrap.has-post-thumbnail").length&&t(this).addClass("no-thumbs")}),ht.usingMobileBrowser||t(".nectar-recent-posts-slider").length>0&&!ht.usingFrontEndEditor&&e.requestAnimationFrame($n),ht.usingMobileBrowser||ht.usingFrontEndEditor||Tn()}function En(){t(".style-5").each(function(){t(this).find(".sizer").insertBefore(t(this).find(".parallaxImg"))}),t(".style-5").parents(".wpb_row").css("z-index","100");var n=a,i=(n.getElementsByTagName("body")[0],e),s=n.querySelectorAll(".parallaxImg"),o=s.length,l="ontouchstart"in i||navigator.msMaxTouchPoints,d=!1;if(!(o<=0)){for(var c=0;c<o;c++){var h=s[c],u=h.querySelectorAll(".parallaxImg-layer"),p=u.length;if(!(p<=0)){for(;h.firstChild;)h.removeChild(h.firstChild);var f=0,g=80;navigator.userAgent.indexOf("Chrome")>-1&&navigator.userAgent.indexOf("Edge/")<1?(g=1,t("html").addClass("cssreflections")):r.addClass("cssreflections");var m=n.createElement("div"),v=n.createElement("div"),b=n.createElement("div"),w=n.createElement("div"),y=[];h.id="parallaxImg__"+c,m.className="parallaxImg-container",b.className="parallaxImg-shadow",w.className="parallaxImg-layers";for(var _=0;_<p;_++){var C=n.createElement("div"),x=n.createElement("div"),k=u[_].getAttribute("data-img");t(C).html(t(u[_]).html()),C.className="parallaxImg-rendered-layer",C.setAttribute("data-layer",_),0==_&&0==t(h).parents(".wpb_gallery").length&&(x.className="bg-img",t(h).parents(".nectar-fancy-box").length>0?(x.setAttribute("data-nectar-img-src",k),d=!0):x.style.backgroundImage="url("+k+")",C.appendChild(x)),w.appendChild(C),y.push(C)}m.appendChild(w),h.appendChild(m),t(h).wrap('<div class="parallaxImg-wrap" />'),-1!=navigator.userAgent.indexOf("Safari")&&-1==navigator.userAgent.indexOf("Chrome")||t(h).parent().append(b),l&&t("body.using-mobile-browser").length>0||function(a,n,i,s){t(h).parents(".style-5").on("mousemove",function(r){var o=t(this),l=o.find(".parallaxImg-container"),d=o.find(".parallaxImg-shadow"),c=Date.now(),h=t(a).parents(".wpb_gallery").length>0;c>f+g&&(f=c,e.requestAnimationFrame(function(){$(r,!1,a,n,i,s,o,l,d,h)}))}),t(h).parents(".style-5").on("mouseenter",function(t){T(t,a)}),t(h).parents(".style-5").on("mouseleave",function(t){I(t,a)})}(h,y,p,v),function(t,a,n,i){E(!1,t,a,n),e.addEventListener("resize",function(){E(!1,t,a,n)})}(h,y,p)}}d&&Ke()}function $(e,a,n,i,s,r,o,l,d,c){if(!t(n.firstChild).hasClass("over"))return I(e,n),!1;var h=.03,u=.063,p="1.03",f="-10",g=!1;t(n).parents(".col.wide").length>0?(h=.03,u=.063,g=!0):t(n).parents(".col.regular").length>0||t(n).parents(".wpb_gallery").length>0?(h=.045,u=.045):t(n).parents(".col.tall").length>0?(h=.05,u=.015,g=!0):t(n).parents(".col.wide_tall").length>0?(h=.04,u=.04,g=!0):o.hasClass("nectar-fancy-box")?(h=.045,u=.022,p="1.06",f="-2"):(h=.045,u=.075);var m,v=ht.scrollTop,b=a?e.touches[0].pageX:e.pageX,w=a?e.touches[0].pageY:e.pageY,y=n.getBoundingClientRect(),_=n.clientWidth||n.offsetWidth||n.scrollWidth,C=n.clientHeight||n.offsetHeight||n.scrollHeight,x=320/_,k=.52-(b-y.left-0)/_,$=.52-(w-y.top-v)/C,T=w-y.top-v-C/2,E=h*x*(k-(b-y.left-0-_/2)),O=u*x*(T-$);m=1==c?" perspective("+3*_+"px) rotateX("+1.9*-O+"deg) rotateY("+1.3*-E+"deg)":0==g?" perspective("+3*_+"px) rotateX("+O+"deg) rotateY("+E+"deg) translateY("+$*f+"px) translateX("+k*f+"px) scale("+p+")":" perspective("+3*_+"px) rotateX("+O+"deg) rotateY("+E+"deg) translateY("+-10*$+"px) translateX("+-10*k+"px) scale(1.013)",l.css("transform",m),-1!=navigator.userAgent.indexOf("Safari")&&-1==navigator.userAgent.indexOf("Chrome")||d.css("transform",m)}function T(e,a){a.firstChild.className+=" over",a.className+=" over",t(a).addClass("transition"),t(a).parents(".wpb_gallery").length>0?setTimeout(function(){t(a).removeClass("transition")},450):setTimeout(function(){t(a).removeClass("transition")},200)}function I(e,a){var n=a.clientWidth||a.offsetWidth||a.scrollWidth,i=a.firstChild;i.className=i.className.replace(" over",""),a.className=a.className.replace(" over",""),t(i).css("transform","perspective("+3*n+"px) rotateX(0deg) rotateY(0deg) translateZ(0)"),t(a).parents(".parallaxImg-wrap").find(".parallaxImg-shadow").css("transform","perspective("+3*n+"px) rotateX(0deg) rotateY(0deg) translateZ(0)"),t(a).addClass("transition"),setTimeout(function(){t(a).removeClass("transition")},200)}function E(e,a,n,i){for(var s=a.clientWidth||a.offsetWidth||a.scrollWidth,r=a.firstChild,o=0;o<i;o++)0==o?t(n[o]).css("transform","translateZ(0px)"):t(n[o]).css("transform","translateZ("+3*s/27*(1.1*o)+"px) ");i+=3,t(r).css("transform","perspective("+3*s+"px)")}}function On(){if(0==t('.nectar-fancy-box[data-style="hover_desc"]').length)return!1;var e=0;t("body").on("mouseenter touchstart",'.nectar-fancy-box[data-style="hover_desc"]',function(){e=parseInt(t(this).find(".hover-content").outerHeight(!0)),t(this).addClass("hovered"),t(this).find(".heading-wrap").css("transform","translateY(-"+e+"px)")}),t("body").on("mouseleave touchend",'.nectar-fancy-box[data-style="hover_desc"]',function(){t(this).removeClass("hovered"),t(this).find(".heading-wrap").css("transform","translateY(0)")})}function zn(t,e){this.$el=t,this.$iconEl=this.$el.find(e),this.$innerIconEl=this.$el.find(".inner"),this.initialX=this.$el.width()/2,this.initialY=this.$el.height()/2,this.elX=0,this.elY=0,this.lastScroll=0,this.scrollAdjust=0,this.lastX=this.initialX,this.lastY=this.initialY,this.lastY2=this.initialY,this.innerLastX=0,this.innerLastY=0,this.activeFollow=!1,this.hoverOnly=!1,this.percentage=.03,this.percentageInterval,this.exitTimeout,this.$iconEl.css({top:"0",left:"0"}),s.on("resize",this.resizeEvent.bind(this)),this.mouseEvents(),this.rafLoop()}function Hn(){if(L=[],r.on("mouseenter",'.nectar_video_lightbox[data-parent-hover="1"]',function(){var e=t(this).parents(".wpb_row");e.find("> .row-bg-wrap .row-bg, > .nectar-video-wrap .nectar-video-inner").addClass("transition"),e.find("> .row-bg-wrap .row-bg, > .nectar-video-wrap .nectar-video-inner").css({transform:"scale(1.08)"})}),r.on("mouseleave",'.nectar_video_lightbox[data-parent-hover="1"]',function(){t(this).parents(".wpb_row").find("> .row-bg-wrap .row-bg, > .nectar-video-wrap .nectar-video-inner").css({transform:"scale(1)"})}),t(".nectar_video_player_self_hosted").each(function(e){!ht.usingMobileBrowser&&t(this).find(".play_button.follow_mouse").length>0&&(L[e]=new zn(t(this),".play_button.follow_mouse .play"))}),"IntersectionObserver"in e){var n=new IntersectionObserver(function(t){t.forEach(function(t){if(t.isIntersecting){var e=t.target,a=200;e.readyState>1&&(a=20),setTimeout(function(){e.pause(),e.currentTime=0,e.play()},a),n.unobserve(t.target)}})},{root:a,rootMargin:"-10% 0% -10% 0%",threshold:0});t("video.scroll-triggered-play").each(function(){n.observe(t(this)[0])})}t(".nectar-video-box").each(function(e){if(t(this).find(".play_button_mouse_follow").length>0){var a=t(this);t(this).imagesLoaded(function(){ht.usingMobileBrowser||(L[e]=new zn(a,".play_button_mouse_follow"));var t=a.is("[data-mouse-icon-color]")&&a.attr("data-mouse-icon-color").length>0?a.attr("data-mouse-icon-color"):"#000";a.is('[data-mouse-style="solid_color"]')&&a.find(".play_button_mouse_follow").css({"background-color":t}),a.find(".play_button_mouse_follow").addClass("visible")})}})}function Sn(e){if(!(t("body.vc_editor").length>0)){var a=e.find(".project-slides").length>0?".dot-nav > span":".controls > li",n=e.find(".project-slides").length>0?"span":" li",i=e.find(a).length;e.find(a+".active").index()+1==i?e.find(a+":first-child").trigger("click"):e.find(a+".active").next(n).trigger("click")}}function An(){X=[],"undefined"!=typeof SalientRecentProjectsFullScreen&&t(".nectar_fullscreen_zoom_recent_projects").each(function(e){X[e]=new SalientRecentProjectsFullScreen(t(this))})}function Mn(){t(".infinite_scroll").length>0&&(t(".portfolio-items.infinite_scroll").infinitescroll({navSelector:"div#pagination",nextSelector:"div#pagination a:first",itemSelector:".portfolio-items.infinite_scroll .element",finishedMsg:"<em>Congratulations, you've reached the end of the internet.</em>",msgText:" "},function(e){var a=t(".portfolio-items.infinite_scroll:not(.carousel)");t(e).css("opacity",0).imagesLoaded(function(){var n;(t(e).css("opacity",1),a.isotope("appended",t(e)),t(e).find(".work-item").addClass("ajax-loaded"),t(e).addClass("ajax-loaded"),t(e).find(".work-meta, .nectar-love-wrap").css({opacity:1}),t(".portfolio-filters-inline").length>0||t(".portfolio-filters").length>0)&&(n=t(".portfolio-filters-inline").length>0?t(".portfolio-filters-inline a.active").attr("data-filter"):t(".portfolio-filters a.active").attr("data-filter"),t(".portfolio-filters-inline a.active").attr("data-filter"),a.isotope({filter:n}));for(var i=0;i<S.length;i++)S[i].reLayout();if(t(e).find(".work-item.style-5").length>0&&En(),"none"==t(e).find(".inner-wrap").attr("data-animation"))t(".portfolio-items .col .inner-wrap").removeClass("animated");else{for(i=0;i<S.length;i++)S[i].masonryZindex(),S[i].portfolioAccentColor();t(e).each(function(){var e=t("#nectar_fullscreen_rows").length>0?"200%":"90%",a=t(this),n=new Waypoint({element:a[0],handler:function(){var t=a.is('[data-masonry-type="photography"].masonry-items')?85:115;setTimeout(function(){a.addClass("animated-in")},t*a.attr("data-delay-amount")),n.destroy()},offset:e})})}t(".portfolio-items").each(function(){var e=Nt();t(this).find('a[rel^="prettyPhoto"], a.pretty_photo').attr("rel","prettyPhoto["+e+"_gal]").removeClass("pretty_photo")}),t(".portfolio-items").each(function(){var e=Nt();t(this).find('a[data-fancybox^="group_"]').attr("data-fancybox","group_"+e)}),ae(),setTimeout(function(){for(var a=0;a<S.length;a++)S[a].masonryZindex(),S[a].reLayout(),S[a].isotopeCatSelection();t(e).removeClass("ajax-loaded")},700),Ae()})}),t(".post-area.infinite_scroll .posts-container").infinitescroll({navSelector:"div#pagination",nextSelector:"div#pagination a:first",itemSelector:".post-area.infinite_scroll .posts-container .post",finishedMsg:"<em>Congratulations, you've reached the end of the internet.</em>",msgText:" "},function(e){t(e).find("[data-nectar-img-src]").length>0&&Ke(),t(".masonry.classic").length>0||t(".post-area:not(.masonry):not(.featured_img_left)").length>0||t(".post-area.standard-minimal").length>0?(vt(),t().mediaelementplayer&&t(e).find(".wp-audio-shortcode, .wp-video-shortcode").mediaelementplayer(),ae(),t(".carousel").length>0&&(Ot(),Wt()),Na(),t(".testimonial_slider").animate({opacity:"1"},800),da(),ca(),setTimeout(function(){ma(),va(),s.trigger("resize")},500),Ae(),s.trigger("resize")):(Ae(),s.trigger("resize"));var a=t(".infinite_scroll .posts-container");a.parent().hasClass("masonry")&&t(e).addClass("masonry-blog-item");var n=t(e);0==n.find("img").length&&(n=t("body")),n.imagesLoaded(function(){a.parent().hasClass("masonry")&&!a.parent().hasClass("auto_meta_overlaid_spaced")&&a.isotope("appended",t(e));for(var n=0;n<G.length;n++)G[n].flickityBlogInit();if(t(e).addClass("ajax-loaded"),a.parent().hasClass("classic_enhanced")&&(a.find(".large_featured.has-post-thumbnail.ajax-loaded .post-featured-img, .wide_tall.has-post-thumbnail.ajax-loaded .post-featured-img").each(function(){var e=t(this).find("img").attr("src");t(this).css("background-image","url("+e+")")}),a.find(".large_featured.ajax-loaded .nectar-flickity, .wide_tall.ajax-loaded .nectar-flickity").each(function(){t(this).find(".cell").each(function(){var e=t(this).find("img").attr("src");t(this).css("background-image","url("+e+")")})})),"none"==t(e).parents(".posts-container").attr("data-animation"))t(e).find(".inner-wrap").removeClass("animated");else{for(n=0;n<G.length;n++)G[n].blogMasonryZindex();t(e).each(function(){var e=t(this),a=new Waypoint({element:e[0],handler:function(){setTimeout(function(){e.addClass("animated-in")},80*e.attr("data-delay-amount")),a.destroy()},offset:"90%"})})}setTimeout(function(){t(e).removeClass("ajax-loaded")},700)})}))}function Wn(){ht.scrollTop>350&&!o.is(".fullscreen.open")&&(t("#to-top").stop().transition({transform:"translateY(-50%)"},350,"easeInOutCubic"),s.off("scroll",Wn),s.on("scroll",Bn))}function Bn(){if(ht.scrollTop<350||o.is(".fullscreen.open")){var e=t("#slide-out-widget-area.fullscreen.open").length>0?1150:350;t("#to-top").stop().transition({transform:"translateY(105%)"},e,"easeInOutQuint"),s.off("scroll",Bn),s.on("scroll",Wn)}}function Fn(){if(0==t(".nectar-social.fixed").length&&(t("#to-top").length>0&&s.width()>1020||t("#to-top").length>0&&t("#to-top.mobile-enabled").length>0)&&(ht.scrollTop>350?s.on("scroll",Bn):s.on("scroll",Wn)),t('body[data-button-style*="rounded"]').length>0){var e=t("#to-top .fa-angle-up").clone();e.addClass("top-icon"),t("#to-top").prepend(e)}r.on("click",'#to-top, a[href="#top"]',function(){return t("body,html").stop().animate({scrollTop:0},800,"easeOutQuad",function(){t(".nectar-box-roll").length>0&&r.trigger("mousewheel",[1,0,0])}),!1})}function qn(){var a=t('body[data-header-format="left-header"]').length>0&&s.width()>1e3?0:d.outerHeight();(t(".page-template-template-no-header-footer").length>0||t(".page-template-template-no-header").length>0)&&(a=0);var n=!1;t('header#top .sf-menu li a[href="#"]').on("click",function(t){t.preventDefault()}),0==t("#nectar_fullscreen_rows").length||0==ct.$usingFullScreenRows?t("a.nectar-next-section").each(function(){if(t(this).parents(".wpb_row:not(.inner_row)").length>0){var e=t(this).parents(".wpb_row:not(.inner_row)");if(e.next(".wpb_row[id]:not(.inner_row)").length>0){var a=e.next(".wpb_row[id]:not(.inner_row)").attr("id");t(this).attr("href","#"+a),n=!0}}}):t().fullpage&&t("a.nectar-next-section").on("click",function(){return t.fn.fullpage.moveSectionDown(),!1}),t("#slide-out-widget-area .off-canvas-menu-container").length>0&&t("#slide-out-widget-area .off-canvas-menu-container").find("a[href*='"+location.pathname+"']").each(function(){var e=t(this).attr("href");"#"!=e&&-1!=e.indexOf("#")&&"#"!==e.substr(e.indexOf("#"))&&t("div"+e.substr(e.indexOf("#"))).length>0&&(t(this).attr("href",e.substr(e.indexOf("#"))),t(this).parent().removeClass("current_page_item").removeClass("current-menu-item")),t('div[data-fullscreen-anchor-id="'+e.substr(e.indexOf("#")+1)+'"]').length>0&&t(this).parent().removeClass("current_page_item").removeClass("current-menu-item")}),t("#header-outer").find("a[href*='"+location.pathname+"']").each(function(){var e=t(this).attr("href");-1!=e.indexOf("#")&&"#"!==e.substr(e.indexOf("#"))&&t("div"+e.substr(e.indexOf("#"))).length>0&&(t(this).attr("href",e.substr(e.indexOf("#"))),t(this).parent().removeClass("current_page_item").removeClass("current-menu-item")),t('div[data-fullscreen-anchor-id="'+e.substr(e.indexOf("#")+1)+'"]').length>0&&t(this).parent().removeClass("current_page_item").removeClass("current-menu-item")}),t("#header-outer").length>0&&t("#header-outer").find("a[href*='#']:not([href='#'])").each(function(){"#"!==t(this).attr("href")&&"#searchbox"!==t(this).attr("href")&&"#sidewidgetarea"!==t(this).attr("href")&&(n=!0)}),t("#slide-out-widget-area .off-canvas-menu-container").length>0&&t("#slide-out-widget-area .off-canvas-menu-container").find("a[href*='#']:not([href='#'])").each(function(){"#"!==t(this).attr("href")&&(n=!0)});var i=[];1==n&&i.push("#header-outer nav"),t('.page-submenu[data-sticky="true"] a[href*="#"]').length>0&&i.push('.page-submenu[data-sticky="true"]'),i.length>0&&i.forEach(function(n,i){(0==i?r:t(e)).scrollspy({target:n,offset:a+ht.adminBarHeight+40})})}function Ln(){var a=e.location.hash;a&&a.length>0&&(a=a.replace(/<|>/g,""));var n=a&&a.length>0?a.substring(1,a.length):0,i=w-w/1.8,o=0;if(n&&(o=(o=n.split("/")).length),n&&o>1&&(n=n.replace(/\//g,""),a=a.replace(/\//g,"")),a&&t(".main-content").find(a).length>0||a&&t(".main-content").find('[data-fullscreen-anchor-id="'+n+'"]').length>0){var l=t(".main-content").find(a).length>0?t(".main-content").find(a):t(".main-content").find('[data-fullscreen-anchor-id="'+n+'"]'),h=t('body[data-header-format="left-header"]').length>0&&s.width()>1e3?0:t("#header-space").outerHeight();(t(".page-template-template-no-header-footer").length>0||t(".page-template-template-no-header").length>0)&&(h=0);var u=100;t(".nectar-box-roll").length>0&&t(".container-wrap.bottomBoxOut").length>0&&(dt.boxRoll(null,-1),u=2050),t("img[data-nectar-img-src]").length>0&&(Ue(),u=200),setTimeout(function(){var e;if(0==t('body[data-permanent-transparent="1"]').length)if(r.hasClass("mobile"))e=t('#header-outer[data-mobile-fixed="1"]').length>0?l.offset().top+2-h+ht.adminBarHeight:l.offset().top-ht.adminBarHeight+1;else{var a=t('#header-outer[data-header-resize="0"]').length>0?0:parseInt(y)+2*i;if(t('#header-outer[data-remove-fixed="1"]').length>0&&(h=0),e=l.offset().top-parseInt(h)+a+3-ht.adminBarHeight,0==t("body.mobile").length&&t('#header-outer[data-condense="true"]').length>0&&0===t("body.page-template-template-no-header").length&&0===t("body.page-template-template-no-header-footer").length){var n=t('#header-outer[data-format="centered-menu-bottom-bar"] header#top .span_9'),s=d.height()-(parseInt(n.height())+parseInt(t("#header-outer #logo").css("margin-top")));e=l.offset().top-parseInt(h)+s-ht.adminBarHeight}}else e=l.offset().top-ht.adminBarHeight+1;t('body[data-hhun="1"]').length>0&&0==t('#header-outer[data-remove-fixed="1"]').length&&0==t("#header-outer.detached").length&&(e+=h),Dt(e-(t('.page-submenu[data-sticky="true"]').length>0?t(".page-submenu").height():0)+(t("body.material").length>0&&c.length>0&&0==t('body[data-hhun="1"]').length&&0==t('#header-outer[data-remove-fixed="1"]').length&&!r.hasClass("mobile")?c.height():0),700,"easeInOutQuint"),pt.animatedScrolling=!0,setTimeout(function(){pt.animatedScrolling=!1},1100)},u)}}function jn(){t('body[data-animated-anchors="true"]').length>0&&(0==t(".nectar-box-roll").length&&0==t("#nectar_fullscreen_rows").length&&(void 0!==Jt.tab?setTimeout(function(){Ln()},800):Ln()),t('#nectar_fullscreen_rows[data-mobile-disable="on"]').length>0&&0==t(".nectar-box-roll").length&&ht.usingMobileBrowser&&Ln())}function Yn(){S=[];var e=0;t(".portfolio-items:not(.carousel)").each(function(a){if(t(this).attr("instance",a),t(this).parent().parent().find("div[class^=portfolio-filters]").attr("instance",a),"undefined"!=typeof SalientPortfolio)S[e]=new SalientPortfolio(t(this),We,st,ke),e++;else{var n=t(this);Rt("#salient-portfolio-js-js",100,function(){S[e]=new SalientPortfolio(n,We,st,ke),e++})}})}function Pn(){ht.winW>690&&t('.posts-container[data-load-animation="perspective"]').css("perspective-origin","50% "+(ht.scrollTop+ht.winH)+"px"),requestAnimationFrame(Pn)}function Rn(){t('.posts-container[data-load-animation="perspective"]').length>0&&requestAnimationFrame(Pn)}function Vn(e){"none"==e.attr("data-load-animation")?e.find(".inner-wrap").removeClass("animated"):e.find("article").each(function(e){if(t(this).visible(!0))t(this).delay(110*e).queue(function(e){t(this).addClass("animated-in"),e()});else var a=t(this),n=new Waypoint({element:a[0],handler:function(){setTimeout(function(){a.addClass("animated-in")},80*a.attr("data-delay-amount")),n.destroy()},offset:"90%"})})}function Xn(){G=[],t(".posts-container").each(function(e){if(t(this).parent().hasClass("masonry")&&!t(this).parent().hasClass("auto_meta_overlaid_spaced")){if("undefined"==typeof NectarMasonryBlog){var a=t(this);return void Rt("#nectar-masonry-blog-js",0,function(){G[e]=new NectarMasonryBlog(a,ke,Vn)})}G[e]=new NectarMasonryBlog(t(this),ke,Vn)}else Vn(t(this))})}function Nn(){var e=50;if(t('#header-outer[data-remove-fixed="0"]').length>0&&0==t('#header-outer[data-format="left-header"]').length){if(e+=d.outerHeight(),t('#header-outer[data-shrink-num][data-header-resize="1"]').length>0){var a=parseInt(d.attr("data-padding"))-parseInt(d.attr("data-padding"))/1.8;e-=y,e-=a}if(0==t("body.mobile").length&&t('#header-outer[data-condense="true"]').length>0){var n=t('#header-outer[data-format="centered-menu-bottom-bar"] header#top .span_9');e=50,e+=d.height()-(parseInt(n.position().top)-parseInt(t("#header-outer #logo").css("margin-top")))-parseInt(ht.secondaryHeaderHeight)}}return u.length>0&&(e+=u.outerHeight()),e}function Dn(){var n=Nn();if(ht.winW<690&&ht.usingMobileBrowser||a.documentElement.style.setProperty("--nectar-sticky-top-distance",n+"px"),t(".nectar-sticky-column-css").each(function(){0==t(this).find(".n-sticky").length&&(t(this).wrapInner('<div class="n-sticky" />'),t(this).hasClass("nectar-sticky-column-css--middle")&&new ue(t(this)))}),t().theiaStickySidebar&&!(ht.usingMobileBrowser&&ht.winW<1e3)&&!(0!=ct.$usingFullScreenRows&&ht.winW>1e3)){var i='#sidebar[data-nectar-ss="true"], #sidebar[data-nectar-ss="1"], .nectar-scrolling-tabs:not(.navigation_func_active_link_only) .scrolling-tab-nav, .nectar-sticky-column';e.nectarOptions&&e.nectarOptions.woo_sticky_sidebar&&"1"===e.nectarOptions.woo_sticky_sidebar&&(i+=", .woocommerce.archive #sidebar"),t(i).each(function(){var e=n;t(this).parents(".wpb_widgetised_column").length>0?t("body.vc_editor").length>0||t(this).parents(".wpb_column").theiaStickySidebar({additionalMarginTop:e,updateSidebarHeight:!1}):t(this).theiaStickySidebar({additionalMarginTop:e,updateSidebarHeight:!1})})}}function Qn(){t(".nectar-liquid-bg").removeClass("animated-in");for(var e=0;e<D.length;e++)"displace-filter-fade"==D[e].animationType&&t(D[e].canvasContainer).parents(".fp-section.active").length>0&&(0==t(D[e].canvasContainer).find(".image-added-to-stage").length&&D[e].imgContainer.addChild(D[e].bg),t(D[e].canvasContainer).find(".nectar-liquid-bg").addClass("image-added-to-stage"),D[e].animateProps(D[e]))}function Zn(){if(t("#nectar_fullscreen_rows").length>0&&t().fullpage){st=e.vc_iframe?".vc_element.vc_vc_row.active ":".wpb_row.active ";var a=t("#nectar_fullscreen_rows[data-mobile-disable]").length>0?t("#nectar_fullscreen_rows").attr("data-mobile-disable"):"off";ht.usingMobileBrowser||(a="off"),"on"!=a?rt=!0:st="","undefined"!=typeof NectarFullScreenRows&&(ct=new NectarFullScreenRows(Na,Z,Qn,ht,Qe,U,A,J))}else Rt("#nectar-fullpage-js",100,Zn)}function Gn(){t(".wpb_column").each(function(){if(t(this).hasClass("backdrop_filter_blur")){var e=t(this).closest(".wpb_row");e.addClass("row-col-gap");var a=t(this).closest(".wpb_row[data-column-margin]").length>0?t(this).closest(".wpb_row[data-column-margin]").attr("data-column-margin"):"default";"default"!=a&&e.find(".span_12").first().css({"column-gap":a})}}),ht.usingMobileBrowser&&r.addClass("using-mobile-browser"),e.navigator.userAgent.indexOf("Edge/")>0&&r.addClass("msie"),0==t("html.js").length&&t("html").removeClass("no-js").addClass("js"),t("code").find("br").remove(),t(".wpcf7-form p:has(input[type=submit])").css("padding-bottom","0px"),t(".full-width-content .wpcf7-submit").on("click",function(){setTimeout(function(){We()},1e3),setTimeout(function(){We()},2e3)}),t(".gform_body").on("click",function(){setTimeout(function(){We()},200)}),t(".pum.pum-theme-salient-page-builder-optimized button.pum-close").wrapInner("<span />"),t(e).on("pumBeforeOpen",function(){e.dispatchEvent(new Event("resize"))}),t("#nectar_fullscreen_rows").length>0&&t(".pum-container .pum-content > .wpb_row .full-page-inner > .container > .span_12").length>0&&t(".pum-container .pum-content > .wpb_row .full-page-inner > .container > .span_12").unwrap(),t(".single .blog_next_prev_buttons").length>0&&t(".container-wrap").css("padding-bottom",0),t(".full-width-section").each(function(){t(this).find("> .span_12 > div.col_last").last().css("margin-bottom","0")}),t(".full-width-content .col.boxed").removeClass("boxed"),t(".wpb_column.neg-marg").parents(".wpb_row:not(.inner_row):not(.zindex-set)").css("z-index","110"),t(".wpb_row.legacy").each(function(){t(this).find(".wpb_column").length>0&&t(this).removeClass("legacy")})}function Un(){t(".wpb_row").each(function(){void 0!==t(this).find(".span_12").offset()&&t(this).find('[class*="vc_col-"]').each(function(){var e=t(this).parents(".span_12").offset().left;t(this).removeClass("no-left-margin"),t(this).offset().left<e+27?t(this).addClass("no-left-margin"):t(this).removeClass("no-left-margin")})})}function Jn(){var a=ht.winW,n=ht.winH,i=0;r.is('[data-flex-cols="true"]')||t('[class*="vc_col-xs-"], [class*="vc_col-md-"], [class*="vc_col-lg-"]').length>0&&(Un(),ht.usingMobileBrowser?(e.addEventListener("orientationchange",function(){i=1}),s.on("resize",function(){(s.width()!=a&&s.height!=n||1===i)&&(Un(),a=ht.winW,n=ht.winH,i=0)})):s.on("resize",Un))}function Kn(){t('body[data-fancy-form-rcs="1"]').length>0&&0==t("#wcfm-main-content").length&&(t("select:not(.comment-form-rating #rating)").each(function(){var e;t(this).parents(".wpcf7-form-control-wrap").length>0?1==(e=t(this).parents(".wpcf7-form-control-wrap").find(".select2-container").length>0?t(t(this).prev(".select2-container")):t(this)).parents(".wpcf7-form-control-wrap").parent().find("label").length?e.parents(".wpcf7-form-control-wrap").parent().wrapInner('<div class="fancy-select-wrap" />'):e.wrap('<div class="fancy-select-wrap" />'):(e=t(this).prev(".select2-container").length>0?t(this).prev(".select2-container"):t(this),0==t(this).parents("#buddypress").length&&0==t(this).parents(".widget_categories").length&&(1==e.prev("label").length?e.prev("label").andSelf().wrapAll('<div class="fancy-select-wrap" />'):1==e.next("label").length?e.next("label").andSelf().wrapAll('<div class="fancy-select-wrap" />'):e.wrap('<div class="fancy-select-wrap" />')))}),t("select:not(.state_select):not(.country_select):not(.comment-form-rating #rating):not(#tribe-bar-form select):not(.woocommerce-currency-switcher):not(.nectar-custom-product-attr select)").each(function(){var a=ht.winW>690?7:200;if((t(this).hasClass("skip-select2-search")||t(this).parents(".skip-select2-search").length>0)&&(a=1e3),0==t(this).parents("#buddypress").length){var n={minimumResultsForSearch:a,width:"100%"};("underline"==(e.nectarOptions&&e.nectarOptions.woo_product_variable_select?e.nectarOptions.woo_product_variable_select:"default")||t(this).parents(".woocommerce-ordering").length>0)&&(n={minimumResultsForSearch:a,dropdownParent:t(this).parent(),dropdownAutoWidth:!0}),t(this).select2(n)}}))}function ti(){(-1!=navigator.userAgent.indexOf("Safari")&&-1==navigator.userAgent.indexOf("Chrome")||navigator.userAgent.match(/(iPod|iPhone|iPad)/))&&(e.onpageshow=function(e){e.persisted&&(t(".nectar-video-wrap, .nectar-slider-wrap .swiper-slide .video-wrap").each(function(){t(this).find("video").length>0&&t(this).find("video")[0].play()}),t("body.material-ocm-open").length>0?(t("body > .slide_out_area_close").addClass("non-human-allowed").trigger("click"),setTimeout(function(){t("body > .slide_out_area_close").removeClass("non-human-allowed")},100)):t("#slide-out-widget-area.slide-out-from-right-hover.open").length>0&&navigator.userAgent.match(/(iPod|iPhone|iPad)/)?Ha():(t("#slide-out-widget-area.fullscreen.open").length>0||t("#slide-out-widget-area.fullscreen-alt.open").length>0||t("#slide-out-widget-area.slide-out-from-right.open").length>0)&&(t("#slide-out-widget-area .slide_out_area_close").addClass("non-human-allowed"),t(".slide-out-widget-area-toggle:not(.std-menu) a.open").addClass("non-human-allowed").trigger("click"),setTimeout(function(){t("#slide-out-widget-area .slide_out_area_close").removeClass("non-human-allowed")},100)))})}function ei(){t(".wpb_row").removeClass("only-ns"),t('.nectar-slider-wrap[data-full-width="true"], .page-submenu, .portfolio-items[data-col-num="elastic"]:not(.fullwidth-constrained), .blog-fullwidth-wrap').parents(".wpb_row").addClass("only-ns"),t("body.vc_editor.compose-mode .wpb_row .vc_vc_column > .wpb_column > .vc_column-inner").each(function(){t(this).find("> .vc_element-container > div").length>0&&(t(this).find("> .vc_element-container > div:first-child").is(".vc_vc_row_inner")?t(this).find("> .vc_element-container > div:first-child").addClass("first-inner-row-el"):t(this).find("> .vc_element-container > div:first-child").removeClass("first-inner-row-el"))}),t("body.vc_editor.compose-mode .vc_row.inner_row").each(function(){t(this).hasClass("row_position_absolute")?t(this).parent().css({position:"static","min-height":"0"}):t(this).parent().css({position:"","min-height":""})}),t(".img-with-aniamtion-wrap, .nectar_icon_wrap, .nectar-lottie-wrap, .nectar-cta").each(function(){(t(this).hasClass("position_desktop_absolute")||t(this).hasClass("position_tablet_absolute")||t(this).hasClass("position_phone_absolute"))&&t(this).parent().addClass("absolute-parent")})}function ai(){t('.vc_element > .wpb_column[class*="padding-"][class*="-percent"]').each(function(){var e=4,a=this.className.match(/padding-\d+/);if(a&&(e=(e=a[0].match(/\d+/))?e[0]/100:0),e){var n=t(this).parents(".span_12").width();t(this).is('[data-padding-pos="all"]')?t(this).css("padding",n*e):t(this).is('[data-padding-pos="top"]')?t(this).css("padding-top",n*e):t(this).is('[data-padding-pos="bottom"]')?t(this).css("padding-bottom",n*e):t(this).is('[data-padding-pos="left"]')?t(this).css("padding-left",n*e):t(this).is('[data-padding-pos="right"]')?t(this).css("padding-right",n*e):t(this).is('[data-padding-pos="top-bottom"]')?t(this).css({"padding-top":n*e,"padding-bottom":n*e}):t(this).is('[data-padding-pos="top-right"]')?t(this).css({"padding-top":n*e,"padding-right":n*e}):t(this).is('[data-padding-pos="bottom-right"]')?t(this).css({"padding-right":n*e,"padding-bottom":n*e}):t(this).is('[data-padding-pos="bottom-left"]')?t(this).css({"padding-left":n*e,"padding-bottom":n*e}):t(this).is('[data-padding-pos="left-right"]')&&t(this).css({"padding-left":n*e,"padding-right":n*e})}}),t('.wpb_row[class*="vc_custom_"]').each(function(){t(this).parent().addClass("no-bottom-margin")})}function ni(){setTimeout(function(){t("body.compose-mode").length>0&&t(".container-wrap").addClass("visible-editor-controls"),ht.usingFrontEndEditor&&(ei(),r.is('[data-flex-cols="true"]')||(ai(),s.on("smartresize",ai)))},200),s.on("vc_reload",function(){if(ei(),be(),ge(),$t(),Ae(),vt(),he(),Fe(),_e(),On(),ga(),Ft(),aa(),xn(),Hn(),qe(),Ke(),t(".carousel").length>0&&(Ot(),Wt(),Mt()),t(".owl-carousel").length>0&&(t(".owl-carousel").each(function(){t(this).trigger("destroy.owl.carousel").removeClass("owl-loaded"),t(this).find(".owl-stage-outer .owl-stage > *").unwrap(),t(this).find(".owl-stage-outer > *").unwrap(),t(this).find(".owl-item > *").unwrap(),t(this).find(".owl-dots").remove(),t(this).find(".owl-nav").remove()}),zt()),t(".nectar_cascading_images").length>0&&imagesLoaded(t(".nectar_cascading_images"),function(){je()}),ke(),Me(),In(),W.length>0)for(var a=0;a<W.length;a++)W[a].instance.reloadCells(),W[a].instance.off("scroll.flickity"),W[a].instance.off("dragStart.flickity"),W[a].instance.off("dragEnd.flickity");if(yt(),setTimeout(function(){if(_t(),W.length>0)for(var t=0;t<W.length;t++)W[t].instance.reloadCells(),W[t].instance.resize()},100),N.length>0)for(a=0;a<N.length;a++)N[a].instance.flickity("reloadCells"),N[a].instance.off("scroll.flickity"),N[a].instance.off("dragStart.flickity"),N[a].instance.off("dragEnd.flickity");setTimeout(function(){if(t(".nectar-woo-flickity").length>0&&At(),N.length>0)for(var e=0;e<N.length;e++)N[e].instance.flickity("reloadCells"),N[e].instance.flickity("resize")},100),da();for(a=0;a<Q.length;a++)"multiple_visible"!=Q[a].type&&"multiple_visible_minimal"!=Q[a].type||(Q[a].flickityEl.flickity("reloadCells"),Q[a].flickityEl.off("select.flickity"),da(),Q[a].flickityEl.resize()),Q[a].testimonialSliderHeight();if(ca(),la(),fa(),ae(),Ze(),me(),Va(),ma(),va(),We(),setTimeout(We,1e3),ya(),bn(),s.off("scroll.parallaxSections").off("resize.parallaxSections"),Se(),ze(),Xn(),Yn(),S.length>0)for(a=0;a<S.length;a++)S[a].portfolioAccentColor();if(En(),An(),setTimeout(function(){if(t(".nectar_fullscreen_zoom_recent_projects").length>0&&X.length>0)for(var e=0;e<X.length;e++)X[e].sliderCalcs()},300),s.unbind(".infscr"),Mn(),Be(),t(".nectar-video-wrap").each(function(){t(this).find("video").length>0&&t(this).find("video").css("visibility","visible")}),t(".wpb_column[data-t-w-inherits]").each(function(){t(this).is('[data-t-w-inherits="small_desktop"]')?t(this).parent().addClass("inherits-s-desktop-col"):t(this).parent().removeClass("inherits-s-desktop-col")}),t("#nectar_fullscreen_rows").length>0){0==t("#nectar_fullscreen_rows > .vc_element").length&&t("#nectar_fullscreen_rows").prepend('<div class="vc_element empty_placeholder" />'),t("#nectar_fullscreen_rows > .vc_element:not(.empty_placeholder)").length>0&&t("#nectar_fullscreen_rows >.vc_element.empty_placeholder").remove();var n=t("#nectar_fullscreen_rows > div.vc_element.active").index();t.fn.fullpage.destroy("all"),Zn();var i=[{el:"",offset:0}];t("#nectar_fullscreen_rows > div.vc_element").each(function(e){i[e]={el:t(this),offset:t(this).offset().top}}),n>-1&&t.fn.fullpage.silentMoveTo(n+1,0),1===t("#nectar_fullscreen_rows > div.vc_element").length&&t("#nectar_fullscreen_rows").css({transform:"translate3d(0,0,0)"}),r.scrollTo(0,0)}else t('body .main-content > .row > .vc_element:first > .wpb_row[class*="full-width-"]').length>0||t('body .main-content > .row > .vc_element:first .nectar-slider-wrap[data-full-width="true"]').length>0?t(".container-wrap").css({"padding-top":"0","margin-top":"0"}):t(".container-wrap").css({"padding-top":"40px"});A=[],t(".svg-icon-holder").removeClass("animated-in").removeClass("bound"),t(".vc_nectar_gmap").length>0&&setTimeout(function(){"object"==typeof google&&"object"==typeof google.maps?e.mapAPI_Loaded():e.nectarLove.mapApiKey.length>0&&t.getScript("https://maps.google.com/maps/api/js?sensor=false&key="+e.nectarLove.mapApiKey+"&callback=mapAPI_Loaded")},100),Dn(),void 0!==e.Waypoint&&(Waypoint.destroyAll(),Na())})}function ii(){var a=!1;if(t('body[data-ajax-transitions="true"]').length>0&&t('#ajax-loading-screen[data-disable-mobile="1"]').length>0&&ht.winW<1e3&&(a=!0),t('body[data-ajax-transitions="true"]').length>0&&t('#ajax-loading-screen[data-method="standard"]').length>0&&0==a){if(t("html").addClass("page-trans-loaded"),t('#ajax-loading-screen[data-effect="standard"]').length>0?(0==t(".nectar-particles").length&&(p.transition({opacity:0},500,function(){t(this).css({display:"none"})}),t("#ajax-loading-screen .loading-icon").transition({opacity:0},500)),0==t(".nectar-box-roll").length&&setTimeout(function(){Na()},550)):(t('#ajax-loading-screen[data-effect*="horizontal_swipe"]').length>0&&setTimeout(function(){p.addClass("loaded")},60),0==t('#page-header-wrap #page-header-bg[data-animate-in-effect="zoom-out"] .nectar-video-wrap').length&&setTimeout(function(){t("#ajax-loading-screen:not(.loaded)").addClass("loaded"),setTimeout(function(){p.addClass("hidden")},1e3)},150),0==t(".nectar-box-roll").length&&t('#ajax-loading-screen[data-effect*="horizontal_swipe"]').length>0?setTimeout(function(){Na()},750):0==t(".nectar-box-roll").length&&setTimeout(function(){Na()},350)),e.onpageshow=function(e){e.persisted&&(t("#ajax-loading-screen").stop().transition({opacity:0},200,function(){t(this).css({display:"none"})}),t("#ajax-loading-screen .loading-icon").transition({opacity:0},100))},t(".portfolio-loading, .nectar-slider-loading .loading-icon").remove(),0==t('#ajax-loading-screen[data-disable-fade-on-click="1"]').length&&0==t('body.using-mobile-browser #ajax-loading-screen[data-method="standard"][data-disable-mobile="1"]').length){var n=!1;t('a[href^="mailto"], a[href^="tel"], .woocommerce-order-downloads a[class*="downloads-file"], .wpdm-cta.download-link a[data-downloadurl], .nectar-ignore-beforeunload a').on("click",function(){n=!0}),e.addEventListener("beforeunload",function(){n||(p.addClass("set-to-fade"),t('#ajax-loading-screen[data-effect*="horizontal_swipe"]').length>0?(p.removeClass("loaded"),p.addClass("in-from-right"),setTimeout(function(){p.addClass("loaded")},30)):t('#ajax-loading-screen[data-effect="center_mask_reveal"]').length>0?p.css("opacity","0").css("display","block").transition({opacity:"1"},450):p.show().transition({opacity:"1"},450)),n=!1})}}else 1==a&&p.css({opacity:"0",display:"none"}).addClass("loaded").addClass("hidden"),0!=t(".nectar-box-roll").length||ht.usingFrontEndEditor||Na()}function si(n){var i,l,u,p,g;ht.usingMobileBrowser&&ht.scrollPosRAF(),ta(),function(){var n;if(Et(),0!=t('body[data-header-format="left-header"]').length||ht.usingPhoneBrowser||(n=!(t('#header-outer[data-megamenu-rt="1"]').length>0&&t('#header-outer[data-transparent-header="true"]').length>0),t(".sf-menu:not(.buttons)").superfish({delay:500,speed:"fast",disableHI:n,speedOut:"fast",animation:{opacity:"show"}}),t("#header-outer .sf-menu.buttons li.menu-item").on("mouseover",function(){t(this).addClass("sfHover"),t('#header-outer[data-megamenu-rt="1"]').length>0&&t(this).hasClass("megamenu")&&!t(this).hasClass("width-75")&&!t(this).hasClass("width-50")&&"true"==t("#header-outer").attr("data-transparent-header")&&(t("#header-outer").addClass("no-transition"),t("#header-outer").removeClass("transparent"))}),t("#header-outer .sf-menu.buttons > li.menu-item.menu-item-has-children:not(.megamenu):not(.nectar-megamenu-menu-item)").on("mouseenter",function(){var a=t("#top .container").width(),n=t(this).children("ul");n.offset().left-(t(e).width()-a)/2+n.width()<=t(e).width()-100?t(this).removeClass("edge"):t(this).addClass("edge")}),t("#header-outer .sf-menu.buttons li.menu-item").on("mouseleave",function(){var e=t(this);e.is(".menu-item-has-children")?setTimeout(function(){e.is(":hover")||(e.removeClass("sfHover"),t('#header-outer[data-megamenu-rt="1"]').length>0&&t('#header-outer[data-transparent-header="true"]').length>0&&(0==t("#header-outer.scrolled-down").length&&0==t("#header-outer.small-nav").length&&0==t("#header-outer.detached").length&&0==t("#header-outer.fixed-menu").length&&t("#header-outer").addClass("transparent"),t('#header-outer[data-permanent-transparent="1"][data-transparent-header="true"]').length>0&&t("#header-outer").addClass("transparent")))},200):e.removeClass("sfHover")}),t('#header-secondary-outer li.megamenu:not(.nectar-megamenu-menu-item), #header-outer:not([data-format="menu-left-aligned"]):not([data-format="centered-logo-between-menu-alt"]) .sf-menu.buttons li.megamenu').removeClass("nectar-megamenu-menu-item").removeClass("megamenu"),t('#header-outer[data-format="centered-menu-bottom-bar"] .right-side .sf-menu li.nectar-megamenu-menu-item').removeClass("align-left").removeClass("align-middle").addClass("align-right"),t('#header-outer[data-format="centered-menu-bottom-bar"] .left-side .sf-menu li.nectar-megamenu-menu-item').removeClass("align-right").removeClass("align-middle").addClass("align-left"),t("#header-outer .sf-menu > li:not(.megamenu) > ul > li > ul").each(function(){t(this).offset().left+t(this).outerWidth()>s.width()&&(t(this).addClass("on-left-side"),t(this).find("ul").addClass("on-left-side"))}),t('body:not([data-header-format="left-header"]) header#top nav > ul > li.megamenu > ul > li > ul > li').each(function(){t(this).find("> ul").length>0&&t(this).addClass("has-ul")}),t('body[data-megamenu-width="full-width"]').length>0&&t("ul.sub-menu").length>0&&(It(),s.on("smartresize",It),t("header#top nav > ul > li.megamenu > .sub-menu").css("box-sizing","content-box")),t("header#top nav > ul.sf-menu > li.menu-item").on("mouseenter",function(){t(this).addClass("menu-item-over")}),t("header#top nav > ul.sf-menu > li.menu-item").on("mouseleave",function(){t(this).removeClass("menu-item-over")}),t("#header-outer nav .megamenu .sub-menu a.sf-with-ul .sf-sub-indicator, #header-outer .megamenu .sub-menu a .sf-sub-indicator").remove(),t(".sf-menu > .nectar-megamenu-menu-item > a .menu-title-text .megamenu-bg-lazy[data-bg-src]").each(function(){var e=t(this).parents(".nectar-megamenu-menu-item"),a=t(this).attr("data-bg-src"),n=t(this).attr("data-align").replace("_"," ");e.find("> ul").css({"background-position":n,"background-image":'url("'+a+'")'}),t(this).remove()}),t(".sf-menu > .nectar-megamenu-menu-item > ul > li > a .menu-title-text .megamenu-col-bg-lazy[data-bg-src]").each(function(){var e=t(this).closest(".menu-item"),a=t(this).attr("data-bg-src"),n=t(this).attr("data-align").replace("_"," ");e.css({"background-position":n,"background-image":'url("'+a+'")'}),t(this).remove()}),t("#header-outer nav > ul > li.megamenu > ul.sub-menu > li > a").each(function(){("-"==t(this).text()||"–"==t(this).text()||t(this).parent().hasClass("hide-title"))&&t(this).remove()})),"IntersectionObserver"in e){var i=new IntersectionObserver(function(t){t.forEach(function(t){if(t.isIntersecting){var e=t.target;e.classList.add("loaded");var a=e.getAttribute("data-menu-img-src");a&&(e.setAttribute("src",a),e.removeAttribute("data-menu-img-src")),i.unobserve(e)}})},{rootMargin:"0px",threshold:0});[].slice.call(a.querySelectorAll(".nectar-menu-icon-img[data-menu-img-src], #header-outer .nectar-ext-menu-item .image-layer")).forEach(function(t){i.observe(t)})}else t(".sf-menu .nectar-menu-icon-img[data-menu-img-src]").each(function(){t(this).attr("src",t(this).attr("data-menu-img-src")),t(this).removeAttr("data-menu-img-src")}),t(".nectar-ext-menu-item .image-layer").addClass("loaded");t(".sub-menu .nectar-menu-icon, .sub-menu .nectar-menu-icon-img, .off-canvas-menu-container > ul > li > a .nectar-menu-icon, .off-canvas-menu-container > ul > li > a .nectar-menu-icon-img").each(function(){var e=t(this).parent(),a=t(this).detach();0==e.parents(".nectar-ext-menu-item").length&&(e.wrapInner('<span class="nectar-menu-icon-text" />'),e.addClass("nectar-menu-item-with-icon")),e.prepend(a)}),t("#slide-out-widget-area:not(.fullscreen) .nectar-menu-label").each(function(){0==t(this).parents(".nectar-ext-menu-item").length&&t(this).closest("a").addClass("nectar-menu-item-with-icon")}),t(".off-canvas-menu-container .nectar-menu-icon, .off-canvas-menu-container .nectar-menu-icon-img").each(function(){var e=t(this).parent();(e.find(".item_desc").length>0||e.find(".nav_desc").length>0)&&e.addClass("nectar-menu-item-with-desc")}),Tt()}(),function(){e.nectarOptions&&e.nectarOptions.quick_search&&"true"===e.nectarOptions.quick_search&&new Ja;var n=t("#search-outer #search input[type=text][data-placeholder]").length>0?t("#search-outer #search input[type=text]").attr("data-placeholder"):"";function i(){if(r.hasClass("ascend")||t('body[data-header-format="left-header"]').length>0&&0==t("body.material").length?(t("#search-outer").stop().transition({opacity:0},300,"cubic-bezier(0.2, 1, 0.3, 1)"),h.addClass("inactive"),setTimeout(function(){t("#search-outer").hide(),h.removeClass("inactive")},300)):0==t("body.material").length&&t("#search-outer").stop(!0).fadeOut(450,"easeOutExpo"),r.hasClass("material")){t(e).trigger("nectar-search-close");var a=d.hasClass("results-shown")?800:400;setTimeout(function(){t("#search-outer #s").val("")},a),t("#ajax-content-wrap").removeClass("material-open"),pt.materialSearchOpen=!1,d.removeClass("material-search-open"),t("#search-outer").removeClass("material-open"),t("#fp-nav").removeClass("material-ocm-open")}}r.hasClass("material")&&0==t("#header-outer .bg-color-stripe").length&&d.append('<div class="bg-color-stripe" />'),r.on("click","#search-btn a",function(){return!1}),r.on("click","#search-btn a:not(.inactive), #header-outer .mobile-search",function(){return!t(this).hasClass("open-search")&&(r.hasClass("original")&&t(".slide-out-widget-area-toggle.mobile-icon a.open").length>0&&(t(".slide-out-widget-area-toggle.mobile-icon a").addClass("non-human-allowed").trigger("click"),setTimeout(function(){t(".slide-out-widget-area-toggle.mobile-icon a").removeClass("non-human-allowed")},100)),r.hasClass("ascend")||t('body[data-header-format="left-header"]').length>0&&0==t("body.material").length?(t("#search-outer > #search form, #search-outer #search .span_12 span, #search-outer #search #close").css("opacity",0),t("#search-outer > #search form").css("transform","translateY(-30px)"),t("#search-outer #search .span_12 span").css("transform","translateY(20px)"),t("#search-outer").show(),t("#search-outer").stop().transition({scale:"1,0",opacity:1},0).transition({scale:"1,1"},700,"cubic-bezier(0.2, 1, 0.3, 1)"),t("#search-outer > #search form").delay(350).transition({opacity:1,transform:"translateY(0)"},700,"cubic-bezier(0.2, 1, 0.3, 1)"),t("#search-outer #search #close").delay(500).transition({opacity:1},700,"cubic-bezier(0.2, 1, 0.3, 1)"),t("#search-outer #search .span_12 span").delay(450).transition({opacity:1,transform:"translateY(0)"},700,"cubic-bezier(0.2, 1, 0.3, 1)")):r.hasClass("material")?(t('#header-outer[data-transparent-header="true"] .bg-color-stripe').css("transition",""),t("#search-outer, #ajax-content-wrap").addClass("material-open"),pt.materialSearchOpen=!0,d.addClass("material-search-open"),t("#fp-nav").addClass("material-ocm-open"),t(e).trigger("nectar-search-open")):t("#search-outer").stop(!0).fadeIn(600,"easeOutExpo"),setTimeout(function(){t("#search input[type=text]").trigger("focus"),t("#search input[type=text]").val()==n&&t("#search input[type=text]").setCursorPosition(0)},300),t(this).toggleClass("open-search"),t(".slide-out-widget-area-toggle a:not(#toggle-nav).open:not(.animating)").trigger("click"),!1)}),t("body:not(.material)").on("keydown","#search input[type=text]",function(){t(this).val()==n&&t(this).val("")}),t("body:not(.material)").on("keyup","#search input[type=text]",function(){0==t(this).val().length&&(t(this).val(n),t(this).setCursorPosition(0))}),r.on("click","#close",function(){return i(),h.removeClass("open-search"),t("#header-outer .mobile-search").removeClass("open-search"),!1}),t("body:not(.material)").on("blur","#search-box input[type=text]",function(){i(),h.removeClass("open-search"),t("#header-outer .mobile-search").removeClass("open-search")}),t("body.material").on("click","#ajax-content-wrap",function(e){void 0!==e.originalEvent&&(i(),h.removeClass("open-search"),t("#header-outer .mobile-search").removeClass("open-search"))}),t("body.material").length>0&&t(a).on("keyup",function(e){27==e.keyCode&&(i(),h.removeClass("open-search"),t(".ocm-effect-wrap.material-ocm-open").length>0&&t(".slide-out-widget-area-toggle.material-open a").trigger("click"))})}(),0==t('#header-outer[data-remove-fixed="1"]').length&&ht.winW>1e3&&0!=t(e).scrollTop()&&1==t('#header-outer.transparent[data-permanent-transparent="false"]').length&&d.removeClass("transparent"),ht.winW<1e3&&0==t(".nectar-box-roll").length?(hn(),s.on("smartresize.nectarNavScrollEffects",hn)):(un(),s.on("smartresize.nectarNavScrollEffects",un)),Dn(),ca(),be(),Ba(),i=t("#top #mobile-menu").length>0?"#top #mobile-menu ":".off-canvas-menu-container.mobile-only ",t(i+".menu-item > ul > li > a").each(function(){if("-"==t(this).text()||"–"==t(this).text()||t(this).parent().hasClass("hide-title")||t(this).find("> .remove-menu-item-title").length>0){var e=t(this).parent().find("> ul > li").clone();t(this).parent().find("> .widget-area-active").length>0?t(this).parent().find("> a").remove():(t(this).parent().find("ul").remove(),t(this).parent().parent().append(e),t(this).parent().remove())}}),Ca(),"separate-dropdown-parent-link"==(t("#slide-out-widget-area[data-dropdown-func]").length>0?o.attr("data-dropdown-func"):"default")&&t("#slide-out-widget-area .off-canvas-menu-container li.menu-item-has-children").append('<span class="ocm-dropdown-arrow"><i class="fa fa-angle-down"></i></span>'),function(){if(!(!t('#header-outer[data-format="left-header"]').length>0&&!t('body.material[data-slide-out-widget-area-style*="slide-out-from-right"]').length>0&&!t("#slide-out-widget-area.fullscreen-split").length>0&&!t('#slide-out-widget-area[data-dropdown-func="separate-dropdown-parent-link"]').length>0)){var a;t('#header-outer[data-format="left-header"] nav li.megamenu').removeClass("nectar-megamenu-menu-item").removeClass("megamenu"),a=t('#slide-out-widget-area[data-dropdown-func="separate-dropdown-parent-link"]').length>0?"#slide-out-widget-area .off-canvas-menu-container li.menu-item-has-children > .ocm-dropdown-arrow":'body.material #slide-out-widget-area[class*="slide-out-from-right"] .off-canvas-menu-container li.menu-item-has-children > a, #slide-out-widget-area.fullscreen-split .off-canvas-menu-container li.menu-item-has-children > a';var n='#header-outer[data-format="left-header"] nav li.menu-item-has-children > a',i=e.nectarOptions&&e.nectarOptions.left_header_dropdown_func?e.nectarOptions.left_header_dropdown_func:"default";"separate-dropdown-parent-link"===i&&(n='#header-outer[data-format="left-header"] nav li.menu-item-has-children > a .sf-sub-indicator'),t(n+", "+a).on("click",function(){var e=t(this).parent();if("separate-dropdown-parent-link"===i&&(e=t(this).closest(".menu-item")),e.hasClass("open-submenu"))e.find(".sub-menu").css({"max-height":"0"}),e.removeClass("open-submenu");else{var a,n=t(this);e.find("> .sub-menu").addClass("no-trans"),setTimeout(function(){e.find("> .sub-menu").css({"max-height":"none",position:"absolute",visibility:"hidden"}),a=e.find("> .sub-menu").height(),e.find("> .sub-menu").removeClass("no-trans"),e.find("> .sub-menu").css({"max-height":"0",position:"relative",visibility:"visible"})},25),setTimeout(function(){n.closest("ul").find("li.menu-item-has-children").removeClass("open-submenu"),n.closest("ul").find("li.menu-item-has-children > .sub-menu").css({"max-height":"0"}),e.addClass("open-submenu"),e.find("> .sub-menu").css("max-height",a),n.parents("ul").length>0&&n.parents("ul:not(.sf-menu)").each(function(){t(this).css("max-height"),t(this).css("max-height",parseInt(t(this).height()+2*parseInt(t(this).css("padding-top"))+a)+"px")})},50)}return!1});var s=t('#header-outer[data-format="left-header"] nav .sf-menu > .current-menu-ancestor.menu-item-has-children');if(s.length>0&&s.find(".current-menu-item").length>0){s.find("ul").css("transition","none");var r=s.find(".current-menu-item").parents(".current-menu-ancestor.menu-item-has-children");r=Array.from(r),"separate-dropdown-parent-link"===i?r.reverse().forEach(function(e){t(e).find("> a .sf-sub-indicator").trigger("click")}):r.reverse().forEach(function(e){t(e).find("> a").trigger("click")}),setTimeout(function(){s.find("ul").css("transition","")},100)}}}(),l=0,u=0,t(p=".carousel-wrap .portfolio-items .col .work-info a, .woocommerce .products-carousel ul.products li.product a").on("mousedown",function(t){l=t.clientX}),t(p).on("mouseup",function(t){u=t.clientX}),t(p).on("click",function(){if(Math.abs(l-u)>10)return!1}),ze(),ae(),Mn(),Fn(),g=w-w/1.8,r.on("click",".section-down-arrow, .scroll-down-wrap > .minimal-arrow",function(){if(t(this).parents(".nectar-box-roll").length>0)return!1;var e=t(this).parents("#page-header-bg"),a=e.height(),n=0==e.parents(".first-section").length||t('body[data-transparent-header="false"]').length>0?e.offset().top:0,i=f.length>0&&s.width()>1e3?f.height():0,o=t('body[data-header-format="left-header"]').length>0?0:t("#header-space").height(),l=0;if(t("body.material").length>0&&c.length>0&&(l=c.height()),0==t('body[data-permanent-transparent="1"]').length)if(r.hasClass("mobile"))Dt((t('#header-outer[data-mobile-fixed="1"]').length>0?parseInt(a)-o+parseInt(e.offset().top)+2:parseInt(a)+parseInt(e.offset().top)+2)-2*i,700,"easeInOutQuint");else if(t('body[data-hhun="1"]').length>0&&0==t('#header-outer[data-remove-fixed="1"]').length)Dt(parseInt(a)+n+2-2*i,700,"easeInOutQuint");else{var h=t('#header-outer[data-header-resize="0"]').length>0?0:parseInt(y)+2*g;if(t('#header-outer[data-remove-fixed="1"]').length>0&&(o=0,n=0),0==t("body.mobile").length&&t('#header-outer[data-condense="true"]').length>0){var u=t('#header-outer[data-format="centered-menu-bottom-bar"] header#top .span_9');o=d.height()-(parseInt(u.position().top)-parseInt(t("#header-outer #logo").css("margin-top")))-parseInt(ht.secondaryHeaderHeight)}Dt(parseInt(a-o)+h+3+n+l,700,"easeInOutQuint")}else Dt(parseInt(a)+parseInt(e.offset().top)+2-2*i,700,"easeInOutQuint");return!1}),function(){if(O&&r.on("click",'#header-outer nav .sf-menu li:not(.slide-out-widget-area-toggle) a[href*="#"]',function(){pt.ocmOpen&&"#"!=t(this).attr("href")&&Fa(t(this).parent())}),t('body[data-animated-anchors="true"]').length>0||t('.single-product [data-gallery-style="left_thumb_sticky"]').length>0){var a,n=w-w/1.8;setTimeout(qn,100),r.on("click","#header-outer nav .sf-menu a, #footer-outer .nectar-button, #footer-outer .widget_nav_menu a, #footer-widgets .textwidget a, #mobile-menu li a, .nectar-scrolling-tabs:not(.navigation_func_active_link_only) .scrolling-tab-nav a, .container-wrap a:not(.wpb_tabs_nav a):not(.navigation_func_active_link_only .scrolling-tab-nav a):not(.comment-wrap .navigation a):not(.woocommerce-checkout a):not(.um-woo-view-order):not(.magnific):not([data-fancybox]):not(.woocommerce-tabs .tabs a):not(.slider-prev):not(.slider-next):not(.testimonial-next-prev a):not(.page-numbers), .swiper-slide .button a, #slide-out-widget-area a, #slide-out-widget-area .inner div a",function(i){var o=!0,l=t(this).prop("hash");l&&!t(this).hasClass("nectar-next-section")&&0==t(this).parents(".slide-out-widget-area-toggle").length&&(r.addClass("animated-scrolling"),pt.animatedScrolling=!0),clearTimeout(a),a=setTimeout(function(){r.removeClass("animated-scrolling"),pt.animatedScrolling=!1},1100);var h=t('body[data-header-format="left-header"]').length>0&&s.width()>1e3?0:t("#header-space").outerHeight();if((t(".page-template-template-no-header-footer").length>0||t(".page-template-template-no-header").length>0||0==t("#header-space").length)&&(h=0),0!=ct.$usingFullScreenRows&&t('#nectar_fullscreen_rows[data-anchors="on"]').length>0&&l&&""!=l&&"#top"!=l&&t('body.material[data-slide-out-widget-area-style="slide-out-from-right"].material-ocm-open').length>0&&(i.preventDefault(),t(this).hasClass("skip-hash")||(history.pushState?history.pushState(null,null,l):location.hash=l),setTimeout(function(){t(e).trigger("hashchange")},800)),l&&r.find(l).length>0&&"#top"!=l&&""!=l&&-1!==t(this).attr("href").indexOf(e.location.href.split("#")[0])||t(this).is('[href^="#"]')&&""!=l&&r.find(l).length>0&&"#top"!=l){if(t(this).hasClass("skip-hash")||(history.pushState?history.pushState(null,null,l):location.hash=l),t(this).parents("ul").length>0&&t(this).parents("ul").find("li").removeClass("current-menu-item"),t(this).parents("#slide-out-widget-area").length>0){if(t('body.material[data-slide-out-widget-area-style="slide-out-from-right"].material-ocm-open').length>0){t("body > .slide_out_area_close").addClass("non-human-allowed").trigger("click");var u=t(this);o=!1,setTimeout(function(){u.trigger("click")},1e3)}else t("#slide-out-widget-area .slide_out_area_close").addClass("non-human-allowed").trigger("click");setTimeout(function(){t('body.material[data-slide-out-widget-area-style="slide-out-from-right"]').length>0?t("body > .slide_out_area_close").removeClass("non-human-allowed"):t("#slide-out-widget-area .slide_out_area_close").removeClass("non-human-allowed")},100)}t(this).parents("#mobile-menu").length>0&&(t(".slide-out-widget-area-toggle.mobile-icon a").addClass("non-human-allowed").trigger("click"),setTimeout(function(){t(".slide-out-widget-area-toggle.mobile-icon a").removeClass("non-human-allowed")},100));var p=t(this).parents("#mobile-menu").length>0?t(this).parents("#mobile-menu").height():null,f=1,g=t(this);t(".nectar-box-roll").length>0&&t(".container-wrap.bottomBoxOut").length>0&&(dt.boxRoll(null,-1),f=2050),t("img[data-nectar-img-src]").length>0&&(Ue(),f=200),setTimeout(function(){var e;if(0==t('body[data-permanent-transparent="1"]').length)if(r.hasClass("mobile"))e=t('#header-outer[data-mobile-fixed="1"]').length>0?t(l).offset().top+2-h+ht.adminBarHeight:t(l).offset().top-p-ht.adminBarHeight+1;else{var a=t('#header-outer[data-header-resize="0"]').length>0?0:parseInt(y)+2*n;if(t('#header-outer[data-remove-fixed="1"]').length>0&&(h=0),e=t(l).offset().top-p-parseInt(h)+a+3-ht.adminBarHeight,0==t("body.mobile").length&&0===t("body.page-template-template-no-header").length&&0===t("body.page-template-template-no-header-footer").length&&t('#header-outer[data-condense="true"]').length>0){var i=t('#header-outer[data-format="centered-menu-bottom-bar"] header#top .span_9'),s=d.height()-(parseInt(i.height())+parseInt(t("#header-outer #logo").css("margin-top")));e=t(l).offset().top-parseInt(h)+s-ht.adminBarHeight}}else e=t(l).offset().top-ht.adminBarHeight+1;t('body[data-hhun="1"]').length>0&&0==t('#header-outer[data-remove-fixed="1"]').length&&((0==t("#header-outer.detached").length||g.parents('.page-submenu[data-sticky="true"]').length>0)&&(e+=h),g.parents('.page-submenu[data-sticky="true"]').length>0&&(t("#header-outer.detached").addClass("invisible"),t(".page-submenu").addClass("header-not-visible").css("transform","translateY(0px)")));var u,f=g.parents('.page-submenu[data-sticky="true"]').length>0?g.parents(".page-submenu").height():0;u=t("body.material").length>0&&c.length>0&&0==t('body[data-hhun="1"]').length&&0==t('#header-outer[data-remove-fixed="1"]').length&&!r.hasClass("mobile")?c.height():t('body[data-hhun="1"]').length>0&&c.length>0&&!r.hasClass("mobile")&&0==t('#header-outer[data-remove-fixed="1"]').length?c.height():0,o&&Dt(e-f+u,700,"easeInOutQuint")},f),i.preventDefault()}"#top"==l&&t(this).parents("#slide-out-widget-area").length>0&&t("#slide-out-widget-area .slide_out_area_close").trigger("click")})}}()}vn.prototype.events=function(){var a=this;t(e).on("smartresize",this.resize.bind(this)),e.addEventListener("orientationchange",function(){this.setTimeout(function(){a.orientationChange()},100)})},vn.prototype.resize=function(){ht.usingMobileBrowser||(this.storedWinH=ht.winH,this.calculate())},vn.prototype.calculate=function(){if(1==pt.materialOffCanvasOpen)return!0;this.offsetTop=this.$el.offset().top,this.offsetTop<this.storedWinH&&this.$el.hasClass("top-level")&&!ht.usingFrontEndEditor||(this.$el.css("min-height",this.storedWinH),this.$el.find("> .col.span_12").css("min-height",this.storedWinH))},vn.prototype.orientationChange=function(){ht.usingMobileBrowser&&(this.storedWinH=ht.winH,this.calculate())},zn.prototype.resizeEvent=function(){this.initialX=this.$el.width()/2,this.initialY=this.$el.height()/2},zn.prototype.mouseEvents=function(){var a=this;a.$el.hasClass("play_button_hover")&&(a.hoverOnly=!0),a.$el.on("mouseenter",function(t){a.activeFollow=!0,a.elX=t.offsetX,a.elY=t.offsetY,a.lastScroll=0,a.hoverOnly?(a.percentage=1,clearTimeout(a.exitTimeout),setTimeout(function(){a.percentage=.16},60)):(clearInterval(a.percentageInterval),a.percentageInterval=setInterval(function(){a.percentage<.16?a.percentage+=.008:clearInterval(a.percentageInterval)},30))}),a.$el.on("mouseleave",function(){a.hoverOnly?a.exitTimeout=setTimeout(function(){a.activeFollow=!1,a.lastScroll=0,clearInterval(a.percentageInterval),a.percentage=.03},400):(a.activeFollow=!1,a.lastScroll=0,clearInterval(a.percentageInterval),a.percentage=.03)}),a.$el.on("mousemove",function(t){a.elX=t.offsetX,a.elY=t.offsetY,a.lastScroll=0}),t(e).on("scroll",function(){1==a.activeFollow&&0==a.lastScroll&&(a.lastScroll=ht.scrollTop)})},zn.prototype.rafLoop=function(){1==this.activeFollow?(this.scrollAdjust=0,this.alteredY=this.elY,this.lastScroll>0&&(this.scrollAdjust=ht.scrollTop-this.lastScroll,this.alteredY+=this.scrollAdjust),this.lastY=Lt(this.lastY,this.alteredY,this.percentage),this.lastX=Lt(this.lastX,this.elX,this.percentage),this.lastY2=Lt(this.lastY2,this.alteredY,this.percentage),this.innerLastX=Lt(this.innerLastX,parseInt(this.elX)-parseInt(this.lastX),this.percentage)/1.7,this.innerLastY=Lt(this.innerLastY,parseInt(this.alteredY)-parseInt(this.lastY2),this.percentage)/1.7):(this.lastY=Lt(this.lastY,this.initialY,.055),this.lastX=Lt(this.lastX,this.initialX,.055),this.innerLastX=0,this.innerLastY=0),this.$iconEl[0].style.transform="translateX("+this.lastX+"px) translateY("+this.lastY+"px)",this.$innerIconEl.length>0&&(this.$innerIconEl[0].style.transform="translateX("+qt(this.innerLastX,14,-14)+"px) translateY("+qt(this.innerLastY,14,-14)+"px)"),requestAnimationFrame(this.rafLoop.bind(this))},jQuery(a).ready(function(t){ht.usingFrontEndEditor=void 0!==e.vc_iframe,Xa(),Zn(),Ke(),Ka(),en(),an(),fn(),Da(),Jn(),ke(),Me(),xe(),$e(),We(),ga(),wn(),bn(),Se(),Ae(),ba(),ma(),va(),ya(),_a(),Ya(),mn(),Ua(),Kn(),Rn();!e.nectarOptions||!e.nectarOptions.delay_js||e.nectarOptions.delay_js;si(),new Vt,Gn(),ti(),ni(),ii(),s.off("smartresize.srInit"),s.on("smartresize.srInit",ft),s.off("resize.srInit"),s.on("resize.srInit",mt),e.addEventListener("orientationchange",gt);var n=!(!e.nectarOptions||!e.nectarOptions.react_compat||"enabled"!==e.nectarOptions.react_compat);"complete"===a.readyState&&1!=n&&setTimeout(function(){s.trigger("load")},30),s.on("load",function(){0==t(e).scrollTop()&&pn(),t("video").css("visibility","visible"),jn(),We(),ht.usingMobileBrowser||Ae(),wa()})})}(window.jQuery,window,document)
;/* Touch swipe */
(function(d){var m="left",l="right",c="up",s="down",b="in",t="out",j="none",o="auto",i="swipe",p="pinch",u="tap",x="horizontal",q="vertical",g="all",e="start",h="move",f="end",n="cancel",a="ontouchstart" in window,v="TouchSwipe";var k={fingers:1,threshold:75,cancelThreshold:25,pinchThreshold:20,maxTimeThreshold:null,fingerReleaseThreshold:250,swipe:null,swipeLeft:null,swipeRight:null,swipeUp:null,swipeDown:null,swipeStatus:null,pinchIn:null,pinchOut:null,pinchStatus:null,click:null,tap:null,triggerOnTouchEnd:true,triggerOnTouchLeave:false,allowPageScroll:"auto",fallbackToMouseEvents:true,excludedElements:"button, input, select, textarea, a, .noSwipe"};d.fn.swipe=function(A){var z=d(this),y=z.data(v);if(y&&typeof A==="string"){if(y[A]){return y[A].apply(this,Array.prototype.slice.call(arguments,1))}else{d.error("Method "+A+" does not exist on jQuery.swipe")}}else{if(!y&&(typeof A==="object"||!A)){return r.apply(this,arguments)}}return z};d.fn.swipe.defaults=k;d.fn.swipe.phases={PHASE_START:e,PHASE_MOVE:h,PHASE_END:f,PHASE_CANCEL:n};d.fn.swipe.directions={LEFT:m,RIGHT:l,UP:c,DOWN:s,IN:b,OUT:t};d.fn.swipe.pageScroll={NONE:j,HORIZONTAL:x,VERTICAL:q,AUTO:o};d.fn.swipe.fingers={ONE:1,TWO:2,THREE:3,ALL:g};function r(y){if(y&&(y.allowPageScroll===undefined&&(y.swipe!==undefined||y.swipeStatus!==undefined))){y.allowPageScroll=j}if(y.click!==undefined&&y.tap===undefined){y.tap=y.click}if(!y){y={}}y=d.extend({},d.fn.swipe.defaults,y);return this.each(function(){var A=d(this);var z=A.data(v);if(!z){z=new w(this,y);A.data(v,z)}})}function w(S,ag){var aJ=(a||!ag.fallbackToMouseEvents),az=aJ?"touchstart":"mousedown",U=aJ?"touchmove":"mousemove",av=aJ?"touchend":"mouseup",D=aJ?null:"mouseleave",R="touchcancel";var ad=0,N=null,ah=0,aF=0,A=0,aj=1,aA=0,aN=0,Z=null;var H=d(S);var O="start";var aI=0;var ai=null;var I=0,Y=0,aD=0,aP=0;try{H.bind(az,at);H.bind(R,L)}catch(aG){d.error("events not supported "+az+","+R+" on jQuery.swipe")}this.enable=function(){H.bind(az,at);H.bind(R,L);return H};this.disable=function(){Q();return H};this.destroy=function(){Q();H.data(v,null);return H};this.option=function(aR,aQ){if(ag[aR]!==undefined){if(aQ===undefined){return ag[aR]}else{ag[aR]=aQ}}else{d.error("Option "+aR+" does not exist on jQuery.swipe.options")}};function at(aS){if(X()){return}if(d(aS.target).closest(ag.excludedElements,H).length>0){return}var aT=aS.originalEvent?aS.originalEvent:aS;var aR,aQ=a?aT.touches[0]:aT;O=e;if(a){aI=aT.touches.length}else{aS.preventDefault()}ad=0;N=null;aN=null;ah=0;aF=0;A=0;aj=1;aA=0;ai=T();Z=aE();z();if(!a||(aI===ag.fingers||ag.fingers===g)||ap()){aO(0,aQ);I=B();if(aI==2){aO(1,aT.touches[1]);aF=A=aa(ai[0].start,ai[1].start)}if(ag.swipeStatus||ag.pinchStatus){aR=aH(aT,O)}}else{aR=false}if(aR===false){O=n;aH(aT,O);return aR}else{ak(true)}}function P(aT){var aW=aT.originalEvent?aT.originalEvent:aT;if(O===f||O===n||af()){return}var aS,aR=a?aW.touches[0]:aW;var aU=V(aR);Y=B();if(a){aI=aW.touches.length}O=h;if(aI==2){if(aF==0){aO(1,aW.touches[1]);aF=A=aa(ai[0].start,ai[1].start)}else{V(aW.touches[1]);A=aa(ai[0].end,ai[1].end);aN=ao(ai[0].end,ai[1].end)}aj=y(aF,A);aA=Math.abs(aF-A)}if((aI===ag.fingers||ag.fingers===g)||!a||ap()){N=ar(aU.start,aU.end);C(aT,N);ad=G(aU.start,aU.end);ah=K();aK(N,ad);if(ag.swipeStatus||ag.pinchStatus){aS=aH(aW,O)}if(!ag.triggerOnTouchEnd||ag.triggerOnTouchLeave){var aQ=true;if(ag.triggerOnTouchLeave){var aV=au(this);aQ=aC(aU.end,aV)}if(!ag.triggerOnTouchEnd&&aQ){O=aM(h)}else{if(ag.triggerOnTouchLeave&&!aQ){O=aM(f)}}if(O==n||O==f){aH(aW,O)}}}else{O=n;aH(aW,O)}if(aS===false){O=n;aH(aW,O)}}function ab(aS){var aU=aS.originalEvent;if(a){if(aU.touches.length>0){aw();return true}}if(af()){aI=aP}aS.preventDefault();Y=B();if(ag.triggerOnTouchEnd||(ag.triggerOnTouchEnd==false&&O===h)){O=f;var aR=((aI===ag.fingers||ag.fingers===g)||!a);var aQ=ai[0].end.x!==0;var aT=aR&&aQ&&(an()||aB());if(aT){aH(aU,O)}else{O=n;aH(aU,O)}}else{if(!ag.triggerOnTouchEnd&&ay()){O=f;am(aU,O,u)}else{if(O===h){O=n;aH(aU,O)}}}ak(false)}function L(){aI=0;Y=0;I=0;aF=0;A=0;aj=1;z();ak(false)}function W(aQ){var aR=aQ.originalEvent;if(ag.triggerOnTouchLeave){O=aM(f);aH(aR,O)}}function Q(){H.unbind(az,at);H.unbind(R,L);H.unbind(U,P);H.unbind(av,ab);if(D){H.unbind(D,W)}ak(false)}function aM(aT){var aS=aT;var aR=aq();var aQ=ae();if(!aR){aS=n}else{if(aQ&&aT==h&&(!ag.triggerOnTouchEnd||ag.triggerOnTouchLeave)){aS=f}else{if(!aQ&&aT==f&&ag.triggerOnTouchLeave){aS=n}}}return aS}function aH(aS,aQ){var aR=undefined;if(ac()){aR=am(aS,aQ,i)}if(ap()&&aR!==false){aR=am(aS,aQ,p)}if(ay()&&aR!==false){aR=am(aS,aQ,u)}if(aQ===n){L(aS)}if(aQ===f){if(a){if(aS.touches.length==0){L(aS)}}else{L(aS)}}return aR}function am(aT,aQ,aS){var aR=undefined;if(aS==i){H.trigger("swipeStatus",[aQ,N||null,ad||0,ah||0,aI]);if(ag.swipeStatus){aR=ag.swipeStatus.call(H,aT,aQ,N||null,ad||0,ah||0,aI);if(aR===false){return false}}if(aQ==f&&aB()){H.trigger("swipe",[N,ad,ah,aI]);if(ag.swipe){aR=ag.swipe.call(H,aT,N,ad,ah,aI);if(aR===false){return false}}switch(N){case m:H.trigger("swipeLeft",[N,ad,ah,aI]);if(ag.swipeLeft){aR=ag.swipeLeft.call(H,aT,N,ad,ah,aI)}break;case l:H.trigger("swipeRight",[N,ad,ah,aI]);if(ag.swipeRight){aR=ag.swipeRight.call(H,aT,N,ad,ah,aI)}break;case c:H.trigger("swipeUp",[N,ad,ah,aI]);if(ag.swipeUp){aR=ag.swipeUp.call(H,aT,N,ad,ah,aI)}break;case s:H.trigger("swipeDown",[N,ad,ah,aI]);if(ag.swipeDown){aR=ag.swipeDown.call(H,aT,N,ad,ah,aI)}break}}}if(aS==p){H.trigger("pinchStatus",[aQ,aN||null,aA||0,ah||0,aI,aj]);if(ag.pinchStatus){aR=ag.pinchStatus.call(H,aT,aQ,aN||null,aA||0,ah||0,aI,aj);if(aR===false){return false}}if(aQ==f&&an()){switch(aN){case b:H.trigger("pinchIn",[aN||null,aA||0,ah||0,aI,aj]);if(ag.pinchIn){aR=ag.pinchIn.call(H,aT,aN||null,aA||0,ah||0,aI,aj)}break;case t:H.trigger("pinchOut",[aN||null,aA||0,ah||0,aI,aj]);if(ag.pinchOut){aR=ag.pinchOut.call(H,aT,aN||null,aA||0,ah||0,aI,aj)}break}}}if(aS==u){if(aQ===n||aQ===f){if((aI===1||!a)&&(isNaN(ad)||ad===0)){H.trigger("tap",[aT.target]);if(ag.tap){aR=ag.tap.call(H,aT,aT.target)}}}}return aR}function ae(){var aQ=true;if(ag.threshold!==null){aQ=ad>=ag.threshold}if(aQ&&ag.cancelThreshold!==null){aQ=(M(N)-ad)<ag.cancelThreshold}return aQ}function al(){if(ag.pinchThreshold!==null){return aA>=ag.pinchThreshold}return true}function aq(){var aQ;if(ag.maxTimeThreshold){if(ah>=ag.maxTimeThreshold){aQ=false}else{aQ=true}}else{aQ=true}return aQ}function C(aQ,aR){if(ag.allowPageScroll===j||ap()){aQ.preventDefault()}else{var aS=ag.allowPageScroll===o;switch(aR){case m:if((ag.swipeLeft&&aS)||(!aS&&ag.allowPageScroll!=x)){aQ.preventDefault()}break;case l:if((ag.swipeRight&&aS)||(!aS&&ag.allowPageScroll!=x)){aQ.preventDefault()}break;case c:if((ag.swipeUp&&aS)||(!aS&&ag.allowPageScroll!=q)){aQ.preventDefault()}break;case s:if((ag.swipeDown&&aS)||(!aS&&ag.allowPageScroll!=q)){aQ.preventDefault()}break}}}function an(){return al()}function ap(){return !!(ag.pinchStatus||ag.pinchIn||ag.pinchOut)}function ax(){return !!(an()&&ap())}function aB(){var aQ=aq();var aS=ae();var aR=aS&&aQ;return aR}function ac(){return !!(ag.swipe||ag.swipeStatus||ag.swipeLeft||ag.swipeRight||ag.swipeUp||ag.swipeDown)}function E(){return !!(aB()&&ac())}function ay(){return !!(ag.tap)}function aw(){aD=B();aP=event.touches.length+1}function z(){aD=0;aP=0}function af(){var aQ=false;if(aD){var aR=B()-aD;if(aR<=ag.fingerReleaseThreshold){aQ=true}}return aQ}function X(){return !!(H.data(v+"_intouch")===true)}function ak(aQ){if(aQ===true){H.bind(U,P);H.bind(av,ab);if(D){H.bind(D,W)}}else{H.unbind(U,P,false);H.unbind(av,ab,false);if(D){H.unbind(D,W,false)}}H.data(v+"_intouch",aQ===true)}function aO(aR,aQ){var aS=aQ.identifier!==undefined?aQ.identifier:0;ai[aR].identifier=aS;ai[aR].start.x=ai[aR].end.x=aQ.pageX||aQ.clientX;ai[aR].start.y=ai[aR].end.y=aQ.pageY||aQ.clientY;return ai[aR]}function V(aQ){var aS=aQ.identifier!==undefined?aQ.identifier:0;var aR=J(aS);aR.end.x=aQ.pageX||aQ.clientX;aR.end.y=aQ.pageY||aQ.clientY;return aR}function J(aR){for(var aQ=0;aQ<ai.length;aQ++){if(ai[aQ].identifier==aR){return ai[aQ]}}}function T(){var aQ=[];for(var aR=0;aR<=5;aR++){aQ.push({start:{x:0,y:0},end:{x:0,y:0},identifier:0})}return aQ}function aK(aQ,aR){aR=Math.max(aR,M(aQ));Z[aQ].distance=aR}function M(aQ){return Z[aQ].distance}function aE(){var aQ={};aQ[m]=aL(m);aQ[l]=aL(l);aQ[c]=aL(c);aQ[s]=aL(s);return aQ}function aL(aQ){return{direction:aQ,distance:0}}function K(){return Y-I}function aa(aT,aS){var aR=Math.abs(aT.x-aS.x);var aQ=Math.abs(aT.y-aS.y);return Math.round(Math.sqrt(aR*aR+aQ*aQ))}function y(aQ,aR){var aS=(aR/aQ)*1;return aS.toFixed(2)}function ao(){if(aj<1){return t}else{return b}}function G(aR,aQ){return Math.round(Math.sqrt(Math.pow(aQ.x-aR.x,2)+Math.pow(aQ.y-aR.y,2)))}function F(aT,aR){var aQ=aT.x-aR.x;var aV=aR.y-aT.y;var aS=Math.atan2(aV,aQ);var aU=Math.round(aS*180/Math.PI);if(aU<0){aU=360-Math.abs(aU)}return aU}function ar(aR,aQ){var aS=F(aR,aQ);if((aS<=45)&&(aS>=0)){return m}else{if((aS<=360)&&(aS>=315)){return m}else{if((aS>=135)&&(aS<=225)){return l}else{if((aS>45)&&(aS<135)){return s}else{return c}}}}}function B(){var aQ=new Date();return aQ.getTime()}function au(aQ){aQ=d(aQ);var aS=aQ.offset();var aR={left:aS.left,right:aS.left+aQ.outerWidth(),top:aS.top,bottom:aS.top+aQ.outerHeight()};return aR}function aC(aQ,aR){return(aQ.x>aR.left&&aQ.x<aR.right&&aQ.y>aR.top&&aQ.y<aR.bottom)}}})(jQuery);
;/*! modernizr 3.6.0 (Custom Build) | MIT *
* https://modernizr.com/download/?-setclasses !*/
!function(n,e,s){function o(n,e){return typeof n===e}function a(){var n,e,s,a,i,l,r;for(var c in f)if(f.hasOwnProperty(c)){if(n=[],e=f[c],e.name&&(n.push(e.name.toLowerCase()),e.options&&e.options.aliases&&e.options.aliases.length))for(s=0;s<e.options.aliases.length;s++)n.push(e.options.aliases[s].toLowerCase());for(a=o(e.fn,"function")?e.fn():e.fn,i=0;i<n.length;i++)l=n[i],r=l.split("."),1===r.length?Modernizr[r[0]]=a:(!Modernizr[r[0]]||Modernizr[r[0]]instanceof Boolean||(Modernizr[r[0]]=new Boolean(Modernizr[r[0]])),Modernizr[r[0]][r[1]]=a),t.push((a?"":"no-")+r.join("-"))}}function i(n){var e=r.className,s=Modernizr._config.classPrefix||"";if(c&&(e=e.baseVal),Modernizr._config.enableJSClass){var o=new RegExp("(^|\\s)"+s+"no-js(\\s|$)");e=e.replace(o,"$1"+s+"js$2")}Modernizr._config.enableClasses&&(e+=" "+s+n.join(" "+s),c?r.className.baseVal=e:r.className=e)}var t=[],f=[],l={_version:"3.6.0",_config:{classPrefix:"",enableClasses:!0,enableJSClass:!0,usePrefixes:!0},_q:[],on:function(n,e){var s=this;setTimeout(function(){e(s[n])},0)},addTest:function(n,e,s){f.push({name:n,fn:e,options:s})},addAsyncTest:function(n){f.push({name:null,fn:n})}},Modernizr=function(){};Modernizr.prototype=l,Modernizr=new Modernizr;var r=e.documentElement,c="svg"===r.nodeName.toLowerCase();a(),i(t),delete l.addTest,delete l.addAsyncTest;for(var u=0;u<Modernizr._q.length;u++)Modernizr._q[u]();n.Modernizr=Modernizr}(window,document);
;/*! html5shiv v3.7.0 - https://github.com/aFarkas/html5shiv */
(function(k,m){var g="3.7.0";var d=k.html5||{};var h=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i;var c=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i;var q;var i="_html5shiv";var a=0;var o={};var e;(function(){try{var t=m.createElement("a");t.innerHTML="<xyz></xyz>";q=("hidden" in t);e=t.childNodes.length==1||(function(){(m.createElement)("a");var v=m.createDocumentFragment();return(typeof v.cloneNode=="undefined"||typeof v.createDocumentFragment=="undefined"||typeof v.createElement=="undefined")}())}catch(u){q=true;e=true}}());function f(t,v){var w=t.createElement("p"),u=t.getElementsByTagName("head")[0]||t.documentElement;w.innerHTML="x<style>"+v+"</style>";return u.insertBefore(w.lastChild,u.firstChild)}function l(){var t=j.elements;return typeof t=="string"?t.split(" "):t}function p(t){var u=o[t[i]];if(!u){u={};a++;t[i]=a;o[a]=u}return u}function n(w,t,v){if(!t){t=m}if(e){return t.createElement(w)}if(!v){v=p(t)}var u;if(v.cache[w]){u=v.cache[w].cloneNode()}else{if(c.test(w)){u=(v.cache[w]=v.createElem(w)).cloneNode()}else{u=v.createElem(w)}}return u.canHaveChildren&&!h.test(w)&&!u.tagUrn?v.frag.appendChild(u):u}function r(v,x){if(!v){v=m}if(e){return v.createDocumentFragment()}x=x||p(v);var y=x.frag.cloneNode(),w=0,u=l(),t=u.length;for(;w<t;w++){y.createElement(u[w])}return y}function s(t,u){if(!u.cache){u.cache={};u.createElem=t.createElement;u.createFrag=t.createDocumentFragment;u.frag=u.createFrag()}t.createElement=function(v){if(!j.shivMethods){return u.createElem(v)}return n(v,t,u)};t.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+l().join().replace(/[\w\-:]+/g,function(v){u.createElem(v);u.frag.createElement(v);return'c("'+v+'")'})+");return n}")(j,u.frag)}function b(t){if(!t){t=m}var u=p(t);if(j.shivCSS&&!q&&!u.hasCSS){u.hasCSS=!!f(t,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")}if(!e){s(t,u)}return t}var j={elements:d.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:g,shivCSS:(d.shivCSS!==false),supportsUnknownElements:e,shivMethods:(d.shivMethods!==false),type:"default",shivDocument:b,createElement:n,createDocumentFragment:r};k.html5=j;b(m)}(this,document));
;/*!
*
* Homebrewed plugin functions!
*
* Basically it's a bunch of common functions used in the websites we
* build. They're built in the format of jQuery plugins for reusability.
*
* You may remove those that you don't need.
*
* - HC
*
* @TODO: Make these more extensible for easier future usage.
*/var homebrew={};(function($){var method,noop=function(){},methods=['assert','clear','count','debug','dir','dirxml','error','exception','group','groupCollapsed','groupEnd','info','log','markTimeline','profile','profileEnd','table','time','timeEnd','timeStamp','trace','warn'],length=methods.length,console=(window.console=window.console||{});while(length--){method=methods[length];if(!console[method]){console[method]=noop}}
var root=$('html');$.extend(homebrew,{browser:{ie:root.hasClass('ie'),ie9:root.hasClass('ie9'),lt9:root.hasClass('lt9'),ie8:root.hasClass('ie8'),lt8:root.hasClass('lt8'),ie7:root.hasClass('ie7'),firefox:(window.mozIndexedDB!==undefined)},events:{transitionEnd:'oTransitionEnd otransitionend webkitTransitionEnd transitionend'},classes:{transitionable:'is-transitionable'},screenSize:{small:!1,medium:!1,large:!0},mediaQueries:{small:'only screen and (max-width: 40em)',medium:'only screen and (min-width: 40.063em)',large:'only screen and (min-width: 64.063em)'},mediaQueriesIE9:{small:{size:640,method:'max-width'},medium:{size:641,method:'min-width'},large:{size:1025,method:'min-width'}}});$.extend(homebrew,{utils:{throttle:function(func,delay){var timer=null;return function(){var context=this,args=arguments;clearTimeout(timer);timer=setTimeout(function(){func.apply(context,args)},delay)}},debounce:function(func,delay,immediate){var timeout,result;return function(){var context=this,args=arguments,later=function(){timeout=null;if(!immediate)result=func.apply(context,args)};var callNow=immediate&&!timeout;clearTimeout(timeout);timeout=setTimeout(later,delay);if(callNow)result=func.apply(context,args);return result}}},makePlugin:function(plugin){var pluginName=plugin.prototype.name;$.fn[pluginName]=function(options){var args=$.makeArray(arguments),after=args.slice(1);return this.each(function(){var instance=$.data(this,pluginName);if(instance){if(typeof options==='string'){instance[options].apply(instance,after)}else if(instance.update){instance.update.apply(instance,args)}}else{new plugin(this,options)}})}},generateUniqueID:function(){return String(new Date().getTime())+String(Math.round(Math.random()*100000,10))},getSelectorsFromHTMLString:function(str){if(typeof str!=='string'){console.error('homebrew.getSelectorsFromHTMLString(): Expecting a string as the first argument. Please check:');console.log(str);return{}}
var tagMatch=str.match(/<(.*?) /g),attributesMatch=str.match(/ (.*?)=("|')(.*?)("|')/g),selectorsObj={};if(tagMatch){selectorsObj.tag=tagMatch[0].replace(/(<| )/g,'')}
if(attributesMatch){var attributeSplitArray,classesArray;while(attributesMatch.length){attributeSplitArray=$.trim(attributesMatch.shift()).split('=');switch(attributeSplitArray[0]){case 'class':classesArray=attributeSplitArray[1].replace(/("|')/g,'').split(' ');for(var i=classesArray.length-1;i>-1;i--){if(classesArray[i]===''){classesArray.splice(i,1)}}
selectorsObj.classes=classesArray;break;default:selectorsObj[attributeSplitArray[0]]=attributeSplitArray[1].replace(/("|')/g,'');break}}}
return selectorsObj},getClassFromHTMLString:function(str){var selectorsObj=this.getSelectorsFromHTMLString(str);if(selectorsObj.classes&&selectorsObj.classes.length){return selectorsObj.classes}else{return[]}},getKeyValuePairsFromString:function(str,pairSeparator,keyValueSeparator){pairSeparator=pairSeparator||';';keyValueSeparator=keyValueSeparator||':';var splitArray=str.split(pairSeparator),keyValuePairs={},currentPair;while(splitArray.length){currentPair=splitArray.shift();if(!currentPair)continue;currentPair=currentPair.split(keyValueSeparator);currentPair=currentPair.map(function(str){return $.trim(str)});if(currentPair[1]==='true'){currentPair[1]=!0}else if(currentPair[1]==='false'){currentPair[1]=!1}
keyValuePairs[currentPair[0]]=currentPair[1]}
return keyValuePairs},watchSize:function(mediaQuery,callback){var self=this,_mediaQuery=self.mediaQueries[mediaQuery];if(typeof _mediaQuery==='undefined'){throw new Error('homebrew.watchSize(): No match media query. mediaQuery provided is '+mediaQuery)}
if(typeof matchMedia==='function'&&matchMedia.addListener){var matchMediaObj=matchMedia(_mediaQuery);callback(matchMediaObj.matches);matchMediaObj.addListener(function(mq){callback(mq.matches)})}else if(!self.browser.lt9){var mediaQueryProps=self.mediaQueriesIE9[mediaQuery];if(typeof mediaQueryProps==='undefined')return;var currentScreen,getCurrentScreen;if(mediaQueryProps.method==='min-width'){getCurrentScreen=function(){return($(window).width()>=mediaQueryProps.size)}}else if(mediaQueryProps.method==='max-width'){getCurrentScreen=function(){return($(window).width()<=mediaQueryProps.size)}}
currentScreen=getCurrentScreen();callback(currentScreen);$(window).on('resize.watchMedia',self.utils.throttle(function(){if(currentScreen!==getCurrentScreen()){currentScreen=!currentScreen;callback(currentScreen)}},100))}else{if(mediaQuery==='small'||mediaQuery==='xsmall'){callback(!1)}else{callback(!0)}}}});homebrew.watchSize('small',function(isMediumScreen){homebrew.screenSize.small=isMediumScreen;homebrew.screenSize.medium=!isMediumScreen});homebrew.watchSize('large',function(isLargeScreen){homebrew.screenSize.medium=!isLargeScreen;homebrew.screenSize.large=isLargeScreen});homebrew.Carousel=function(el,args){if(!el)return;this.init(el,args)};$.extend(homebrew.Carousel.prototype,{name:'carouselify',options:{items:'.carousel-item',activeItem:null,classes:{active:'is-active',hidden:'is-hidden'},loop:!0,transitions:{enable:!0,classes:{transitionIn:'is-transitioning-in',transitionOut:'is-transitioning-out',reverse:'is-reverse'},onStart:null,onEnd:null},switchers:{enable:!0,markups:{nextSwitcher:'<div class="carousel__switcher carousel__switcher--next" />',prevSwitcher:'<div class="carousel__switcher carousel__switcher--prev" />'}},pagers:{enable:!0,markup:'<a href="#/" class="carousel__pager" />',holder:'<div class="carousel__pagers" />'},timer:{enable:!0,duration:10000,showBar:!0,barMarkup:'<div class="carousel__timer-bar" />'},onSwitch:null},init:function(el,args){var instance=this,options=$.extend(!0,{},instance.options,args);if(typeof options.items!=='string'){console.error('$.fn.carouselify: Expecting String type from `items` argument. Please check:');console.log(options.items);return}
var $el=$(el),$items=$el.find(options.items);if(!$items.length)return;instance.$el=$el;instance.$items=$items;instance.totalItems=$items.length;instance.options=options;if(typeof options.activeItem==='number'){$items.eq(instance.activeItem).addClass(options.classes.active);instance.activeItem=options.activeItem}else if(instance.$items.filter(options.classes.active).length){instance.activeItem=instance.$items.filter(options.classes.active).index()}else{instance.activeItem=0}
if(options.switchers.enable){var $nextSwitcher,nextSwitcherClasses=homebrew.getClassFromHTMLString(options.switchers.markups.nextSwitcher);if(nextSwitcherClasses.length){$nextSwitcher=$el.find('.'+nextSwitcherClasses.join('.'))}
if(!$nextSwitcher||!$nextSwitcher.length){$nextSwitcher=$(options.switchers.markups.nextSwitcher);$el.append($prevSwitcher);instance.addDestroyable($nextSwitcher)}
instance.$nextSwitcher=$nextSwitcher;var $prevSwitcher,prevSwitcherClasses=homebrew.getClassFromHTMLString(options.switchers.markups.prevSwitcher);if(prevSwitcherClasses.length){$prevSwitcher=$el.find('.'+prevSwitcherClasses.join('.'))}
if(!$prevSwitcher||!$prevSwitcher.length){$prevSwitcher=$(options.switchers.markups.prevSwitcher);$el.prepend($prevSwitcher);instance.addDestroyable($prevSwitcher)}
instance.$prevSwitcher=$prevSwitcher}
if(options.pagers.enable){var $holders,$pagers,pagerClasses=homebrew.getClassFromHTMLString(options.pagers.markup);if(typeof options.pagers.holder==='string'&&options.pagers.holder!==''){var holderClasses=homebrew.getClassFromHTMLString(options.pagers.holder);if(holderClasses.length){$holders=$el.find('.'+holderClasses.join('.'))}
if(!$holders||!$holders.length){$holders=$(options.pagers.holder).appendTo($el)}}
if(!$holders||!$holders.length){$holders=$el}
if(pagerClasses.length){$pagers=$holders.find('.'+pagerClasses.join('.'))}
if(!$pagers||!$pagers.length){var finalPagersStr=[];for(var i=instance.totalItems-1;i>-1;i--){finalPagersStr.push(options.pagers.markup)}
$pagers=$(finalPagersStr.join('')).appendTo($holders);instance.addDestroyable($pagers)}
$pagers.eq(instance.activeItem).addClass(options.classes.active);instance.$pagers=$pagers}
if(options.timer.enable&&options.showBar){var $timerBar,timerBarClasses=homebrew.getClassFromHTMLString(options.timer.barMarkup);if(timerBarClasses.length){$timerBar=$el.find('.'+timerBarClasses.join('.'))}
if(!$timerBar||!$timerBar.length){$timerBar=$(options.timer.barMarkup);instance.addDestroyable($timerBar)}
instance.$timerBar=$timerBar;if(typeof options.timer.duration!=='number'){console.error('$.fn.carouselify(): Expecting a number for the timer duration. Please check:');console.log(options.timer.duration);console.error('Reverting back to default.');options.timer.duration=homebrew.Carousel.prototype.options.timer.duration}}
instance.enable();$.data(el,instance.name,instance);return instance},enable:function(){var instance=this;if(instance.$nextSwitcher&&instance.$prevSwitcher){instance.$nextSwitcher.on('click.'+instance.name,function(){instance.switchTo('next')});instance.$prevSwitcher.on('click.'+instance.name,function(){instance.switchTo('prev')})}
if(instance.$pagers){instance.$pagers.each(function(index){$(this).on('click.'+instance.name,function(e){e.preventDefault();instance.switchTo(index)})})}
instance.runTimer();if(instance.options.timer.enable){$(window).on('focus.'+instance.name,function(){instance.runTimer()}).on('blur.'+instance.name,function(){clearTimeout(instance.timer)})}
return instance},disable:function(){var instance=this;clearTimeout(instance.timer);if(instance.$nextSwitcher&&instance.$prevSwitcher){instance.$nextSwitcher.add(instance.$prevSwitcher).off('click.'+instance.name)}
if(instance.$pagers){instance.$pagers.off('click.'+instance.name)}
return instance},switchTo:function(itemIndex){var instance=this;if(instance.isSwitching===!0)return instance;instance.isSwitching=!0;var activeItem=instance.activeItem,options=instance.options;if(typeof itemIndex==='string'){switch(itemIndex){case 'next':activeItem++;if(activeItem>=instance.totalItems){activeItem=0}
break;case 'prev':activeItem--;if(activeItem<0){activeItem=instance.totalItems-1}
break;default:console.error('Homebrew.Carousel.switchTo(): Unrecognised string method `'+itemIndex+'`.');return;break}}else if(typeof itemIndex==='number'){activeItem=itemIndex}else{console.error('Homebrew.Carousel.switchTo(): Unsupported argument type: `'+typeof itemIndex+'`.');console.log(itemIndex);return}
if(activeItem===instance.activeItem)return instance;var $currentItem=instance.$items.eq(activeItem),$prevItem=instance.$items.eq(instance.activeItem),activeClass=options.classes.active;if(typeof options.onSwitch==='function'){options.onSwitch.call(instance.$el[0],$currentItem,$prevItem)}
instance.runTimer();if(options.transitions.enable){var transitionEvent=homebrew.events.transitionEnd,transitionClass=homebrew.classes.transitionable,transitionInClass=options.transitions.classes.transitionIn,transitionOutClass=options.transitions.classes.transitionOut,reverseClass=options.transitions.classes.reverse;instance.$items.removeClass([reverseClass,transitionClass].join(' '));instance.$items.not($prevItem).removeClass(activeClass);$currentItem.one(transitionEvent,function(){$currentItem.off(transitionEvent).add($prevItem).removeClass([transitionInClass,transitionOutClass,reverseClass,transitionClass,activeClass].join(' ')).end().addClass(activeClass);instance.isSwitching=!1;if(typeof options.transitions.onEnd==='function'){options.transitions.onEnd.call(instance.$el[0],$currentItem,$prevItem)}});if(itemIndex==='prev'&&instance.activeItem===0&&activeItem===instance.totalItems-1||itemIndex!=='next'&&instance.activeItem>activeItem){$prevItem.add($currentItem).addClass(reverseClass)}
setTimeout(function(){$prevItem.add($currentItem).addClass(transitionClass);$prevItem.addClass(transitionOutClass);$currentItem.addClass(transitionInClass);if(typeof options.transitions.onStart==='function'){options.transitions.onStart.call(instance.$el[0],$currentItem,$prevItem)}},10)}else{instance.$items.removeClass(activeClass);$currentItem.addClass(activeClass);instance.isSwitching=!1}
instance.$pagers.removeClass(activeClass).eq(activeItem).addClass(activeClass);instance.activeItem=activeItem;return instance},runTimer:function(){var instance=this,options=instance.options;if(!options.timer.enable)return instance;clearTimeout(instance.timer);if(options.loop||activeItem<instance.totalItems-1){instance.timer=setTimeout(function(){instance.switchTo('next')},options.timer.duration)}
return instance},addDestroyable:function($obj){var instance=this;if(!instance.destroyables)instance.destroyables=[];instance.destroyables.push($obj);return instance},destroy:function(){var instance=this;instance.disable();if(instance.destroyable){while(instance.destroyable.length){instance.destoryable.shift().remove()}}
$.removeData(instance.$el[0],instance.name)}});homebrew.makePlugin(homebrew.Carousel);homebrew.HeightSyncer=function(el,args){if(!el)return;this.init(el,args)};$.extend(homebrew.HeightSyncer.prototype,{name:'heightSyncify',init:function(el,args){args=args||{};var instance=this;instance.$el=$(el);instance.uniqueID=homebrew.generateUniqueID();instance.update(args).enable();$.data(el,instance.name,instance);return instance},update:function(args){args=args||{};var instance=this;instance.items=args.items.slice(0);for(var i=instance.items.length-1;i>-1;i--){if(typeof instance.items[i]==='string'){instance.items[i]=instance.$el.find(instance.items[i])}
instance.items[i].find('img').each(function(){if(this.complete)return;$(this).one('load',function(){clearTimeout(instance.timer);instance.timer=setTimeout(function(){instance.sync()},100)})})}
if(args.options){$.extend(instance,args.options)}
instance.sync();return instance},enable:function(){var instance=this;if(instance.enabled)return instance;instance.enabled=!0;$(window).on('resize.'+instance.uniqueID,homebrew.utils.throttle(function(){instance.sync()},30));return instance},disable:function(){this.enabled=!1;$(window).off('.'+this.uniqueID);return this},sync:function(){var instance=this,$currentCollection,$items=$(),leftOffset,currentLeftThreshold,heights,tallestHeight;if(!instance.items||!instance.items.length)return instance;for(var i=0,ii=instance.items.length;i<ii;i++){leftOffset=currentLeftThreshold=-9999;$currentCollection=instance.items[i];$currentCollection.each(function(index){$items=$items.add($(this));leftOffset=$(this).offset().left;if(!$currentCollection.eq(index+1).length||$currentCollection.eq(index+1).offset().left<=leftOffset){heights=[];$items.css('height','');$items.each(function(){heights.push($(this).outerHeight())});tallestHeight=Math.max.apply(null,heights);$items.outerHeight(tallestHeight);$items=$()}})}
instance.$el.trigger('afterSync');return instance},destroy:function(){var instance=this;while(instance.items.length){instance.items.shift().css('height','')}
instance.disable();$.removeData(instance.$el[0],instance.name)}});homebrew.makePlugin(homebrew.HeightSyncer);homebrew.Tooltip=function(el,args){if(!el)return;this.init(el,args)};$.extend(homebrew.Tooltip.prototype,{name:'tooltipify',options:{appendTo:'body',markups:{tooltip:'<div class="tooltip" />',closer:'<a href="#/" class="tooltip__closer" />'},classes:{active:'is-active'},contents:function(){var instance=this,title=instance.$el.attr('title');instance.$el.data(instance.name+'-title',title);instance.$el.removeAttr('title');return title},hoverDuration:400,transitions:{enable:!0,classes:{transition:homebrew.classes.transitionable,transitionIn:'is-transitioning-in',transitionOut:'is-transitioning-out'}}},init:function(el,args){var instance=this,options=$.extend({},instance.options,args);instance.$el=$(el).addClass(instance.name);instance.uniqueID=homebrew.generateUniqueID();instance.options=options;instance.$appendTo=$(options.appendTo);if(!instance.$appendTo.length){instance.$appendTo='body'}
if(typeof options.contents==='function'){options.contents=options.contents.call(instance)}
instance.enable();$.data(el,instance.name,instance)},enable:function(){var instance=this,$el=instance.$el,options=instance.options;$el.on('click.'+instance.uniqueID,function(e){e.preventDefault();clearTimeout(instance.timer);instance.open()});$el.on('mouseenter.'+instance.uniqueID,function(e){clearTimeout(instance.timer);instance.timer=setTimeout(function(){instance.open()},options.hoverDuration)});$el.on('mouseleave.'+instance.uniqueID,function(e){clearTimeout(instance.timer);instance.timer=setTimeout(function(){instance.close()},options.hoverDuration)});return instance},disable:function(){this.$el.off('.'+instance.uniqueID);return this},getAltRender:function(){return Modernizr.touch&&homebrew.screenSize.small},open:function(){var instance=this;if(instance.$tooltip)return;var $el=instance.$el,options=instance.options,$tooltip=$(options.markups.tooltip).appendTo(instance.$appendTo).html(options.contents),activeClass=options.classes.active,altRender=instance.getAltRender();instance.$tooltip=$tooltip;if(altRender){var $closer=$('.'+homebrew.getClassFromHTMLString(options.markups.closer).join('.'));if(!$closer.length){$closer=$(options.markups.closer).prependTo($tooltip)}
$closer.on('click',function(e){e.preventDefault();instance.close()})}else{if(homebrew.screenSize.small){if($tooltip.outerWidth()+parseInt($tooltip.css('margin-left'),10)===$(window).width()){$tooltip.css({left:'0px',marginLeft:'0px'})}else if($el.offset().left+$tooltip.outerWidth()>$(window).width()){$tooltip.css('right','0px')}else{$tooltip.css('left',$el.offset().left+'px')}}else{if($el.offset().left+$tooltip.outerWidth()>$(window).width()){$tooltip.addClass('is-opposite').css('right','0px')}else{$tooltip.css('left',$el.offset().left+'px')}}
$tooltip.css('top',$el.offset().top-$('#mainContent').offset().top-$tooltip.outerHeight()+'px')}
if(options.transitions.enable){var transitionEvent=homebrew.events.transitionEnd,transitionClass=homebrew.classes.transitionable,transitionInClass=options.transitions.classes.transitionIn;$tooltip.one(transitionEvent,function(){$tooltip.removeClass([transitionClass,transitionInClass].join(' ')).addClass(activeClass);$(document).on(['click.fauxBlur.',instance.uniqueID,' touchstart.fauxBlur.',instance.uniqueID].join(''),function(e){if(!$tooltip.is(e.target)&&$tooltip.has(e.target).length===0){instance.close()}})}).on({mouseenter:function(){clearTimeout(instance.timer)},mouseleave:function(){clearTimeout(instance.timer);instance.timer=setTimeout(function(){instance.close()},options.hoverDuration)}});setTimeout(function(){$tooltip.addClass(transitionClass);if(altRender){$tooltip.css('margin-top',-$tooltip.outerHeight()+'px')}else{$tooltip.addClass(transitionInClass)}},10)}else{$tooltip.addClass(activeClass)}
return instance},close:function(args){args=args||{};var instance=this,$tooltip=instance.$tooltip;if(!$tooltip)return;var options=instance.options,activeClass=options.classes.active,altRender=instance.getAltRender();$(document).off('.fauxBlur.'+instance.uniqueID);if(options.transitions.enable){var transitionEvent=homebrew.events.transitionEnd,transitionClass=homebrew.classes.transitionable,transitionOutClass=options.transitions.classes.transitionOut;$tooltip.trigger(transitionEvent).off('mouseenter mouseleave').one(transitionEvent,function(){$tooltip.removeClass([transitionClass,transitionOutClass].join(' ')).removeClass(activeClass).remove();instance.$tooltip=null;if(typeof args.onCloseEnd==='function'){args.onCloseEnd()}});setTimeout(function(){$tooltip.addClass(transitionClass);if(altRender){$tooltip.css('margin-top','')}else{$tooltip.addClass(transitionOutClass)}},10)}else{$tooltip.removeClass(activeClass);instance.$tooltip=null;if(typeof args.onClose==='function'){args.onClose()}}
return instance},destroy:function(){var instance=this,el=instance.$el[0],options=instance.options;instance.disable().close();$.removeData(el,instance.name);if($.data(el,instance.name+'-title')){el.title=$.data(el,instance.name+'-title');$.removeData(el,instance.name+'-title')}}});homebrew.makePlugin(homebrew.Tooltip);$.fn.extend({dropdownify:function(){var pluginName='dropdownify',options={markups:{holder:'<div />',button:'<div />',arrow:'<div><i /></div>',label:'<span />'},classes:{holder:'dropdown',button:'dropdown-btn',arrow:'dropdown-arrow',label:'dropdown-label'}},methods={create:function(){var forms=this.parents('form');if(forms.length){forms.off('.'+pluginName).on('reset.'+pluginName,function(){var _this=$(this);setTimeout(function(){_this.find('select').trigger('change')},25)})}
this.each(function(){var $this=$(this),dropdown=($this.is('select'))?$this:$this.children('select');if(!dropdown.length||typeof dropdown.data(pluginName)!=='undefined')return;var dropdownAttr;if($this.is('select')){dropdownAttr=$this.data('dropdown-attributes')}else{dropdownAttr=$this.getAttributes();dropdown.unwrap()}
var holder=dropdown.closest('.'+options.classes.holder);if(holder.length<1){holder=$(options.markups.holder).addClass(options.classes.holder);dropdown.after(holder).prependTo(holder)}
if(typeof dropdownAttr==='object'){$.each(dropdownAttr,function(key,value){if(key==='class'){holder.addClass(value)}else{holder.attr(key,value)}})}
var btn=holder.find('.'+options.classes.button);if(btn.length<1)btn=$(options.markups.button).addClass(options.classes.button).appendTo(holder);var arrow=btn.find('.'+options.classes.arrow);if(arrow.length<1)arrow=$(options.markups.arrow).addClass(options.classes.arrow).appendTo(btn);var label=btn.find('.'+options.classes.label);if(label.length<1)label=$(options.markups.label).addClass(options.classes.label).text(dropdown.find('option:checked').text()).appendTo(btn);dropdown.data(pluginName,{activate:function(){var _this=this;dropdown.on('change.'+pluginName,function(){_this.refresh()});return _this},deactivate:function(){dropdown.off('.'+pluginName);return this},refresh:function(){var checkedText=dropdown.find('option:checked').text();if(!dropdown.data('ignore-asterisk')&&checkedText.lastIndexOf('*')===checkedText.length-1){checkedText=[checkedText.substr(0,checkedText.length-1),'<span class="text-red">*</span>'].join('')}
label.html(checkedText);btn.toggleClass('is-placeholder',Boolean(dropdown.val()===''));return this},destroy:function(){dropdown.insertBefore(holder).off('.'+pluginName).removeData(pluginName).closest('form').off('.'+pluginName);holder.remove()},$elems:{arrow:arrow,button:btn,holder:holder,label:label}});dropdown.data(pluginName).activate().refresh()})},activate:function(){runElemMethod.call(this,pluginName,'activate')},deactivate:function(){runElemMethod.call(this,pluginName,'deactivate')},refresh:function(){runElemMethod.call(this,pluginName,'refresh')},destroy:function(){runElemMethod.call(this,pluginName,'destroy')}},_arguments=arguments;for(var i=_arguments.length-1;i>-1;i--){if(typeof _arguments[i]==='object')$.extend(!0,options,_arguments[i])}
if(typeof _arguments[0]==='string'&&typeof methods[_arguments[0]]==='function'){methods[_arguments[0]].call(this)}else{methods.create.call(this)}
return this},getAttributes:function(){var elem=this,attr={};if(elem.length){$.each(elem.get(0).attributes,function(v,n){n=n.nodeName||n.name;v=elem.attr(n);if(v!==undefined&&v!==!1)attr[n]=v})}
return attr},inputify:function(_options){var pluginName='inputify',options={inputIconClass:'icon--input',radioClass:'icon--radio-btn',checkboxClass:'icon--checkbox',checkedClass:'is-checked',hiddenClass:'hidden-accessible',inputVisualMarkupArray:['<div class="icon ','inputIconClass',' ','inputTypeClass','"><i /></div>'],labelMarkupArray:['<label for="','inputID','">','inputVisualMarkupArray','</label>']},methods={create:function(){var labels=$('label');this.each(function(index){var input=$(this);if(typeof input.data(pluginName)!=='undefined')return;var inputType=input.attr('type'),inputTypeClass=getInputTypeClass(input.attr('type')),inputID=input.attr('id'),label=labels.filter('[for="'+inputID+'"]');if(!label.length)label=input.closest('label');if(!label.length){if(typeof inputID!=='string'||inputID===''){input.attr('id',index+new Date().getTime());inputID=input.attr('id')}
options.labelMarkupArray[1]=inputID;options.labelMarkupArray[3]=options.inputVisualMarkupArray.join('');label=$(options.labelMarkupArray.join(''));label.data(pluginName,{destroyable:!0});input.after(label)}
var inputVisual=label.find('.'+inputTypeClass);if(!inputVisual.length){options.inputVisualMarkupArray[1]=options.inputIconClass;options.inputVisualMarkupArray[3]=inputTypeClass;if(input.is(':checked'))options.inputVisualMarkupArray[3]+=' is-checked';if(input.parents('label').length){$(options.inputVisualMarkupArray.join('')).insertAfter(input)}else{$(options.inputVisualMarkupArray.join('')).prependTo(label)}}
input.addClass(options.hiddenClass).data(pluginName,{'$els':{'label':label},refresh:function(){var $inputVisual=this.$els.label.find('.'+options.inputIconClass);if(input.is(':checked')){$inputVisual.addClass(options.checkedClass)}else{$inputVisual.removeClass(options.checkedClass)}
return this}})});var radioInputs=this.filter('[type="radio"]');if(radioInputs.length){var radioGroupNames=[];radioInputs.each(function(){var radioInput=$(this),radioInputName=radioInput.attr('name');if(typeof radioInputName!=='string')return;if(radioGroupNames.length<1&&radioInputName!==''){radioGroupNames.push(radioInputName)}else{for(var i=radioGroupNames.length-1;i>-1;i--){if(radioGroupNames[i]==radioInputName){break}else if(i===0){radioGroupNames.push(radioInputName)}}}});for(var i=radioGroupNames.length;i>-1;i--){(function(){var $radioGroupInputs=radioInputs.filter('[name="'+radioGroupNames[i]+'"]');$radioGroupInputs.off('change.'+pluginName).on('change.'+pluginName,function(){$radioGroupInputs.each(function(){$(this).data(pluginName).refresh()})})})()}}
var checkboxInputs=this.filter('[type="checkbox"]');if(checkboxInputs.length){checkboxInputs.off('change.'+pluginName).on('change.'+pluginName,function(){$(this).data(pluginName).refresh()})}
var forms=this.closest('form'),inputs=this;if(forms.length){forms.off('reset.inputify').on('reset.inputify',function(){setTimeout(function(){inputs.trigger('change')},25)})}},destroy:function(){var labels=$('label');this.each(function(){var $this=$(this),inputId=$this.attr('id');if(typeof label.data(pluginName)!=='object'&&label.data(pluginName).destroyable){label.remove()}});var forms=this.closest('form');this.off('.'+pluginName);forms.off('.'+pluginName)},refresh:function(){runElemMethod.call(this,pluginName,'refresh')}},_arguments=arguments;function getInputTypeClass(type){switch(type){case 'radio':return options.radioClass;case 'checkbox':return options.checkboxClass;default:return undefined}}
for(var i=_arguments.length-1;i>-1;i--){if(typeof _arguments[i]==='object')$.extend(options,_arguments[i])}
if(typeof _arguments[0]==='string'&&typeof methods[_arguments[0]]==='function'){methods[_arguments[0]].call(this)}else{methods.create.call(this)}
return this},popupify:function(_options){var pluginName='popupify',$body=$('body'),options={classes:{mainPopupHolder:'main-popup-holder',shown:'is-shown'},ids:{mainPopupHolder:'mainPopupHolder'},$elems:{mainPopupHolder:null},markups:{closeBtn:'<a href="#close" data-hide-popup="true" class="popup-closer">Back</a>'},content:undefined,addCloseBtns:!0,closeOnOverlay:!0},methods={create:function(){var $mainPopupHolder=options.$elems.mainPopupHolder;if(!thisObjectExists($mainPopupHolder))$mainPopupHolder=$('#'+options.ids.mainPopupHolder);if($mainPopupHolder.length<1){$mainPopupHolder=$(['<div class="',options.classes.mainPopupHolder,'" id="',options.ids.mainPopupHolder,'" ></div>'].join('')).appendTo($body);options.$elems.mainPopupHolder=$mainPopupHolder}else{$mainPopupHolder.appendTo('body')}
if(!thisDataIsValidObject($mainPopupHolder,pluginName)){$mainPopupHolder.data(pluginName,{reveal:function(){$body.addClass('popup-is-shown');setTimeout(function(){$mainPopupHolder.addClass(options.classes.shown)},10);return this},conceal:function(){$body.removeClass('popup-is-shown');setTimeout(function(){$mainPopupHolder.removeClass(options.classes.shown)},10);return this},activate:function(){var _dataMethods=this;_dataMethods.deactivate();$mainPopupHolder.on("click."+pluginName,function(){if($.fn.popupify.closeOnOverlay===!0){_dataMethods.conceal()}});$mainPopupHolder.on('click.'+pluginName,'.popup',function(e){e.stopPropagation()});$mainPopupHolder.on('click.'+pluginName,'[data-hide-popup]',function(e){e.preventDefault();_dataMethods.conceal()});return _dataMethods},deactivate:function(){$mainPopupHolder.off('.'+pluginName);return this},destroy:function(){this.deactivate();$mainPopupHolder.removeData(pluginName)}});$mainPopupHolder.data(pluginName).activate();if(homebrew.browser.ie7)$mainPopupHolder.pseudofy({method:'before'})}
if(this.length<1)return;this.each(function(){var $this=$(this),dataTargetPopup=$this.data('target-popup'),target;if(typeof options.content==='function'){target=options.content.call(this)}else if(typeof dataTargetPopup==='string'){target=$($this.data('target-popup'))}else if(typeof dataTargetPopup==='object'&&dataTargetPopup instanceof jQuery){target=dataTargetPopup}else if(typeof $this.attr('href')!=='undefined'){target=$($this.attr('href'))}
if(thisObjectExists(target)){if(!thisDataIsValidObject($this,pluginName)){$this.data(pluginName,{reveal:function(){target.data(pluginName).reveal();return this},conceal:function(){$mainPopupHolder.data(pluginName).conceal();return this},activate:function(){var _dataMethods=this;_dataMethods.deactivate();$this.on('click.'+pluginName,function(e){e.preventDefault();_dataMethods.reveal()});return $this},deactivate:function(){$this.off('.'+pluginName);return $this},destroy:function(){this.deactivate();target.data(pluginName).destroy();$this.removeData(pluginName)}});$this.data(pluginName).activate()}}else{target=$(this)}
if(!target.parent().is($mainPopupHolder)){target.appendTo($mainPopupHolder)}
if(options.addCloseBtns&&target.find('.popup-closer').length<1){target.prepend(options.markups.closeBtn)}
if(typeof target.data(pluginName)==='undefined'){target.data(pluginName,{reveal:function(){$mainPopupHolder.find('.popup').removeClass(options.classes.shown);target.addClass(options.classes.shown);$mainPopupHolder.data(pluginName).reveal();$.fn.popupify.closeOnOverlay=options.closeOnOverlay;if(homebrew.browser.ie){target.trigger('revealed')}else{$mainPopupHolder.on(homebrew.events.transitionEnd,function(){$mainPopupHolder.off(homebrew.events.transitionEnd);target.trigger('revealed')})}
return this},conceal:function(){$mainPopupHolder.data(pluginName).conceal();return this},destroy:function(){target.removeData(pluginName)}})}})},activate:function(){runElemMethod.call(this,pluginName,'activate')},deactivate:function(){runElemMethod.call(this,pluginName,'deactivate')},destroy:function(){var $mainPopupHolder=options.$elems.mainPopupHolder;if(!thisObjectExists($mainPopupHolder))$mainPopupHolder=$('#'+options.ids.mainPopupHolder);if($mainPopupHolder.length&&typeof $mainPopupHolder.data(pluginName)!=='undefined'){$mainPopupHolder.data(pluginName).destroy()}
runElemMethod.call(this,pluginName,'destroy')}},_arguments=arguments;for(var i=_arguments.length-1;i>-1;i--){if(typeof _arguments[i]==='object')$.extend(options,_arguments[i])}
if(typeof _arguments[0]==='string'&&typeof methods[_arguments[0]]==='function'){methods[_arguments[0]].call(this)}else{methods.create.call(this)}
return this},placeholderify:function(_options){var options=$.extend({},_options,{placeholderClass:'is-placeholder'});return this.each(function(){var input=$(this),placeholderText=input.attr('placeholder');if(input.val()===''){if(input.attr('type')==='password'){input.attr('type','text');input.data('was-password',!0)}
input.val(placeholderText).addClass(options.placeholderClass)}
input.on({'focus.placeholder':function(){if(input.val()===placeholderText){if(input.data('was-password')){input.attr('type','password')}
input.val('').removeClass(options.placeholderClass)}},'blur.placeholder':function(){if(input.val()===''){if(input.data('was-password')){input.attr('type','text')}
input.val(placeholderText).addClass(options.placeholderClass)}}})})},queryStr:function(key){var searchStr=window.location.search;if(searchStr==='')return!1;var queryArr=window.location.search.substr(1).split('&'),tempArr;if(typeof key==='string'){for(var i=0,ii=queryArr.length;i<ii;i++){tempArr=queryArr[i].split('=');if(tempArr[0]===key)return tempArr[1]}
return!1}else{var resultValue={};for(var i=0,ii=queryArr.length;i<ii;i++){tempArr=queryArr[i].split('=');resultValue[tempArr[0]]=tempArr[1]}
return resultValue}},togglerify:function(){var pluginName='togglerify',options={toggledClass:'is-toggled',singleActive:!1,selfToggleable:!0,slide:!1,slideDuration:300,pretoggle:undefined,content:undefined,useCSSTransitions:!homebrew.browser.ie&&root.hasClass('csstransitions'),classes:{transitionable:homebrew.classes.transitionable}},methods={create:function(){var togglers=this;togglers.each(function(index){var thisToggler=$(this),targetData=thisToggler.data('togglerify-target'),target;if(typeof options.content==='function'){target=options.content.call(this,index)}else if(typeof targetData==='string'){target=$('#'+targetData)}else{target=$(thisToggler.attr('href'))}
if(!target.length)return;var togglerAndTarget=thisToggler.add(target);togglerAndTarget.data(pluginName,{activate:function(){this.deactivate();thisToggler.on('click.'+pluginName,function(e){e.preventDefault();if(thisToggler.hasClass(options.toggledClass)){if(options.selfToggleable===!1)return;thisToggler.data(pluginName).toggleOff();return}
thisToggler.data(pluginName).toggleOn()});return this},deactivate:function(){thisToggler.off('click.'+pluginName);return this},toggleOn:function(methodSettings){methodSettings=methodSettings||{};togglerAndTarget.trigger('toggleOn',[thisToggler,target]).trigger('toggle',[thisToggler,target]);thisToggler.addClass(options.toggledClass);target.addClass(options.toggledClass);if(options.singleActive){togglers.not(thisToggler).togglerify('toggleOff')}
if(options.slide&&!methodSettings.noSlide){var targetHeight=methodSettings.contentHeight;if(options.useCSSTransitions){if(typeof targetHeight!=='number'){target.css('height','auto');targetHeight=target.get(0).clientHeight}
target.css('height','0px').addClass(options.classes.transitionable);setTimeout(function(){target.off(homebrew.events.transitionEnd).on(homebrew.events.transitionEnd,function(){target.off(homebrew.events.transitionEnd).removeClass(options.classes.transitionable);if(typeof methodSettings.contentHeight!=='number'){target.css('height','')}
togglerAndTarget.trigger('afterToggleOn',[thisToggler,target]).trigger('afterToggle',[thisToggler,target])}).css('height',targetHeight+'px')},5)}else{if(typeof targetHeight!=='number'){target.show();targetHeight=target.get(0).clientHeight}
target.hide();target.slideDown(options.slideDuration,function(){togglerAndTarget.trigger('afterToggleOn',[thisToggler,target]).trigger('afterToggle',[thisToggler,target])})}}else{togglerAndTarget.trigger('afterToggleOn',[thisToggler,target]).trigger('afterToggle',[thisToggler,target])}
return this},toggleOff:function(methodSettings){if(!thisToggler.hasClass(options.toggledClass))return;methodSettings=methodSettings||{};togglerAndTarget.trigger('toggleOff',[thisToggler,target]).trigger('toggle',[thisToggler,target]);thisToggler.removeClass(options.toggledClass);if(options.slide&&!methodSettings.noSlide){if(options.useCSSTransitions){var targetHeight=target.get(0).clientHeight;target.css('height',targetHeight+'px').removeClass(options.toggledClass);setTimeout(function(){target.addClass(options.classes.transitionable).off(homebrew.events.transitionEnd).on(homebrew.events.transitionEnd,function(){target.off(homebrew.events.transitionEnd).removeClass(options.classes.transitionable).css('height','');togglerAndTarget.trigger('afterToggleOff',[thisToggler,target]).trigger('afterToggle',[thisToggler,target])}).css('height','0px')},5)}else{target.slideUp(options.slideDuration,function(){togglerAndTarget.trigger('afterToggleOff',[thisToggler,target]).trigger('afterToggle',[thisToggler,target])}).removeClass(options.toggledClass)}}else{target.removeClass(options.toggledClass);togglerAndTarget.trigger('afterToggleOff',[thisToggler,target]).trigger('afterToggle',[thisToggler,target])}
return this},set:function(key,value){if(typeof arguments[0]==='object'){$.extend(!0,options,arguments[0])}else{options[key]=value}
return this},destroy:function(){this.deactivate();togglerAndTarget.removeData(pluginName)}});thisToggler.data(pluginName).activate();if(typeof options.pretoggle==='number'&&index===options.pretoggle){thisToggler.addClass(options.toggledClass);if(options.slide)target.addClass(options.toggledClass);if(!options.useCSSTransitions)target.show()}})},activate:function(){runElemMethod.call(this,pluginName,'activate',arguments)},deactivate:function(){runElemMethod.call(this,pluginName,'deactivate',arguments)},toggleOn:function(){runElemMethod.call(this,pluginName,'toggleOn',arguments)},toggleOff:function(){runElemMethod.call(this,pluginName,'toggleOff',arguments)},set:function(){runElemMethod.call(this,pluginName,'set',arguments)},destroy:function(){runElemMethod.call(this,pluginName,'destroy',arguments)}},_arguments=arguments;if(typeof _arguments[0]==='string'&&_arguments[0]!=='create'&&typeof methods[_arguments[0]]==='function'){methods[_arguments[0]].apply(this,$.makeArray(_arguments).slice(1))}else{for(var i=_arguments.length-1;i>-1;i--){if(typeof _arguments[i]==='object')$.extend(options,_arguments[i])}
methods.create.call(this)}
return this},validify:function(_options){var pluginName='validify',options={selectors:{all:'input[data-validify], textarea[data-validify], select[data-validify]',fields:'input[data-validify], textarea[data-validify], select[data-validify]',groups:'[data-validify-group]',textFields:'input[type="text"], input[type="tel"], input[type="number"], input[type="email"], input[type="password"], textarea',checkButtons:'input[type="radio"], input[type="checkbox"]',dropdowns:'select'},classes:[{key:'success',className:'is-success'},{key:'hovered',className:'is-hovered'},{key:'focused',className:'is-focused'},{key:'failed',className:'is-failed'},{key:'pattern',className:'is-failed-pattern'},{key:'minlength',className:'is-failed-minlength'},{key:'required',className:'is-failed-required'},{key:'compare-with',className:'is-failed-compare-with'},{key:'minchecked',className:'is-failed-minchecked'},{key:'custom',className:'is-failed-custom'}],regexes:[{key:'name',pattern:/^[^\d<>!@#$%^&*()=+|{}:;"',.`~_\/\\\]]+$/i},{key:'alphabet',pattern:/^[a-z\s]+$/i},{key:'alphanumeric',pattern:/^[a-z0-9\s]+$/i},{key:'email',pattern:/^[^\s@]+@[^\s@]+\.[^\s@]+$/i},{key:'dob',pattern:/^(?:(?:31(\/|-|\.)(?:0?[13578]|1[02]))\1|(?:(?:29|30)(\/|-|\.)(?:0?[1,3-9]|1[0-2])\2))(?:(?:1[6-9]|[2-9]\d)?\d{2})$|^(?:29(\/|-|\.)0?2\3(?:(?:(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00))))$|^(?:0?[1-9]|1\d|2[0-8])(\/|-|\.)(?:(?:0?[1-9])|(?:1[0-2]))\4(?:(?:1[6-9]|[2-9]\d)?\d{2})$/},{key:'numbers',pattern:/^\s*\d+\s*$/},{key:'phone',pattern:/^[\+\-0-9\s]+$/},{key:'mobile-number',pattern:/^01(|[\d]+)$/},{key:'full-mobile-number',pattern:/^601(|[\d]+)$/},{key:'basic',pattern:/^[^<>]+$/i}],validationTimerDuration:250,debug:!1},allClasses=(function(){var tempArr=[];for(var i=options.classes.length-1;i>-1;i--){if(options.classes[i].key==='focused')continue;tempArr.push(options.classes[i].className)}
return tempArr.join(' ')})(),methods={create:function(){this.each(function(){var thisForm=$(this),allInputs=thisForm.find(options.selectors.all);thisForm.data(pluginName,{valid:!1,strict:!1,debug:options.debug,allInputs:allInputs,validate:function(){var _this=this;debugMsg.call(thisForm,[' /*===================================================*\\ ',' Updating form validation status ',' ------------------------------------------------------- '],'start');debugMsg.call(thisForm,['Form: ',thisForm,' ']);allInputs.each(function(){$(this).data(pluginName).validate()});_this.refresh();debugMsg.call(thisForm,'Form validation: '+_this.valid);debugMsg.call(thisForm,[' ------------------------------------------------------- ',' Form validation status update complete ',' \\*===================================================*/ ',''],'end')},refresh:function(){var _this=this;_this.valid=!0;allInputs.each(function(){if($(this).data(pluginName).valid===!1){_this.valid=!1;return!1}})},set:function(key,value){this[key]=value;return this},destroy:function(){runElemMethod.call(this.allInputs,pluginName,'destroy');thisForm.removeData(pluginName)}});if(thisForm.is('form')){thisForm.off('.'+pluginName).on('reset.'+pluginName,function(){setTimeout(thisForm.data(pluginName).validate,100)})}
allInputs.each(function(index){var thisInput=$(this),validifyData=typeCast(convertCSVtoObject(thisInput.data(pluginName))),inputPluginObj={group:thisInput.closest('[data-validify-group]')},triggerEvents;inputPluginObj.isInHolder=Boolean(thisInput.parent('.field-holder').length);if(thisObjectExists(inputPluginObj.group)){var nestedGroupInputs=inputPluginObj.group.find(options.selectors.groups).find(options.selectors.all),groupValidifyData=typeCast(convertCSVtoObject(inputPluginObj.group.data(pluginName+'-group')));if(thisIsJSON(groupValidifyData)){if(typeof groupValidifyData==='string'){$.extend(inputPluginObj,JSON.parse(groupValidifyData))}else{$.extend(inputPluginObj,groupValidifyData)}}
inputPluginObj.groupInputs=inputPluginObj.group.find(options.selectors.all).not(nestedGroupInputs)}
if(thisIsJSON(validifyData)){if(typeof validifyData==='string'){$.extend(!0,inputPluginObj,JSON.parse(validifyData))}else{$.extend(!0,inputPluginObj,validifyData)}}
if(thisInput.data('validify-pattern')){inputPluginObj.pattern=thisInput.data('validify-pattern')}
if(typeof inputPluginObj.pattern==='undefined'){if(thisInput.attr('type')==='email'){inputPluginObj.pattern='email'}else{inputPluginObj.pattern='basic'}}
if(typeof inputPluginObj.compareWith==='string'){inputPluginObj.$compareWith=$(inputPluginObj.compareWith)}
if(typeof inputPluginObj.response==='string'){inputPluginObj.$response=$(inputPluginObj.response)}
if(typeof inputPluginObj.groupResponse==='string'){inputPluginObj.$groupResponse=$(inputPluginObj.groupResponse)}
if(typeof inputPluginObj.floater==='string'){inputPluginObj.$floater=$(inputPluginObj.floater);if(inputPluginObj.$floater.length){inputPluginObj.$floater.data('floater',{$popup:inputPluginObj.$floater.closest('.popup')});if(inputPluginObj.$floater.data('floater').$popup.length){inputPluginObj.$floater.appendTo($('#mainPopupHolder'))}else{inputPluginObj.$floater.appendTo('body')}
$.extend(inputPluginObj.$floater.data('floater'),{refresh:function(){var topPos=thisInput.offset().top-inputPluginObj.$floater.outerHeight();if(this.$popup.length)topPos+=$('#mainPopupHolder').scrollTop()-$(window).scrollTop();inputPluginObj.$floater.off(FE.events.transitionEnd).css({width:thisInput.outerWidth()+'px',marginTop:'',top:topPos+'px',left:thisInput.offset().left+'px'}).addClass('is-shown');return this},reveal:function(){var self=this;self.refresh();inputPluginObj.$floater.addClass('is-shown');$(window).off('.'+inputPluginObj.eventID).on('resize.'+pluginName+'.'+inputPluginObj.eventID,homebrew.utils.throttle(function(){self.refresh()},100));return self},conceal:function(){inputPluginObj.$floater.removeClass('is-shown').css({marginTop:'',top:'',left:''});$(window).off('resize.'+inputPluginObj.eventID);return this}})}else{debugMsg.call(thisForm,'A floater ID `'+inputPluginObj.floater+'` has been provided, but selection returns nothing.','error');inputPluginObj.$floater=undefined}}
if(thisInput.is(options.selectors.checkButtons)){triggerEvents='change.'+pluginName}else if(thisInput.is(options.selectors.textFields)){triggerEvents=['input.'+pluginName,'blur.'+pluginName].join(' ')}else if(thisInput.is(options.selectors.dropdowns)){triggerEvents=['change.'+pluginName,'blur.'+pluginName].join(' ')}
thisInput.data(pluginName,$.extend(validifyData,{eventID:new Date().getTime()+index,parentForm:thisForm,validate:function(){var _this=this;debugMsg.call(thisForm,thisInput);$.extend(_this,validateInput(thisInput,thisForm));reflectValidity(thisInput,thisForm);debugMsg.call(thisForm,' ');thisInput.trigger('validate');thisForm.data(pluginName).refresh();return _this},activate:function(){var _this=this;_this.deactivate();thisInput.on(triggerEvents,function(){clearTimeout(_this.timer);_this.timer=setTimeout(function(){if(thisInput.attr('type')==='radio'||thisInput.attr('type')==='checkbox'){allInputs.filter('[name="'+thisInput.attr('name')+'"]').each(function(){$(this).data('validify').validate()})}else{_this.validate()}},options.validationTimerDuration)});if(thisObjectExists(_this.$response)){thisInput.on('focus.'+pluginName,function(){_this.$response.addClass(getClassFromString('focused'))});thisInput.on('blur.'+pluginName,function(){_this.$response.removeClass(getClassFromString('focused'))})}
if(thisObjectExists(_this.$groupResponse)){thisInput.on('focus.'+pluginName,function(){_this.$groupResponse.addClass(getClassFromString('focused'))});thisInput.on('blur.'+pluginName,function(){_this.$groupResponse.removeClass(getClassFromString('focused'))})}
if(thisObjectExists(_this.$compareWith)){_this.$compareWith.on('validate.'+pluginName,function(){_this.validate()})}
if(thisObjectExists(_this.$floater)){thisInput.on('focus.'+pluginName,function(){_this.$floater.addClass(getClassFromString('focused'));toggleFloater(_this)}).on('blur.'+pluginName,function(){_this.$floater.removeClass(getClassFromString('focused')).data('floater').conceal()});var mouseTarget=(_this.isInHolder)?thisInput.parent('.field-holder'):thisInput;mouseTarget.on('mouseenter.'+pluginName,function(){_this.$floater.addClass(getClassFromString('hovered'));toggleFloater(_this)}).on('mouseleave.'+pluginName,function(){_this.$floater.removeClass(getClassFromString('hovered'));if(_this.$floater.hasClass(getClassFromString('focused')))return;_this.$floater.data('floater').conceal()})}
return _this},deactivate:function(){var _this=this;thisInput.off('.'+pluginName);if(thisObjectExists(_this.$compareWith)){_this.$compareWith.off('validate.'+pluginName)}
return _this},forceValidate:function(){this.set('valid',!0).set('error',!1);clearTimeout(this.timer);reflectValidity(thisInput,thisForm);return this},forceInvalidate:function(errorCode){this.set('valid',!1).set('error',errorCode);clearTimeout(this.timer);reflectValidity(thisInput,thisForm);return this},forceNeutral:function(){this.set('valid','neutral').set('error',!1);clearTimeout(this.timer);reflectValidity(thisInput,thisForm);return this},excludeFromValidation:function(){return this.set('required',!1)},includeInValidation:function(){return this.set('required',!0)},destroy:function(){thisInput.removeData(pluginName)},set:function(key,value){this[key]=value;return this}},inputPluginObj))});allInputs.each(function(){var thisInput=$(this),dataObj=thisInput.data(pluginName);if(typeof dataObj.valid==='undefined'||dataObj.valid===null||dataObj.valid==='neutral'){dataObj.validate()}else{dataObj.originalState={val:thisInput.val(),valid:dataObj.valid,error:dataObj.error}}
reflectValidity(thisInput,thisForm);dataObj.activate()})})},activate:function(){runElemMethod.call(this,pluginName,'activate')},deactivate:function(){runElemMethod.call(this,pluginName,'deactivate')},forceValidate:function(){runElemMethod.call(this,pluginName,'forceValidate')},forceInvalidate:function(){runElemMethod.call(this,pluginName,'forceInvalidate')},forceNeutral:function(){runElemMethod.call(this,pluginName,'forceNeutral')},excludeFromValidation:function(){runElemMethod.call(this,pluginName,'excludeFromValidation')},includeInValidation:function(){runElemMethod.call(this,pluginName,'includeInValidation')},destroy:function(){runElemMethod.call(this,pluginName,'destroy')},set:function(){runElemMethod.call(this,pluginName,'set',arguments)}},_arguments=arguments;for(var i=_arguments.length-1;i>-1;i--){if(typeof _arguments[i]==='object')$.extend(options,_arguments[i])}
if(typeof _arguments[0]==='string'&&typeof methods[_arguments[0]]==='function'){methods[_arguments[0]].call(this)}else{methods.create.call(this)}
function validateInput(targetInput,targetForm){var dataObj=targetInput.data(pluginName),formDataObj=targetForm.data(pluginName),inputValue=targetInput.val();if(targetInput.is(options.selectors.checkButtons)){debugMsg.call(targetForm,'Input is a :checked element (radio button / checkbox.)');if(thisObjectExists(dataObj.group)){debugMsg.call(targetForm,':checked element is in a group.');var inputName=targetInput.attr('name'),inputGroup=dataObj.groupInputs.filter('[name="'+inputName+'"]'),minChecked=dataObj.minChecked,maxChecked=dataObj.maxChecked;var maxChecked=getDataAttr(dataObj.group,'validify-max-checked');if(typeof maxChecked==='number'){targetInput.on('change.'+pluginName,function(){var isMaxed=(inputGroup.filter(':checked').length>=maxChecked);inputGroup.not(':checked').prop('disabled',isMaxed)})}
if(typeof minChecked==='number'){debugMsg.call(targetForm,[indentStr(0)+'The group requires at least '+minChecked+':checked elements.',indentStr(1)+'Number of :checked elements in the group: '+inputGroup.filter(':checked').length]);if(inputGroup.filter(':checked').length<minChecked){debugMsg.call(targetForm,indentStr(2)+'Group does not meet the minimum number of :checked elements.');if(formDataObj.strict){debugMsg.call(targetForm,indentStr(3)+'Strict mode on. Input fails validation.','error');return{valid:!1,error:'min-checked'}}else{debugMsg.call(targetForm,indentStr(3)+'Strict mode off. Input is in neutral validation.','neutral');return{valid:'neutral',error:!1}}}else{debugMsg.call(targetForm,indentStr(2)+'Group meets the minimm number of :checked elements.')}}}
if(!targetInput.is(':checked')){debugMsg.call(targetForm,[":checked element isn't checked.",indentStr(0)+'Validation type: required.']);if(typeof dataObj.required==='boolean'&&dataObj.required===!0){debugMsg.call(targetForm,indentStr(1)+":checked element is required.");debugMsg.call(targetForm,indentStr(2)+'Check to see if any other buttons in its group has been checked.');if(targetForm.data('validify').allInputs.filter('[name="'+targetInput.attr('name')+'"]').is(':checked')){debugMsg.call(targetForm,indentStr(3)+'There is a checked input in the group. Validation passes.','success');return{valid:!0,error:!1}}else{debugMsg.call(targetForm,indentStr(3)+'There are no checked inputs in the group.');if(formDataObj.strict){debugMsg.call(targetForm,indentStr(4)+'Strict mode on; Validation fails.','error');return{valid:!1,error:'required'}}else{debugMsg.call(targetForm,indentStr(4)+'Strict mode off; node is in neutral validation.','neutral');return{valid:'neutral',error:!1}}}}else{debugMsg.call(targetForm,indentStr(1)+":checked element isn't required.");debugMsg.call(targetForm,indentStr(2)+"Neutral validation.",'neutral');return{valid:'neutral',error:!1}}}
debugMsg.call(targetForm,":checked element is checked.")}else{if(typeof dataObj.originalState!=='undefined'){debugMsg.call(targetForm,"Input has an original state cached, checking to see if its value matches its original state.");if(inputValue===dataObj.originalState.val){debugMsg.call(targetForm,indentStr(1)+"Value matches its original state. Returning to how it was.");return{valid:dataObj.originalState.valid,error:dataObj.originalState.error}}}
if(inputValue===''){debugMsg.call(targetForm,["Input is empty.",indentStr(0)+'Validation type: required.']);if(typeof dataObj.required==='boolean'&&dataObj.required===!0){if(formDataObj.strict){debugMsg.call(targetForm,indentStr(1)+'Input is required. Strict mode on; input has failed validation','error');return{valid:!1,error:'required'}}else{debugMsg.call(targetForm,indentStr(1)+'Input is required. Strict mode off; input is in neutral validation','neutral');return{valid:'neutral',error:!1}}}else{debugMsg.call(targetForm,indentStr(1)+"Input isn't required. Neutral validation.",'neutral');return{valid:'neutral',error:!1}}}else if(thisObjectExists(dataObj.$compareWith)){debugMsg.call(targetForm,"Input needs to be compared to: "+dataObj.compareWith);var targetComparison=dataObj.$compareWith;if(targetComparison.length<1){throw new Error('$.validify(): A target for comparison has been provided, but selection has returned with nothing. Please check your spelling, or make sure both this input and the target comparison input exist on the same page at the same time.')}
if(targetComparison.data(pluginName).valid!==!0){debugMsg.call(targetForm,indentStr(0)+"The input to compare with hasn't passed validation yet. Neutral validation.",'neutral');return{valid:'neutral',error:!1}}else if(targetInput.val()!==targetComparison.val()){debugMsg.call(targetForm,indentStr(0)+"Comparison failed. Input has failed validation.",'error');return{valid:!1,error:'compare-with'}}}else{debugMsg.call(targetForm,"Input isn't empty.");if(typeof dataObj.pattern==='string'){debugMsg.call(targetForm,[indentStr(0)+'Validation type: pattern.',indentStr(1)+'Pattern provided: '+dataObj.pattern]);var regExp;regExp=getRegexFromString(dataObj.pattern);if(typeof regExp==='string'){var patternArray=dataObj.pattern.split('/');if(patternArray.length>2){regExp=new RegExp(patternArray[1],patternArray[2])}else{regExp=new RegExp(dataObj.pattern)}}
if(typeof regExp==='object'){if(regExp.test(inputValue)){debugMsg.call(targetForm,indentStr(1)+"Input value matches the requierd pattern.",'success')}else{debugMsg.call(targetForm,indentStr(1)+"Input value doesn't match the required pattern. Input has failed validation.",'error');return{valid:!1,error:'pattern'}}}else{debugMsg.call(targetForm,indentStr(1)+"A pattern has been provided, but it doesn't seem to result in a valid RegExp object. Please check again.",'error')}}
if(typeof dataObj.minlength==='number'){debugMsg.call(targetForm,indentStr(0)+'Validation type: minlength.');var minlengthNum=parseInt(dataObj.minlength,10);if(inputValue.length<minlengthNum){if(formDataObj.strict){debugMsg.call(targetForm,indentStr(1)+'Input value hasn\'t reached the minimum length. Strict mode on; input has failed validation.','error');return{valid:!1,error:'minlength'}}else{debugMsg.call(targetForm,indentStr(1)+'Input value hasn\'t reached the minimum length. Strict mode off; input is in neutral validation.','neutral');return{valid:'neutral',error:!1}}}else{debugMsg.call(targetForm,indentStr(1)+"Input value has reached the minimum length.")}}}}
debugMsg.call(targetForm,'Input has passed validation.','success');return{valid:!0,error:!1}}
function reflectValidity(targetInput,targetForm){var dataObj=targetInput.data(pluginName),isInGroup=thisObjectExists(dataObj.group),$response=$(dataObj.$response),$floater=$(dataObj.$floater),$groupResponse=$(dataObj.$groupResponse);targetInput.add($response).add($floater).add($groupResponse).removeClass(allClasses);if(isInGroup){var groupStatus=!0;debugMsg.call(targetForm,'Input is in a group. Checking through all inputs in the group.');dataObj.groupInputs.each(function(){var thisInput=$(this),thisDataObj=thisInput.data(pluginName),$validifyResponses=thisInput.add($(thisDataObj.$response)).add($(thisDataObj.$floater)),thisInputStatus=thisDataObj.valid,thisIsCheckInput=(targetInput.is(options.selectors.checkButtons));if(thisInputStatus===!0){if(thisIsCheckInput&&!thisInput.is(':checked')){$validifyResponses.removeClass(getClassFromString('success'));return}
$validifyResponses.addClass(getClassFromString('success'))}else if(thisInputStatus===!1){$validifyResponses.addClass(getClassFromString('failed'));if(typeof thisDataObj.error==='string'){$validifyResponses.add($groupResponse).addClass(getClassFromString(thisDataObj.error))}
groupStatus=!1}else if(typeof thisInputStatus==='undefined'||thisInputStatus==='neutral'){if(groupStatus!==!1)groupStatus='neutral'}
toggleFloater.call(thisInput,thisDataObj)});if(groupStatus===!0){debugMsg.call(targetForm,indentStr(0)+'Input group has passed validation. Applying success classes onto the group response element.','success');$groupResponse.addClass(getClassFromString('success'))}else if(groupStatus===!1){debugMsg.call(targetForm,indentStr(0)+'Input group has failed validation. Applying failed classes onto the group response element.','error');$groupResponse.addClass(getClassFromString('failed'))}else if(groupStatus==='neutral'){debugMsg.call(targetForm,indentStr(0)+'Input group has neutral validation. Group response element will not be modified.','neutral')}}else{var $validifyResponses=targetInput.add($response).add($floater);if(dataObj.valid===!1){$validifyResponses.addClass(getClassFromString('failed'));if(typeof dataObj.error==='string'){$validifyResponses.addClass(getClassFromString(dataObj.error))}}else if(dataObj.valid===!0){if(dataObj.noSuccess){debugMsg.call(targetForm,'Input has `noSuccess` set to true. Leaving response in its neutral state.','neutral')}else{$validifyResponses.addClass(getClassFromString('success'))}}
toggleFloater.call(targetInput,dataObj)}}
function getRegexFromString(string){for(var i=options.regexes.length-1;i>-1;i--){if(string===options.regexes[i].key)return options.regexes[i].pattern}
return''}
function getClassFromString(string){var returnClass;for(var i=options.classes.length-1;i>-1;i--){if(string===options.classes[i].key)return options.classes[i].className}
return''}
function getDataAttr(target,key){if(typeof target==='undefined'||target===null)return;return target.data(key,null).data(key)}
function toggleFloater(dataObj){var $theFloater=dataObj.$floater;if(typeof $theFloater==='undefined')return;if($theFloater.hasClass(getClassFromString('failed'))){if($theFloater.hasClass(getClassFromString('focused'))||$theFloater.hasClass(getClassFromString('hovered'))){$theFloater.data('floater').reveal()}}else{$theFloater.data('floater').conceal()}}
function indentStr(levels){var indentationStrArr=[];if(typeof levels==='number'&&levels>0){for(var i=0,ii=levels;i<ii;i++){indentationStrArr.push(' ')}}
indentationStrArr.push('`- ');return indentationStrArr.join('')}
function thisIsJSON(value){if(typeof value==='string'){return(value.substr(0,1)==='{'&&value.substr(value.length-1,value.length)==='}')}else{return(typeof value==='object'&&value!==null&&value!==undefined)}}
function debugMsg(message,styles){if(!this.data(pluginName).debug)return;switch(styles){case 'error':styles='color: #ff8201;';break;case 'neutral':styles='color: #999;';break;case 'success':styles='color: #5cb21d;';break;case 'start':styles='background-color: #6b3269; color: #fff;';break;case 'end':styles='background-color: #444; color: #fff;';break;default:styles='';break}
if(message instanceof Array){while(message.length){if(typeof message[0]==='string'){console.log('%c'+message[0],styles)}else{console.log(message[0])}
message.shift()}}else{if(typeof message[0]==='string'){console.log('%c'+message,styles)}else{console.log(message)}}}
function typeCast(keyValueObj){$.each(keyValueObj,function(key,value){switch(key){case 'valid':case 'required':keyValueObj[key]=(value==='true')?!0:!1;break;case 'minlength':case 'maxlength':case 'minchecked':case 'maxchecked':keyValueObj[key]=parseInt(value,10);break}});return keyValueObj}
return this}});function runElemMethod(pluginName,methodName,_args){this.each(function(){var $this=$(this),pluginData=$this.data(pluginName);if(typeof pluginData==='object'&&typeof pluginData[methodName]==='function'){pluginData[methodName].apply(pluginData,_args)}})}
function thisObjectExists(target){return(typeof target==='object'&&target!==null&&target.length)}
function thisDataIsValidObject($elem,dataName){var elemData=$elem.data(dataName);return(typeof elemData==='object'&&elemData!==null&&elemData!==undefined)}
function convertCSVtoObject(csv){if(csv==='')return{};var splitArray=csv.split(','),keyValuesArray=[],keyValuesObj={};while(splitArray.length){keyValuesArray.push($.trim(splitArray[0]).split(':'));splitArray.shift()}
while(keyValuesArray.length){keyValuesObj[$.trim(keyValuesArray[0][0])]=$.trim(keyValuesArray[0][1]);keyValuesArray.shift()}
return keyValuesObj}})(jQuery)
;/**
* @preserve FastClick: polyfill to remove click delays on browsers with touch UIs.
*
* @version 0.6.11
* @codingstandard ftlabs-jsv2
* @copyright The Financial Times Limited [All Rights Reserved]
* @license MIT License (see LICENSE.txt)
*/
function FastClick(a){"use strict";var b,c=this;if(this.trackingClick=!1,this.trackingClickStart=0,this.targetElement=null,this.touchStartX=0,this.touchStartY=0,this.lastTouchIdentifier=0,this.touchBoundary=10,this.layer=a,!a||!a.nodeType)throw new TypeError("Layer must be a document node");this.onClick=function(){return FastClick.prototype.onClick.apply(c,arguments)},this.onMouse=function(){return FastClick.prototype.onMouse.apply(c,arguments)},this.onTouchStart=function(){return FastClick.prototype.onTouchStart.apply(c,arguments)},this.onTouchMove=function(){return FastClick.prototype.onTouchMove.apply(c,arguments)},this.onTouchEnd=function(){return FastClick.prototype.onTouchEnd.apply(c,arguments)},this.onTouchCancel=function(){return FastClick.prototype.onTouchCancel.apply(c,arguments)},FastClick.notNeeded(a)||(this.deviceIsAndroid&&(a.addEventListener("mouseover",this.onMouse,!0),a.addEventListener("mousedown",this.onMouse,!0),a.addEventListener("mouseup",this.onMouse,!0)),a.addEventListener("click",this.onClick,!0),a.addEventListener("touchstart",this.onTouchStart,!1),a.addEventListener("touchmove",this.onTouchMove,!1),a.addEventListener("touchend",this.onTouchEnd,!1),a.addEventListener("touchcancel",this.onTouchCancel,!1),Event.prototype.stopImmediatePropagation||(a.removeEventListener=function(b,c,d){var e=Node.prototype.removeEventListener;"click"===b?e.call(a,b,c.hijacked||c,d):e.call(a,b,c,d)},a.addEventListener=function(b,c,d){var e=Node.prototype.addEventListener;"click"===b?e.call(a,b,c.hijacked||(c.hijacked=function(a){a.propagationStopped||c(a)}),d):e.call(a,b,c,d)}),"function"==typeof a.onclick&&(b=a.onclick,a.addEventListener("click",function(a){b(a)},!1),a.onclick=null))}FastClick.prototype.deviceIsAndroid=navigator.userAgent.indexOf("Android")>0,FastClick.prototype.deviceIsIOS=/iP(ad|hone|od)/.test(navigator.userAgent),FastClick.prototype.deviceIsIOS4=FastClick.prototype.deviceIsIOS&&/OS 4_\d(_\d)?/.test(navigator.userAgent),FastClick.prototype.deviceIsIOSWithBadTarget=FastClick.prototype.deviceIsIOS&&/OS ([6-9]|\d{2})_\d/.test(navigator.userAgent),FastClick.prototype.needsClick=function(a){"use strict";switch(a.nodeName.toLowerCase()){case"button":case"select":case"textarea":if(a.disabled)return!0;break;case"input":if(this.deviceIsIOS&&"file"===a.type||a.disabled)return!0;break;case"label":case"video":return!0}return/\bneedsclick\b/.test(a.className)},FastClick.prototype.needsFocus=function(a){"use strict";switch(a.nodeName.toLowerCase()){case"textarea":return!0;case"select":return!this.deviceIsAndroid;case"input":switch(a.type){case"button":case"checkbox":case"file":case"image":case"radio":case"submit":return!1}return!a.disabled&&!a.readOnly;default:return/\bneedsfocus\b/.test(a.className)}},FastClick.prototype.sendClick=function(a,b){"use strict";var c,d;document.activeElement&&document.activeElement!==a&&document.activeElement.blur(),d=b.changedTouches[0],c=document.createEvent("MouseEvents"),c.initMouseEvent(this.determineEventType(a),!0,!0,window,1,d.screenX,d.screenY,d.clientX,d.clientY,!1,!1,!1,!1,0,null),c.forwardedTouchEvent=!0,a.dispatchEvent(c)},FastClick.prototype.determineEventType=function(a){"use strict";return this.deviceIsAndroid&&"select"===a.tagName.toLowerCase()?"mousedown":"click"},FastClick.prototype.focus=function(a){"use strict";var b;this.deviceIsIOS&&a.setSelectionRange&&0!==a.type.indexOf("date")&&"time"!==a.type?(b=a.value.length,a.setSelectionRange(b,b)):a.focus()},FastClick.prototype.updateScrollParent=function(a){"use strict";var b,c;if(b=a.fastClickScrollParent,!b||!b.contains(a)){c=a;do{if(c.scrollHeight>c.offsetHeight){b=c,a.fastClickScrollParent=c;break}c=c.parentElement}while(c)}b&&(b.fastClickLastScrollTop=b.scrollTop)},FastClick.prototype.getTargetElementFromEventTarget=function(a){"use strict";return a.nodeType===Node.TEXT_NODE?a.parentNode:a},FastClick.prototype.onTouchStart=function(a){"use strict";var b,c,d;if(a.targetTouches.length>1)return!0;if(b=this.getTargetElementFromEventTarget(a.target),c=a.targetTouches[0],this.deviceIsIOS){if(d=window.getSelection(),d.rangeCount&&!d.isCollapsed)return!0;if(!this.deviceIsIOS4){if(c.identifier===this.lastTouchIdentifier)return a.preventDefault(),!1;this.lastTouchIdentifier=c.identifier,this.updateScrollParent(b)}}return this.trackingClick=!0,this.trackingClickStart=a.timeStamp,this.targetElement=b,this.touchStartX=c.pageX,this.touchStartY=c.pageY,a.timeStamp-this.lastClickTime<200&&a.preventDefault(),!0},FastClick.prototype.touchHasMoved=function(a){"use strict";var b=a.changedTouches[0],c=this.touchBoundary;return Math.abs(b.pageX-this.touchStartX)>c||Math.abs(b.pageY-this.touchStartY)>c?!0:!1},FastClick.prototype.onTouchMove=function(a){"use strict";return this.trackingClick?((this.targetElement!==this.getTargetElementFromEventTarget(a.target)||this.touchHasMoved(a))&&(this.trackingClick=!1,this.targetElement=null),!0):!0},FastClick.prototype.findControl=function(a){"use strict";return void 0!==a.control?a.control:a.htmlFor?document.getElementById(a.htmlFor):a.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea")},FastClick.prototype.onTouchEnd=function(a){"use strict";var b,c,d,e,f,g=this.targetElement;if(!this.trackingClick)return!0;if(a.timeStamp-this.lastClickTime<200)return this.cancelNextClick=!0,!0;if(this.cancelNextClick=!1,this.lastClickTime=a.timeStamp,c=this.trackingClickStart,this.trackingClick=!1,this.trackingClickStart=0,this.deviceIsIOSWithBadTarget&&(f=a.changedTouches[0],g=document.elementFromPoint(f.pageX-window.pageXOffset,f.pageY-window.pageYOffset)||g,g.fastClickScrollParent=this.targetElement.fastClickScrollParent),d=g.tagName.toLowerCase(),"label"===d){if(b=this.findControl(g)){if(this.focus(g),this.deviceIsAndroid)return!1;g=b}}else if(this.needsFocus(g))return a.timeStamp-c>100||this.deviceIsIOS&&window.top!==window&&"input"===d?(this.targetElement=null,!1):(this.focus(g),this.deviceIsIOS4&&"select"===d||(this.targetElement=null,a.preventDefault()),!1);return this.deviceIsIOS&&!this.deviceIsIOS4&&(e=g.fastClickScrollParent,e&&e.fastClickLastScrollTop!==e.scrollTop)?!0:(this.needsClick(g)||(a.preventDefault(),this.sendClick(g,a)),!1)},FastClick.prototype.onTouchCancel=function(){"use strict";this.trackingClick=!1,this.targetElement=null},FastClick.prototype.onMouse=function(a){"use strict";return this.targetElement?a.forwardedTouchEvent?!0:a.cancelable?!this.needsClick(this.targetElement)||this.cancelNextClick?(a.stopImmediatePropagation?a.stopImmediatePropagation():a.propagationStopped=!0,a.stopPropagation(),a.preventDefault(),!1):!0:!0:!0},FastClick.prototype.onClick=function(a){"use strict";var b;return this.trackingClick?(this.targetElement=null,this.trackingClick=!1,!0):"submit"===a.target.type&&0===a.detail?!0:(b=this.onMouse(a),b||(this.targetElement=null),b)},FastClick.prototype.destroy=function(){"use strict";var a=this.layer;this.deviceIsAndroid&&(a.removeEventListener("mouseover",this.onMouse,!0),a.removeEventListener("mousedown",this.onMouse,!0),a.removeEventListener("mouseup",this.onMouse,!0)),a.removeEventListener("click",this.onClick,!0),a.removeEventListener("touchstart",this.onTouchStart,!1),a.removeEventListener("touchmove",this.onTouchMove,!1),a.removeEventListener("touchend",this.onTouchEnd,!1),a.removeEventListener("touchcancel",this.onTouchCancel,!1)},FastClick.notNeeded=function(a){"use strict";var b,c;if("undefined"==typeof window.ontouchstart)return!0;if(c=+(/Chrome\/([0-9]+)/.exec(navigator.userAgent)||[,0])[1]){if(!FastClick.prototype.deviceIsAndroid)return!0;if(b=document.querySelector("meta[name=viewport]")){if(-1!==b.content.indexOf("user-scalable=no"))return!0;if(c>31&&window.innerWidth<=window.screen.width)return!0}}return"none"===a.style.msTouchAction?!0:!1},FastClick.attach=function(a){"use strict";return new FastClick(a)},"undefined"!=typeof define&&define.amd?define(function(){"use strict";return FastClick}):"undefined"!=typeof module&&module.exports?(module.exports=FastClick.attach,module.exports.FastClick=FastClick):window.FastClick=FastClick;
;var FE={};jQuery(function(){"use strict";homebrew.Carousel.prototype.options.transitions.enable=Modernizr.csstransitions;homebrew.Tooltip.prototype.options.appendTo='#mainContent';homebrew.Tooltip.prototype.options.transitions.enable=Modernizr.csstransitions;jQuery.extend(FE,{$els:{backToTop:jQuery('#globalBackToTop'),body:jQuery('body'),mainSite:jQuery('#mainSite'),pageOverlay:jQuery('#pageOverlay'),root:jQuery('html')},events:{transitionEnd:homebrew.events.transitionEnd||'transitionend oTransitionEnd otransitionend webkitTransitionEnd msTransitionEnd',animationEnd:homebrew.events.animationEnd||'animationend webkitAnimationEnd MSAnimationEnd oAnimationEnd'},browser:homebrew.browser,baseURL:(typeof fileUrl==='string')?fileUrl:(window.location.href.indexOf('')>-1)?'':''});if(!FE.$els.pageOverlay.length){FE.$els.pageOverlay=jQuery('<div class="page-overlay" id="pageOverlay" />').appendTo(FE.$els.mainSite)}
if(!FE.$els.backToTop.length){FE.$els.backToTop=jQuery('<a href="#top" title="Back To Top" class="main-back-to-top" id="mainBackToTop" />').appendTo('#mainContent');FE.$els.backToTop.on('click',function(e){e.preventDefault();jQuery('html, body').animate({scrollTop:0},400)});jQuery(window).on('scroll.toggleBackToTop',homebrew.utils.throttle(function(){FE.$els.backToTop.toggleClass('is-shown',jQuery(window).scrollTop()>jQuery(window).height()*0.5)},50))}
if(typeof FE.browser==='undefined'){FE.browser={ie:FE.$els.root.hasClass('ie'),ie9:FE.$els.root.hasClass('ie9'),lt9:FE.$els.root.hasClass('lt9'),ie8:FE.$els.root.hasClass('ie8'),lt8:FE.$els.root.hasClass('lt8'),ie7:FE.$els.root.hasClass('ie7'),firefox:(window.mozIndexedDB!==undefined)}}
jQuery.extend(!0,FE,{alert:function(args){this.showAlertPopup(args,'alert')},confirm:function(args){this.showAlertPopup(args,'confirm')},showAlertPopup:function(args,method){args=args||{};var $popup=jQuery('#FE__alertPopup');if(!$popup.length){$popup=jQuery(['<div class="ssf-popup text-center" id="FE__alertPopup">','<h2 class="title space-bottom-2x" />','<div class="popup-message" />','<div class="space-top-2x">','<a href="#/" class="button padded xlarge okay-button">Okay</a>','<a href="#/" class="button padded xlarge space-left cancel-button" style="display: none;">Cancel</a>','</div>','</div>'].join('')).appendTo('body');$popup.popupify({addCloseBtns:!1,closeOnOverlay:!1})}
if(jQuery('body').hasClass('popup-is-shown')&&$popup.hasClass('is-shown')){return}
var $title=$popup.find('.title'),$message=$popup.find('.popup-message'),$prevPopup=jQuery('.popup-is-shown').find('.ssf-popup.is-shown');if(args.title)$title.html(args.title);if(args.message)$message.html(args.message);$popup.find('.cancel-button').toggle(method==='confirm');$popup.find('.okay-button, .cancel-button').off('.alert').on('click.alert',function(){if($prevPopup.length&&typeof $prevPopup.eq(0).data('popupify')!=='undefined'){$prevPopup.data('popupify').reveal()}else{$popup.data('popupify').conceal()}
if(typeof args.onConfirm==='function'){if(method==='confirm'){args.onConfirm(jQuery(this).is('.okay-button'))}else{args.onConfirm()}}});$popup.data('popupify').reveal()},FootnoteAnchor:function(){this.init.apply(this,arguments)},Hasher:function(options){this.options=options},HeightSlider:function(heightSlider){if(typeof heightSlider==='string')heightSlider=jQuery(heightSlider);var self=this;jQuery.extend(self,{reveal:function(){if(Modernizr.csstransitions){if(heightSlider.height()!==0)return;var targetHeight=0;heightSlider.css('height','auto');targetHeight=heightSlider.height();heightSlider.css('height','');setTimeout(function(){heightSlider.off(FE.events.transitionEnd).on(FE.events.transitionEnd,function(){heightSlider.off(FE.events.transitionEnd).removeClass('is-transitionable').css('height','').addClass('is-toggled')}).addClass('is-transitionable').css('height',targetHeight+'px')},1)}else{if(heightSlider.css('display')!=='none')return;heightSlider.slideDown(400,function(){jQuery(this).addClass('is-toggled')})}},conceal:function(){if(Modernizr.csstransitions){if(heightSlider.height()===0)return;heightSlider.css('height',heightSlider.height()+'px').removeClass('is-toggled');setTimeout(function(){heightSlider.off(FE.events.transitionEnd).on(FE.events.transitionEnd,function(){heightSlider.off(FE.events.transitionEnd);heightSlider.removeClass('is-transitionable');heightSlider.css('height','')}).addClass('is-transitionable').css('height','0px')},1)}else{if(heightSlider.css('display')==='none')return;heightSlider.removeClass('is-toggled').slideUp(400)}},toggle:function(){if(Modernizr.csstransitions){heightSlider.trigger((heightSlider.height()===0)?'reveal':'conceal')}else{heightSlider.trigger((heightSlider.css('display')==='none')?'reveal':'conceal')}}});heightSlider.data('height-slider',self)},StickyColumn:function(){this.load.apply(this,arguments)},getHash:function(){var hash=window.location.hash;if(hash===''||hash.substr(1,1)==='.'){return''}else{return hash}},getQueryStr:function(str){var search=window.location.search;if(!search)return!1;if(search.substr(0,1)==='?'){search=search.substr(1)}
var splitSearch=search.split('&');keyValuePairs={};splitSearch.map(function(searchStr){var splitSearchStr=searchStr.split('=');splitSearchStr=splitSearchStr.map(function(str){return jQuery.trim(str)});keyValuePairs[splitSearchStr[0]]=splitSearchStr[1]});if(typeof str==='string'){return(typeof keyValuePairs[str]==='undefined')?!1:keyValuePairs[str]}else{return keyValuePairs}},initContentTabbers:function(){jQuery('.js-togglerify-tabs').each(function(){var $this=jQuery(this),$nestedTabs=$this.find('.js-togglerify-tabs').find('.tab'),$tabs=$this.find('.tab').not($nestedTabs),$nestedContents=$this.find('.js-togglerify-tabs').find('.tab-content'),$contents=$this.find('.tab-content').not($nestedContents);$tabs.togglerify('destroy').togglerify({toggledClass:'current',selfToggleable:!1,singleActive:!0,content:function(index){return $contents.eq(index)}}).on('afterToggleOn',function(){jQuery(window).trigger('resize')}).on('toggleOff',function(e,$thisTab,$thisContent){$thisContent.find('.video-holder').find('iframe').each(function(){this.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}','*')})})})},initContentShowers:function(){var types={TAB:'tab',TOGGLER:'toggler',NOTES:'notes'},$notesToggler=jQuery('#notesToggler'),$notesContent=jQuery('#notesContent');jQuery('.js-show-content').each(function(){var $this=jQuery(this),thisHref=$this.attr('href');if(typeof thisHref!=='string'){console.log($this);console.error("No target specified. Set the target's ID as the `href` attribute on the element.");return}
var $target=jQuery($this.attr('href'));if(!$target.length){console.log($this);console.error("Target `"+$this.attr('href')+"` does not exist.");return}
var data=$this.data('show-content-options');if(!data){console.log($this);console.error('Options undeclared. Declare the options using the `data-show-content-options` attribute on the element.');return}
var options=(typeof data==='string')?homebrew.getKeyValuePairsFromString(data):{};if(!options.type){console.log($this);console.error('Options declared, but no type specified.');return}
var scrollArgs=[$target];if(options.smoothScroll!==!0){scrollArgs.push('snap')}
switch(options.type){case types.TAB:$this.on('click',function(e){e.preventDefault();var $tabContent=$target.closest('.tab-content'),$heightSyncers=$tabContent.find('.js-sync-height-wrapper');if($tabContent.hasClass('current')){FE.scrollTo.apply(null,scrollArgs)}else{if($heightSyncers.length){$heightSyncers.last().one('afterSync',function(){FE.scrollTo.apply(null,scrollArgs)});$tabContent.data('togglerify').toggleOn()}else{$tabContent.data('togglerify').toggleOn();FE.scrollTo.apply(null,scrollArgs)}}});break;case types.NOTES:if(!$notesToggler.length||!$notesContent.length){return}
$this.on('click',function(e){e.preventDefault();if(!$notesToggler.hasClass('is-toggled')){$notesToggler.togglerify('toggleOn',{noSlide:!0})}
FE.scrollTo($target)});break;default:console.log($this);var errorMsg=['The type `',options.type,'` is not supported. Our currently supported types are: '];jQuery.each(types,function(key,value){errorMsg.push('\n'+value)});errorMsg.push('\n\nCheck the type again.');console.error(errorMsg.join(''));break}})},initDropdownSwitchers:function($scope){var $holders=($scope&&$scope.length)?$scope.find('.dropdown-switcher-holder'):jQuery('.dropdown-switcher-holder');if(!$holders.length)return;$holders.each(function(){var $dropdown=jQuery(this).find('.dropdown-switcher'),$contents=jQuery(this).find('.dropdown-content');$dropdown.on('change',function(){$contents.hide().eq(this.selectedIndex).show()}).trigger('change')})},initNumberTabbers:function(){jQuery('.number-tabber').each(function(){var $tabs=jQuery(this).find('.number-tabber__tabs').children('li'),$contents=jQuery(this).find('.number-tabber__contents').children('li');$tabs.togglerify('destroy').togglerify({toggledClass:'current',singleActive:!0,selfToggleable:!1,content:function(index){return $contents.eq(index)}})})},initPage:function(){jQuery('.js-dropdownify').dropdownify();jQuery('.js-inputify').inputify();jQuery.each(FE,function(key,value){if(key.indexOf('init')===0&&key!=='initPage')value()});FE.loadXMLForm(jQuery('.js-xml-form-holder'));FE.loadXMLTable(jQuery('.js-xml-tbl-holder'));FE.loadXMLLocations(jQuery('.js-xml-locations-holder'));if(FE.browser.ie)jQuery('[placeholder]').placeholderify()},initSectionSnap:function(){if(!Modernizr.touch)return;var hash=FE.getHash();if(!hash||hash.indexOf('#/')>-1)return;var $hash=jQuery(hash);if(!$hash.length||!$hash.is('.section'))return;setTimeout(function(){FE.scrollTo($hash)},25)},initSelfTogglers:function(){jQuery('.self-toggler__toggler').togglerify({singleActive:!1,slide:!0,content:function(){return jQuery(this).next()}})},initSectionContentToggler:function(){var $sectionContentTogglers=jQuery('.section-content-toggler');if(!$sectionContentTogglers.length)return;var $sectionToggleableContents=jQuery('.section-toggleable-content'),$sectionDropdown=jQuery('<select>'),optionsStrArray=[];$sectionContentTogglers.togglerify({selfToggleable:!1,singleActive:!0,content:function(index){return $sectionToggleableContents.eq(index)}}).each(function(index){var $dropdownOption=jQuery(['<option>',jQuery.trim(jQuery(this).find('.toggler__title').text()),'</option>'].join(''));$dropdownOption.data('section-content-toggler',jQuery(this));$dropdownOption.appendTo($sectionDropdown)});jQuery('<div class="column show-for-small-down" />').prepend($sectionDropdown).prependTo($sectionContentTogglers.eq(0).closest('.row'));$sectionDropdown.dropdownify({markups:{holder:'<div class="expand space-bottom" />'}}).on('change',function(){var $thisToggler=jQuery(this).find('option:checked').data('section-content-toggler');$thisToggler.togglerify('toggleOn')});FE.watchSize('small',function(isSmallScreen){var method=(isSmallScreen)?'deactivate':'activate';$sectionContentTogglers.togglerify(method)})},initSmallNav:function(){if(Modernizr.touch||jQuery('#mainSmallNav').data('initSmallNav')===!0)return;jQuery('#mainSmallNav').data('initSmallNav',!0);var prevScrollTop=jQuery(window).scrollTop(),navHeight=jQuery('#mainSmallNav').height()+jQuery('#mainNav').height();jQuery(window).on('resize.navHider',function(){navHeight=jQuery('#mainSmallNav').height()+jQuery('#mainNav').height()}).trigger('resize.navHider').on('scroll.navHider',function(){var currentScrollTop=jQuery(window).scrollTop(),partialHiddenBool=currentScrollTop>47,hiddenBool=currentScrollTop>=prevScrollTop&¤tScrollTop>navHeight&&!FE.$els.body.hasClass('mobile-nav-is-shown');jQuery('body').toggleClass('main-header-is-partially-hidden',partialHiddenBool);jQuery('body').toggleClass('main-header-is-hidden',hiddenBool);prevScrollTop=currentScrollTop}).trigger('scroll.navHider')},initSyncHeightWrappers:function($scope){var $syncHeightWrappers=jQuery('.js-sync-height-wrapper');if(!$syncHeightWrappers.length)return;$syncHeightWrappers.each(function(){var selectors=jQuery(this).data('sync-height-selector');if(!selectors)return;var selectorsSplitArray=selectors.split(',');for(var i=selectorsSplitArray.length-1;i>-1;i--){selectorsSplitArray[i]=jQuery.trim(selectorsSplitArray[i])}
jQuery(this).heightSyncify({items:selectorsSplitArray})})},initTooltips:function(){var $els=jQuery('.icon--question[title], .js-tooltipify');$els.tooltipify()},initQuickLinks:function(){var $quicklinksToggler=jQuery('#mainNav__quicklinksToggler'),$quicklinks=jQuery('#mainNav__quicklinks');if(!$quicklinksToggler.length||!$quicklinks.length)return;if($quicklinksToggler.data('initQuickLinks')===!0)return;$quicklinksToggler.data('initQuickLinks',!0);var mouseupEv='mouseup.mainNavQuicklinksFauxBlur',resizeEv='resize.limitQuicklinksHeight';$quicklinksToggler.togglerify({slide:!0,content:function(){return $quicklinks}}).togglerify('deactivate').on({click:function(e){e.preventDefault();var $thisToggler=jQuery(this);if($thisToggler.hasClass('is-toggled')){$thisToggler.togglerify('toggleOff')}else{var heightLimit=jQuery(window).height()-jQuery('#mainNav').height(),contentHeight;$quicklinks.css('height','auto');contentHeight=$quicklinks.height();$quicklinks.css('height','');if(contentHeight>=heightLimit){$thisToggler.togglerify('toggleOn',{contentHeight:heightLimit})}else{$thisToggler.togglerify('toggleOn')}}},toggleOn:function(e,$thisToggler,$target){jQuery(document).on(mouseupEv,function(e){var container=$thisToggler.add($target);if(!container.is(e.target)&&container.has(e.target).length===0){jQuery(document).off(mouseupEv);$target.data('togglerify').toggleOff()}});jQuery(window).on(resizeEv,function(){if(!$thisToggler.hasClass('is-toggled'))return;var heightLimit=jQuery(window).height()-jQuery('#mainNav').height();$quicklinks.css('height','');if($quicklinks.height()>=heightLimit){$quicklinks.height(heightLimit)}})},toggleOff:function(){jQuery(document).off(mouseupEv);jQuery(window).off(resizeEv)}})},loadXMLForm:function($holders){$holders=jQuery($holders);if(!$holders.length)return;$holders.each(function(){var $thisHolder=jQuery(this);if(jQuery.data(this,'loaded-xml-form')===!0)return;var xmlURL=$thisHolder.data('xml-form-url');if(typeof xmlURL!=='string')return;jQuery.ajax({type:'GET',url:xmlURL,dataType:'xml',success:function(data){makeXMLForm(data,$thisHolder);FE.initFancyPlaceholders($thisHolder);FE.initInputFocus($thisHolder);$thisHolder.find('.js-inputify').inputify();$thisHolder.find('.js-dropdownify').dropdownify();$thisHolder.data('loaded-xml-form',!0)},error:function(d){console.log(d)}})});function makeXMLForm(data,$holder){var $data=jQuery(data),$inputs=$data.find('formInput'),uniqueID=new Date().getTime()+'_'+Math.round(Math.random()*10000),$xmlForm=jQuery(['<form action="https://docs.google.com/forms/d/',getText($data.find('formID')),'/formResponse"','target="hiddenIframe_',uniqueID,'"','method="post" class="xml-form-asset xml-form-contents" />'].join('')).prependTo($holder),xmlFormStrArray=[];xmlFormStrArray.push(['<div class="row collapse space-bottom medium-space-bottom-2x">',makeTitle($data.find('formTitle')),'</div>'].join(''));$inputs.each(function(index){var $thisInput=jQuery(this),uniqueInputID=new Date().getTime()+'_'+index,name=getText($thisInput.find('name')),label=getText($thisInput.find('label')),type=getText($thisInput.find('type')).toLowerCase(),required=getText($thisInput.find('required')).toLowerCase(),pattern=getText($thisInput.find('pattern')),tooltip=getText($thisInput.find('tooltip'));switch(type){case 'text':case 'number':case 'email':case 'textarea':var validifyStrArray=['response: #response_'+uniqueInputID],floaterStrArray=[];if(!pattern){if(type==='number'){validifyStrArray.unshift('pattern: numbers')}else if(type==='email'){validifyStrArray.unshift('pattern: email')}}
if(required==='yes'){validifyStrArray.unshift('required: true')}
validifyStrArray.push('floater: #floater_roi_'+uniqueInputID);floaterStrArray.push('<div class="validify-floater" id="floater_roi_',uniqueInputID,'">');if(required==='yes'){floaterStrArray.push(['<span class="validify-floater__message validify-floater__message--failed-required">','This input is required.','</span>'].join(''))}
var errorMessage=getText($thisInput.find('errorMessage'));if(type==='number'){errorMessage='This input should consist of numbers only.'}else if(type==='email'){errorMessage='The address should be in this format: username@youremail.com'}else if(!errorMessage){errorMessage='Invalid input.'}
floaterStrArray.push(['<span class="validify-floater__message validify-floater__message--failed-pattern">',errorMessage,'</span>'].join(''));floaterStrArray.push('</div>');var elementStr;if(type==='textarea'){elementStr=['<textarea']}else{elementStr=['<input',' type="',(type==='email')?'email':'text','"']}
elementStr.push(' data-validify="',validifyStrArray.join(', '),'"',(pattern)?' data-validify-pattern="'+pattern+'"':'',' name="',name,'"',' class="field expand"',' id="roi_',uniqueInputID,'"',(type==='textarea')?'></textarea>':' />');xmlFormStrArray.push(['<div class="form-obj',(tooltip)?' form-obj--with-tooltip':'','">','<div class="field-holder expand">',elementStr.join(''),'<label for="roi_',uniqueInputID,'" class="field-holder__label">',label,(required==='yes')?'<span class="text-red">*</span>':'','</label>','</div>','<span class="validify-responses form-obj__icon" id="response_',uniqueInputID,'">','<span class="validify-response validify-response--success">','<i class="icon icon--success-tick"></i>','</span>','</span>',(tooltip)?'<i title="'+tooltip+'" class="icon icon--question round-circle form-obj__icon"></i>':'',floaterStrArray.join(''),'</div>'].join(''));break;case 'dropdown':var validifyStrArray=['response: #response_'+uniqueInputID],floaterStr='';if(required==='yes'){validifyStrArray.unshift('required: true');validifyStrArray.push('floater: #floater_roi_'+uniqueInputID);floaterStr=['<div class="validify-floater" id="floater_roi_',uniqueInputID,'">','<span class="validify-floater__message validify-floater__message--failed-required">','This input is required.','</span>','</div>'].join('')}
var optionsArray=getText($thisInput.find('options')).split('\n'),options=[];while(optionsArray.length){options.push(['<option value="',optionsArray[0],'">',optionsArray[0],'</option>'].join(''));optionsArray.shift()}
xmlFormStrArray.push(['<div class="form-obj',(tooltip)?' form-obj--with-tooltip':'','">','<span class="expand js-dropdownify">','<select data-validify="',validifyStrArray.join(', '),'" name="',name,'">','<option value="">',label,(required==='yes')?'*':'','</option>',options.join(''),'</select>','</span>','<span class="validify-responses form-obj__icon" id="response_',uniqueInputID,'">','<span class="validify-response validify-response--success">','<i class="icon icon--success-tick"></i>','</span>','</span>',(tooltip)?'<i title="'+tooltip+'" class="icon icon--question round-circle form-obj__icon"></i>':'',floaterStr,'</div>'].join(''));break;case 'radio':case 'checkbox':var validifyStrArray=['groupResponse: #response_'+uniqueInputID],validifyRequiredStr='';if(required==='yes'){validifyStrArray.unshift('required: true');validifyRequiredStr=['<span class="validify-response validify-response--failed-required">','<br />This input is required.','</span>'].join('')}
var optionsArray=getText($thisInput.find('options')).split('\n'),optionsLabelsArray=getText($thisInput.find('optionsLabels')).split('\n'),options=[],currentOption;for(var i=0,ii=optionsArray.length;i<ii;i++){if(optionsArray[i]==='__other_option__'){}else{options.push(['<label>','<input type="',type,'" name="',name,'" data-validify value="',optionsArray[i],'" class="js-inputify" /> ',(typeof optionsLabelsArray[i]==='string'&&optionsLabelsArray[i])?optionsLabelsArray[i]:optionsArray[i],'</label>'].join(''))}}
xmlFormStrArray.push(['<div class="form-obj" data-validify-group="',validifyStrArray.join(', '),'">','<p class="form-obj__label">',label,(required==='yes')?'<span class="text-red">*</span>':'',(tooltip)?' <i title="'+tooltip+'" class="icon icon--question round-circle"></i>':'',' <span class="validify-responses" id="response_',uniqueInputID,'">','<span class="validify-response validify-response--success">','<i class="icon icon--success-tick"></i>','</span>',validifyRequiredStr,'</span>','</p>',options.join(''),'</div>'].join(''));break}});xmlFormStrArray.push(['<div class="text-center space-top medium-space-top-2x">','<input type="submit" value="Submit" class="button padded xlarge" />','</div>'].join(''));$xmlForm.append(xmlFormStrArray.join(''));$xmlForm.find('.icon--question[title]').tooltipify();var $hiddenIframe=jQuery('<iframe data-submitted="false" name="hiddenIframe_'+uniqueID+'" style="display: none;" />').appendTo($xmlForm);$hiddenIframe.on('load',function(){if(jQuery(this).data('submitted')!==!0)return;$xmlForm.addClass('is-hidden');$holder.find('.xml-form-thanks').addClass('is-shown');FE.scrollTo($holder.find('.xml-form-thanks'))});$xmlForm.validify().on('submit',function(e){var validifyData=jQuery.data(this,'validify');validifyData.set('strict',!0).validate();if(validifyData.valid!==!0){var $errorInput=jQuery(this).find('.is-failed').eq(0);FE.scrollTo($errorInput,function(){$errorInput.focus().select()});e.preventDefault()}else{$hiddenIframe.data('submitted',!0);$xmlForm.find('input[type="submit"]').addClass('is-loading').prop('disabled',!0)}})}
function getText($node){return($node.length)?jQuery.trim($node.text()):''}
function makeTitle($title){var title=getText($title);if(title){return['<div class="large-6 column">','<h3>',title,'</h3>','</div>','<div class="large-6 column medium-down-pad-vertical large-text-right align-to-h3 text-dark-grey">','<span class="text-red">*</span> Please fill in the mandatory fields.','</div>'].join('')}else{return['<div class="column medium-down-pad-vertical large-text-right text-dark-grey">','<span class="text-red">*</span> Please fill in the mandatory fields.','</div>'].join('')}}},loadXMLTable:function($holders){$holders=jQuery($holders);if(!$holders.length)return;var worksheets={},xmlSerializer=new XMLSerializer();$holders.each(function(){var $thisHolder=jQuery(this);if($thisHolder.data('loaded-xml-table')===!0)return;var xmlURL=$thisHolder.data('xml-table-url');if(typeof xmlURL!=='string')return;jQuery.ajax({type:'GET',url:xmlURL,dataType:'xml',success:function(data){var xmlStyles=getXMLStyles(data);makeXMLTable(data,xmlStyles,$thisHolder);attachRowHoverers();$thisHolder.data('loaded-xml-table',!0)},error:function(d){console.log(d)}})});function makeXMLTable(data,xmlStyles,$holder){var $data=jQuery(data),$worksheets=$data.find('Worksheet'),dropdown={},finalTableStrArr=[];worksheets={};$worksheets.each(function(){var $thisWorksheet=jQuery(this),thisWorksheetName=$thisWorksheet.attr('ss:Name').toLowerCase();if(thisWorksheetName.indexOf('dropdown')===0){$thisWorksheet.find('Data').each(function(){var $Data=jQuery(this),DataIndex=$Data.index(),DataText=jQuery(this).text().toLowerCase();switch(DataText){case 'dropdown label':dropdown.__label=jQuery(this).closest('Row').next('Row').find('Data').text();break;case 'option label':jQuery(this).closest('Row').nextUntil().each(function(){var optionLabelText=jQuery(this).find('Data').eq(DataIndex).text();if(optionLabelText==='')return;dropdown[jQuery(this).find('Data').eq(DataIndex).text()]=jQuery(this).find('Data').eq(DataIndex+1).text().toLowerCase()});break}})}else{worksheets[thisWorksheetName]=$thisWorksheet}});if(jQuery.isEmptyObject(dropdown)){var worksheetNames=[];jQuery.each(worksheets,function(key,value){worksheetNames.push(key)});finalTableStrArr.push(iterateWorksheetsArray(worksheetNames,xmlStyles))}else{var dropdownOptionsArray=[],dropdownContentsArray=[];jQuery.each(dropdown,function(key,value){if(key==='__label')return;dropdownOptionsArray.push(key);var dropdownWorksheets={},valueSplitArray=value.split('\n');if(valueSplitArray.length===1){valueSplitArray=valueSplitArray[0].split(',')}
for(var i=valueSplitArray.length-1;i>-1;i--){valueSplitArray[i]=jQuery.trim(valueSplitArray[i])}
dropdownContentsArray.push(iterateWorksheetsArray(valueSplitArray,xmlStyles))});var dropdownOptionsStrArray=[],dropdownContentsStrArray=[];while(dropdownOptionsArray.length){dropdownOptionsStrArray.push(['<option>',dropdownOptionsArray.shift(),'</option>'].join(''))}
while(dropdownContentsArray.length){dropdownContentsStrArray.push(['<div class="dropdown-content">',dropdownContentsArray.shift(),'</div>'].join(''))}
finalTableStrArr.push(['<div class="dropdown-switcher-holder">','<div class="text-center text-large">',dropdown.__label,'<span class="js-dropdownify tbl-dropdown">','<select class="dropdown-switcher">',dropdownOptionsStrArray.join(''),'</select>','</span>','</div>','<div class="dropdown-contents-holder">',dropdownContentsStrArray.join(''),'</div>','</div>'].join(''))}
$holder.append(finalTableStrArr.join(''));FE.initFootnotes($holder);if(!$holder.find('.js-dropdownify').length)return;$holder.find('.js-dropdownify').dropdownify();FE.initDropdownSwitchers($holder)}
function iterateWorksheetsArray(worksheetNames,xmlStyles){var worksheetStrArr=[],currentWorksheetName,mediaClass;while(worksheetNames.length){currentWorksheetName=worksheetNames.shift();if(typeof worksheets[currentWorksheetName]==='undefined'){console.error("FE.loadXMLTable(): Can't find the worksheet '"+currentWorksheetName+"'");continue}
if(currentWorksheetName.indexOf('desktop')===0){mediaClass='show-for-large-up'}else if(currentWorksheetName.indexOf('tabletup')===0){mediaClass='show-for-medium-up'}else if(currentWorksheetName.indexOf('tabletonly')===0){mediaClass='show-for-medium-only'}else if(currentWorksheetName.indexOf('tabletdown')===0){mediaClass='show-for-medium-down'}else if(currentWorksheetName.indexOf('mobile')===0){mediaClass='show-for-small-down'}
worksheetStrArr.push(['<div class="tbl-holder',(typeof mediaClass==='string')?' '+mediaClass:'','">'].join(''));worksheetStrArr.push(makeTableString(worksheets[currentWorksheetName],xmlStyles));worksheetStrArr.push('</div>')}
return(worksheetStrArr.length)?worksheetStrArr.join(''):!1}
function getColumnCount($worksheet){var $worksheetRows=$worksheet.find('Row'),_columnCount=[];$worksheetRows.each(function(){var $cells=jQuery(this).find('Cell');$cells.each(function(){if(!jQuery(this).text()){$cells=$cells.not(jQuery(this))}});_columnCount.push($cells.length)});return Math.max.apply(null,_columnCount)}
function getXMLStyles(data){var $styles=jQuery(data).find('Style'),styleObj={};$styles.each(function(){var $thisStyle=jQuery(this),$alignment=$thisStyle.find('Alignment'),$interior=$thisStyle.find('Interior'),$numberFormat=$thisStyle.find('NumberFormat'),$font=$thisStyle.find('Font'),thisStyleObj={};if($alignment.length&&hasAttributes($alignment,['ss:Horizontal','ss:Vertical'])){var verticalAlignment,horizontalAlignment;switch($alignment.attr('ss:Vertical')){case 'Top':verticalAlignment='top';break;case 'Center':verticalAlignment='middle';break;case 'Bottom':verticalAlignment='bottom';break}
switch($alignment.attr('ss:Horizontal')){case 'Top':horizontalAlignment='top';break;case 'Center':horizontalAlignment='center';break;case 'Bottom':horizontalAlignment='bottom';break}
thisStyleObj.alignment={'vertical':verticalAlignment,'horizontal':horizontalAlignment}}
if($interior.length&&hasAttributes($interior,['ss:Color'])){thisStyleObj.bgColor=$interior.attr('ss:Color')}
if($font.length&&hasAttributes($font,['ss:Italic','ss:Bold','ss:Underline','ss:Color','ss:Size'])){thisStyleObj.font={'italic':$font.attr('ss:Italic'),'bold':$font.attr('ss:Bold'),'underline':$font.attr('ss:Underline'),'color':$font.attr('ss:Color'),'size':$font.attr('ss:Size')}}
if($numberFormat.length&&hasAttributes($numberFormat,['ss:Format'])){thisStyleObj.numberFormat=$numberFormat.attr('ss:Format')}
styleObj[$thisStyle.attr('ss:ID')]=thisStyleObj});return styleObj}
function makeTableString($worksheet,xmlStyles){var $rows=filterOutEmptyRows($worksheet.find('Row'));if(!$rows.length)return'';var totalColumns=parseInt(getColumnCount($worksheet),10),totalRows=$rows.length,i,ii,j,jj,tableLayout=[];for(i=$rows.length-1;i>-1;i--){tableLayout.push(new Array(totalColumns))}
$rows.each(function(rowIndex){var cellCount=0;jQuery(this).find('Cell').each(function(cellIndex){if(cellCount>=totalColumns)return;var $thisCell=jQuery(this),cellMergeDown=parseInt($thisCell.attr('ss:MergeDown'),10)||0,cellMergeAcross=parseInt($thisCell.attr('ss:MergeAcross'),10)||0;while(typeof tableLayout[rowIndex][cellCount]==='number'){cellCount++}
tableLayout[rowIndex][cellCount]=$thisCell;if(cellMergeAcross){for(i=cellCount,ii=cellCount+cellMergeAcross;i<ii;i++){tableLayout[rowIndex][i+1]=0}
cellCount+=cellMergeAcross}
if(cellMergeDown){for(i=rowIndex+1,ii=rowIndex+cellMergeDown;i<=ii;i++){tableLayout[i][cellCount]=0;if(cellMergeAcross){for(j=cellCount+1,jj=cellCount+cellMergeAcross;j<=jj;j++){tableLayout[i][j]=0}}}}
cellCount++})});var tableStrArr=[],tableStyleID=$worksheet.find('Table').attr('ss:StyleID'),defaultStyle=(xmlStyles[tableStyleID])?xmlStyles[tableStyleID]:{};tableStrArr.push('<table class="default-tbl">');var cellStrArr,cellArray,cell,k,kk;while(tableLayout.length){cellStrArr=[];cellArray=tableLayout.shift();for(k=0,kk=cellArray.length;k<kk;k++){if(typeof cellArray[k]==='undefined'){cellStrArr.push('<td></td>')}else if(typeof cellArray[k]==='object'){cellStrArr.push(makeCellString(cellArray[k],k))}}
if(cellStrArr.length){cellStrArr.unshift('<tr>');cellStrArr.push('</tr>');tableStrArr.push(cellStrArr.join(''))}}
tableStrArr.push('</table>');return tableStrArr.join('');function makeCellString($cell,cellIndex,log){var $thisCell=$cell,cellContent=$thisCell.text();if(cellContent===''){if(cellIndex%2===1){return'<td class="alt"></td>'}else{return'<td></td>'}}
var cellStyle=jQuery.extend({},defaultStyle),cellData=$thisCell.find('Data'),cellDataType=cellData.attr('ss:Type');if(cellDataType==='Number'){var decimalSplit=cellContent.split('.');if(decimalSplit.length>1&&decimalSplit[1].length>2){cellContent=parseFloat(cellContent,10).toFixed(2)}}
if(xmlStyles[$thisCell.attr('ss:StyleID')]){jQuery.extend(cellStyle,xmlStyles[$thisCell.attr('ss:StyleID')])}
var cellNumberFormat=cellStyle.numberFormat,cellMergeDown=parseInt($thisCell.attr('ss:MergeDown'),10)||0,cellMergeAcross=parseInt($thisCell.attr('ss:MergeAcross'),10)||0,cellSSData=$thisCell.children('ss\\:Data'),cellInlineTags={'italic':0,'bold':0,'underline':0},cellTagName=(cellStyle.bgColor&&cellStyle.bgColor!=='#FFFFFF')?'th':'td',cellClassNames=[],cellClassName='',cellRowspan='',cellColspan='',cellInlineStyles=[];if(cellIndex%2===1){cellClassNames.push('alt')}
if(cellSSData.length){cellInlineTags={'bold':cellSSData.find('B').length,'italic':cellSSData.find('I').length,'underline':cellSSData.find('U').length};cellContent=makeCellInlineFormats(cellSSData)}
if(typeof cellStyle.bgColor==='string'){cellInlineStyles.push('background-color: '+cellStyle.bgColor)}
if(typeof cellStyle.alignment==='object'){if(typeof cellStyle.alignment.horizontal==='string'){cellInlineStyles.push('text-align: '+cellStyle.alignment.horizontal)}
if(typeof cellStyle.alignment.vertical==='string'){cellInlineStyles.push('vertical-align: '+cellStyle.alignment.vertical)}}
if(typeof cellStyle.font==='object'){if(typeof cellStyle.font.italic!=='undefined'){cellInlineStyles.push('font-style: italic')}
if(typeof cellStyle.font.bold!=='undefined'){cellInlineStyles.push('font-weight: bold')}
if(typeof cellStyle.font.underline!=='undefined'){cellInlineStyles.push('text-decoration: underline')}
if(typeof cellStyle.font.color!=='undefined'){cellInlineStyles.push('color: '+cellStyle.font.color)}}
if(cellClassNames.length){cellClassName=[' class="',cellClassNames.join(' '),'"'].join('')}
if(cellMergeDown){cellRowspan=[' rowspan="',cellMergeDown+1,'"'].join('')}
if(cellMergeAcross){cellColspan=[' colspan="',cellMergeAcross+1,'"'].join('')}
if(typeof cellNumberFormat!=='undefined'){cellContent=makeCellCurrency(cellNumberFormat,cellContent)}
if(cellInlineStyles.length){cellInlineStyles=[' style="',cellInlineStyles.join('; '),'"'].join('')}else{cellInlineStyles=''}
cellContent=cellContent.replace(/\n/g,'<br />');if(typeof cellStyle.font==='object'&&typeof cellStyle.font.size!=='undefined'&&cellStyle.font.size!=='11'){cellContent=['<span style="font-size: ',Math.round(parseFloat(cellStyle.font.size,10)/11*100,10),'%;">',cellContent,'</span>'].join('')}
return['<',cellTagName,cellClassName,cellRowspan,cellColspan,cellInlineStyles,'>',cellContent,'</',cellTagName,'>'].join('')}}
function makeCellInlineFormats($ssData){var ssDataChildNodes=jQuery.makeArray($ssData[0].childNodes),contentsStr=[];while(ssDataChildNodes.length){contentsStr.push(xmlSerializer.serializeToString(ssDataChildNodes.shift()))}
contentsStr=contentsStr.join('');var cellContentStr=contentsStr,fontMatchArray=cellContentStr.match(/<Font+(.*?)>/g);var inlineStyles;for(var i=0,ii=fontMatchArray.length;i<ii;i++){inlineStyles=getInlineStyles(fontMatchArray[i]);if(inlineStyles===''){cellContentStr=cellContentStr.replace(fontMatchArray[i],'').replace('</Font>','')}else{cellContentStr=cellContentStr.replace(fontMatchArray[i],'<span style="'+inlineStyles+'">').replace('</Font>','</span>')}}
var inlineTags=['b','i','u','sup'],tagName;while(inlineTags.length){tagName=inlineTags.shift();cellContentStr=cellContentStr.replace(new RegExp('<'+tagName+'+(.*?)>','gi'),'<'+tagName+'>').replace(new RegExp('<\/'+tagName+'+(.*?)>','gi'),'</'+tagName+'>')}
return cellContentStr;function getInlineStyles(fontHTMLStr){var splitArray=fontHTMLStr.substring(1,fontHTMLStr.length-1).split(' '),attrStr,splitAttrArray,inlineStylesArray=[];while(splitArray.length){attrStr=splitArray.shift();if(attrStr.indexOf('html:')===-1)continue;splitAttrArray=attrStr.replace(/(html\:)|"/g,'').toLowerCase().split('=');switch(splitAttrArray[0]){case 'color':if(splitAttrArray[1]==='#000000')continue;inlineStylesArray.push(['color: ',splitAttrArray[1]].join(''));break;case 'size':inlineStylesArray.push(['font-size: ',Math.round((parseFloat(splitAttrArray[1],10)/11*100),10),'%'].join(''));break}}
return inlineStylesArray.join('; ')}}
function makeCellCurrency(cellNumberFormat,cellContent){if(cellNumberFormat==='@'||cellNumberFormat==='0')return cellContent;var splitCellContentArray;if(cellNumberFormat==='Currency'){splitCellContentArray=parseFloat(cellContent,10).toFixed(2).split('.');cellContent='RM'+contentWithcommas();if(splitCellContentArray.length>1){cellContent+='.'+splitCellContentArray[1]}}else if(cellNumberFormat==='Fixed'){splitCellContentArray=parseFloat(cellContent,10).toFixed(2).split('.');cellContent=contentWithcommas();if(splitCellContentArray.length>1){cellContent+='.'+splitCellContentArray[1]}}else{var currencyFormatArray=cellNumberFormat.split(';')[0].split(','),currency=currencyFormatArray[0].replace(/\[|\]| |#|\\|"/g,'').replace(/\$/,'').split('-'),decimals=currencyFormatArray[1].split('.');if(currency.length>1)currency=currency[0];if(decimals.length===1){decimals=0}else{decimals=decimals[1].replace(/_\)/g,'').length}
splitCellContentArray=parseFloat(cellContent,10).toFixed(decimals).split('.');cellContent=currency+contentWithcommas();if(splitCellContentArray.length>1){cellContent+='.'+splitCellContentArray[1]}}
return cellContent;function contentWithcommas(){return splitCellContentArray[0].replace(/\B(?=(\d{3})+(?!\d))/g,",")}}
function attachRowHoverers(){$holders.find('[rowspan]').each(function(){var $thisCell=jQuery(this),rowspan=$thisCell.attr('rowspan');if(typeof rowspan!=='string')return;rowspan=parseInt(rowspan,10);var $thisRow=$thisCell.closest('tr'),$nextRows=$thisRow.nextAll('tr').slice(0,rowspan-1);$nextRows.each(function(){jQuery(this).on({mouseenter:function(){$thisCell.addClass('is-hovered')},mouseleave:function(){$thisCell.removeClass('is-hovered')}})})})}
function filterOutEmptyRows($rows){$rows.each(function(){var empty=!0;jQuery(this).find('Cell').each(function(){if(jQuery(this).text()!=='')empty=!1;return!1});if(empty)$rows=$rows.not(jQuery(this))});return $rows}
function hasAttributes($obj,attrArr){while(attrArr.length){if(typeof $obj.attr(attrArr.shift())!=='undefined'){return!0}}
return!1}},loadXMLLocations:function($holders){$holders=jQuery($holders);if(!$holders.length)return;$holders.each(function(){var $thisHolder=jQuery(this);if($thisHolder.data('loaded-xml-locations')===!0)return;var xmlURL=$thisHolder.data('xml-locations-url');if(typeof xmlURL!=='string')return;jQuery.ajax({type:'GET',url:xmlURL,dataType:'xml',success:function(data){makeLocationsList(data,$thisHolder);$thisHolder.data('loaded-xml-locations',!0)},error:function(d){console.log(d)}})});function makeLocationsList(data,$holder){var $locations=jQuery(data).find('obj'),regions=[];$locations.each(function(){var $region=jQuery(this).find('region'),regionStr=jQuery.trim($region.text());regionStr=(regionStr)?regionStr:'Default';if(regions.length){for(var i=regions.length-1;i>-1;i--){if(regions[i].name===regionStr){regions[i].$els.push(jQuery(this));return}}}
regions.push({'name':regionStr,'$els':[jQuery(this)]})});regions.sort(function(a,b){var strA=a.name.toLowerCase(),strB=b.name.toLowerCase();if(strA<strB)return-1;if(strA>strB)return 1;return 0});var output=[],switcherStrArr=['<span class="location-dropdown"><select>','','</select></span>'],rowMarkup=['<div class="row location-list',1,'"><div class="row__flexi-width ',3,'">'],i,ii,totalLocationsInRegion;for(i=0,ii=regions.length;i<ii;i++){rowMarkup[1]=(i===0)?' current':'';totalLocationsInRegion=regions[i].$els.length;if(totalLocationsInRegion<2){rowMarkup[3]='has-1-item'}else if(totalLocationsInRegion===2){rowMarkup[3]='has-2-items'}else if(totalLocationsInRegion===3){rowMarkup[3]='has-3-items'}else{rowMarkup[3]='more-than-3-items'}
output.push(rowMarkup.join(''));while(regions[i].$els.length){output.push(['<div class="column">','<div class="location">','<div class="location__name">',jQuery.trim(regions[i].$els[0].find('storeName').text()),'</div>','<div class="location__address">',jQuery.trim(regions[i].$els[0].find('storeAddress').text()),'</div>','<div class="location__footer">','<a href="https://maps.google.com/maps?daddr=',jQuery.trim(regions[i].$els[0].find('storeLat').text()),',',jQuery.trim(regions[i].$els[0].find('storeLng').text()),'" target="_blank">','Get Directions','</a>','</div>','</div>','</div>'].join(''));regions[i].$els.shift()}
output.push('</div></div>')}
$holder.html(output.join(''));if(regions.length>1){for(i=0,ii=regions.length;i<ii;i++){switcherStrArr[1]+=['<option value="',i,'">',regions[i].name,'</option>'].join('')}
var $switcher=jQuery(switcherStrArr.join(''));jQuery('<div class="text-center" />').prependTo($holder).append($switcher);$switcher.dropdownify();var $locationLists=$holder.find('.location-list');$holder.find('select').on('change',function(){var targetIndex=parseInt(jQuery(this).val(),10);$locationLists.each(function(index){if(index===targetIndex){jQuery(this).addClass('current').heightSyncify('enable').heightSyncify('sync')}else{jQuery(this).removeClass('current').heightSyncify('disable')}})})}
var syncHeightSelectors=['.location__name','.location__address'];$holder.find('.location-list').heightSyncify({items:syncHeightSelectors})}},scrollTo:function($obj,callback){if(typeof $obj!=='object'||!$obj instanceof jQuery||!$obj.length){return}
var targetScrollPos=$obj.offset().top-50;if(targetScrollPos<jQuery(window).scrollTop()){targetScrollPos-=jQuery('#mainNav').outerHeight();if(jQuery('#mainSmallNav').css('display')!=='none'&&!jQuery('#mainHeader').hasClass('is-partially-hidden')){targetScrollPos-=jQuery('#mainSmallNav').outerHeight()}}
if(callback==='snap'){jQuery(window).scrollTop(targetScrollPos)}else{jQuery('html, body').animate({scrollTop:targetScrollPos},400,callback)}},watchSize:function(){homebrew.watchSize.apply(homebrew,arguments)}});jQuery.extend(FE.FootnoteAnchor.prototype,{init:function($el,$footnote){if(!$el.length||!$footnote.length)return;var instance=this;instance.$el=$el;instance.$footnote=$footnote;$el.tooltipify({contents:$footnote.html()});instance.$el.data('footnote-anchor',this);instance.enable()},enable:function(){if(Modernizr.touch)return this;var instance=this;instance.$el.on({'click.footnotesTooltip':function(e){e.preventDefault();e.stopPropagation();var $thisFootnote=instance.$footnote;if(!jQuery('#notesToggler').hasClass('is-toggled')){jQuery('#notesToggler').togglerify('toggleOn',{noSlide:!0})}
FE.scrollTo($thisFootnote);$thisFootnote.addClass('is-active');jQuery(document).off('mouseup.notesFauxBlur').on('mouseup.notesFauxBlur',function(e){if(!$thisFootnote.is(e.target)&&$thisFootnote.has(e.target).length===0){jQuery(document).off('mouseup.notesFauxBlur');$thisFootnote.removeClass('is-active')}})}});return this},disable:function(){var instance=this;instance.$el.off('click.footnotesTooltip');instance.$el.tooltipify('disable');return instance}});jQuery.extend(FE.Hasher.prototype,{get:function(args){var instance=this,hash=window.location.hash;if(hash===''||hash==='#/'||hash.substr(0,2)!=='#/'){instance.data={};return instance}
var splitHash=hash.substring(2).split('&'),keyValuePairs,dataObj={};while(splitHash.length){keyValuePairs=splitHash.shift().split('=');dataObj[jQuery.trim(keyValuePairs[0])]=decodeURIComponent(jQuery.trim(keyValuePairs[1]))}
instance.data=dataObj;return instance},setData:function(data){if(!data||!jQuery.isPlainObject(data))return this;this.data=jQuery.extend({},data);return this},extendData:function(data){if(!data||!jQuery.isPlainObject(data))return this;if(this.data){jQuery.extend(this.data,data)}else{this.data=data}
return this},set:function(args){args=args||{};var instance=this,options=jQuery.extend(instance.options,args);if(options.ignoreDefault&&!instance.data)return instance;instance.data=instance.data||{};var hashKeys=[],hash=[],sequence=options.sequence;if(sequence==='alphabetical'||typeof sequence==='function'){jQuery.each(instance.data,function(key,value){if(key===''||value==='')return;hashKeys.push(key)});var sorter;if(sequence==='alphabetical'){sorter=function(a,b){var _a=a.toLowerCase(),_b=b.toLowerCase();if(_a<_b)return-1;if(_a>_b)return 1;return 0}}else if(typeof sequence==='function'){sorter=sequence}
hashKeys.sort(sorter);var currentHashKey;while(hashKeys.length){currentHashKey=hashKeys.shift();hash.push([currentHashKey,encodeURIComponent(instance.data[currentHashKey])].join('='))}}else if(typeof sequence==='string'){var splitSequence=sequence.split(','),i,ii,currentSequenceKey;for(i=0,ii=splitSequence.length;i<ii;i++){currentSequenceKey=splitSequence[i];if(instance.data[currentSequenceKey]){hash.push([currentSequenceKey,encodeURIComponent(instance.data[currentSequenceKey])].join('='))}}
jQuery.each(instance.data,function(key,value){if(key===''||value==='')return;for(i=splitSequence.length-1;i>-1;i--){if(key===splitSequence[i])return}
hash.push([key,encodeURIComponent(value)].join('='))})}else{jQuery.each(instance.data,function(key,value){if(key===''||value==='')return;hash.push([key,encodeURIComponent(value)].join('='))})}
window.location.hash='#/'+hash.join('&')},isSameWith:function(data){if(!data)return!1;var same=!0,count=0,instance=this;jQuery.each(data,function(key,value){if(typeof instance.data[key]==='undefined'||instance.data[key]!==value){same=!1;return!1}else{count++}});if(same){var refCount=0;jQuery.each(instance.data,function(){refCount++});same=(count===refCount)}
return same}});jQuery.extend(FE.StickyColumn.prototype,{callbacks:jQuery({}),hasMousewheel:Boolean(jQuery.fn.mousewheel),classes:{stickyColumn:'sticky-column',sticky:'is-sticky',stickBottom:'is-stick-to-bottom'},load:function(args){var instance=this,proto=FE.StickyColumn.prototype;if(!proto.hasMousewheel){if(!proto.loadingMousewheel){proto.loadingMousewheel=!0;jQuery.getScript(FE.baseURL+'js/plugins/jquery.mousewheel.min.js',function(){FE.StickyColumn.prototype.hasMousewheel=!0;proto.callbacks.dequeue('mousewheelLoaded')})}
proto.callbacks.queue('mousewheelLoaded',function(next){instance.init(args);if(typeof next==='function')next()})}},init:function(args){var $el=args.$el,$comparee=args.$comparee;if(!$el||!$comparee||!$el instanceof jQuery||!$comparee instanceof jQuery||!$el.length||!$comparee.length){return}
var instance=this,proto=FE.StickyColumn.prototype;instance.$el=$el;instance.$comparee=$comparee;instance.uniqueID=homebrew.generateUniqueID();$el.addClass(instance.classes.stickyColumn);FE.watchSize('large',function(isLargeScreen){if(isLargeScreen){instance.watch()}else{instance.rest();instance.unstick();instance.updatePosition()}});return instance},determineState:function(){if(!homebrew.screenSize.large)return'should-be-unstuck';var instance=this,$stickyCol=instance.$el,$comparee=instance.$comparee,windowTop=jQuery(window).scrollTop(),stickyColMarginTop=parseInt($stickyCol.css('margin-top'),10);instance.offsetTop=(jQuery('#mainHeader').css('position')==='fixed')?0:0;instance.offsetBottom=parseInt($comparee.find('.column').css('margin-bottom'),10)*2;if(!$comparee.is(':visible')||$stickyCol.height()>=$comparee.height()){return'should-be-unstuck'}else if($stickyCol.hasClass(instance.classes.stickBottom)&&$stickyCol.offset().top>=windowTop+instance.offsetTop){return'should-be-stuck'}else if((windowTop+$stickyCol.height()+stickyColMarginTop+instance.offsetTop)>($comparee.offset().top+$comparee.height()-instance.offsetBottom)){return'should-be-stuck-to-bottom'}else if($comparee.offset().top<=windowTop+instance.offsetTop){return'should-be-stuck'}else{return'should-be-unstuck'}},updatePosition:function(){var instance=this,$el=instance.$el;if($el.hasClass(instance.classes.stickBottom)||!$el.hasClass(instance.classes.sticky)){$el.css('top','')}else{$el.css('top',jQuery(window).scrollTop()-instance.$comparee.offset().top+instance.offsetTop+'px')}
return instance},stick:function(){var instance=this;instance.$el.addClass(instance.classes.sticky).removeClass(instance.classes.stickBottom);return instance},stickToBottom:function(){var instance=this;instance.$el.addClass([instance.classes.sticky,instance.classes.stickBottom].join(' ')).css('margin-top','');return instance},unstick:function(){var instance=this;instance.$el.removeClass([instance.classes.sticky,instance.classes.stickBottom].join(' ')).css('margin-top','');return instance},watch:function(){var instance=this;jQuery(window).on(['scroll.',instance.uniqueID,' resize.',instance.uniqueID].join(''),function(){var state=instance.determineState();switch(state){case 'should-be-stuck':instance.stick();break;case 'should-be-stuck-to-bottom':instance.stickToBottom();break;case 'should-be-unstuck':instance.unstick();break}
instance.updatePosition()}).trigger('scroll');instance.$el.on('mousewheel',function(e){if(instance.determineState()!=='should-be-stuck')return;var vector;if(e.deltaY<0){var bottomDiff=jQuery(window).scrollTop()+jQuery(window).height()-jQuery(this).offset().top-jQuery(this).height();if(bottomDiff>=0){return}else if(Math.abs(bottomDiff)<100){vector=bottomDiff}else{vector=-100}}else if(e.deltaY>0){var topDiff=jQuery(window).scrollTop()+instance.offsetTop-jQuery(this).offset().top;if(topDiff===0){return}else if(topDiff<100){vector=topDiff}else{vector=100}}
e.preventDefault();instance.$el.css('margin-top',[parseInt(instance.$el.css('margin-top'),10)+vector,'px'].join(''))});return instance},rest:function(){jQuery(window).off('.'+this.uniqueID);return this}});FE.initPage();if(typeof FE__callbacks==='object'&&FE__callbacks instanceof Array&&FE__callbacks.length){while(FE__callbacks.length){FE__callbacks.shift()()}}})
;var $infoToggler=jQuery('.info__toggler'),$infoTogglerContents=jQuery('.info__toggler-contents');$infoToggler.togglerify({singleActive:!0,slide:!0,content:function(index){return $infoTogglerContents.eq(index)}});function SendMail(rcvEmail){var emailRegex=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;var name=document.form.ssf_cont_name.value,email=document.form.ssf_cont_email.value,phone=document.form.ssf_cont_phone.value,message=document.form.ssf_cont_msg.value;email=email.trim();var storename=jQuery('#storeLocatorInfobox .store-location').html();if(name==""){document.form.ssf_cont_name.focus();document.getElementById("ssf-msg-status").innerHTML="<span style='color:red;'>"+contact_plc_name+"</span>"
return!1}
if(email==""){document.form.ssf_cont_email.focus();document.getElementById("ssf-msg-status").innerHTML="<span style='color:red;'>"+contact_plc_email+"</span>";return!1}else if(!emailRegex.test(email)){document.form.ssf_cont_email.focus();document.getElementById("ssf-msg-status").innerHTML="<span style='color:red;'>"+contact_plc_email+" </span>";return!1}
if(message==""){document.form.ssf_cont_msg.focus();document.getElementById("ssf-msg-status").innerHTML="<span style='color:red;'>"+contact_plc_msg+" </span>";return!1}
if(jQuery('#ssf_gdpr_check').length>0){if(jQuery('input#ssf_gdpr_check').is(':checked')){}else{jQuery('input#ssf_gdpr_check').addClass('ssf_invalid');return!1}}
var name_lbl=ssf_cont_us_name;var email_lbl=ssf_cont_us_email;var msg_lbl=ssf_cont_us_msg;var phone_lbl=contact_plc_phone;jQuery.ajax({type:"POST",url:ssf_wp_base+'/sendMail.php?t='+d.getTime(),data:{name:name,email:email,phone:phone,message:message,rcvEmail:rcvEmail,subject:storename,name_lbl:name_lbl,email_lbl:email_lbl,msg_lbl:msg_lbl,phone_lbl:phone_lbl},cache:!1,success:function(html){document.getElementById("ssf-contact-form").reset();document.getElementById("ssf-msg-status").innerHTML="<span style='color:green;' id='imageMsgAlert'>"+ssf_msg_sucess+"</span>";jQuery('#imageMsgAlert').fadeOut(5000)}})}
jQuery(document).ready(function(){"use strict";jQuery("input#ssf_gdpr_check").click(function(){var s_checked=jQuery(this).is(':checked');if(s_checked){jQuery('input#ssf_gdpr_check').removeClass('ssf_invalid')}})})
;var initStoreLocator;var d=new Date();var geocoder;var street;var placeholdersearch='';var initTheMap='';var _map;var lastid='';var defualtLatLong;var mapWithStyle=[];var mapWithoutStyle=[];var customMarkersUrl=[];var getStreetView='';var placeLocation='';var fileUrl='';var calltodefualt=!1;var contact_us_email;if(typeof YourSearchLocation=='undefined'||YourSearchLocation==""){var YourSearchLocation="Your search location";var YourCurrentlocation="Your current location"}
jQuery(function(){"use strict";if(document.getElementById('storeLocator__searchBar')!=null){placeholdersearch=document.getElementById('storeLocator__searchBar').placeholder}else{return}
var baseURL=FE.baseURL,urls={pathToJS:ssf_wp_base+'/js/',pathToIcons:ssf_wp_uploads_base+'/images/icons/',pathToXML:baseURL+'',pins:{regular:custom_marker,active:custom_marker_active,skeuomorph:'youarehere.png'}},map={el:document.getElementById('storeLocatorMap'),infobox:{el:document.getElementById('storeLocatorInfobox')},status:{$el:jQuery('#storeLocator__mapStatus'),$label:jQuery('#storeLocator__mapStatus__inner'),$closer:jQuery('#storeLocator__mapStatus__closer'),messages:{loadingGoogleMap:ssf_wp_loadingGoogleMap,loadingGoogleMapUtilities:ssf_wp_loadingGoogleMapUtilities,startSearch:ssf_wp_startSearch,gettingUserLocation:ssf_wp_gettingUserLocation,lookingForNearbyStores:ssf_wp_lookingForNearbyStores,lookingForStoresNearLocation:ssf_wp_lookingForStoresNearLocation,filteringStores:ssf_wp_filteringStores,cantLocateUser:ssf_wp_cantLocateUser,notAllowedUserLocation:ssf_wp_notAllowedUserLocation,noStoresNearSearchLocation:ssf_wp_noStoresNearSearchLocation,noStoresNearUser:ssf_wp_noStoresNearUser,noStoresFromFilter:ssf_wp_noStoresFromFilter,cantGetStoresInfo:ssf_wp_cantGetStoresInfo,noStoresFoundNearUser:ssf_noStoresFound,noStoresFound:ssf_noStoresFound,storesFound:ssf_storesFound,generalError:ssf_generalError},duration:5000}},autocompleter={el:document.getElementById('storeLocator__searchBar'),placeholderMediumUp:placeholdersearch,placeholderSmallDown:placeholdersearch},geolocator={$el:jQuery('#geolocator'),currentState:'neutral',states:{NEUTRAL:'neutral',RUNNING:'running'}},$els={map:jQuery('#storeLocatorMap'),storeList:jQuery('#storeLocator__storeList'),topHalf:jQuery('#storeLocator__topHalf'),currentStoreCount:jQuery('#storeLocator__currentStoreCount'),totalStoreCount:jQuery('#storeLocator__totalStoreCount'),storeLocatorInfoBox:{self:jQuery('#storeLocatorInfobox'),init:function(){this.storeimage=this.self.find('.store-image');this.location=this.self.find('.store-location');this.address=this.self.find('.store-address');this.website=this.self.find('.store-website');this.exturl=this.self.find('.store-exturl');this.embedvideo=this.self.find('.store-embedvideo');this.defaultmedia=this.self.find('.store-defaultmedia');this.email=this.self.find('.store-email');this.contactus=this.self.find('.store-contactus');this.telephone=this.self.find('.store-tel');this.fax=this.self.find('.store-fax');this.description=this.self.find('.store-description');this.operatingHours=this.self.find('.store-operating-hours');this.productsServices=this.self.find('.store-products-services');this.directions=this.self.find('.infobox__cta');this.streetview=this.self.find('.infobox__stv');this.custmmarker=this.self.find('.store-custom-marker');this.zip=this.self.find('.store-zip');this.state=this.self.find('.store-state')}},mobileStoreLocatorInfobox:{self:jQuery('#mobileStoreLocatorInfobox'),init:function(){this.storeimage=this.self.find('.store-image');this.location=this.self.find('.store-location');this.address=this.self.find('.store-address');this.website=this.self.find('.store-website');this.exturl=this.self.find('.store-exturl');this.embedvideo=this.self.find('.store-embedvideo');this.defaultmedia=this.self.find('.store-defaultmedia');this.email=this.self.find('.store-email');this.contactus=this.self.find('.store-contactus');this.telephone=this.self.find('.store-tel');this.fax=this.self.find('.store-fax');this.description=this.self.find('.store-description');this.operatingHours=this.self.find('.store-operating-hours');this.productsServices=this.self.find('.store-products-services');this.directions=this.self.find('.infobox__cta');this.streetview=this.self.find('.infobox__stv');this.custmmarker=this.self.find('.store-custom-marker');this.zip=this.self.find('.store-zip');this.state=this.self.find('.store-state')}},filters:{init:function(){this.states=jQuery('#filter__states').find('input[name="storesState"]');this.outletTypes=jQuery('#filter__outlets').find('input[name="storesOutletType"]');this.productsServices=jQuery('#filter__services').find('input[name="storesProductsServices"]');this.countryVal=jQuery('#filter__country').find('input[name="storesCountry"]');return this}}},legend,xml={filename:ssf_wp_base+'/ssf-wp-xml.php?wpml_lang='+wmpl_ssf_lang+'&t='+d.getTime()},json={filename:ssf_wp_uploads_base+"/ssf-data.json?t="+d.getTime()},jsonwpml={filename:ssf_wp_base+'/ssf-wp-json-wpml.php?wpml_lang='+wmpl_ssf_lang+'&t='+d.getTime()},isLocal=(window.location.hostname===''||window.location.hostname==='localhost'),isLargeScreen=!0,isMediumScreen=!0;setupMapStatus();var $filterTogglers=jQuery('.filter__toggler'),$filterTogglerContents=jQuery('.filter__toggler-contents');$filterTogglers.togglerify({singleActive:!0,slide:!0,content:function(index){return $filterTogglerContents.eq(index)}});FE.watchSize('large',function(isLargeScreen){var settings=(isLargeScreen)?[!0,'toggleOff','activate']:[!1,'toggleOn','deactivate'];$filterTogglers.togglerify('set','singleActive',settings[0]).togglerify(settings[1],{noSlide:!0}).togglerify(settings[2]);if(placeholdersearch!=''){autocompleter.el.placeholder=(isLargeScreen)?autocompleter.placeholderMediumUp:autocompleter.placeholderMediumUp}});var $storeLocatorFilterToggler=jQuery('#storeLocatorFilterToggler'),$filterPanel=$els.topHalf.find('.filter-radio');$filterPanel.data('filter-popup',{reveal:function(){jQuery('body').addClass('filter-popup-is-shown')},conceal:function(){jQuery('body').removeClass('filter-popup-is-shown')}});$filterPanel.find('[data-close-popup]').on('click',function(e){e.preventDefault();$filterPanel.data('filter-popup').conceal()});$storeLocatorFilterToggler.on('click',function(e){e.preventDefault();$filterPanel.data('filter-popup').reveal()});map.status.notify({message:'loadingGoogleMap',loadingIndicator:!0});var googleApi='';if(google_api_key!=''&&google_api_key!='undefined'){googleApi='key='+google_api_key+'&'}
jQuery.getScript('https://maps.googleapis.com/maps/api/js?'+googleApi+'sensor=false&libraries=places&v=3.15&language='+ssf_m_lang+'®ion='+ssf_m_rgn+'&callback=initStoreLocator');initStoreLocator=function(){map.status.notify({message:'loadingGoogleMapUtilities',loadingIndicator:!0});jQuery.getScript(ssf_wp_base+'/js/plugins/google-maps-utility-library/marker-with-label.packed.js',onLoad);jQuery.getScript(ssf_wp_base+'/js/plugins/google-maps-utility-library/infobox.packed.js',onLoad);var loadCounter=0;function onLoad(){loadCounter++;if(loadCounter<2)return;map.status.notify({message:'startSearch',autoclose:!0});jQuery.extend(!0,map,{markers:{user:{},stores:{list:[]}}});$els.storeLocatorInfoBox.init();$els.mobileStoreLocatorInfobox.init();setupMediaQueries();setupGeolocator();setupAutocompleter();setupEventHandlers();if(typeof xml.data==='undefined'){if(typeof ssf_data_source==='undefined'||ssf_data_source=='false'){jQuery.ajax({type:"GET",url:urls.pathToXML+xml.filename,dataType:"xml",success:function(data){xml.data=data;continueInit()}})}else{if(typeof wmpl_ssf_lang!='undefined'&&wmpl_ssf_lang!='en'&&wmpl_ssf_lang!=''){var jsonssfurl=jsonwpml.filename}else{var jsonssfurl=json.filename}
jQuery.getJSON(jsonssfurl,function(data){xml.data=data;continueInit()})}}else{continueInit()}
function continueInit(){legend={};var radiosStrArray=[];if(typeof ssf_data_source==='undefined'||ssf_data_source=='false'){jQuery(xml.data).find('label').each(function(){var tag=jQuery(this).find('tag').text().trim();var copy=jQuery(this).find('copy').text().trim();legend[tag]=copy;radiosStrArray.push(['<label class="label--vertical-align ssflabel">','<div class="label__input-icon">','<i class="icon icon--input icon--radio-btn"></i>','</div>','<div class="label__contents">','<input type="radio" name="storesProductsServices" value="',tag,'" /> ',copy,'</div>','</label>'].join(''))})}else{jQuery(xml.data.tags).each(function(){var tag=this.tag;var copy=this.copy;legend[tag]=copy;radiosStrArray.push(['<label class="label--vertical-align ssflabel">','<div class="label__input-icon">','<i class="icon icon--input icon--radio-btn"></i>','</div>','<div class="label__contents">','<input type="radio" name="storesProductsServices" value="',tag,'" /> ',copy,'</div>','</label>'].join(''))})}
jQuery('#productsServicesFilterOptions').append(radiosStrArray.join(''));if(ssf_default_category!=''&&ssf_default_category!=undefined){jQuery(function(){setTimeout(function(){jQuery('input[value='+ssf_default_category+']').trigger('click');jQuery('#filter__services .filter__toggler').trigger('click')},3000)})}
$els.filters.init().productsServices.inputify();if(typeof ssf_data_source==='undefined'||ssf_data_source=='false'){$els.totalStoreCount.text(jQuery(xml.data).find('item').length)}else{$els.totalStoreCount.text(jQuery(xml.data.item).length)}
startMap()}}
function startMap(){jQuery('#ssf-overlay').css('display','none');jQuery('#ssf-dummy-blck').css('display','none');jQuery('#ssf-preloader').css('display','none');jQuery('#store-locator-section-bg').css('display','block');jQuery('#mainPopupContat').css('display','block');jQuery('#mainPopupHolder').css('display','block');jQuery('#storeLocator__topHalf').css('display','block');setTimeout(function(){jQuery('#store-locator-section-bg').addClass('store-locator-section-bg')},1000);var defaultLatLng
if(default_location!=''&&default_location!==undefined&&ssf_wp_map_settings=='geo'){geocoder=new google.maps.Geocoder();geocoder.geocode({'address':default_location,'region':''},function(results,status){if(status==google.maps.GeocoderStatus.OK){defaultLatLng=results[0].geometry.location;loadDefaultMap(defaultLatLng)}})}else{defaultLatLng=new google.maps.LatLng(40.705,-74.0139);loadDefaultMap(defaultLatLng)}}
function loadDefaultMap(defaultLatLng){defualtLatLong=defaultLatLng;var scrollset=!1;if(map_mouse_scroll==1){scrollset=!0}
var mobile_gesture;if(ssf_mobile_gesture=='true'){mobile_gesture='cooperative'}else{mobile_gesture='greedy'}
mapWithStyle={center:defaultLatLng,styles:ssf_wp_map_code,streetViewControl:!0,streetViewControlOptions:{position:google.maps.ControlPosition.RIGHT_TOP},zoom:init_zoom,zoomControl:!0,gestureHandling:mobile_gesture,zoomControlOptions:{position:google.maps.ControlPosition.RIGHT_TOP},mapTypeId:google.maps.MapTypeId.ROADMAP,scrollwheel:scrollset};mapWithoutStyle={center:defaultLatLng,streetViewControl:!0,gestureHandling:mobile_gesture,streetViewControlOptions:{position:google.maps.ControlPosition.RIGHT_TOP},zoom:init_zoom,zoomControl:!0,zoomControlOptions:{position:google.maps.ControlPosition.RIGHT_TOP},mapTypeId:google.maps.MapTypeId.ROADMAP,scrollwheel:scrollset};if(ssf_wp_map_code!=""&&ssf_wp_map_code!=undefined){map.self=new google.maps.Map(map.el,mapWithStyle)}else{map.self=new google.maps.Map(map.el,mapWithoutStyle)}
map.infobox.self=new InfoBox({content:map.infobox.el,pixelOffset:new google.maps.Size(35,-240),closeBoxMargin:"10px 10px 0 0",closeBoxURL:ssf_wp_base+"/images/icons/cross-white.png"});$els.storeLocatorInfoBox.self.find('.infobox__closer').on('click',function(e){e.preventDefault();map.infobox.self.close()});geolocator.watch()}
function setupGeolocator(){jQuery.extend(!0,geolocator,{watch:function(){var self=this;self.currentState=self.states.RUNNING;map.status.notify({message:'gettingUserLocation',loadingIndicator:!0});self.$el.addClass('is-loading');if(initTheMap==''&&ssf_wp_map_settings=='showall'){searchForStores({productsServices:ssf_default_category})}else if(initTheMap==''&&default_location!=''&&ssf_wp_map_settings=='specific'){jQuery('input#storeLocator__searchBar').val(default_location);jQuery('.icon--search').trigger('click')}else{map.watcher=navigator.geolocation.watchPosition(function(position){if(self.currentState!==self.states.RUNNING)return;self.rest();calltodefualt==!0;var coordinates=position.coords,userLatLng=new google.maps.LatLng(coordinates.latitude,coordinates.longitude);setMainMapMarker(userLatLng,YourCurrentlocation);map.status.notify({message:'lookingForNearbyStores',loadingIndicator:!0});var categories=$els.filters.productsServices.filter(':checked').val();if(typeof categories!=='undefined'&&categories!=''){categories=categories}else{categories=ssf_default_category}
searchForStores({latLng:userLatLng,distance:ssf_distance_limit,productsServices:categories,centerOnUser:!0,onError:function(){map.status.notify({message:'noStoresNearUser',closeable:!0})}})},function(error){if(self.currentState!==self.states.RUNNING)return;self.rest();switch(error.code){case error.TIMEOUT:map.status.notify({message:'cantLocateUser',closeable:!0});break;default:locationNotAvailable();break}},{enableHighAccuracy:!0,maximumAge:30000,timeout:15000})}
initTheMap='1';setTimeout(function(){navigator.geolocation.clearWatch(map.watcher)},20000)
geolocator.timer=setTimeout(function(){if(ssf_wp_map_settings=='geo'&&calltodefualt==!1){defaultLocationStore()}
self.rest();locationNotAvailable()},20000)},rest:function(){if(!navigator.geolocation)return;geolocator.currentState=geolocator.states.NEUTRAL;navigator.geolocation.clearWatch(map.watcher);clearTimeout(geolocator.timer);geolocator.$el.removeClass('is-loading')}})}
function defaultLocationStore(){searchForStores({latLng:defualtLatLong,distance:ssf_distance_limit,productsServices:ssf_default_category,centerOnUser:!0,onError:function(){map.status.notify({message:'noStoresNearUser',closeable:!0})}})}
function setupMediaQueries(){FE.watchSize('large',function(mq){isLargeScreen=mq;if(typeof map.markers.stores.current==='undefined'||map.markers.stores.current===null){return}
if(isLargeScreen){map.infobox.self.open(map.self,map.markers.stores.current)}});FE.watchSize('medium',function(mq){isMediumScreen=mq;if(typeof map.markers.stores.current==='undefined'||map.markers.stores.current===null){return}
if(isMediumScreen){map.infobox.self.open(map.self,map.markers.stores.current)}else{setMapCenter(map.markers.stores.current.position);map.infobox.self.close()}})}
function setupAutocompleter(){if(ssf_defualt_region=='false'){var _autocompleter=new google.maps.places.Autocomplete(autocompleter.el,{componentRestrictions:{'country':ssf_m_rgn}})}else{var _autocompleter=new google.maps.places.Autocomplete(autocompleter.el,{})}
google.maps.event.addListener(_autocompleter,'place_changed',function(){jQuery('div[jsaction="closeControl.click"]').trigger('click');var searchPlace=jQuery('#storeLocator__searchBar').val();if(searchPlace!=''){geocoder=new google.maps.Geocoder();geocoder.geocode({'address':searchPlace+', '+ssf_m_rgn},function(results,status){if(status==google.maps.GeocoderStatus.OK){placeLocation=results[0].geometry.location;setMainMapMarker(placeLocation,YourSearchLocation+': '+searchPlace);var categories=$els.filters.productsServices.filter(':checked').val();if(typeof categories!=='undefined'&&categories!=''){categories=categories}else{categories=ssf_default_category}
searchForStores({latLng:placeLocation,distance:ssf_distance_limit,productsServices:categories,centerOnUser:!0,onError:function(){map.status.notify({message:'noStoresNearSearchLocation',closeable:!0})}})}else{}})}});jQuery(".icon--search").on("click",function(e){jQuery('div[jsaction="closeControl.click"]').trigger('click');var searchPlace=jQuery('#storeLocator__searchBar').val();if(searchPlace!=''){geocoder=new google.maps.Geocoder();geocoder.geocode({'address':searchPlace+','+ssf_m_rgn},function(results,status){if(status==google.maps.GeocoderStatus.OK){placeLocation=results[0].geometry.location;setMainMapMarker(placeLocation,YourSearchLocation+': '+searchPlace);var categories=$els.filters.productsServices.filter(':checked').val();if(typeof categories!=='undefined'&&categories!=''){categories=categories}else{categories=ssf_default_category}
searchForStores({latLng:placeLocation,distance:ssf_distance_limit,productsServices:categories,centerOnUser:!0,onError:function(){map.status.notify({message:'noStoresNearSearchLocation',closeable:!0})}})}else{}})}});jQuery("input[name='storesRegion']").on("click",function(e){jQuery('div[jsaction="closeControl.click"]').trigger('click');var searchPlace=jQuery("input[name=storesRegion]:checked").val()
jQuery('input#storeLocator__searchBar').val(searchPlace);if(searchPlace!=''){geocoder=new google.maps.Geocoder();geocoder.geocode({'address':searchPlace,'region':ssf_m_rgn},function(results,status){if(status==google.maps.GeocoderStatus.OK){placeLocation=results[0].geometry.location;setMainMapMarker(placeLocation,YourSearchLocation+': '+searchPlace);var categories=$els.filters.productsServices.filter(':checked').val();if(typeof categories!=='undefined'&&categories!=''){categories=categories}else{categories=ssf_default_category}
searchForStores({latLng:placeLocation,distance:ssf_distance_limit,productsServices:categories,centerOnUser:!0,onError:function(){map.status.notify({message:'noStoresNearSearchLocation',closeable:!0})}})}else{}})}});jQuery(document).on({'DOMNodeInserted':function(){jQuery('.pac-item, .pac-item span',this).addClass('needsclick')}},'.pac-container')}
function setupEventHandlers(){geolocator.$el.on('click',function(e){e.preventDefault();jQuery('div[jsaction="closeControl.click"]').trigger('click');if(!jQuery(this).hasClass('is-loading')){geolocator.watch()}});jQuery('#filterOptionsClearer').on('click',function(e){e.preventDefault();jQuery('.icon--radio-btn').removeClass('is-checked');jQuery.each($els.filters,function(key,value){if(typeof value!=='object'||!value instanceof jQuery)return;value.prop('checked',!1).inputify('refresh')})});jQuery('#filterShowAll').on('click',function(e){e.preventDefault();jQuery('#storesProductsServices').trigger('click');$filterPanel.data('filter-popup').conceal();searchForStores()});jQuery('#applyFilterOptions').on('click',function(e){var filterProps={latLng:(map.markers.user.self)?map.markers.user.self.position:undefined,state:$els.filters.states.filter(':checked').val(),country:$els.filters.countryVal.filter(':checked').val(),productsServices:$els.filters.productsServices.filter(':checked').val(),onError:function(){map.status.notify({message:'noStoresFromFilter',closeable:!0})}};if(typeof filterProps.country==='undefined'){jQuery.extend(filterProps,{distance:ssf_distance_limit,centerOnUser:!0})}
searchForStores(filterProps)});$els.mobileStoreLocatorInfobox.self.find('.infobox__closer').on('click',function(e){e.preventDefault();$els.mobileStoreLocatorInfobox.self.removeClass('is-shown')});$els.storeList.on('click','.store-locator__infobox',function(e){e.preventDefault();setCurrentStoreDetails(jQuery(this))});map.status.$closer.on('click',function(e){e.preventDefault();map.status.conceal()});$els.storeList.on('click','a',function(e){e.stopPropagation()})}
function makeStoreDetailsString($storeXMLElem,index,useLabel){if(typeof ssf_data_source==='undefined'||ssf_data_source=='false'){var _store={lat:getText($storeXMLElem.find('latitude')),lng:getText($storeXMLElem.find('longitude')),storeimage:getText($storeXMLElem.find('storeimage')),custmmarker:getText($storeXMLElem.find('custmmarker')),location:getText($storeXMLElem.find('location')),address:getText($storeXMLElem.find('address')),website:getText($storeXMLElem.find('website')),exturl:getText($storeXMLElem.find('exturl')),embedvideo:getText($storeXMLElem.find('embedvideo')),defaultmedia:getText($storeXMLElem.find('defaultmedia')),email:getText($storeXMLElem.find('email')),contactus:getText($storeXMLElem.find('contactus')),telephone:getText($storeXMLElem.find('telephone')),fax:getText($storeXMLElem.find('fax')),description:getText($storeXMLElem.find('description')),operatingHours:getText($storeXMLElem.find('operatingHours')),zip:getText($storeXMLElem.find('zip')),state:getText($storeXMLElem.find('state')),productsServices:getText($storeXMLElem.find('productsServices'))}}else{var _store={lat:$storeXMLElem.latitude,lng:$storeXMLElem.longitude,storeimage:$storeXMLElem.storeimage,custmmarker:$storeXMLElem.custmmarker,location:$storeXMLElem.location,address:$storeXMLElem.address,website:$storeXMLElem.website,exturl:$storeXMLElem.exturl,embedvideo:$storeXMLElem.embedvideo,defaultmedia:$storeXMLElem.defaultmedia,email:$storeXMLElem.email,contactus:$storeXMLElem.contactus,telephone:$storeXMLElem.telephone,fax:$storeXMLElem.fax,description:$storeXMLElem.description,operatingHours:$storeXMLElem.operatingHours,zip:$storeXMLElem.zip,state:$storeXMLElem.state,productsServices:$storeXMLElem.productsServices}}
var letter='',clearClass='',getDirections='<div class="infobox__row infobox__cta"> </div>';getStreetView='<div class="infobox__row infobox__stv"> </div>';if(_store.lat&&_store.lng){letter=translateIntoLetter(index);getDirections=['<a href="https://maps.google.com/maps?',(map.markers.user.self)?'saddr='+map.markers.user.self.getPosition()+'&':'','daddr=(',_store.lat,', ',_store.lng,')"',' target="new"',' class="infobox__row infobox__cta ssflinks">',ssf_wp_direction_label,'</a>'].join('');getStreetView=['<a href="javascript:streetView(',_store.lat,', ',_store.lng,')"',' class="infobox__row infobox__stv">',ssf_wp_streetview_label,'</a>'].join('')}
if(index!==0&&index%3===0){clearClass+=' medium-clear-left'}
var ext_url;var ext_url_link;if(_store.exturl!=''&&_store.exturl!=undefined){ext_url="<div class='btn-super-info'>"+ssf_wp_ext_url_label+"</div>"}else{ext_url=''}
var ssf_image_video='';var ssf_image_image='';if(ssf_show_image_list=='showboth'&&_store.defaultmedia=='video'&&_store.embedvideo!=''){ssf_image_video=base64.decode(_store.embedvideo)}else if(ssf_show_image_list=='showboth'&&_store.defaultmedia!='video'){ssf_image_image=(_store.storeimage!='')?_store.storeimage:ssf_wp_base+'/images/NoImage.png'}
if(ssf_tel_fax_link=='true'){if(_store.telephone!=''){_store.telephone='<a href="tel:'+_store.telephone+'">'+_store.telephone+'</a>'}
if(_store.fax!=''){_store.fax='<a href="tel:'+_store.fax+'">'+_store.fax+'</a>'}}
return['<div class="medium-4',clearClass,' ssf-column">','<div class="store-locator__infobox" id="store',index,'">','<div class="infobox__row infobox__row--marker">','<div class="infobox__marker',(letter.length>1)?' infobox__marker--small':'','">',letter,'</div>','</div>','<div class="infobox__body">','<div class="infobox__title ssf_image_setting" style="background-image: url(',ssf_image_image,');">',ssf_image_video,'</div>','<div class="infobox__row infobox__title store-image" style="display:none;">',_store.storeimage,'</div>','<div class="infobox__row infobox__title store-location">',_store.location,'</div>','<div class="infobox__row store-address">',_store.address,'</div>','<div class="infobox__row store-products-services">',_store.productsServices,'</div>','<div class="infobox__row store-website" style="display:none;"><a target="new" href="',_store.website.replace(/(http:\/\/)\1/,'$1'),'">',_store.website,'</a></div>','<div class="infobox__row store-exturl" style="display:none;"><a ',((ssf_wp_exturl_link=='true')?"target='new'":""),' href="',_store.exturl.replace(/(http:\/\/)\1/,'$1'),'">',ext_url,'</a></div>','<div class="infobox__row store-email" style="display:none;"><a href="mailto:',_store.email,'">',_store.email,'</a></div>','<div class="infobox__row store-tel" style="display:none;">',_store.telephone,'</div>','<div class="infobox__row store-fax" style="display:none;">',_store.fax,'</div>','<div class="infobox__row store-contactus" style="display:none;">',_store.contactus,'</div>','<div class="infobox__row store-description" style="display:none;">',_store.description,'</div>','<div class="infobox__row store-embedvideo" style="display:none;">',_store.embedvideo,'</div>','<div class="infobox__row store-defaultmedia" style="display:none;">',_store.defaultmedia,'</div>','<div class="infobox__row store-custom-marker" style="display:none;">',_store.custmmarker,'</div>','<div class="infobox__row store-operating-hours" style="display:none;">',_store.operatingHours,'</div>','<div class="infobox__row store-zip" style="display:none;">',_store.zip,'</div>','<div class="infobox__row store-state" style="display:none;">',_store.state,'</div>','</div>',getDirections,'<div style="display:none;">',getStreetView,'</div>','</div>','</div>'].join('')}
function makeStoreProductsServicesString($storeXMLElem){var servicesStrArr=[];jQuery.each(legend,function(tag,copy){var $service=$storeXMLElem.find(tag);if(!$service.length)return;var serviceBoolStr=$service.text().trim();if(serviceBoolStr!=='true')return;servicesStrArr.push(['<li>',copy,'</li>'].join(''))});return servicesStrArr.join('')}
function searchForStores(settings){settings=settings||{};_map=map.self;if(ssf_wp_map_code!=""&&ssf_wp_map_code!=undefined){_map.setOptions({styles:ssf_wp_map_code})}else{if(style_map_color!=""){var styles=[{stylers:[{hue:style_map_color},{saturation:0},{lightness:50},{gamma:1},]}];_map.setOptions({styles:styles})}}
geolocator.rest();map.infobox.self.close();$els.topHalf.addClass('has-searched');if(typeof xml.data==='undefined'){jQuery.ajax({type:"GET",url:xml.url,dataType:"xml",success:function(data){xml.data=data;addStores()},error:function(){hideMapFeedback();showStatusFeedback(messages.cantGetStoresInfo)}})}else{addStores()}
function addStores(){var targetItems,storesXMLArray=[];map.markers.stores.current=null;jQuery('#page_navigation').html('');while(map.markers.stores.list.length){map.markers.stores.list.shift().setMap(null)}
$els.mobileStoreLocatorInfobox.self.removeClass('is-shown');if(typeof settings.state==='string'&&settings.state!=='default'){if(typeof ssf_data_source==='undefined'||ssf_data_source=='false'){targetItems=jQuery(xml.data).find(settings.state).find('item')}else{targetItems=jQuery(xml.data.item)}}else{if(typeof ssf_data_source==='undefined'||ssf_data_source=='false'){targetItems=jQuery(xml.data).find('item')}else{targetItems=jQuery(xml.data.item)}}
if(typeof ssf_data_source==='undefined'||ssf_data_source=='false'){targetItems.each(function(indexs){var $thisStore=jQuery(this),storeLatNode=$thisStore.find('latitude'),storeLngNode=$thisStore.find('longitude'),storeMrkNode=$thisStore.find('custmmarker').text().trim(),storeLatLng='nope',storeDistance='nope';if(storeLatNode.length&&storeLngNode.length){storeLatLng=new google.maps.LatLng(parseFloat(storeLatNode.text()),parseFloat(storeLngNode.text()));storeDistance=(typeof settings.latLng==='undefined')?0:distHaversine(settings.latLng,storeLatLng);if(typeof settings.distance==='number'&&storeDistance>settings.distance){return}}else if(!settings.state||!$thisStore.parent().is(jQuery.trim(settings.state))){return}
if(typeof settings.country==='string'&&settings.country!=='default'&&$thisStore.find('country').text()!==settings.country){return}
if(typeof settings.productsServices==='string'&&settings.productsServices!=='default'&&settings.productsServices!==''&&$thisStore.find(settings.productsServices).text()!=='true'){return}
if(storeLatLng!=='nope'){map.markers.stores.list.push({latLng:storeLatLng,distance:storeDistance,sortord:$thisStore.find('sortord').text().trim(),storeMNode:storeMrkNode,storeLocation:$thisStore.find('location').text().trim()})}
storesXMLArray.push({'$xml':$thisStore,distance:storeDistance,sortord:$thisStore.find('sortord').text().trim()})})}else{jQuery(targetItems).each(function(indexes){var $thisStore=this;var storeLatNode=$thisStore.latitude,storeLngNode=$thisStore.longitude,storeMrkNode=$thisStore.custmmarker,storeLatLng='nope',storeDistance='nope';if(storeLatNode.length&&storeLngNode.length){storeLatLng=new google.maps.LatLng(parseFloat(storeLatNode),parseFloat(storeLngNode));storeDistance=(typeof settings.latLng==='undefined')?0:distHaversine(settings.latLng,storeLatLng);if(typeof settings.distance==='number'&&storeDistance>settings.distance){return}}else if(!settings.state||!$thisStore.parent().is(jQuery.trim(settings.state))){return}
if(settings.country!==undefined&&settings.country!=='default'&&settings.country!==''&&$thisStore.country!=settings.country){return}
if(settings.productsServices!==undefined&&settings.productsServices!=='default'&&settings.productsServices!==''){var found=1;for(var ssf_i=0;ssf_i<$thisStore.category.length;ssf_i++){if($thisStore.category[ssf_i]==settings.productsServices){found=0}}
if(found!=0){return}}
if(storeLatLng!=='nope'){map.markers.stores.list.push({latLng:storeLatLng,distance:storeDistance,sortord:$thisStore.sortord,storeMNode:storeMrkNode,storeLocation:$thisStore.location})}
storesXMLArray.push({'$xml':$thisStore,distance:storeDistance,sortord:$thisStore.sortord})})}
if(!storesXMLArray.length){var errorMessage=map.status.messages[settings.errorMessage]||settings.errorMessage;if(typeof settings.onError==='function')settings.onError('noResults');$els.storeList.html('<div class="text-large text-center">'+map.status.messages.noStoresFound+'</div>');$els.currentStoreCount.text('0');return}
$els.currentStoreCount.text(storesXMLArray.length);if(settings.distance!==undefined&&settings.distance!==''){storesXMLArray.sort(distanceAscendingSorter);map.markers.stores.list.sort(distanceAscendingSorter)}else{storesXMLArray.sort(sortordAscendingSorter);map.markers.stores.list.sort(sortordAscendingSorter)}
var maximumNumberOfLabels=25,storesStrArr=[];for(var ssf_i=0,ssf_ii=storesXMLArray.length;ssf_i<ssf_ii;ssf_i++){storesStrArr.push(makeStoreDetailsString(storesXMLArray[ssf_i].$xml,ssf_i))}
$els.storeList.html(storesStrArr.join(''));$els.storeList.heightSyncify({items:['.infobox__body']});map.status.notify({message:'storesFound',autoclose:!0});map.markers.bounds=new google.maps.LatLngBounds();var markerLabelClass,markerLabelContent;for(var j=0,jj=map.markers.stores.list.length;j<jj;j++){if(labeled_marker=='1'){markerLabelContent=translateIntoLetter(j)}else{markerLabelContent=''}
if(map.markers.stores.list[j].storeMNode!=''){customMarkersUrl=map.markers.stores.list[j].storeMNode}else{customMarkersUrl=urls.pathToIcons+urls.pins.regular}
markerLabelClass='store-locator__map-pin';if(j>maximumNumberOfLabels){markerLabelClass+=' store-locator__map-pin--small'}else if(j>maximumNumberOfLabels+9){markerLabelClass+=' store-locator__map-pin--xsmall'}
map.markers.bounds.extend(map.markers.stores.list[j].latLng);map.markers.stores.list[j]=new MarkerWithLabel({position:map.markers.stores.list[j].latLng,map:map.self,title:ssfDecode(map.markers.stores.list[j].storeLocation),icon:customMarkersUrl,zIndex:jj-j,labelContent:markerLabelContent,labelClass:markerLabelClass,originalLabelClass:markerLabelClass,labelInBackground:!1});map.markers.stores.list[j].originalZIndex=jj-j;(function(){var $targetStore=jQuery('#store'+j);$targetStore.data('storeMarker',map.markers.stores.list[j]);google.maps.event.addListener(map.markers.stores.list[j],'click',function(){setCurrentStoreDetails($targetStore)})})()}
if(storesXMLArray.length===1){setCurrentStoreDetails(jQuery('#store0'))}
if(ssf_map_position=='false'){map.self.fitBounds(map.markers.bounds);map.self.setZoom(map.self.getZoom())}else if(settings.centerOnUser&&ssf_map_position=='true'){if(zoom_level=='auto'){map.self.fitBounds(map.markers.bounds)}
if(typeof map.markers.user.self!=='undefined'){setMapCenter(map.markers.user.self.position,!0)}}else{map.self.setCenter(map.markers.bounds.getCenter());if(zoom_level=='auto'){map.self.fitBounds(map.markers.bounds)}
map.self.setZoom(map.self.getZoom())}
ssf_ifrane_vedio();if(ssf_pagination>0&&storesXMLArray.length>ssf_pagination){pagging(ssf_pagination)}
if(typeof settings.onSuccess==='function')settings.onSuccess()}}
var imgToggleS=function(v,v2){jQuery('div .info-img').css('height','150px');jQuery('div .info-img').css('background-image','url('+v+')');jQuery('#storeLocatorInfobox').children('div .info-img').on("click",function(e){showPopup(v,v2)})};var imgToggleH=function(){jQuery('div .info-img').css('background-image','url("")');jQuery('#storeLocatorInfobox').children('div .info-img').unbind();jQuery('div .info-img').css('height','0px')};function ssfDecode(txt){var sp=document.createElement('span');sp.innerHTML=txt;return sp.innerHTML.replace("&","&").replace(">",">").replace("<","<").replace(""",'"')}
jQuery('#modernBrowserConatct').on('click','#contact-submit',function(){SendMail(contact_us_email)})
function setCurrentStoreDetails($targetStoreElem){setTimeout(function(){if($targetStoreElem.find('.store-tel').html()==""){jQuery('.store-locator__infobox--main .store-tel').addClass('nossficon');jQuery('#info-tel').css('display','none');if(jQuery('#info-tel').is(":visible")){jQuery('#info-tel').css('display','none');jQuery('.store-locator__infobox--main .store-tel').addClass('nossficon')}}else{jQuery('#info-tel').css('display','block');jQuery('.store-locator__infobox--main .store-tel').removeClass('nossficon')}
if($targetStoreElem.find('.store-description').html()==""){jQuery('#info-description').css('display','none');jQuery('.store-locator__infobox--main .store-description').addClass('nossficon')}else{jQuery('#info-description').css('display','block');jQuery('.store-locator__infobox--main .store-description').removeClass('nossficon')}
if($targetStoreElem.find('.store-contactus').html()==""){jQuery('.store-contact-us').css('display','none')}else{jQuery('.store-contact-us').css('display','block')}
if($targetStoreElem.find('.store-operating-hours').html()==""){jQuery('.info-operatinghour').css('display','none')}else{jQuery('.info-operatinghour').css('display','block')}
if($targetStoreElem.find('.store-website').html()==""||$targetStoreElem.find('.store-website').html()=='<a target="new" href="http://"></a>'||$targetStoreElem.find('.store-website').html()=='<a target="new" href=""></a>'||$targetStoreElem.find('.store-website').html().indexOf('href=""')!==-1){jQuery('#info-website').css('display','none');jQuery('.store-locator__infobox--main .store-website').addClass('nossficon')}else{jQuery('#info-website').css('display','block');jQuery('.store-locator__infobox--main .store-website').removeClass('nossficon')}
if($targetStoreElem.find('.store-exturl').html()==""||$targetStoreElem.find('.store-exturl').html()=='<a target="new" href="http://"></a>'||$targetStoreElem.find('.store-exturl').html()=='<a target="new" href=""></a>'){jQuery('#info-exturl').css('display','none')}else{jQuery('#info-exturl').css('display','block')}
if($targetStoreElem.find('.store-email').html()==""||$targetStoreElem.find('.store-email').html()=='<a href="mailto:"></a>'){jQuery('#info-email').css('display','none');jQuery('.store-locator__infobox--main .store-email').addClass('nossficon')}else{jQuery('#info-email').css('display','block');jQuery('.store-locator__infobox--main .store-email').removeClass('nossficon')}
if($targetStoreElem.find('.store-fax').html()==""){jQuery('#info-fax').css('display','none');jQuery('.store-locator__infobox--main .store-fax').addClass('nossficon')}else{jQuery('#info-fax').css('display','block');jQuery('.store-locator__infobox--main .store-fax').removeClass('nossficon')}
if($targetStoreElem.find('.store-zip').html()==""){jQuery('#info-zip').css('display','none')}else{jQuery('#info-zip').css('display','block')}
if($targetStoreElem.find('.store-state').html()==""){jQuery('#info-state').css('display','none')}else{jQuery('#info-state').css('display','block')}
jQuery('.info__toggler').addClass('actives');jQuery('.info__toggler').removeClass('is-toggled');jQuery('.info__toggler-contents').removeClass('is-toggled')},200);jQuery('div[jsaction="closeControl.click"]').trigger('click');var _store={storeimage:$targetStoreElem.find('.store-image').html(),location:$targetStoreElem.find('.store-location').html(),custmmarker:$targetStoreElem.find('.store-custom-marker').html(),address:$targetStoreElem.find('.store-address').html(),website:$targetStoreElem.find('.store-website').html(),exturl:$targetStoreElem.find('.store-exturl').html(),embedvideo:$targetStoreElem.find('.store-embedvideo').html(),defaultmedia:$targetStoreElem.find('.store-defaultmedia').html(),email:$targetStoreElem.find('.store-email').html(),telephone:$targetStoreElem.find('.store-tel').html(),fax:$targetStoreElem.find('.store-fax').html(),contactus:$targetStoreElem.find('.store-contactus').html(),description:$targetStoreElem.find('.store-description').html(),zip:$targetStoreElem.find('.store-zip').html(),state:$targetStoreElem.find('.store-state').html(),operatingHours:$targetStoreElem.find('.store-operating-hours').html(),productsServices:$targetStoreElem.find('.store-products-services').html(),directions:$targetStoreElem.find('.infobox__cta').attr('href'),streetview:$targetStoreElem.find('.infobox__stv').attr('href')};var custm='';var custm=_store.custmmarker;if(_store.defaultmedia=='image'||_store.defaultmedia==''){if(_store.storeimage!=''){var splitstr=_store.storeimage.split("/");var ori_img=splitstr[splitstr.length-1];var imgpath='';for(var ssf_i=0;ssf_i<splitstr.length-1;ssf_i++){imgpath+=splitstr[ssf_i]+"/"}
setTimeout(function(){jQuery('div .info-img').css('height','150px');jQuery('div .info-img').html('');jQuery('#storeLocatorInfobox').children('div .info-img').on("click",function(e){showPopup(_store.location,imgpath+ori_img)});jQuery('.info-img').css('background-image','url('+_store.storeimage+')')},200)}else{jQuery('div .info-img').html('');jQuery('div .info-img').css('background-image','url("")');jQuery('#storeLocatorInfobox').children('div .info-img').unbind();jQuery('div .info-img').css('height','0px');setTimeout(imgToggleH,200)}}else{if(_store.embedvideo!=''){var video=base64.decode(_store.embedvideo);setTimeout(function(){jQuery('div .info-img').css('background-image','url("")');jQuery('div .info-img').css('height','250px');jQuery('div .info-img').html(video);var jQueryallVideos=jQuery(".ssf-content-section iframe[src^='http']");jQueryallVideos.each(function(){jQuery(this).data('aspectRatio',this.height/this.width).removeAttr('height').removeAttr('width')});var newWidth="100%";jQueryallVideos.each(function(){var jQueryel=jQuery(this);jQueryel.width(newWidth).height(newWidth)})},200)}else{jQuery('div .info-img').html('');jQuery('div .info-img').css('background-image','url("")');jQuery('#storeLocatorInfobox').children('div .info-img').unbind();jQuery('div .info-img').css('height','0px');setTimeout(imgToggleH,200)}}
if(_store.contactus!=''){contact_us_email=_store.contactus}
if(typeof(ssf_anatrac)!=='undefined'){if(ssf_anatrac=='true'){jQuery.ajax({type:"POST",url:ssf_wp_base+'/tracking.php?t='+d.getTime(),data:{ssf_wp_trk_store:_store.location},cache:!1,success:function(html){}})}}
if(typeof map.markers.stores.current!=='undefined'&&map.markers.stores.current!==null){map.markers.stores.current.set('labelClass',map.markers.stores.current.originalLabelClass);if(lastid!=''){map.markers.stores.current.setIcon(lastid)}else{map.markers.stores.current.setIcon(urls.pathToIcons+urls.pins.regular)}
map.markers.stores.current.setZIndex(map.markers.stores.current.originalZIndex)}
map.markers.stores.current=$targetStoreElem.data('storeMarker');var thereIsCurrentStore=(typeof map.markers.stores.current!=='undefined'&&map.markers.stores.current!==null);if(thereIsCurrentStore){map.markers.stores.current.set('labelClass',map.markers.stores.current.originalLabelClass+' is-active');if(custm!=''){lastid=custm;jQuery('.gmnoprint').children('img').unbind();map.markers.stores.current.setIcon(custm)}else{lastid='';map.markers.stores.current.setIcon(urls.pathToIcons+urls.pins.active)}
map.markers.stores.current.setZIndex(999);setMapCenter(map.markers.stores.current.position)}
$els.storeList.find('.store-locator__infobox').removeClass('is-active');$targetStoreElem.addClass('is-active');if(isMediumScreen){if(thereIsCurrentStore){map.infobox.self.open(map.self,map.markers.stores.current)}else{var mapCenter=map.self.getCenter(),fauxMarker=new google.maps.Marker({position:mapCenter});map.infobox.self.open(map.self,fauxMarker)}}
var infoboxArray=[$els.storeLocatorInfoBox,$els.mobileStoreLocatorInfobox];while(infoboxArray.length){infoboxArray[0].self.toggleClass('store-locator__infobox--no-pointer',!thereIsCurrentStore);infoboxArray[0].location.html(_store.storeimage);infoboxArray[0].location.html(_store.location);infoboxArray[0].address.html(_store.address);infoboxArray[0].website.html(_store.website);infoboxArray[0].exturl.html(_store.exturl);infoboxArray[0].email.html(_store.email);infoboxArray[0].telephone.html(_store.telephone);infoboxArray[0].fax.html(_store.fax);infoboxArray[0].zip.html(_store.zip);infoboxArray[0].state.html(_store.state);infoboxArray[0].description.html(_store.description);infoboxArray[0].operatingHours.html(_store.operatingHours);infoboxArray[0].productsServices.html(_store.productsServices);if(_store.directions){infoboxArray[0].directions.attr('href',_store.directions);infoboxArray[0].directions.css('display','')}else{infoboxArray[0].directions.hide()}
if(_store.streetview){infoboxArray[0].streetview.attr('href',_store.streetview);infoboxArray[0].streetview.css('display','')}else{infoboxArray[0].streetview.hide()}
infoboxArray.shift()}
$els.mobileStoreLocatorInfobox.self.addClass('is-shown');if(scroll_setting=='0'){if(isLargeScreen){jQuery('html, body').animate({scrollTop:jQuery('#mainContent').offset().top-scroll_to_top},'fast')}else if(isMediumScreen||thereIsCurrentStore){jQuery('html, body').animate({scrollTop:jQuery('#mainContent').offset().top},'fast')}else{jQuery('html, body').animate({scrollTop:jQuery('#mainContent').offset().top},'fast')}}else if(scroll_setting=='1'){jQuery("html,body").animate({scrollTop:0},'fast')}}
function setMainMapMarker(latLng,markerTitle){setMapCenter(latLng,!0);if(typeof map.markers.user.self!=='undefined')map.markers.user.self.setMap(null);map.markers.user.self=new MarkerWithLabel({position:latLng,map:map.self,animation:google.maps.Animation.DROP,title:markerTitle,zIndex:98,icon:urls.pathToIcons+urls.pins.skeuomorph});google.maps.event.removeListener(map.markers.user.clicker);map.markers.user.clicker=google.maps.event.addListener(map.markers.user.self,'click',function(){setMapCenter(map.markers.user.self.getPosition())})}
function setMapCenter(latLng,fitBounds){_map=map.self;if(ssf_wp_map_code!=""&&ssf_wp_map_code!=undefined){_map.setOptions({styles:ssf_wp_map_code})}else{if(style_map_color!=""){var styles=[{stylers:[{hue:style_map_color},{saturation:0},{lightness:50},{gamma:1},]}];_map.setOptions({styles:styles})}}
_map.setCenter(latLng);if(isLargeScreen&&ssf_pan_by_map=='true')_map.panBy(-100,0);if(_map.getZoom()<13&&fitBounds!==!0)_map.setZoom(14)}
function translateIntoLetter(index){if(index<26){switch(index){case 0:return'A';break;case 1:return'B';break;case 2:return'C';break;case 3:return'D';break;case 4:return'E';break;case 5:return'F';break;case 6:return'G';break;case 7:return'H';break;case 8:return'I';break;case 9:return'J';break;case 10:return'K';break;case 11:return'L';break;case 12:return'M';break;case 13:return'N';break;case 14:return'O';break;case 15:return'P';break;case 16:return'Q';break;case 17:return'R';break;case 18:return'S';break;case 19:return'T';break;case 20:return'U';break;case 21:return'V';break;case 22:return'W';break;case 23:return'X';break;case 24:return'Y';break;case 25:return'Z';break}}else{return''+(index-25)}}
function distanceAscendingSorter(a,b){var distA=a.distance,distB=b.distance;if(distA==='nope')distA=9999999;if(distB==='nope')distB=9999999;return(distA-distB)}
function sortordAscendingSorter(a,b){var distA=a.sortord,distB=b.sortord;if(distA==='nope')distA=9999999;if(distB==='nope')distB=9999999;return(distA-distB)}
function distHaversine(p1,p2){var R=6371;var dLat=rad(p2.lat()-p1.lat());var dLong=rad(p2.lng()-p1.lng());var a=Math.sin(dLat/2)*Math.sin(dLat/2)+Math.cos(rad(p1.lat()))*Math.cos(rad(p2.lat()))*Math.sin(dLong/2)*Math.sin(dLong/2);var c=2*Math.atan2(Math.sqrt(a),Math.sqrt(1-a));var d=R*c;return d.toFixed(3)}
function rad(x){return x*Math.PI/180}
function getText($obj){if(!$obj.length)return'';return jQuery.trim($obj.text())}
function locationNotAvailable(){map.status.notify({message:'notAllowedUserLocation',closeable:!0});jQuery('<a href="#/" class="inline-space-left inline-space-right">'+ssfContinueAnyway+'</a>').appendTo(map.status.$label).on('click',function(e){e.preventDefault();map.status.conceal()});map.status.$label.append('|');jQuery('<a href="#/" class="inline-space-left inline-space-right">'+ssfShareLocation+'</a>').appendTo(map.status.$label).on('click',function(e){e.preventDefault();geolocator.watch()})}};function setupMapStatus(){jQuery.extend(map.status,{notify:function(settings){var self=this;clearTimeout(self.timer);if(settings.message){var statusMessage=self.messages[settings.message]||settings.message;self.$label.find('a').off();self.$label.html(statusMessage)}
self.$el.toggleClass('is-loading',Boolean(settings.loadingIndicator));self.$el.toggleClass('is-closeable',Boolean(settings.closeable));self.reveal();if(settings.autoclose){self.timer=setTimeout(function(){self.conceal()},self.duration)}},reveal:function(){var $statusEl=this.$el,targetHeight;if($statusEl.hasClass('is-shown'))return;$statusEl.css('height','auto');targetHeight=$statusEl.height();$statusEl.css('height','').addClass('is-shown');setTimeout(function(){$statusEl.off(FE.events.transitionEnd).on(FE.events.transitionEnd,function(){jQuery(this).off(FE.events.transitionEnd).removeClass('is-transitionable').css('height','auto')}).addClass('is-transitionable').css('height',targetHeight+'px')},5)},conceal:function(){var $statusEl=map.status.$el;$statusEl.css('height',$statusEl.height()).removeClass('is-shown');setTimeout(function(){$statusEl.off(FE.events.transitionEnd).on(FE.events.transitionEnd,function(){jQuery(this).off(FE.events.transitionEnd).removeClass('is-transitionable')}).addClass('is-transitionable').css('height','')},5)}})}});jQuery(".info__toggler").on("click",function(e){var id=this.id;if(jQuery('#'+id).hasClass('actives')){jQuery('.info__toggler').addClass('actives');jQuery('#'+id).removeClass('actives')}else{jQuery('.info__toggler').addClass('actives')}})
function streetView(lat,lng){if(scroll_setting=='0'){jQuery('html, body').animate({scrollTop:jQuery('#mainContent').offset().top-scroll_to_top},'fast')}else if(scroll_setting=='1'){jQuery("html,body").animate({scrollTop:0},'fast')}
street=new google.maps.StreetViewPanorama(document.getElementById("storeLocatorMap"),{position:new google.maps.LatLng(lat,lng),zoomControl:!1,enableCloseButton:!0,addressControl:!1,panControl:!0,linksControl:!0})}
var base64={};base64.PADCHAR='=';base64.ALPHA='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';base64.makeDOMException=function(){var e,tmp;try{return new DOMException(DOMException.INVALID_CHARACTER_ERR)}catch(tmp){var ex=new Error("DOM Exception 5");ex.code=ex.number=5;ex.name=ex.description="INVALID_CHARACTER_ERR";ex.toString=function(){return'Error: '+ex.name+': '+ex.message};return ex}}
base64.getbyte64=function(s,i){var idx=base64.ALPHA.indexOf(s.charAt(i));if(idx===-1){throw base64.makeDOMException()}
return idx}
base64.decode=function(s){s=''+s;var getbyte64=base64.getbyte64;var pads,i,b10;var imax=s.length
if(imax===0){return s}
if(imax%4!==0){throw base64.makeDOMException()}
pads=0
if(s.charAt(imax-1)===base64.PADCHAR){pads=1;if(s.charAt(imax-2)===base64.PADCHAR){pads=2}
imax-=4}
var x=[];for(i=0;i<imax;i+=4){b10=(getbyte64(s,i)<<18)|(getbyte64(s,i+1)<<12)|(getbyte64(s,i+2)<<6)|getbyte64(s,i+3);x.push(String.fromCharCode(b10>>16,(b10>>8)&0xff,b10&0xff))}
switch(pads){case 1:b10=(getbyte64(s,i)<<18)|(getbyte64(s,i+1)<<12)|(getbyte64(s,i+2)<<6);x.push(String.fromCharCode(b10>>16,(b10>>8)&0xff));break;case 2:b10=(getbyte64(s,i)<<18)|(getbyte64(s,i+1)<<12);x.push(String.fromCharCode(b10>>16));break}
return x.join('')}
base64.getbyte=function(s,i){var x=s.charCodeAt(i);if(x>255){throw base64.makeDOMException()}
return x}
base64.encode=function(s){if(arguments.length!==1){throw new SyntaxError("Not enough arguments")}
var padchar=base64.PADCHAR;var alpha=base64.ALPHA;var getbyte=base64.getbyte;var i,b10;var x=[];s=''+s;var imax=s.length-s.length%3;if(s.length===0){return s}
for(i=0;i<imax;i+=3){b10=(getbyte(s,i)<<16)|(getbyte(s,i+1)<<8)|getbyte(s,i+2);x.push(alpha.charAt(b10>>18));x.push(alpha.charAt((b10>>12)&0x3F));x.push(alpha.charAt((b10>>6)&0x3f));x.push(alpha.charAt(b10&0x3f))}
switch(s.length-imax){case 1:b10=getbyte(s,i)<<16;x.push(alpha.charAt(b10>>18)+alpha.charAt((b10>>12)&0x3F)+padchar+padchar);break;case 2:b10=(getbyte(s,i)<<16)|(getbyte(s,i+1)<<8);x.push(alpha.charAt(b10>>18)+alpha.charAt((b10>>12)&0x3F)+alpha.charAt((b10>>6)&0x3f)+padchar);break}
return x.join('')}
function ssf_ifrane_vedio(){var jQueryallVideos=jQuery(".ssf-content-section iframe[src^='http']");jQueryallVideos.each(function(){jQuery(this).data('aspectRatio',this.height/this.width).removeAttr('height').removeAttr('width')});var newWidth="100%";jQueryallVideos.each(function(){var jQueryel=jQuery(this);jQueryel.width(newWidth).height(newWidth)})}
var number_of_pages;function pagging(ssf_pagination){var show_per_page=ssf_pagination;var number_of_items=jQuery('#storeLocator__storeList').children().size();number_of_pages=Math.ceil(number_of_items/show_per_page);jQuery('#current_page').val(0);jQuery('#show_per_page').val(show_per_page);jQuery('#storeLocator__currentStoreCount').html(number_of_items);if(number_of_pages>1){var navigation_html='<a class="previous_link arrow-toggler-left pagination-btn paginationgrey" id="ssf_previous_link" href="javascript:previous();"> '+ssf_prev_label+'</a>';var current_link=0;while(number_of_pages>current_link){navigation_html+='<a class="page_link" style="display:none;" href="javascript:go_to_page('+current_link+')" longdesc="'+current_link+'">'+(current_link+1)+'</a>';current_link++}
navigation_html+='<a class="next_link arrow-toggler-right pagination-btn ssf-button" id="ssf_next_link" href="javascript:next();">'+ssf_next_label+' </a>'}else{var navigation_html=''}
jQuery('#page_navigation').html(navigation_html);jQuery('#page_navigation .page_link:first').addClass('active_page');jQuery('#storeLocator__storeList').children().css('display','none');jQuery('#storeLocator__storeList').children().slice(0,show_per_page).css('display','block')}
function previous(){new_page=parseInt(jQuery('#current_page').val())-1;if(jQuery('.active_page').prev('.page_link').length==!0){go_to_page(new_page)}}
function next(){new_page=parseInt(jQuery('#current_page').val())+1;if(jQuery('.active_page').next('.page_link').length==!0){go_to_page(new_page)}}
function go_to_page(page_num){var show_per_page=parseInt(jQuery('#show_per_page').val());if(page_num==number_of_pages-1){jQuery('#ssf_next_link').addClass('paginationgrey');jQuery('#ssf_next_link').removeClass('ssf-button')}else{jQuery('#ssf_next_link').removeClass('paginationgrey');jQuery('#ssf_next_link').addClass('ssf-button')}
if(page_num>0){jQuery('#ssf_previous_link').removeClass('paginationgrey');jQuery('#ssf_previous_link').addClass('ssf-button')}else{jQuery('#ssf_previous_link').addClass('paginationgrey');jQuery('#ssf_previous_link').removeClass('ssf-button')}
start_from=page_num*show_per_page;end_on=start_from+show_per_page;jQuery('#storeLocator__storeList').children().css('display','none').slice(start_from,end_on).css('display','block');jQuery('.page_link[longdesc='+page_num+']').addClass('active_page').siblings('.active_page').removeClass('active_page');jQuery('#current_page').val(page_num);jQuery('#storeLocator__storeList').heightSyncify({items:['.infobox__body']});if(ssf_pan_by_map=='true'){jQuery("html,body").animate({scrollTop:jQuery("#storeLocator__storeListRow").offset().top-100},'slow')}else{jQuery("#super-left-panel").animate({scrollTop:0},'slow')}}
;jQuery(document).ready(function(){var d=new Date();var $mobile=jQuery('#storeLocatorInfobox .store-tel a');var $ssfemail=jQuery('#storeLocatorInfobox .store-email a');jQuery('#storeLocatorInfobox .store-tel,#mobileStoreLocatorInfobox .store-tel').on('click',function(e){var location=jQuery('.store-locator__infobox--main .store-location').html();jQuery.ajax({type:"POST",url:ssf_wp_base+'/tracking.php?t='+d.getTime(),data:{ssf_store_name:location},cache:!1,success:function(html){}})});jQuery('#storeLocatorInfobox .store-email, #mobileStoreLocatorInfobox .store-email').on('click',function(e){var location=jQuery('.store-locator__infobox--main .store-location').html();jQuery.ajax({type:"POST",url:ssf_wp_base+'/tracking.php?t='+d.getTime(),data:{ssf_email_name:location},cache:!1,success:function(html){}})});var typingTimer;var doneTypingInterval=3000;var $input=jQuery('#storeLocator__searchBar');$input.on('keyup',function(){clearTimeout(typingTimer);typingTimer=setTimeout(doneTyping,doneTypingInterval)});$input.on('keydown',function(){clearTimeout(typingTimer)});function doneTyping(){var searchPlace=jQuery('#storeLocator__searchBar').val();if(searchPlace!=''){jQuery.ajax({type:"POST",url:ssf_wp_base+'/tracking.php?t='+d.getTime(),data:{ssf_wp_track_add:searchPlace},cache:!1,success:function(html){}})}}})
;var ol=function(){"use strict";const t={1:"The view center is not defined",2:"The view resolution is not defined",3:"The view rotation is not defined",4:"`image` and `src` cannot be provided at the same time",5:"`imgSize` must be set when `image` is provided",7:"`format` must be set when `url` is set",8:"Unknown `serverType` configured",9:"`url` must be configured or set using `#setUrl()`",10:"The default `geometryFunction` can only handle `Point` geometries",11:"`options.featureTypes` must be an Array",12:"`options.geometryName` must also be provided when `options.bbox` is set",13:"Invalid corner",14:"Invalid color",15:"Tried to get a value for a key that does not exist in the cache",16:"Tried to set a value for a key that is used already",17:"`resolutions` must be sorted in descending order",18:"Either `origin` or `origins` must be configured, never both",19:"Number of `tileSizes` and `resolutions` must be equal",20:"Number of `origins` and `resolutions` must be equal",22:"Either `tileSize` or `tileSizes` must be configured, never both",24:"Invalid extent or geometry provided as `geometry`",25:"Cannot fit empty extent provided as `geometry`",26:"Features must have an id set",27:"Features must have an id set",28:'`renderMode` must be `"hybrid"` or `"vector"`',30:"The passed `feature` was already added to the source",31:"Tried to enqueue an `element` that was already added to the queue",32:"Transformation matrix cannot be inverted",33:"Invalid units",34:"Invalid geometry layout",36:"Unknown SRS type",37:"Unknown geometry type found",38:"`styleMapValue` has an unknown type",39:"Unknown geometry type",40:"Expected `feature` to have a geometry",41:"Expected an `ol/style/Style` or an array of `ol/style/Style.js`",42:"Question unknown, the answer is 42",43:"Expected `layers` to be an array or a `Collection`",47:"Expected `controls` to be an array or an `ol/Collection`",48:"Expected `interactions` to be an array or an `ol/Collection`",49:"Expected `overlays` to be an array or an `ol/Collection`",50:"`options.featureTypes` should be an Array",51:"Either `url` or `tileJSON` options must be provided",52:"Unknown `serverType` configured",53:"Unknown `tierSizeCalculation` configured",55:"The {-y} placeholder requires a tile grid with extent",56:"mapBrowserEvent must originate from a pointer event",57:"At least 2 conditions are required",59:"Invalid command found in the PBF",60:"Missing or invalid `size`",61:"Cannot determine IIIF Image API version from provided image information JSON",62:"A `WebGLArrayBuffer` must either be of type `ELEMENT_ARRAY_BUFFER` or `ARRAY_BUFFER`",64:"Layer opacity must be a number",66:"`forEachFeatureAtCoordinate` cannot be used on a WebGL layer if the hit detection logic has not been enabled. This is done by providing adequate shaders using the `hitVertexShader` and `hitFragmentShader` properties of `WebGLPointsLayerRenderer`",67:"A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both",68:"A VectorTile source can only be rendered if it has a projection compatible with the view projection"};class e extends Error{constructor(e){const i=t[e];super(i),this.code=e,this.name="AssertionError",this.message=i}}class i{constructor(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}}function n(t){t.stopPropagation()}var r="propertychange";class s{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}function o(t,e,i){let n,r;i=i||a;let s=0,o=t.length,l=!1;for(;s<o;)n=s+(o-s>>1),r=+i(t[n],e),r<0?s=n+1:(o=n,l=!r);return l?s:~s}function a(t,e){return t>e?1:t<e?-1:0}function l(t,e,i){const n=t.length;if(t[0]<=e)return 0;if(e<=t[n-1])return n-1;{let r;if(i>0){for(r=1;r<n;++r)if(t[r]<e)return r-1}else if(i<0){for(r=1;r<n;++r)if(t[r]<=e)return r}else for(r=1;r<n;++r){if(t[r]==e)return r;if(t[r]<e)return"function"==typeof i?i(e,t[r-1],t[r])>0?r-1:r:t[r-1]-e<e-t[r]?r-1:r}return n-1}}function h(t,e,i){for(;e<i;){const n=t[e];t[e]=t[i],t[i]=n,++e,--i}}function c(t,e){const i=Array.isArray(e)?e:[e],n=i.length;for(let e=0;e<n;e++)t[t.length]=i[e]}function u(t,e){const i=t.length;if(i!==e.length)return!1;for(let n=0;n<i;n++)if(t[n]!==e[n])return!1;return!0}function d(t,e,i){const n=e||a;return t.every((function(e,r){if(0===r)return!0;const s=n(t[r-1],e);return!(s>0||i&&0===s)}))}function g(){return!0}function f(){return!1}function p(){}function m(t){let e,i,n,r=!1;return function(){const s=Array.prototype.slice.call(arguments);return r&&this===n&&u(s,i)||(r=!0,n=this,i=s,e=t.apply(this,arguments)),e}}function _(t){return function(){let e;try{e=t()}catch(t){return Promise.reject(t)}return e instanceof Promise?e:Promise.resolve(e)}()}function y(t){for(const e in t)delete t[e]}function x(t){let e;for(e in t)return!1;return!e}class v extends s{constructor(t){super(),this.eventTarget_=t,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(t,e){if(!t||!e)return;const i=this.listeners_||(this.listeners_={}),n=i[t]||(i[t]=[]);n.includes(e)||n.push(e)}dispatchEvent(t){const e="string"==typeof t,n=e?t:t.type,r=this.listeners_&&this.listeners_[n];if(!r)return;const s=e?new i(t):t;s.target||(s.target=this.eventTarget_||this);const o=this.dispatching_||(this.dispatching_={}),a=this.pendingRemovals_||(this.pendingRemovals_={});let l;n in o||(o[n]=0,a[n]=0),++o[n];for(let t=0,e=r.length;t<e;++t)if(l="handleEvent"in r[t]?r[t].handleEvent(s):r[t].call(this,s),!1===l||s.propagationStopped){l=!1;break}if(0==--o[n]){let t=a[n];for(delete a[n];t--;)this.removeEventListener(n,p);delete o[n]}return l}disposeInternal(){this.listeners_&&y(this.listeners_)}getListeners(t){return this.listeners_&&this.listeners_[t]||void 0}hasListener(t){return!!this.listeners_&&(t?t in this.listeners_:Object.keys(this.listeners_).length>0)}removeEventListener(t,e){const i=this.listeners_&&this.listeners_[t];if(i){const n=i.indexOf(e);-1!==n&&(this.pendingRemovals_&&t in this.pendingRemovals_?(i[n]=p,++this.pendingRemovals_[t]):(i.splice(n,1),0===i.length&&delete this.listeners_[t]))}}}var S="change",w="error",E="contextmenu",T="click",C="dblclick",b="dragenter",R="dragover",P="drop",I="keydown",L="keypress",M="load",F="resize",A="touchmove",O="wheel";function N(t,e,i,n,r){if(n&&n!==t&&(i=i.bind(n)),r){const n=i;i=function(){t.removeEventListener(e,i),n.apply(this,arguments)}}const s={target:t,type:e,listener:i};return t.addEventListener(e,i),s}function D(t,e,i,n){return N(t,e,i,n,!0)}function k(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),y(t))}class G extends v{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(S)}getRevision(){return this.revision_}onInternal(t,e){if(Array.isArray(t)){const i=t.length,n=new Array(i);for(let r=0;r<i;++r)n[r]=N(this,t[r],e);return n}return N(this,t,e)}onceInternal(t,e){let i;if(Array.isArray(t)){const n=t.length;i=new Array(n);for(let r=0;r<n;++r)i[r]=D(this,t[r],e)}else i=D(this,t,e);return e.ol_key=i,i}unInternal(t,e){const i=e.ol_key;if(i)j(i);else if(Array.isArray(t))for(let i=0,n=t.length;i<n;++i)this.removeEventListener(t[i],e);else this.removeEventListener(t,e)}}function j(t){if(Array.isArray(t))for(let e=0,i=t.length;e<i;++e)k(t[e]);else k(t)}function B(){throw new Error("Unimplemented abstract method.")}G.prototype.on,G.prototype.once,G.prototype.un;let U=0;function z(t){return t.ol_uid||(t.ol_uid=String(++U))}class X extends i{constructor(t,e,i){super(t),this.key=e,this.oldValue=i}}class V extends G{constructor(t){super(),this.on,this.once,this.un,z(this),this.values_=null,void 0!==t&&this.setProperties(t)}get(t){let e;return this.values_&&this.values_.hasOwnProperty(t)&&(e=this.values_[t]),e}getKeys(){return this.values_&&Object.keys(this.values_)||[]}getProperties(){return this.values_&&Object.assign({},this.values_)||{}}hasProperties(){return!!this.values_}notify(t,e){let i;i=`change:${t}`,this.hasListener(i)&&this.dispatchEvent(new X(i,t,e)),i=r,this.hasListener(i)&&this.dispatchEvent(new X(i,t,e))}addChangeListener(t,e){this.addEventListener(`change:${t}`,e)}removeChangeListener(t,e){this.removeEventListener(`change:${t}`,e)}set(t,e,i){const n=this.values_||(this.values_={});if(i)n[t]=e;else{const i=n[t];n[t]=e,i!==e&&this.notify(t,i)}}setProperties(t,e){for(const i in t)this.set(i,t[i],e)}applyProperties(t){t.values_&&Object.assign(this.values_||(this.values_={}),t.values_)}unset(t,e){if(this.values_&&t in this.values_){const i=this.values_[t];delete this.values_[t],x(this.values_)&&(this.values_=null),e||this.notify(t,i)}}}var W="add",Z="remove";const Y="length";class K extends i{constructor(t,e,i){super(t),this.element=e,this.index=i}}class q extends V{constructor(t,e){if(super(),this.on,this.once,this.un,e=e||{},this.unique_=!!e.unique,this.array_=t||[],this.unique_)for(let t=0,e=this.array_.length;t<e;++t)this.assertUnique_(this.array_[t],t);this.updateLength_()}clear(){for(;this.getLength()>0;)this.pop()}extend(t){for(let e=0,i=t.length;e<i;++e)this.push(t[e]);return this}forEach(t){const e=this.array_;for(let i=0,n=e.length;i<n;++i)t(e[i],i,e)}getArray(){return this.array_}item(t){return this.array_[t]}getLength(){return this.get(Y)}insertAt(t,e){if(t<0||t>this.getLength())throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new K(W,e,t))}pop(){return this.removeAt(this.getLength()-1)}push(t){this.unique_&&this.assertUnique_(t);const e=this.getLength();return this.insertAt(e,t),this.getLength()}remove(t){const e=this.array_;for(let i=0,n=e.length;i<n;++i)if(e[i]===t)return this.removeAt(i)}removeAt(t){if(t<0||t>=this.getLength())return;const e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new K(Z,e,t)),e}setAt(t,e){if(t>=this.getLength())return void this.insertAt(t,e);if(t<0)throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(e,t);const i=this.array_[t];this.array_[t]=e,this.dispatchEvent(new K(Z,i,t)),this.dispatchEvent(new K(W,e,t))}updateLength_(){this.set(Y,this.array_.length)}assertUnique_(t,i){for(let n=0,r=this.array_.length;n<r;++n)if(this.array_[n]===t&&n!==i)throw new e(58)}}var H=0,$=1,J=2,Q=3,tt=4;function et(t){return Math.pow(t,3)}function it(t){return 1-et(1-t)}function nt(t){return 3*t*t-2*t*t*t}function rt(t){return t}class st extends v{constructor(t,e,i){super(),i=i||{},this.tileCoord=t,this.state=e,this.interimTile=null,this.key="",this.transition_=void 0===i.transition?250:i.transition,this.transitionStarts_={},this.interpolate=!!i.interpolate}changed(){this.dispatchEvent(S)}release(){this.state===Q&&this.setState(tt)}getKey(){return this.key+"/"+this.tileCoord}getInterimTile(){if(!this.interimTile)return this;let t=this.interimTile;do{if(t.getState()==J)return this.transition_=0,t;t=t.interimTile}while(t);return this}refreshInterimChain(){if(!this.interimTile)return;let t=this.interimTile,e=this;do{if(t.getState()==J){t.interimTile=null;break}t.getState()==$?e=t:t.getState()==H?e.interimTile=t.interimTile:e=t,t=e.interimTile}while(t)}getTileCoord(){return this.tileCoord}getState(){return this.state}setState(t){if(this.state!==Q&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()}load(){B()}getAlpha(t,e){if(!this.transition_)return 1;let i=this.transitionStarts_[t];if(i){if(-1===i)return 1}else i=e,this.transitionStarts_[t]=i;const n=e-i+1e3/60;return n>=this.transition_?1:et(n/this.transition_)}inTransition(t){return!!this.transition_&&-1!==this.transitionStarts_[t]}endTransition(t){this.transition_&&(this.transitionStarts_[t]=-1)}}class ot extends st{constructor(t){const e=H;super(t.tileCoord,e,{transition:t.transition,interpolate:t.interpolate}),this.loader_=t.loader,this.data_=null,this.error_=null,this.size_=t.size||[256,256]}getSize(){return this.size_}getData(){return this.data_}getError(){return this.error_}load(){if(this.state!==H&&this.state!==Q)return;this.state=$,this.changed();const t=this;this.loader_().then((function(e){t.data_=e,t.state=J,t.changed()})).catch((function(e){t.error_=e,t.state=Q,t.changed()}))}}function at(t,i){if(!t)throw new e(i)}class lt extends V{constructor(t){if(super(),this.on,this.once,this.un,this.id_=void 0,this.geometryName_="geometry",this.style_=null,this.styleFunction_=void 0,this.geometryChangeKey_=null,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),t)if("function"==typeof t.getSimplifiedGeometry){const e=t;this.setGeometry(e)}else{const e=t;this.setProperties(e)}}clone(){const t=new lt(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());const e=this.getGeometry();e&&t.setGeometry(e.clone());const i=this.getStyle();return i&&t.setStyle(i),t}getGeometry(){return this.get(this.geometryName_)}getId(){return this.id_}getGeometryName(){return this.geometryName_}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}handleGeometryChange_(){this.changed()}handleGeometryChanged_(){this.geometryChangeKey_&&(k(this.geometryChangeKey_),this.geometryChangeKey_=null);const t=this.getGeometry();t&&(this.geometryChangeKey_=N(t,S,this.handleGeometryChange_,this)),this.changed()}setGeometry(t){this.set(this.geometryName_,t)}setStyle(t){this.style_=t,this.styleFunction_=t?ht(t):void 0,this.changed()}setId(t){this.id_=t,this.changed()}setGeometryName(t){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=t,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()}}function ht(t){if("function"==typeof t)return t;{let e;if(Array.isArray(t))e=t;else{at("function"==typeof t.getZIndex,41);e=[t]}return function(){return e}}}const ct="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"",ut=ct.includes("firefox"),dt=ct.includes("safari")&&!ct.includes("chrom"),gt=dt&&(ct.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(ct)),ft=ct.includes("webkit")&&!ct.includes("edge"),pt=ct.includes("macintosh"),mt="undefined"!=typeof devicePixelRatio?devicePixelRatio:1,_t="undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&self instanceof WorkerGlobalScope,yt="undefined"!=typeof Image&&Image.prototype.decode,xt=function(){let t=!1;try{const e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch(t){}return t}(),vt=new Array(6);function St(){return[1,0,0,1,0,0]}function wt(t){return Tt(t,1,0,0,1,0,0)}function Et(t,e){const i=t[0],n=t[1],r=t[2],s=t[3],o=t[4],a=t[5],l=e[0],h=e[1],c=e[2],u=e[3],d=e[4],g=e[5];return t[0]=i*l+r*h,t[1]=n*l+s*h,t[2]=i*c+r*u,t[3]=n*c+s*u,t[4]=i*d+r*g+o,t[5]=n*d+s*g+a,t}function Tt(t,e,i,n,r,s,o){return t[0]=e,t[1]=i,t[2]=n,t[3]=r,t[4]=s,t[5]=o,t}function Ct(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function bt(t,e){const i=e[0],n=e[1];return e[0]=t[0]*i+t[2]*n+t[4],e[1]=t[1]*i+t[3]*n+t[5],e}function Rt(t,e){const i=Math.cos(e),n=Math.sin(e);return Et(t,Tt(vt,i,n,-n,i,0,0))}function Pt(t,e,i){return Et(t,Tt(vt,e,0,0,i,0,0))}function It(t,e,i){return Tt(t,e,0,0,i,0,0)}function Lt(t,e,i){return Et(t,Tt(vt,1,0,0,1,e,i))}function Mt(t,e,i,n,r,s,o,a){const l=Math.sin(s),h=Math.cos(s);return t[0]=n*h,t[1]=r*l,t[2]=-n*l,t[3]=r*h,t[4]=o*n*h-a*n*l+e,t[5]=o*r*l+a*r*h+i,t}function Ft(t,e){const i=At(e);at(0!==i,32);const n=e[0],r=e[1],s=e[2],o=e[3],a=e[4],l=e[5];return t[0]=o/i,t[1]=-r/i,t[2]=-s/i,t[3]=n/i,t[4]=(s*l-o*a)/i,t[5]=-(n*l-r*a)/i,t}function At(t){return t[0]*t[3]-t[1]*t[2]}let Ot;function Nt(t){const e="matrix("+t.join(", ")+")";if(_t)return e;const i=Ot||(Ot=document.createElement("div"));return i.style.transform=e,i.style.transform}var Dt=0,kt=1,Gt=2,jt=4,Bt=8,Ut=16;function zt(t){const e=Ht();for(let i=0,n=t.length;i<n;++i)re(e,t[i]);return e}function Xt(t,e,i){return i?(i[0]=t[0]-e,i[1]=t[1]-e,i[2]=t[2]+e,i[3]=t[3]+e,i):[t[0]-e,t[1]-e,t[2]+e,t[3]+e]}function Vt(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t.slice()}function Wt(t,e,i){let n,r;return n=e<t[0]?t[0]-e:t[2]<e?e-t[2]:0,r=i<t[1]?t[1]-i:t[3]<i?i-t[3]:0,n*n+r*r}function Zt(t,e){return Kt(t,e[0],e[1])}function Yt(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}function Kt(t,e,i){return t[0]<=e&&e<=t[2]&&t[1]<=i&&i<=t[3]}function qt(t,e){const i=t[0],n=t[1],r=t[2],s=t[3],o=e[0],a=e[1];let l=Dt;return o<i?l|=Ut:o>r&&(l|=jt),a<n?l|=Bt:a>s&&(l|=Gt),l===Dt&&(l=kt),l}function Ht(){return[1/0,1/0,-1/0,-1/0]}function $t(t,e,i,n,r){return r?(r[0]=t,r[1]=e,r[2]=i,r[3]=n,r):[t,e,i,n]}function Jt(t){return $t(1/0,1/0,-1/0,-1/0,t)}function Qt(t,e){const i=t[0],n=t[1];return $t(i,n,i,n,e)}function te(t,e,i,n,r){return oe(Jt(r),t,e,i,n)}function ee(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function ie(t,e,i){return Math.abs(t[0]-e[0])<i&&Math.abs(t[2]-e[2])<i&&Math.abs(t[1]-e[1])<i&&Math.abs(t[3]-e[3])<i}function ne(t,e){return e[0]<t[0]&&(t[0]=e[0]),e[2]>t[2]&&(t[2]=e[2]),e[1]<t[1]&&(t[1]=e[1]),e[3]>t[3]&&(t[3]=e[3]),t}function re(t,e){e[0]<t[0]&&(t[0]=e[0]),e[0]>t[2]&&(t[2]=e[0]),e[1]<t[1]&&(t[1]=e[1]),e[1]>t[3]&&(t[3]=e[1])}function se(t,e){for(let i=0,n=e.length;i<n;++i)re(t,e[i]);return t}function oe(t,e,i,n,r){for(;i<n;i+=r)le(t,e[i],e[i+1]);return t}function ae(t,e){for(let i=0,n=e.length;i<n;++i)se(t,e[i]);return t}function le(t,e,i){t[0]=Math.min(t[0],e),t[1]=Math.min(t[1],i),t[2]=Math.max(t[2],e),t[3]=Math.max(t[3],i)}function he(t,e){let i;return i=e(ue(t)),i||(i=e(de(t)),i||(i=e(ve(t)),i||(i=e(xe(t)),i||!1)))}function ce(t){let e=0;return Ee(t)||(e=Se(t)*_e(t)),e}function ue(t){return[t[0],t[1]]}function de(t){return[t[2],t[1]]}function ge(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function fe(t,e){let i;return"bottom-left"===e?i=ue(t):"bottom-right"===e?i=de(t):"top-left"===e?i=xe(t):"top-right"===e?i=ve(t):at(!1,13),i}function pe(t,e,i,n,r){const[s,o,a,l,h,c,u,d]=me(t,e,i,n);return $t(Math.min(s,a,h,u),Math.min(o,l,c,d),Math.max(s,a,h,u),Math.max(o,l,c,d),r)}function me(t,e,i,n){const r=e*n[0]/2,s=e*n[1]/2,o=Math.cos(i),a=Math.sin(i),l=r*o,h=r*a,c=s*o,u=s*a,d=t[0],g=t[1];return[d-l+u,g-h-c,d-l-u,g-h+c,d+l-u,g+h+c,d+l+u,g+h-c,d-l+u,g-h-c]}function _e(t){return t[3]-t[1]}function ye(t,e,i){const n=i||[1/0,1/0,-1/0,-1/0];return we(t,e)?(t[0]>e[0]?n[0]=t[0]:n[0]=e[0],t[1]>e[1]?n[1]=t[1]:n[1]=e[1],t[2]<e[2]?n[2]=t[2]:n[2]=e[2],t[3]<e[3]?n[3]=t[3]:n[3]=e[3]):Jt(n),n}function xe(t){return[t[0],t[3]]}function ve(t){return[t[2],t[3]]}function Se(t){return t[2]-t[0]}function we(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function Ee(t){return t[2]<t[0]||t[3]<t[1]}function Te(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t}function Ce(t,e){const i=(t[2]-t[0])/2*(e-1),n=(t[3]-t[1])/2*(e-1);t[0]-=i,t[2]+=i,t[1]-=n,t[3]+=n}function be(t,e,i){let n=!1;const r=qt(t,e),s=qt(t,i);if(r===kt||s===kt)n=!0;else{const o=t[0],a=t[1],l=t[2],h=t[3],c=e[0],u=e[1],d=i[0],g=i[1],f=(g-u)/(d-c);let p,m;s&Gt&&!(r&Gt)&&(p=d-(g-h)/f,n=p>=o&&p<=l),n||!(s&jt)||r&jt||(m=g-(d-l)*f,n=m>=a&&m<=h),n||!(s&Bt)||r&Bt||(p=d-(g-a)/f,n=p>=o&&p<=l),n||!(s&Ut)||r&Ut||(m=g-(d-o)*f,n=m>=a&&m<=h)}return n}function Re(t,e,i,n){let r=[];if(n>1){const e=t[2]-t[0],i=t[3]-t[1];for(let s=0;s<n;++s)r.push(t[0]+e*s/n,t[1],t[2],t[1]+i*s/n,t[2]-e*s/n,t[3],t[0],t[3]-i*s/n)}else r=[t[0],t[1],t[2],t[1],t[2],t[3],t[0],t[3]];e(r,r,2);const s=[],o=[];for(let t=0,e=r.length;t<e;t+=2)s.push(r[t]),o.push(r[t+1]);return function(t,e,i){return $t(Math.min.apply(null,t),Math.min.apply(null,e),Math.max.apply(null,t),Math.max.apply(null,e),i)}(s,o,i)}function Pe(t,e){const i=e.getExtent(),n=ge(t);if(e.canWrapX()&&(n[0]<i[0]||n[0]>=i[2])){const e=Se(i),r=Math.floor((n[0]-i[0])/e)*e;t[0]-=r,t[2]-=r}return t}function Ie(t,e){if(e.canWrapX()){const i=e.getExtent();if(!isFinite(t[0])||!isFinite(t[2]))return[[i[0],t[1],i[2],t[3]]];Pe(t,e);const n=Se(i);if(Se(t)>n)return[[i[0],t[1],i[2],t[3]]];if(t[0]<i[0])return[[t[0]+n,t[1],i[2],t[3]],[i[0],t[1],t[2],t[3]]];if(t[2]>i[2])return[[t[0],t[1],i[2],t[3]],[i[0],t[1],t[2]-n,t[3]]]}return[t]}const Le={9001:"m",9002:"ft",9003:"us-ft",9101:"radians",9102:"degrees"};function Me(t){return Le[t]}const Fe={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};class Ae{constructor(t){this.code_=t.code,this.units_=t.units,this.extent_=void 0!==t.extent?t.extent:null,this.worldExtent_=void 0!==t.worldExtent?t.worldExtent:null,this.axisOrientation_=void 0!==t.axisOrientation?t.axisOrientation:"enu",this.global_=void 0!==t.global&&t.global,this.canWrapX_=!(!this.global_||!this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||Fe[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(t){this.global_=t,this.canWrapX_=!(!t||!this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(t){this.defaultTileGrid_=t}setExtent(t){this.extent_=t,this.canWrapX_=!(!this.global_||!t)}setWorldExtent(t){this.worldExtent_=t}setGetPointResolution(t){this.getPointResolutionFunc_=t}getPointResolutionFunc(){return this.getPointResolutionFunc_}}const Oe=6378137,Ne=Math.PI*Oe,De=[-Ne,-Ne,Ne,Ne],ke=[-180,-85,180,85],Ge=Oe*Math.log(Math.tan(Math.PI/2));class je extends Ae{constructor(t){super({code:t,units:"m",extent:De,global:!0,worldExtent:ke,getPointResolution:function(t,e){return t/Math.cosh(e[1]/Oe)}})}}const Be=[new je("EPSG:3857"),new je("EPSG:102100"),new je("EPSG:102113"),new je("EPSG:900913"),new je("http://www.opengis.net/def/crs/EPSG/0/3857"),new je("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Ue(t,e,i){const n=t.length;i=i>1?i:2,void 0===e&&(e=i>2?t.slice():new Array(n));for(let r=0;r<n;r+=i){e[r]=Ne*t[r]/180;let i=Oe*Math.log(Math.tan(Math.PI*(+t[r+1]+90)/360));i>Ge?i=Ge:i<-Ge&&(i=-Ge),e[r+1]=i}return e}function ze(t,e,i){const n=t.length;i=i>1?i:2,void 0===e&&(e=i>2?t.slice():new Array(n));for(let r=0;r<n;r+=i)e[r]=180*t[r]/Ne,e[r+1]=360*Math.atan(Math.exp(t[r+1]/Oe))/Math.PI-90;return e}const Xe=6378137,Ve=[-180,-90,180,90],We=Math.PI*Xe/180;class Ze extends Ae{constructor(t,e){super({code:t,units:"degrees",extent:Ve,axisOrientation:e,global:!0,metersPerUnit:We,worldExtent:Ve})}}const Ye=[new Ze("CRS:84"),new Ze("EPSG:4326","neu"),new Ze("urn:ogc:def:crs:OGC:1.3:CRS84"),new Ze("urn:ogc:def:crs:OGC:2:84"),new Ze("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new Ze("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new Ze("http://www.opengis.net/def/crs/EPSG/0/4326","neu")];let Ke={};function qe(){Ke={}}function He(t){return Ke[t]||Ke[t.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}function $e(t,e){Ke[t]=e}let Je={};function Qe(){Je={}}function ti(t,e,i){const n=t.getCode(),r=e.getCode();n in Je||(Je[n]={}),Je[n][r]=i}function ei(t,e){let i;return t in Je&&e in Je[t]&&(i=Je[t][e]),i}function ii(t,e,i){return Math.min(Math.max(t,e),i)}function ni(t,e,i,n,r,s){const o=r-i,a=s-n;if(0!==o||0!==a){const l=((t-i)*o+(e-n)*a)/(o*o+a*a);l>1?(i=r,n=s):l>0&&(i+=o*l,n+=a*l)}return ri(t,e,i,n)}function ri(t,e,i,n){const r=i-t,s=n-e;return r*r+s*s}function si(t){const e=t.length;for(let i=0;i<e;i++){let n=i,r=Math.abs(t[i][i]);for(let s=i+1;s<e;s++){const e=Math.abs(t[s][i]);e>r&&(r=e,n=s)}if(0===r)return null;const s=t[n];t[n]=t[i],t[i]=s;for(let n=i+1;n<e;n++){const r=-t[n][i]/t[i][i];for(let s=i;s<e+1;s++)i==s?t[n][s]=0:t[n][s]+=r*t[i][s]}}const i=new Array(e);for(let n=e-1;n>=0;n--){i[n]=t[n][e]/t[n][n];for(let r=n-1;r>=0;r--)t[r][e]-=t[r][n]*i[n]}return i}function oi(t){return 180*t/Math.PI}function ai(t){return t*Math.PI/180}function li(t,e){const i=t%e;return i*e<0?i+e:i}function hi(t,e,i){return t+i*(e-t)}function ci(t,e){const i=Math.pow(10,e);return Math.round(t*i)/i}function ui(t,e){return Math.round(ci(t,e))}function di(t,e){return Math.floor(ci(t,e))}function gi(t,e){return Math.ceil(ci(t,e))}function fi(t,e,i){const n=void 0!==i?t.toFixed(i):""+t;let r=n.indexOf(".");return r=-1===r?n.length:r,r>e?n:new Array(1+e-r).join("0")+n}function pi(t,e){const i=(""+t).split("."),n=(""+e).split(".");for(let t=0;t<Math.max(i.length,n.length);t++){const e=parseInt(i[t]||"0",10),r=parseInt(n[t]||"0",10);if(e>r)return 1;if(r>e)return-1}return 0}function mi(t,e){return t[0]+=+e[0],t[1]+=+e[1],t}function _i(t,e){const i=e.getRadius(),n=e.getCenter(),r=n[0],s=n[1];let o=t[0]-r;const a=t[1]-s;0===o&&0===a&&(o=1);const l=Math.sqrt(o*o+a*a);return[r+i*o/l,s+i*a/l]}function yi(t,e){const i=t[0],n=t[1],r=e[0],s=e[1],o=r[0],a=r[1],l=s[0],h=s[1],c=l-o,u=h-a,d=0===c&&0===u?0:(c*(i-o)+u*(n-a))/(c*c+u*u||0);let g,f;return d<=0?(g=o,f=a):d>=1?(g=l,f=h):(g=o+d*c,f=a+d*u),[g,f]}function xi(t,e,i){const n=li(e+180,360)-180,r=Math.abs(3600*n),s=i||0;let o=Math.floor(r/3600),a=Math.floor((r-3600*o)/60),l=ci(r-3600*o-60*a,s);l>=60&&(l=0,a+=1),a>=60&&(a=0,o+=1);let h=o+"°";return 0===a&&0===l||(h+=" "+fi(a,2)+"′"),0!==l&&(h+=" "+fi(l,2,s)+"″"),0!==n&&(h+=" "+t.charAt(n<0?1:0)),h}function vi(t,e,i){return t?e.replace("{x}",t[0].toFixed(i)).replace("{y}",t[1].toFixed(i)):""}function Si(t,e){let i=!0;for(let n=t.length-1;n>=0;--n)if(t[n]!=e[n]){i=!1;break}return i}function wi(t,e){const i=Math.cos(e),n=Math.sin(e),r=t[0]*i-t[1]*n,s=t[1]*i+t[0]*n;return t[0]=r,t[1]=s,t}function Ei(t,e){return t[0]*=e,t[1]*=e,t}function Ti(t,e){const i=t[0]-e[0],n=t[1]-e[1];return i*i+n*n}function Ci(t,e){return Math.sqrt(Ti(t,e))}function bi(t,e){return Ti(t,yi(t,e))}function Ri(t,e){return vi(t,"{x}, {y}",e)}function Pi(t,e){if(e.canWrapX()){const i=Se(e.getExtent()),n=Ii(t,e,i);n&&(t[0]-=n*i)}return t}function Ii(t,e,i){const n=e.getExtent();let r=0;return e.canWrapX()&&(t[0]<n[0]||t[0]>n[2])&&(i=i||Se(n),r=Math.floor((t[0]-n[0])/i)),r}const Li=6371008.8;function Mi(t,e,i){i=i||Li;const n=ai(t[1]),r=ai(e[1]),s=(r-n)/2,o=ai(e[0]-t[0])/2,a=Math.sin(s)*Math.sin(s)+Math.sin(o)*Math.sin(o)*Math.cos(n)*Math.cos(r);return 2*i*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))}function Fi(t,e){let i=0;for(let n=0,r=t.length;n<r-1;++n)i+=Mi(t[n],t[n+1],e);return i}function Ai(t,e){let i=0;const n=t.length;let r=t[n-1][0],s=t[n-1][1];for(let e=0;e<n;e++){const n=t[e][0],o=t[e][1];i+=ai(n-r)*(2+Math.sin(ai(s))+Math.sin(ai(o))),r=n,s=o}return i*e*e/2}function Oi(t,e,i,n){n=n||Li;const r=ai(t[1]),s=ai(t[0]),o=e/n,a=Math.asin(Math.sin(r)*Math.cos(o)+Math.cos(r)*Math.sin(o)*Math.cos(i));return[oi(s+Math.atan2(Math.sin(i)*Math.sin(o)*Math.cos(r),Math.cos(o)-Math.sin(r)*Math.sin(a))),oi(a)]}let Ni=!0;function Di(t){Ni=!(void 0===t||t)}function ki(t,e,i){if(void 0!==e)for(let i=0,n=t.length;i<n;++i)e[i]=t[i];else e=t.slice();return e}function Gi(t,e,i){if(void 0!==e&&t!==e){for(let i=0,n=t.length;i<n;++i)e[i]=t[i];t=e}return t}function ji(t){$e(t.getCode(),t),ti(t,t,ki)}function Bi(t){t.forEach(ji)}function Ui(t){return"string"==typeof t?He(t):t||null}function zi(t,e,i,n){let r;const s=(t=Ui(t)).getPointResolutionFunc();if(s){if(r=s(e,i),n&&n!==t.getUnits()){const e=t.getMetersPerUnit();e&&(r=r*e/Fe[n])}}else{const s=t.getUnits();if("degrees"==s&&!n||"degrees"==n)r=e;else{const o=qi(t,Ui("EPSG:4326"));if(o===Gi&&"degrees"!==s)r=e*t.getMetersPerUnit();else{let t=[i[0]-e/2,i[1],i[0]+e/2,i[1],i[0],i[1]-e/2,i[0],i[1]+e/2];t=o(t,t,2);r=(Mi(t.slice(0,2),t.slice(2,4))+Mi(t.slice(4,6),t.slice(6,8)))/2}const a=n?Fe[n]:t.getMetersPerUnit();void 0!==a&&(r/=a)}}return r}function Xi(t){Bi(t),t.forEach((function(e){t.forEach((function(t){e!==t&&ti(e,t,ki)}))}))}function Vi(t,e,i,n){t.forEach((function(t){e.forEach((function(e){ti(t,e,i),ti(e,t,n)}))}))}function Wi(t,e){return t?"string"==typeof t?Ui(t):t:Ui(e)}function Zi(t){return function(e,i,n){const r=e.length;n=void 0!==n?n:2,i=void 0!==i?i:new Array(r);for(let s=0;s<r;s+=n){const r=t(e.slice(s,s+n)),o=r.length;for(let t=0,a=n;t<a;++t)i[s+t]=t>=o?e[s+t]:r[t]}return i}}function Yi(t,e,i,n){const r=Ui(t),s=Ui(e);ti(r,s,Zi(i)),ti(s,r,Zi(n))}function Ki(t,e){if(t===e)return!0;const i=t.getUnits()===e.getUnits();if(t.getCode()===e.getCode())return i;return qi(t,e)===ki&&i}function qi(t,e){let i=ei(t.getCode(),e.getCode());return i||(i=Gi),i}function Hi(t,e){return qi(Ui(t),Ui(e))}function $i(t,e,i){return Hi(e,i)(t,void 0,t.length)}function Ji(t,e,i,n){return Re(t,Hi(e,i),void 0,n)}let Qi=null;function tn(t){Qi=Ui(t)}function en(){return Qi}function nn(t,e){return Qi?$i(t,e,Qi):t}function rn(t,e){return Qi?$i(t,Qi,e):(Ni&&!Si(t,[0,0])&&t[0]>=-180&&t[0]<=180&&t[1]>=-90&&t[1]<=90&&(Ni=!1,console.warn("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),t)}function sn(t,e){return Qi?Ji(t,e,Qi):t}function on(t,e){return Qi?Ji(t,Qi,e):t}function an(t,e){if(!Qi)return t;const i=Ui(e).getUnits(),n=Qi.getUnits();return i&&n?t*Fe[i]/Fe[n]:t}function ln(t,e){if(!Qi)return t;const i=Ui(e).getUnits(),n=Qi.getUnits();return i&&n?t*Fe[n]/Fe[i]:t}function hn(t,e,i){return function(n){let r,s;if(t.canWrapX()){const e=t.getExtent(),o=Se(e);s=Ii(n=n.slice(0),t,o),s&&(n[0]=n[0]-s*o),n[0]=ii(n[0],e[0],e[2]),n[1]=ii(n[1],e[1],e[3]),r=i(n)}else r=i(n);return s&&e.canWrapX()&&(r[0]+=s*Se(e.getExtent())),r}}function cn(){Xi(Be),Xi(Ye),Vi(Ye,Be,Ue,ze)}function un(t,e,i,n,r,s){s=s||[];let o=0;for(let a=e;a<i;a+=n){const e=t[a],i=t[a+1];s[o++]=r[0]*e+r[2]*i+r[4],s[o++]=r[1]*e+r[3]*i+r[5]}return s&&s.length!=o&&(s.length=o),s}function dn(t,e,i,n,r,s,o){o=o||[];const a=Math.cos(r),l=Math.sin(r),h=s[0],c=s[1];let u=0;for(let r=e;r<i;r+=n){const e=t[r]-h,i=t[r+1]-c;o[u++]=h+e*a-i*l,o[u++]=c+e*l+i*a;for(let e=r+2;e<r+n;++e)o[u++]=t[e]}return o&&o.length!=u&&(o.length=u),o}function gn(t,e,i,n,r,s,o,a){a=a||[];const l=o[0],h=o[1];let c=0;for(let o=e;o<i;o+=n){const e=t[o]-l,i=t[o+1]-h;a[c++]=l+r*e,a[c++]=h+s*i;for(let e=o+2;e<o+n;++e)a[c++]=t[e]}return a&&a.length!=c&&(a.length=c),a}function fn(t,e,i,n,r,s,o){o=o||[];let a=0;for(let l=e;l<i;l+=n){o[a++]=t[l]+r,o[a++]=t[l+1]+s;for(let e=l+2;e<l+n;++e)o[a++]=t[e]}return o&&o.length!=a&&(o.length=a),o}cn();const pn=[1,0,0,1,0,0];class mn extends V{constructor(){super(),this.extent_=[1/0,1/0,-1/0,-1/0],this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=m((function(t,e,i){if(!i)return this.getSimplifiedGeometry(e);const n=this.clone();return n.applyTransform(i),n.getSimplifiedGeometry(e)}))}simplifyTransformed(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)}clone(){return B()}closestPointXY(t,e,i,n){return B()}containsXY(t,e){const i=this.getClosestPoint([t,e]);return i[0]===t&&i[1]===e}getClosestPoint(t,e){return e=e||[NaN,NaN],this.closestPointXY(t[0],t[1],e,1/0),e}intersectsCoordinate(t){return this.containsXY(t[0],t[1])}computeExtent(t){return B()}getExtent(t){if(this.extentRevision_!=this.getRevision()){const t=this.computeExtent(this.extent_);(isNaN(t[0])||isNaN(t[1]))&&Jt(t),this.extentRevision_=this.getRevision()}return Te(this.extent_,t)}rotate(t,e){B()}scale(t,e,i){B()}simplify(t){return this.getSimplifiedGeometry(t*t)}getSimplifiedGeometry(t){return B()}getType(){return B()}applyTransform(t){B()}intersectsExtent(t){return B()}translate(t,e){B()}transform(t,e){const i=Ui(t),n="tile-pixels"==i.getUnits()?function(t,n,r){const s=i.getExtent(),o=i.getWorldExtent(),a=_e(o)/_e(s);return Mt(pn,o[0],o[3],a,-a,0,0,0),un(t,0,t.length,r,pn,n),Hi(i,e)(t,n,r)}:Hi(i,e);return this.applyTransform(n),this}}class _n extends mn{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates=null}computeExtent(t){return te(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinates(){return B()}getFirstCoordinate(){return this.flatCoordinates.slice(0,this.stride)}getFlatCoordinates(){return this.flatCoordinates}getLastCoordinate(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)}getLayout(){return this.layout}getSimplifiedGeometry(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;const e=this.getSimplifiedGeometryInternal(t);return e.getFlatCoordinates().length<this.flatCoordinates.length?e:(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)}getSimplifiedGeometryInternal(t){return this}getStride(){return this.stride}setFlatCoordinates(t,e){this.stride=yn(t),this.layout=t,this.flatCoordinates=e}setCoordinates(t,e){B()}setLayout(t,e,i){let n;if(t)n=yn(t);else{for(let t=0;t<i;++t){if(0===e.length)return this.layout="XY",void(this.stride=2);e=e[0]}n=e.length,t=function(t){let e;2==t?e="XY":3==t?e="XYZ":4==t&&(e="XYZM");return e}(n)}this.layout=t,this.stride=n}applyTransform(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.stride),this.changed())}rotate(t,e){const i=this.getFlatCoordinates();if(i){const n=this.getStride();dn(i,0,i.length,n,t,e,i),this.changed()}}scale(t,e,i){void 0===e&&(e=t),i||(i=ge(this.getExtent()));const n=this.getFlatCoordinates();if(n){const r=this.getStride();gn(n,0,n.length,r,t,e,i,n),this.changed()}}translate(t,e){const i=this.getFlatCoordinates();if(i){const n=this.getStride();fn(i,0,i.length,n,t,e,i),this.changed()}}}function yn(t){let e;return"XY"==t?e=2:"XYZ"==t||"XYM"==t?e=3:"XYZM"==t&&(e=4),e}function xn(t,e,i){const n=t.getFlatCoordinates();if(n){const r=t.getStride();return un(n,0,n.length,r,e,i)}return null}function vn(t,e,i,n,r,s,o){const a=t[e],l=t[e+1],h=t[i]-a,c=t[i+1]-l;let u;if(0===h&&0===c)u=e;else{const d=((r-a)*h+(s-l)*c)/(h*h+c*c);if(d>1)u=i;else{if(d>0){for(let r=0;r<n;++r)o[r]=hi(t[e+r],t[i+r],d);return void(o.length=n)}u=e}}for(let e=0;e<n;++e)o[e]=t[u+e];o.length=n}function Sn(t,e,i,n,r){let s=t[e],o=t[e+1];for(e+=n;e<i;e+=n){const i=t[e],n=t[e+1],a=ri(s,o,i,n);a>r&&(r=a),s=i,o=n}return r}function wn(t,e,i,n,r){for(let s=0,o=i.length;s<o;++s){const o=i[s];r=Sn(t,e,o,n,r),e=o}return r}function En(t,e,i,n,r){for(let s=0,o=i.length;s<o;++s){const o=i[s];r=wn(t,e,o,n,r),e=o[o.length-1]}return r}function Tn(t,e,i,n,r,s,o,a,l,h,c){if(e==i)return h;let u,d;if(0===r){if(d=ri(o,a,t[e],t[e+1]),d<h){for(u=0;u<n;++u)l[u]=t[e+u];return l.length=n,d}return h}c=c||[NaN,NaN];let g=e+n;for(;g<i;)if(vn(t,g-n,g,n,o,a,c),d=ri(o,a,c[0],c[1]),d<h){for(h=d,u=0;u<n;++u)l[u]=c[u];l.length=n,g+=n}else g+=n*Math.max((Math.sqrt(d)-Math.sqrt(h))/r|0,1);if(s&&(vn(t,i-n,e,n,o,a,c),d=ri(o,a,c[0],c[1]),d<h)){for(h=d,u=0;u<n;++u)l[u]=c[u];l.length=n}return h}function Cn(t,e,i,n,r,s,o,a,l,h,c){c=c||[NaN,NaN];for(let u=0,d=i.length;u<d;++u){const d=i[u];h=Tn(t,e,d,n,r,s,o,a,l,h,c),e=d}return h}function bn(t,e,i,n,r,s,o,a,l,h,c){c=c||[NaN,NaN];for(let u=0,d=i.length;u<d;++u){const d=i[u];h=Cn(t,e,d,n,r,s,o,a,l,h,c),e=d[d.length-1]}return h}function Rn(t,e,i,n){for(let n=0,r=i.length;n<r;++n)t[e++]=i[n];return e}function Pn(t,e,i,n){for(let r=0,s=i.length;r<s;++r){const s=i[r];for(let i=0;i<n;++i)t[e++]=s[i]}return e}function In(t,e,i,n,r){r=r||[];let s=0;for(let o=0,a=i.length;o<a;++o){const a=Pn(t,e,i[o],n);r[s++]=a,e=a}return r.length=s,r}function Ln(t,e,i,n,r){r=r||[];let s=0;for(let o=0,a=i.length;o<a;++o){const a=In(t,e,i[o],n,r[s]);0===a.length&&(a[0]=e),r[s++]=a,e=a[a.length-1]}return r.length=s,r}function Mn(t,e,i,n,r,s,o){const a=(i-e)/n;if(a<3){for(;e<i;e+=n)s[o++]=t[e],s[o++]=t[e+1];return o}const l=new Array(a);l[0]=1,l[a-1]=1;const h=[e,i-n];let c=0;for(;h.length>0;){const i=h.pop(),s=h.pop();let o=0;const a=t[s],u=t[s+1],d=t[i],g=t[i+1];for(let e=s+n;e<i;e+=n){const i=ni(t[e],t[e+1],a,u,d,g);i>o&&(c=e,o=i)}o>r&&(l[(c-e)/n]=1,s+n<c&&h.push(s,c),c+n<i&&h.push(c,i))}for(let i=0;i<a;++i)l[i]&&(s[o++]=t[e+i*n],s[o++]=t[e+i*n+1]);return o}function Fn(t,e,i,n,r,s,o,a){for(let l=0,h=i.length;l<h;++l){const h=i[l];o=Mn(t,e,h,n,r,s,o),a.push(o),e=h}return o}function An(t,e,i,n,r,s,o){if(i<=e+n){for(;e<i;e+=n)s[o++]=t[e],s[o++]=t[e+1];return o}let a=t[e],l=t[e+1];s[o++]=a,s[o++]=l;let h=a,c=l;for(e+=n;e<i;e+=n)h=t[e],c=t[e+1],ri(a,l,h,c)>r&&(s[o++]=h,s[o++]=c,a=h,l=c);return h==a&&c==l||(s[o++]=h,s[o++]=c),o}function On(t,e){return e*Math.round(t/e)}function Nn(t,e,i,n,r,s,o){if(e==i)return o;let a,l,h=On(t[e],r),c=On(t[e+1],r);e+=n,s[o++]=h,s[o++]=c;do{if(a=On(t[e],r),l=On(t[e+1],r),(e+=n)==i)return s[o++]=a,s[o++]=l,o}while(a==h&&l==c);for(;e<i;){const i=On(t[e],r),u=On(t[e+1],r);if(e+=n,i==a&&u==l)continue;const d=a-h,g=l-c,f=i-h,p=u-c;d*p==g*f&&(d<0&&f<d||d==f||d>0&&f>d)&&(g<0&&p<g||g==p||g>0&&p>g)?(a=i,l=u):(s[o++]=a,s[o++]=l,h=a,c=l,a=i,l=u)}return s[o++]=a,s[o++]=l,o}function Dn(t,e,i,n,r,s,o,a){for(let l=0,h=i.length;l<h;++l){const h=i[l];o=Nn(t,e,h,n,r,s,o),a.push(o),e=h}return o}function kn(t,e,i,n,r,s,o,a){for(let l=0,h=i.length;l<h;++l){const h=i[l],c=[];o=Dn(t,e,h,n,r,s,o,c),a.push(c),e=h[h.length-1]}return o}function Gn(t,e,i,n,r){r=void 0!==r?r:[];let s=0;for(let o=e;o<i;o+=n)r[s++]=t.slice(o,o+n);return r.length=s,r}function jn(t,e,i,n,r){r=void 0!==r?r:[];let s=0;for(let o=0,a=i.length;o<a;++o){const a=i[o];r[s++]=Gn(t,e,a,n,r[s]),e=a}return r.length=s,r}function Bn(t,e,i,n,r){r=void 0!==r?r:[];let s=0;for(let o=0,a=i.length;o<a;++o){const a=i[o];r[s++]=1===a.length&&a[0]===e?[]:jn(t,e,a,n,r[s]),e=a[a.length-1]}return r.length=s,r}function Un(t,e,i,n){let r=0,s=t[i-n],o=t[i-n+1];for(;e<i;e+=n){const i=t[e],n=t[e+1];r+=o*i-s*n,s=i,o=n}return r/2}function zn(t,e,i,n){let r=0;for(let s=0,o=i.length;s<o;++s){const o=i[s];r+=Un(t,e,o,n),e=o}return r}function Xn(t,e,i,n){let r=0;for(let s=0,o=i.length;s<o;++s){const o=i[s];r+=zn(t,e,o,n),e=o[o.length-1]}return r}class Vn extends _n{constructor(t,e){super(),this.maxDelta_=-1,this.maxDeltaRevision_=-1,void 0===e||Array.isArray(t[0])?this.setCoordinates(t,e):this.setFlatCoordinates(e,t)}clone(){return new Vn(this.flatCoordinates.slice(),this.layout)}closestPointXY(t,e,i,n){return n<Wt(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Sn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Tn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,i,n))}getArea(){return Un(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return Gn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(t){const e=[];return e.length=Mn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,0),new Vn(e,"XY")}getType(){return"LinearRing"}intersectsExtent(t){return!1}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Pn(this.flatCoordinates,0,t,this.stride),this.changed()}}class Wn extends _n{constructor(t,e){super(),this.setCoordinates(t,e)}clone(){const t=new Wn(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,i,n){const r=this.flatCoordinates,s=ri(t,e,r[0],r[1]);if(s<n){const t=this.stride;for(let e=0;e<t;++e)i[e]=r[e];return i.length=t,s}return n}getCoordinates(){return this.flatCoordinates?this.flatCoordinates.slice():[]}computeExtent(t){return Qt(this.flatCoordinates,t)}getType(){return"Point"}intersectsExtent(t){return Kt(t,this.flatCoordinates[0],this.flatCoordinates[1])}setCoordinates(t,e){this.setLayout(e,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Rn(this.flatCoordinates,0,t,this.stride),this.changed()}}function Zn(t,e,i,n,r){return!he(r,(function(r){return!Yn(t,e,i,n,r[0],r[1])}))}function Yn(t,e,i,n,r,s){let o=0,a=t[i-n],l=t[i-n+1];for(;e<i;e+=n){const i=t[e],n=t[e+1];l<=s?n>s&&(i-a)*(s-l)-(r-a)*(n-l)>0&&o++:n<=s&&(i-a)*(s-l)-(r-a)*(n-l)<0&&o--,a=i,l=n}return 0!==o}function Kn(t,e,i,n,r,s){if(0===i.length)return!1;if(!Yn(t,e,i[0],n,r,s))return!1;for(let e=1,o=i.length;e<o;++e)if(Yn(t,i[e-1],i[e],n,r,s))return!1;return!0}function qn(t,e,i,n,r,s){if(0===i.length)return!1;for(let o=0,a=i.length;o<a;++o){const a=i[o];if(Kn(t,e,a,n,r,s))return!0;e=a[a.length-1]}return!1}function Hn(t,e,i,n,r,s,o){let l,h,c,u,d,g,f;const p=r[s+1],m=[];for(let r=0,s=i.length;r<s;++r){const s=i[r];for(u=t[s-n],g=t[s-n+1],l=e;l<s;l+=n)d=t[l],f=t[l+1],(p<=g&&f<=p||g<=p&&p<=f)&&(c=(p-g)/(f-g)*(d-u)+u,m.push(c)),u=d,g=f}let _=NaN,y=-1/0;for(m.sort(a),u=m[0],l=1,h=m.length;l<h;++l){d=m[l];const r=Math.abs(d-u);r>y&&(c=(u+d)/2,Kn(t,e,i,n,c,p)&&(_=c,y=r)),u=d}return isNaN(_)&&(_=r[s]),o?(o.push(_,p,y),o):[_,p,y]}function $n(t,e,i,n,r){let s=[];for(let o=0,a=i.length;o<a;++o){const a=i[o];s=Hn(t,e,a,n,r,2*o,s),e=a[a.length-1]}return s}function Jn(t,e,i,n,r){let s;for(e+=n;e<i;e+=n)if(s=r(t.slice(e-n,e),t.slice(e,e+n)),s)return s;return!1}function Qn(t,e,i,n,r){const s=oe([1/0,1/0,-1/0,-1/0],t,e,i,n);return!!we(r,s)&&(!!Yt(r,s)||(s[0]>=r[0]&&s[2]<=r[2]||(s[1]>=r[1]&&s[3]<=r[3]||Jn(t,e,i,n,(function(t,e){return be(r,t,e)})))))}function tr(t,e,i,n,r){for(let s=0,o=i.length;s<o;++s){if(Qn(t,e,i[s],n,r))return!0;e=i[s]}return!1}function er(t,e,i,n,r){return!!Qn(t,e,i,n,r)||(!!Yn(t,e,i,n,r[0],r[1])||(!!Yn(t,e,i,n,r[0],r[3])||(!!Yn(t,e,i,n,r[2],r[1])||!!Yn(t,e,i,n,r[2],r[3]))))}function ir(t,e,i,n,r){if(!er(t,e,i[0],n,r))return!1;if(1===i.length)return!0;for(let e=1,s=i.length;e<s;++e)if(Zn(t,i[e-1],i[e],n,r)&&!Qn(t,i[e-1],i[e],n,r))return!1;return!0}function nr(t,e,i,n,r){for(let s=0,o=i.length;s<o;++s){const o=i[s];if(ir(t,e,o,n,r))return!0;e=o[o.length-1]}return!1}function rr(t,e,i,n){for(;e<i-n;){for(let r=0;r<n;++r){const s=t[e+r];t[e+r]=t[i-n+r],t[i-n+r]=s}e+=n,i-=n}}function sr(t,e,i,n){let r=0,s=t[i-n],o=t[i-n+1];for(;e<i;e+=n){const i=t[e],n=t[e+1];r+=(i-s)*(n+o),s=i,o=n}return 0===r?void 0:r>0}function or(t,e,i,n,r){r=void 0!==r&&r;for(let s=0,o=i.length;s<o;++s){const o=i[s],a=sr(t,e,o,n);if(0===s){if(r&&a||!r&&!a)return!1}else if(r&&!a||!r&&a)return!1;e=o}return!0}function ar(t,e,i,n,r){for(let s=0,o=i.length;s<o;++s){const o=i[s];if(!or(t,e,o,n,r))return!1;o.length&&(e=o[o.length-1])}return!0}function lr(t,e,i,n,r){r=void 0!==r&&r;for(let s=0,o=i.length;s<o;++s){const o=i[s],a=sr(t,e,o,n);(0===s?r&&a||!r&&!a:r&&!a||!r&&a)&&rr(t,e,o,n),e=o}return e}function hr(t,e,i,n,r){for(let s=0,o=i.length;s<o;++s)e=lr(t,e,i[s],n,r);return e}function cr(t,e){const i=[];let n=0,r=0;for(let s=0,o=e.length;s<o;++s){const o=e[s];if(sr(t,n,o,2)){if(0===i.length)continue;i[i.length-1].push(e[r])}else i.push(e.slice(r,s+1));r=s+1,n=o}return i}class ur extends _n{constructor(t,e,i){super(),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,void 0!==e&&i?(this.setFlatCoordinates(e,t),this.ends_=i):this.setCoordinates(t,e)}appendLinearRing(t){this.flatCoordinates?c(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const t=new ur(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(t,e,i,n){return n<Wt(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(wn(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Cn(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,i,n))}containsXY(t,e){return Kn(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)}getArea(){return zn(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)}getCoordinates(t){let e;return void 0!==t?(e=this.getOrientedFlatCoordinates().slice(),lr(e,0,this.ends_,this.stride,t)):e=this.flatCoordinates,jn(e,0,this.ends_,this.stride)}getEnds(){return this.ends_}getFlatInteriorPoint(){if(this.flatInteriorPointRevision_!=this.getRevision()){const t=ge(this.getExtent());this.flatInteriorPoint_=Hn(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_}getInteriorPoint(){return new Wn(this.getFlatInteriorPoint(),"XYM")}getLinearRingCount(){return this.ends_.length}getLinearRing(t){return t<0||this.ends_.length<=t?null:new Vn(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)}getLinearRings(){const t=this.layout,e=this.flatCoordinates,i=this.ends_,n=[];let r=0;for(let s=0,o=i.length;s<o;++s){const o=i[s],a=new Vn(e.slice(r,o),t);n.push(a),r=o}return n}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const t=this.flatCoordinates;or(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=lr(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){const e=[],i=[];return e.length=Dn(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),e,0,i),new ur(e,"XY",i)}getType(){return"Polygon"}intersectsExtent(t){return ir(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);const i=In(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()}}function dr(t,e,i,n){i=i||32;const r=[];for(let s=0;s<i;++s)c(r,Oi(t,e,2*Math.PI*s/i,n));return r.push(r[0],r[1]),new ur(r,"XY",[r.length])}function gr(t){const e=t[0],i=t[1],n=t[2],r=t[3],s=[e,i,e,r,n,r,n,i,e,i];return new ur(s,"XY",[s.length])}function fr(t,e,i){e=e||32;const n=t.getStride(),r=t.getLayout(),s=t.getCenter(),o=n*(e+1),a=new Array(o);for(let t=0;t<o;t+=n){a[t]=0,a[t+1]=0;for(let e=2;e<n;e++)a[t+e]=s[e]}const l=[a.length],h=new ur(a,r,l);return pr(h,s,t.getRadius(),i),h}function pr(t,e,i,n){const r=t.getFlatCoordinates(),s=t.getStride(),o=r.length/s-1,a=n||0;for(let t=0;t<=o;++t){const n=t*s,l=a+2*li(t,o)*Math.PI/o;r[n]=e[0]+i*Math.cos(l),r[n+1]=e[1]+i*Math.sin(l)}t.changed()}const mr="accuracy",_r="accuracyGeometry",yr="altitude",xr="altitudeAccuracy",vr="heading",Sr="position",wr="projection",Er="speed",Tr="tracking",Cr="trackingOptions";class br extends i{constructor(t){super(w),this.code=t.code,this.message=t.message}}class Rr extends v{constructor(t,e,i,n){super(),this.extent=t,this.pixelRatio_=i,this.resolution=e,this.state=n}changed(){this.dispatchEvent(S)}getExtent(){return this.extent}getImage(){return B()}getPixelRatio(){return this.pixelRatio_}getResolution(){return this.resolution}getState(){return this.state}load(){B()}}var Pr=0,Ir=1,Lr=2,Mr=3,Fr=4;class Ar extends Rr{constructor(t,e,i,n,r,s){super(t,e,i,Pr),this.src_=n,this.image_=new Image,null!==r&&(this.image_.crossOrigin=r),this.unlisten_=null,this.state=Pr,this.imageLoadFunction_=s}getImage(){return this.image_}handleImageError_(){this.state=Mr,this.unlistenImage_(),this.changed()}handleImageLoad_(){void 0===this.resolution&&(this.resolution=_e(this.extent)/this.image_.height),this.state=Lr,this.unlistenImage_(),this.changed()}load(){this.state!=Pr&&this.state!=Mr||(this.state=Ir,this.changed(),this.imageLoadFunction_(this,this.src_),this.unlisten_=Or(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))}setImage(t){this.image_=t,this.resolution=_e(this.extent)/this.image_.height}unlistenImage_(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}}function Or(t,e,i){const n=t;let r=!0,s=!1,o=!1;const a=[D(n,M,(function(){o=!0,s||e()}))];return n.src&&yt?(s=!0,n.decode().then((function(){r&&e()})).catch((function(t){r&&(o?e():i())}))):a.push(D(n,w,i)),function(){r=!1,a.forEach(k)}}class Nr extends Rr{constructor(t,e,i,n,r){super(t,e,i,void 0!==r?Pr:Lr),this.loader_=void 0!==r?r:null,this.canvas_=n,this.error_=null}getError(){return this.error_}handleLoad_(t){t?(this.error_=t,this.state=Mr):this.state=Lr,this.changed()}load(){this.state==Pr&&(this.state=Ir,this.changed(),this.loader_(this.handleLoad_.bind(this)))}getImage(){return this.canvas_}}function Dr(t,e,i,n){let r;return r=i&&i.length?i.shift():_t?new OffscreenCanvas(t||300,e||300):document.createElement("canvas"),t&&(r.width=t),e&&(r.height=e),r.getContext("2d",n)}function kr(t){const e=t.canvas;e.width=1,e.height=1,t.clearRect(0,0,1,1)}function Gr(t){let e=t.offsetWidth;const i=getComputedStyle(t);return e+=parseInt(i.marginLeft,10)+parseInt(i.marginRight,10),e}function jr(t){let e=t.offsetHeight;const i=getComputedStyle(t);return e+=parseInt(i.marginTop,10)+parseInt(i.marginBottom,10),e}function Br(t,e){const i=e.parentNode;i&&i.replaceChild(t,e)}function Ur(t){return t&&t.parentNode?t.parentNode.removeChild(t):null}function zr(t){for(;t.lastChild;)t.removeChild(t.lastChild)}function Xr(t,e){const i=t.childNodes;for(let n=0;;++n){const r=i[n],s=e[n];if(!r&&!s)break;r!==s&&(r?s?t.insertBefore(s,r):(t.removeChild(r),--n):t.appendChild(s))}}class Vr extends st{constructor(t,e,i,n,r,s){super(t,e,s),this.crossOrigin_=n,this.src_=i,this.key=i,this.image_=new Image,null!==n&&(this.image_.crossOrigin=n),this.unlisten_=null,this.tileLoadFunction_=r}getImage(){return this.image_}setImage(t){this.image_=t,this.state=J,this.unlistenImage_(),this.changed()}handleImageError_(){this.state=Q,this.unlistenImage_(),this.image_=function(){const t=Dr(1,1);return t.fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas}(),this.changed()}handleImageLoad_(){const t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=J:this.state=tt,this.unlistenImage_(),this.changed()}load(){this.state==Q&&(this.state=H,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==H&&(this.state=$,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Or(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))}unlistenImage_(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}}class Wr{constructor(t,e,i){this.decay_=t,this.minVelocity_=e,this.delay_=i,this.points_=[],this.angle_=0,this.initialVelocity_=0}begin(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0}update(t,e){this.points_.push(t,e,Date.now())}end(){if(this.points_.length<6)return!1;const t=Date.now()-this.delay_,e=this.points_.length-3;if(this.points_[e+2]<t)return!1;let i=e-3;for(;i>0&&this.points_[i+2]>t;)i-=3;const n=this.points_[e+2]-this.points_[i+2];if(n<1e3/60)return!1;const r=this.points_[e]-this.points_[i],s=this.points_[e+1]-this.points_[i+1];return this.angle_=Math.atan2(s,r),this.initialVelocity_=Math.sqrt(r*r+s*s)/n,this.initialVelocity_>this.minVelocity_}getDistance(){return(this.minVelocity_-this.initialVelocity_)/this.decay_}getAngle(){return this.angle_}}const Zr=/^#([a-f0-9]{3}|[a-f0-9]{4}(?:[a-f0-9]{2}){0,2})$/i,Yr=/^([a-z]*)$|^hsla?\(.*\)$/i;function Kr(t){return"string"==typeof t?t:Qr(t)}function qr(t){const e=document.createElement("div");if(e.style.color=t,""!==e.style.color){document.body.appendChild(e);const t=getComputedStyle(e).color;return document.body.removeChild(e),t}return""}const Hr=function(){const t={};let e=0;return function(i){let n;if(t.hasOwnProperty(i))n=t[i];else{if(e>=1024){let i=0;for(const n in t)0==(3&i++)&&(delete t[n],--e)}n=function(t){let e,i,n,r,s;Yr.exec(t)&&(t=qr(t));if(Zr.exec(t)){const o=t.length-1;let a;a=o<=4?1:2;const l=4===o||8===o;e=parseInt(t.substr(1+0*a,a),16),i=parseInt(t.substr(1+1*a,a),16),n=parseInt(t.substr(1+2*a,a),16),r=l?parseInt(t.substr(1+3*a,a),16):255,1==a&&(e=(e<<4)+e,i=(i<<4)+i,n=(n<<4)+n,l&&(r=(r<<4)+r)),s=[e,i,n,r/255]}else t.startsWith("rgba(")?(s=t.slice(5,-1).split(",").map(Number),Jr(s)):t.startsWith("rgb(")?(s=t.slice(4,-1).split(",").map(Number),s.push(1),Jr(s)):at(!1,14);return s}(i),t[i]=n,++e}return n}}();function $r(t){return Array.isArray(t)?t:Hr(t)}function Jr(t){return t[0]=ii(t[0]+.5|0,0,255),t[1]=ii(t[1]+.5|0,0,255),t[2]=ii(t[2]+.5|0,0,255),t[3]=ii(t[3],0,1),t}function Qr(t){let e=t[0];e!=(0|e)&&(e=e+.5|0);let i=t[1];i!=(0|i)&&(i=i+.5|0);let n=t[2];n!=(0|n)&&(n=n+.5|0);return"rgba("+e+","+i+","+n+","+(void 0===t[3]?1:Math.round(100*t[3])/100)+")"}function ts(t){return Yr.test(t)&&(t=qr(t)),Zr.test(t)||t.startsWith("rgba(")||t.startsWith("rgb(")}class es{constructor(){this.cache_={},this.cacheSize_=0,this.maxCacheSize_=32}clear(){this.cache_={},this.cacheSize_=0}canExpireCache(){return this.cacheSize_>this.maxCacheSize_}expire(){if(this.canExpireCache()){let t=0;for(const e in this.cache_){const i=this.cache_[e];0!=(3&t++)||i.hasListener()||(delete this.cache_[e],--this.cacheSize_)}}}get(t,e,i){const n=is(t,e,i);return n in this.cache_?this.cache_[n]:null}set(t,e,i,n){const r=is(t,e,i);this.cache_[r]=n,++this.cacheSize_}setSize(t){this.maxCacheSize_=t,this.expire()}}function is(t,e,i){return e+":"+t+":"+(i?Kr(i):"null")}const ns=new es;var rs="opacity",ss="visible",os="extent",as="zIndex",ls="maxResolution",hs="minResolution",cs="maxZoom",us="minZoom",ds="source",gs="map";class fs extends V{constructor(t){super(),this.on,this.once,this.un,this.background_=t.background;const e=Object.assign({},t);"object"==typeof t.properties&&(delete e.properties,Object.assign(e,t.properties)),e[rs]=void 0!==t.opacity?t.opacity:1,at("number"==typeof e[rs],64),e[ss]=void 0===t.visible||t.visible,e[as]=t.zIndex,e[ls]=void 0!==t.maxResolution?t.maxResolution:1/0,e[hs]=void 0!==t.minResolution?t.minResolution:0,e[us]=void 0!==t.minZoom?t.minZoom:-1/0,e[cs]=void 0!==t.maxZoom?t.maxZoom:1/0,this.className_=void 0!==e.className?e.className:"ol-layer",delete e.className,this.setProperties(e),this.state_=null}getBackground(){return this.background_}getClassName(){return this.className_}getLayerState(t){const e=this.state_||{layer:this,managed:void 0===t||t},i=this.getZIndex();return e.opacity=ii(Math.round(100*this.getOpacity())/100,0,1),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=void 0!==i||e.managed?i:1/0,e.maxResolution=this.getMaxResolution(),e.minResolution=Math.max(this.getMinResolution(),0),e.minZoom=this.getMinZoom(),e.maxZoom=this.getMaxZoom(),this.state_=e,e}getLayersArray(t){return B()}getLayerStatesArray(t){return B()}getExtent(){return this.get(os)}getMaxResolution(){return this.get(ls)}getMinResolution(){return this.get(hs)}getMinZoom(){return this.get(us)}getMaxZoom(){return this.get(cs)}getOpacity(){return this.get(rs)}getSourceState(){return B()}getVisible(){return this.get(ss)}getZIndex(){return this.get(as)}setBackground(t){this.background_=t,this.changed()}setExtent(t){this.set(os,t)}setMaxResolution(t){this.set(ls,t)}setMinResolution(t){this.set(hs,t)}setMaxZoom(t){this.set(cs,t)}setMinZoom(t){this.set(us,t)}setOpacity(t){at("number"==typeof t,64),this.set(rs,t)}setVisible(t){this.set(ss,t)}setZIndex(t){this.set(as,t)}disposeInternal(){this.state_&&(this.state_.layer=null,this.state_=null),super.disposeInternal()}}var ps="prerender",ms="postrender",_s="precompose",ys="postcompose",xs="rendercomplete";class vs extends fs{constructor(t){const e=Object.assign({},t);delete e.source,super(e),this.on,this.once,this.un,this.mapPrecomposeKey_=null,this.mapRenderKey_=null,this.sourceChangeKey_=null,this.renderer_=null,this.rendered=!1,t.render&&(this.render=t.render),t.map&&this.setMap(t.map),this.addChangeListener(ds,this.handleSourcePropertyChange_);const i=t.source?t.source:null;this.setSource(i)}getLayersArray(t){return(t=t||[]).push(this),t}getLayerStatesArray(t){return(t=t||[]).push(this.getLayerState()),t}getSource(){return this.get(ds)||null}getRenderSource(){return this.getSource()}getSourceState(){const t=this.getSource();return t?t.getState():"undefined"}handleSourceChange_(){this.changed()}handleSourcePropertyChange_(){this.sourceChangeKey_&&(k(this.sourceChangeKey_),this.sourceChangeKey_=null);const t=this.getSource();t&&(this.sourceChangeKey_=N(t,S,this.handleSourceChange_,this)),this.changed()}getFeatures(t){return this.renderer_?this.renderer_.getFeatures(t):new Promise((t=>t([])))}getData(t){return this.renderer_&&this.rendered?this.renderer_.getData(t):null}render(t,e){const i=this.getRenderer();if(i.prepareFrame(t))return this.rendered=!0,i.renderFrame(t,e)}unrender(){this.rendered=!1}setMapInternal(t){t||this.unrender(),this.set(gs,t)}getMapInternal(){return this.get(gs)}setMap(t){this.mapPrecomposeKey_&&(k(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(k(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=N(t,_s,(function(t){const e=t.frameState.layerStatesArray,i=this.getLayerState(!1);at(!e.some((function(t){return t.layer===i.layer})),67),e.push(i)}),this),this.mapRenderKey_=N(this,S,t.render,t),this.changed())}setSource(t){this.set(ds,t)}getRenderer(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_}hasRenderer(){return!!this.renderer_}createRenderer(){return null}disposeInternal(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_),this.setSource(null),super.disposeInternal()}}function Ss(t,e){if(!t.visible)return!1;const i=e.resolution;if(i<t.minResolution||i>=t.maxResolution)return!1;const n=e.zoom;return n>t.minZoom&&n<=t.maxZoom}class ws extends s{constructor(t){super(),this.map_=t}dispatchRenderEvent(t,e){B()}calculateMatrices2D(t){const e=t.viewState,i=t.coordinateToPixelTransform,n=t.pixelToCoordinateTransform;Mt(i,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),Ft(n,i)}forEachFeatureAtCoordinate(t,e,i,n,r,s,o,a){let l;const h=e.viewState;function c(t,e,i,n){return r.call(s,e,t?i:null,n)}const u=h.projection,d=Pi(t.slice(),u),g=[[0,0]];if(u.canWrapX()&&n){const t=Se(u.getExtent());g.push([-t,0],[t,0])}const f=e.layerStatesArray,p=f.length,m=[],_=[];for(let n=0;n<g.length;n++)for(let r=p-1;r>=0;--r){const s=f[r],u=s.layer;if(u.hasRenderer()&&Ss(s,h)&&o.call(a,u)){const r=u.getRenderer(),o=u.getSource();if(r&&o){const a=o.getWrapX()?d:t,h=c.bind(null,s.managed);_[0]=a[0]+g[n][0],_[1]=a[1]+g[n][1],l=r.forEachFeatureAtCoordinate(_,e,i,h,m)}if(l)return l}}if(0===m.length)return;const y=1/m.length;return m.forEach(((t,e)=>t.distanceSq+=e*y)),m.sort(((t,e)=>t.distanceSq-e.distanceSq)),m.some((t=>l=t.callback(t.feature,t.layer,t.geometry))),l}hasFeatureAtCoordinate(t,e,i,n,r,s){return void 0!==this.forEachFeatureAtCoordinate(t,e,i,n,g,this,r,s)}getMap(){return this.map_}renderFrame(t){B()}scheduleExpireIconCache(t){ns.canExpireCache()&&t.postRenderFunctions.push(Es)}}function Es(t,e){ns.expire()}class Ts extends i{constructor(t,e,i,n){super(t),this.inversePixelTransform=e,this.frameState=i,this.context=n}}const Cs="ol-hidden",bs="ol-selectable",Rs="ol-unselectable",Ps="ol-unsupported",Is="ol-control",Ls="ol-collapsed",Ms=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))","?\\s*([-,\\\"\\'\\sa-z]+?)\\s*$"].join(""),"i"),Fs=["style","variant","weight","size","lineHeight","family"],As=function(t){const e=t.match(Ms);if(!e)return null;const i={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"};for(let t=0,n=Fs.length;t<n;++t){const n=e[t+1];void 0!==n&&(i[Fs[t]]=n)}return i.families=i.family.split(/,\s?/),i},Os="10px sans-serif",Ns="#000",Ds="round",ks=[],Gs="round",js=10,Bs="#000",Us="center",zs="middle",Xs=[0,0,0,0],Vs=new V;let Ws,Zs=null;const Ys={},Ks=function(){const t="32px ",e=["monospace","serif"],i=e.length,n="wmytzilWMYTZIL@#/&?$%10";let r,s;function o(r,o,a){let l=!0;for(let h=0;h<i;++h){const i=e[h];if(s=$s(r+" "+o+" "+t+i,n),a!=i){const e=$s(r+" "+o+" "+t+a+","+i,n);l=l&&e!=s}}return!!l}function a(){let t=!0;const e=Vs.getKeys();for(let i=0,n=e.length;i<n;++i){const n=e[i];Vs.get(n)<100&&(o.apply(this,n.split("\n"))?(y(Ys),Zs=null,Ws=void 0,Vs.set(n,100)):(Vs.set(n,Vs.get(n)+1,!0),t=!1))}t&&(clearInterval(r),r=void 0)}return function(t){const e=As(t);if(!e)return;const i=e.families;for(let t=0,n=i.length;t<n;++t){const n=i[t],s=e.style+"\n"+e.weight+"\n"+n;void 0===Vs.get(s)&&(Vs.set(s,100,!0),o(e.style,e.weight,n)||(Vs.set(s,0,!0),void 0===r&&(r=setInterval(a,32))))}}}(),qs=function(){let t;return function(e){let i=Ys[e];if(null==i){if(_t){const t=As(e),n=Hs(e,"Žg");i=(isNaN(Number(t.lineHeight))?1.2:Number(t.lineHeight))*(n.actualBoundingBoxAscent+n.actualBoundingBoxDescent)}else t||(t=document.createElement("div"),t.innerHTML="M",t.style.minHeight="0",t.style.maxHeight="none",t.style.height="auto",t.style.padding="0",t.style.border="none",t.style.position="absolute",t.style.display="block",t.style.left="-99999px"),t.style.font=e,document.body.appendChild(t),i=t.offsetHeight,document.body.removeChild(t);Ys[e]=i}return i}}();function Hs(t,e){return Zs||(Zs=Dr(1,1)),t!=Ws&&(Zs.font=t,Ws=Zs.font),Zs.measureText(e)}function $s(t,e){return Hs(t,e).width}function Js(t,e,i){if(e in i)return i[e];const n=e.split("\n").reduce(((e,i)=>Math.max(e,$s(t,i))),0);return i[e]=n,n}function Qs(t,e){const i=[],n=[],r=[];let s=0,o=0,a=0,l=0;for(let h=0,c=e.length;h<=c;h+=2){const u=e[h];if("\n"===u||h===c){s=Math.max(s,o),r.push(o),o=0,a+=l;continue}const d=e[h+1]||t.font,g=$s(d,u);i.push(g),o+=g;const f=qs(d);n.push(f),l=Math.max(l,f)}return{width:s,height:a,widths:i,heights:n,lineWidths:r}}function to(t,e,i,n,r,s,o,a,l,h,c){t.save(),1!==i&&(t.globalAlpha*=i),e&&t.setTransform.apply(t,e),n.contextInstructions?(t.translate(l,h),t.scale(c[0],c[1]),function(t,e){const i=t.contextInstructions;for(let t=0,n=i.length;t<n;t+=2)Array.isArray(i[t+1])?e[i[t]].apply(e,i[t+1]):e[i[t]]=i[t+1]}(n,t)):c[0]<0||c[1]<0?(t.translate(l,h),t.scale(c[0],c[1]),t.drawImage(n,r,s,o,a,0,0,o,a)):t.drawImage(n,r,s,o,a,l,h,o*c[0],a*c[1]),t.restore()}class eo extends ws{constructor(t){super(t),this.fontChangeListenerKey_=N(Vs,r,t.redrawText.bind(t)),this.element_=document.createElement("div");const e=this.element_.style;e.position="absolute",e.width="100%",e.height="100%",e.zIndex="0",this.element_.className="ol-unselectable ol-layers";const i=t.getViewport();i.insertBefore(this.element_,i.firstChild||null),this.children_=[],this.renderedVisible_=!0}dispatchRenderEvent(t,e){const i=this.getMap();if(i.hasListener(t)){const n=new Ts(t,void 0,e);i.dispatchEvent(n)}}disposeInternal(){k(this.fontChangeListenerKey_),this.element_.parentNode.removeChild(this.element_),super.disposeInternal()}renderFrame(t){if(!t)return void(this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1));this.calculateMatrices2D(t),this.dispatchRenderEvent(_s,t);const e=t.layerStatesArray.sort((function(t,e){return t.zIndex-e.zIndex})),i=t.viewState;this.children_.length=0;const n=[];let r=null;for(let s=0,o=e.length;s<o;++s){const o=e[s];t.layerIndex=s;const a=o.layer,l=a.getSourceState();if(!Ss(o,i)||"ready"!=l&&"undefined"!=l){a.unrender();continue}const h=a.render(t,r);h&&(h!==r&&(this.children_.push(h),r=h),"getDeclutter"in a&&n.push(a))}for(let e=n.length-1;e>=0;--e)n[e].renderDeclutter(t);Xr(this.element_,this.children_),this.dispatchRenderEvent(ys,t),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(t)}}class io extends i{constructor(t,e){super(t),this.layer=e}}const no="layers";class ro extends fs{constructor(t){t=t||{};const e=Object.assign({},t);delete e.layers;let i=t.layers;super(e),this.on,this.once,this.un,this.layersListenerKeys_=[],this.listenerKeys_={},this.addChangeListener(no,this.handleLayersChanged_),i?Array.isArray(i)?i=new q(i.slice(),{unique:!0}):at("function"==typeof i.getArray,43):i=new q(void 0,{unique:!0}),this.setLayers(i)}handleLayerChange_(){this.changed()}handleLayersChanged_(){this.layersListenerKeys_.forEach(k),this.layersListenerKeys_.length=0;const t=this.getLayers();this.layersListenerKeys_.push(N(t,W,this.handleLayersAdd_,this),N(t,Z,this.handleLayersRemove_,this));for(const t in this.listenerKeys_)this.listenerKeys_[t].forEach(k);y(this.listenerKeys_);const e=t.getArray();for(let t=0,i=e.length;t<i;t++){const i=e[t];this.registerLayerListeners_(i),this.dispatchEvent(new io("addlayer",i))}this.changed()}registerLayerListeners_(t){const e=[N(t,r,this.handleLayerChange_,this),N(t,S,this.handleLayerChange_,this)];t instanceof ro&&e.push(N(t,"addlayer",this.handleLayerGroupAdd_,this),N(t,"removelayer",this.handleLayerGroupRemove_,this)),this.listenerKeys_[z(t)]=e}handleLayerGroupAdd_(t){this.dispatchEvent(new io("addlayer",t.layer))}handleLayerGroupRemove_(t){this.dispatchEvent(new io("removelayer",t.layer))}handleLayersAdd_(t){const e=t.element;this.registerLayerListeners_(e),this.dispatchEvent(new io("addlayer",e)),this.changed()}handleLayersRemove_(t){const e=t.element,i=z(e);this.listenerKeys_[i].forEach(k),delete this.listenerKeys_[i],this.dispatchEvent(new io("removelayer",e)),this.changed()}getLayers(){return this.get(no)}setLayers(t){const e=this.getLayers();if(e){const t=e.getArray();for(let e=0,i=t.length;e<i;++e)this.dispatchEvent(new io("removelayer",t[e]))}this.set(no,t)}getLayersArray(t){return t=void 0!==t?t:[],this.getLayers().forEach((function(e){e.getLayersArray(t)})),t}getLayerStatesArray(t){const e=void 0!==t?t:[],i=e.length;this.getLayers().forEach((function(t){t.getLayerStatesArray(e)}));const n=this.getLayerState();let r=n.zIndex;t||void 0!==n.zIndex||(r=0);for(let t=i,s=e.length;t<s;t++){const i=e[t];i.opacity*=n.opacity,i.visible=i.visible&&n.visible,i.maxResolution=Math.min(i.maxResolution,n.maxResolution),i.minResolution=Math.max(i.minResolution,n.minResolution),i.minZoom=Math.max(i.minZoom,n.minZoom),i.maxZoom=Math.min(i.maxZoom,n.maxZoom),void 0!==n.extent&&(void 0!==i.extent?i.extent=ye(i.extent,n.extent):i.extent=n.extent),void 0===i.zIndex&&(i.zIndex=r)}return e}getSourceState(){return"ready"}}class so extends i{constructor(t,e,i){super(t),this.map=e,this.frameState=void 0!==i?i:null}}class oo extends so{constructor(t,e,i,n,r,s){super(t,e,r),this.originalEvent=i,this.pixel_=null,this.coordinate_=null,this.dragging=void 0!==n&&n,this.activePointers=s}get pixel(){return this.pixel_||(this.pixel_=this.map.getEventPixel(this.originalEvent)),this.pixel_}set pixel(t){this.pixel_=t}get coordinate(){return this.coordinate_||(this.coordinate_=this.map.getCoordinateFromPixel(this.pixel)),this.coordinate_}set coordinate(t){this.coordinate_=t}preventDefault(){super.preventDefault(),"preventDefault"in this.originalEvent&&this.originalEvent.preventDefault()}stopPropagation(){super.stopPropagation(),"stopPropagation"in this.originalEvent&&this.originalEvent.stopPropagation()}}var ao={SINGLECLICK:"singleclick",CLICK:T,DBLCLICK:C,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},lo="pointermove",ho="pointerdown",co="pointerup",uo="pointerout";class go extends v{constructor(t,e){super(t),this.map_=t,this.clickTimeoutId_,this.emulateClicks_=!1,this.dragging_=!1,this.dragListenerKeys_=[],this.moveTolerance_=void 0===e?1:e,this.down_=null;const i=this.map_.getViewport();this.activePointers_=[],this.trackedTouches_={},this.element_=i,this.pointerdownListenerKey_=N(i,ho,this.handlePointerDown_,this),this.originalPointerMoveEvent_,this.relayedListenerKey_=N(i,lo,this.relayMoveEvent_,this),this.boundHandleTouchMove_=this.handleTouchMove_.bind(this),this.element_.addEventListener(A,this.boundHandleTouchMove_,!!xt&&{passive:!1})}emulateClick_(t){let e=new oo(ao.CLICK,this.map_,t);this.dispatchEvent(e),void 0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new oo(ao.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout(function(){this.clickTimeoutId_=void 0;const e=new oo(ao.SINGLECLICK,this.map_,t);this.dispatchEvent(e)}.bind(this),250)}updateActivePointers_(t){const e=t,i=e.pointerId;if(e.type==ao.POINTERUP||e.type==ao.POINTERCANCEL){delete this.trackedTouches_[i];for(const t in this.trackedTouches_)if(this.trackedTouches_[t].target!==e.target){delete this.trackedTouches_[t];break}}else e.type!=ao.POINTERDOWN&&e.type!=ao.POINTERMOVE||(this.trackedTouches_[i]=e);this.activePointers_=Object.values(this.trackedTouches_)}handlePointerUp_(t){this.updateActivePointers_(t);const e=new oo(ao.POINTERUP,this.map_,t,void 0,void 0,this.activePointers_);this.dispatchEvent(e),this.emulateClicks_&&!e.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(t)&&this.emulateClick_(this.down_),0===this.activePointers_.length&&(this.dragListenerKeys_.forEach(k),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)}isMouseActionButton_(t){return 0===t.button}handlePointerDown_(t){this.emulateClicks_=0===this.activePointers_.length,this.updateActivePointers_(t);const e=new oo(ao.POINTERDOWN,this.map_,t,void 0,void 0,this.activePointers_);this.dispatchEvent(e),this.down_={};for(const e in t){const i=t[e];this.down_[e]="function"==typeof i?p:i}if(0===this.dragListenerKeys_.length){const t=this.map_.getOwnerDocument();this.dragListenerKeys_.push(N(t,ao.POINTERMOVE,this.handlePointerMove_,this),N(t,ao.POINTERUP,this.handlePointerUp_,this),N(this.element_,ao.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==t&&this.dragListenerKeys_.push(N(this.element_.getRootNode(),ao.POINTERUP,this.handlePointerUp_,this))}}handlePointerMove_(t){if(this.isMoving_(t)){this.updateActivePointers_(t),this.dragging_=!0;const e=new oo(ao.POINTERDRAG,this.map_,t,this.dragging_,void 0,this.activePointers_);this.dispatchEvent(e)}}relayMoveEvent_(t){this.originalPointerMoveEvent_=t;const e=!(!this.down_||!this.isMoving_(t));this.dispatchEvent(new oo(ao.POINTERMOVE,this.map_,t,e))}handleTouchMove_(t){const e=this.originalPointerMoveEvent_;e&&!e.defaultPrevented||"boolean"==typeof t.cancelable&&!0!==t.cancelable||t.preventDefault()}isMoving_(t){return this.dragging_||Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_}disposeInternal(){this.relayedListenerKey_&&(k(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(A,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(k(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(k),this.dragListenerKeys_.length=0,this.element_=null,super.disposeInternal()}}var fo="postrender",po="movestart",mo="moveend",_o="loadstart",yo="loadend",xo="layergroup",vo="size",So="target",wo="view";const Eo=1/0;class To{constructor(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}}clear(){this.elements_.length=0,this.priorities_.length=0,y(this.queuedElements_)}dequeue(){const t=this.elements_,e=this.priorities_,i=t[0];1==t.length?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));const n=this.keyFunction_(i);return delete this.queuedElements_[n],i}enqueue(t){at(!(this.keyFunction_(t)in this.queuedElements_),31);const e=this.priorityFunction_(t);return e!=Eo&&(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0)}getCount(){return this.elements_.length}getLeftChildIndex_(t){return 2*t+1}getRightChildIndex_(t){return 2*t+2}getParentIndex_(t){return t-1>>1}heapify_(){let t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)}isEmpty(){return 0===this.elements_.length}isKeyQueued(t){return t in this.queuedElements_}isQueued(t){return this.isKeyQueued(this.keyFunction_(t))}siftUp_(t){const e=this.elements_,i=this.priorities_,n=e.length,r=e[t],s=i[t],o=t;for(;t<n>>1;){const r=this.getLeftChildIndex_(t),s=this.getRightChildIndex_(t),o=s<n&&i[s]<i[r]?s:r;e[t]=e[o],i[t]=i[o],t=o}e[t]=r,i[t]=s,this.siftDown_(o,t)}siftDown_(t,e){const i=this.elements_,n=this.priorities_,r=i[e],s=n[e];for(;e>t;){const t=this.getParentIndex_(e);if(!(n[t]>s))break;i[e]=i[t],n[e]=n[t],e=t}i[e]=r,n[e]=s}reprioritize(){const t=this.priorityFunction_,e=this.elements_,i=this.priorities_;let n=0;const r=e.length;let s,o,a;for(o=0;o<r;++o)s=e[o],a=t(s),a==Eo?delete this.queuedElements_[this.keyFunction_(s)]:(i[n]=a,e[n++]=s);e.length=n,i.length=n,this.heapify_()}}class Co extends To{constructor(t,e){super((function(e){return t.apply(null,e)}),(function(t){return t[0].getKey()})),this.boundHandleTileChange_=this.handleTileChange.bind(this),this.tileChangeCallback_=e,this.tilesLoading_=0,this.tilesLoadingKeys_={}}enqueue(t){const e=super.enqueue(t);if(e){t[0].addEventListener(S,this.boundHandleTileChange_)}return e}getTilesLoading(){return this.tilesLoading_}handleTileChange(t){const e=t.target,i=e.getState();if(i===J||i===Q||i===tt){i!==Q&&e.removeEventListener(S,this.boundHandleTileChange_);const t=e.getKey();t in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[t],--this.tilesLoading_),this.tileChangeCallback_()}}loadMoreTiles(t,e){let i,n,r,s=0;for(;this.tilesLoading_<t&&s<e&&this.getCount()>0;)n=this.dequeue()[0],r=n.getKey(),i=n.getState(),i!==H||r in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[r]=!0,++this.tilesLoading_,++s,n.load())}}function bo(t,e,i,n,r){if(!t||!(i in t.wantedTiles))return Eo;if(!t.wantedTiles[i][e.getKey()])return Eo;const s=t.viewState.center,o=n[0]-s[0],a=n[1]-s[1];return 65536*Math.log(r)+Math.sqrt(o*o+a*a)/r}var Ro=0,Po=1,Io={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};const Lo=256;function Mo(t,e,i){return function(n,r,s,o,a){if(!n)return;if(!r&&!e)return n;const l=e?0:s[0]*r,h=e?0:s[1]*r,c=a?a[0]:0,u=a?a[1]:0;let d=t[0]+l/2+c,g=t[2]-l/2+c,f=t[1]+h/2+u,p=t[3]-h/2+u;d>g&&(d=(g+d)/2,g=d),f>p&&(f=(p+f)/2,p=f);let m=ii(n[0],d,g),_=ii(n[1],f,p);if(o&&i&&r){const t=30*r;m+=-t*Math.log(1+Math.max(0,d-n[0])/t)+t*Math.log(1+Math.max(0,n[0]-g)/t),_+=-t*Math.log(1+Math.max(0,f-n[1])/t)+t*Math.log(1+Math.max(0,n[1]-p)/t)}return[m,_]}}function Fo(t){return t}function Ao(t,e,i,n){const r=Se(e)/i[0],s=_e(e)/i[1];return n?Math.min(t,Math.max(r,s)):Math.min(t,Math.min(r,s))}function Oo(t,e,i){let n=Math.min(t,e);return n*=Math.log(1+50*Math.max(0,t/e-1))/50+1,i&&(n=Math.max(n,i),n/=Math.log(1+50*Math.max(0,i/t-1))/50+1),ii(n,i/2,2*e)}function No(t,e,i,n){return e=void 0===e||e,function(r,s,o,a){if(void 0!==r){const h=t[0],c=t[t.length-1],u=i?Ao(h,i,o,n):h;if(a)return e?Oo(r,u,c):ii(r,c,u);const d=Math.min(u,r),g=Math.floor(l(t,d,s));return t[g]>u&&g<t.length-1?t[g+1]:t[g]}}}function Do(t,e,i,n,r,s){return n=void 0===n||n,i=void 0!==i?i:0,function(o,a,l,h){if(void 0!==o){const c=r?Ao(e,r,l,s):e;if(h)return n?Oo(o,c,i):ii(o,i,c);const u=1e-9,d=Math.ceil(Math.log(e/c)/Math.log(t)-u),g=-a*(.5-u)+.5,f=Math.min(c,o),p=Math.floor(Math.log(e/f)/Math.log(t)+g),m=Math.max(d,p);return ii(e/Math.pow(t,m),i,c)}}}function ko(t,e,i,n,r){return i=void 0===i||i,function(s,o,a,l){if(void 0!==s){const o=n?Ao(t,n,a,r):t;return i&&l?Oo(s,o,e):ii(s,e,o)}}}function Go(t){return void 0!==t?0:void 0}function jo(t){return void 0!==t?t:void 0}function Bo(t){const e=2*Math.PI/t;return function(t,i){return i?t:void 0!==t?t=Math.floor(t/e+.5)*e:void 0}}function Uo(t){return t=t||ai(5),function(e,i){return i?e:void 0!==e?Math.abs(e)<=t?0:e:void 0}}class zo extends V{constructor(t){super(),this.on,this.once,this.un,t=Object.assign({},t),this.hints_=[0,0],this.animations_=[],this.updateAnimationKey_,this.projection_=Wi(t.projection,"EPSG:3857"),this.viewportSize_=[100,100],this.targetCenter_=null,this.targetResolution_,this.targetRotation_,this.nextCenter_=null,this.nextResolution_,this.nextRotation_,this.cancelAnchor_=void 0,t.projection&&Di(),t.center&&(t.center=rn(t.center,this.projection_)),t.extent&&(t.extent=on(t.extent,this.projection_)),this.applyOptions_(t)}applyOptions_(t){const e=Object.assign({},t);for(const t in Io)delete e[t];this.setProperties(e,!0);const i=Wo(t);this.maxResolution_=i.maxResolution,this.minResolution_=i.minResolution,this.zoomFactor_=i.zoomFactor,this.resolutions_=t.resolutions,this.padding_=t.padding,this.minZoom_=i.minZoom;const n=Vo(t),r=i.constraint,s=Zo(t);this.constraints_={center:n,resolution:r,rotation:s},this.setRotation(void 0!==t.rotation?t.rotation:0),this.setCenterInternal(void 0!==t.center?t.center:null),void 0!==t.resolution?this.setResolution(t.resolution):void 0!==t.zoom&&this.setZoom(t.zoom)}get padding(){return this.padding_}set padding(t){let e=this.padding_;this.padding_=t;const i=this.getCenter();if(i){const n=t||[0,0,0,0];e=e||[0,0,0,0];const r=this.getResolution(),s=r/2*(n[3]-e[3]+e[1]-n[1]),o=r/2*(n[0]-e[0]+e[2]-n[2]);this.setCenterInternal([i[0]+s,i[1]-o])}}getUpdatedOptions_(t){const e=this.getProperties();return void 0!==e.resolution?e.resolution=this.getResolution():e.zoom=this.getZoom(),e.center=this.getCenterInternal(),e.rotation=this.getRotation(),Object.assign({},e,t)}animate(t){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);const e=new Array(arguments.length);for(let t=0;t<e.length;++t){let i=arguments[t];i.center&&(i=Object.assign({},i),i.center=rn(i.center,this.getProjection())),i.anchor&&(i=Object.assign({},i),i.anchor=rn(i.anchor,this.getProjection())),e[t]=i}this.animateInternal.apply(this,e)}animateInternal(t){let e,i=arguments.length;i>1&&"function"==typeof arguments[i-1]&&(e=arguments[i-1],--i);let n=0;for(;n<i&&!this.isDef();++n){const t=arguments[n];t.center&&this.setCenterInternal(t.center),void 0!==t.zoom?this.setZoom(t.zoom):t.resolution&&this.setResolution(t.resolution),void 0!==t.rotation&&this.setRotation(t.rotation)}if(n===i)return void(e&&Xo(e,!0));let r=Date.now(),s=this.targetCenter_.slice(),o=this.targetResolution_,a=this.targetRotation_;const l=[];for(;n<i;++n){const t=arguments[n],i={start:r,complete:!1,anchor:t.anchor,duration:void 0!==t.duration?t.duration:1e3,easing:t.easing||nt,callback:e};if(t.center&&(i.sourceCenter=s,i.targetCenter=t.center.slice(),s=i.targetCenter),void 0!==t.zoom?(i.sourceResolution=o,i.targetResolution=this.getResolutionForZoom(t.zoom),o=i.targetResolution):t.resolution&&(i.sourceResolution=o,i.targetResolution=t.resolution,o=i.targetResolution),void 0!==t.rotation){i.sourceRotation=a;const e=li(t.rotation-a+Math.PI,2*Math.PI)-Math.PI;i.targetRotation=a+e,a=i.targetRotation}Yo(i)?i.complete=!0:r+=i.duration,l.push(i)}this.animations_.push(l),this.setHint(Ro,1),this.updateAnimations_()}getAnimating(){return this.hints_[Ro]>0}getInteracting(){return this.hints_[Po]>0}cancelAnimations(){let t;this.setHint(Ro,-this.hints_[Ro]);for(let e=0,i=this.animations_.length;e<i;++e){const i=this.animations_[e];if(i[0].callback&&Xo(i[0].callback,!1),!t)for(let e=0,n=i.length;e<n;++e){const n=i[e];if(!n.complete){t=n.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=t,this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN}updateAnimations_(){if(void 0!==this.updateAnimationKey_&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),!this.getAnimating())return;const t=Date.now();let e=!1;for(let i=this.animations_.length-1;i>=0;--i){const n=this.animations_[i];let r=!0;for(let i=0,s=n.length;i<s;++i){const s=n[i];if(s.complete)continue;const o=t-s.start;let a=s.duration>0?o/s.duration:1;a>=1?(s.complete=!0,a=1):r=!1;const l=s.easing(a);if(s.sourceCenter){const t=s.sourceCenter[0],e=s.sourceCenter[1],i=s.targetCenter[0],n=s.targetCenter[1];this.nextCenter_=s.targetCenter;const r=t+l*(i-t),o=e+l*(n-e);this.targetCenter_=[r,o]}if(s.sourceResolution&&s.targetResolution){const t=1===l?s.targetResolution:s.sourceResolution+l*(s.targetResolution-s.sourceResolution);if(s.anchor){const e=this.getViewportSize_(this.getRotation()),i=this.constraints_.resolution(t,0,e,!0);this.targetCenter_=this.calculateCenterZoom(i,s.anchor)}this.nextResolution_=s.targetResolution,this.targetResolution_=t,this.applyTargetState_(!0)}if(void 0!==s.sourceRotation&&void 0!==s.targetRotation){const t=1===l?li(s.targetRotation+Math.PI,2*Math.PI)-Math.PI:s.sourceRotation+l*(s.targetRotation-s.sourceRotation);if(s.anchor){const e=this.constraints_.rotation(t,!0);this.targetCenter_=this.calculateCenterRotate(e,s.anchor)}this.nextRotation_=s.targetRotation,this.targetRotation_=t}if(this.applyTargetState_(!0),e=!0,!s.complete)break}if(r){this.animations_[i]=null,this.setHint(Ro,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;const t=n[0].callback;t&&Xo(t,!0)}}this.animations_=this.animations_.filter(Boolean),e&&void 0===this.updateAnimationKey_&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}calculateCenterRotate(t,e){let i;const n=this.getCenterInternal();return void 0!==n&&(i=[n[0]-e[0],n[1]-e[1]],wi(i,t-this.getRotation()),mi(i,e)),i}calculateCenterZoom(t,e){let i;const n=this.getCenterInternal(),r=this.getResolution();if(void 0!==n&&void 0!==r){i=[e[0]-t*(e[0]-n[0])/r,e[1]-t*(e[1]-n[1])/r]}return i}getViewportSize_(t){const e=this.viewportSize_;if(t){const i=e[0],n=e[1];return[Math.abs(i*Math.cos(t))+Math.abs(n*Math.sin(t)),Math.abs(i*Math.sin(t))+Math.abs(n*Math.cos(t))]}return e}setViewportSize(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)}getCenter(){const t=this.getCenterInternal();return t?nn(t,this.getProjection()):t}getCenterInternal(){return this.get(Io.CENTER)}getConstraints(){return this.constraints_}getConstrainResolution(){return this.get("constrainResolution")}getHints(t){return void 0!==t?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()}calculateExtent(t){return sn(this.calculateExtentInternal(t),this.getProjection())}calculateExtentInternal(t){t=t||this.getViewportSizeMinusPadding_();const e=this.getCenterInternal();at(e,1);const i=this.getResolution();at(void 0!==i,2);const n=this.getRotation();return at(void 0!==n,3),pe(e,i,n,t)}getMaxResolution(){return this.maxResolution_}getMinResolution(){return this.minResolution_}getMaxZoom(){return this.getZoomForResolution(this.minResolution_)}setMaxZoom(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))}getMinZoom(){return this.getZoomForResolution(this.maxResolution_)}setMinZoom(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))}setConstrainResolution(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))}getProjection(){return this.projection_}getResolution(){return this.get(Io.RESOLUTION)}getResolutions(){return this.resolutions_}getResolutionForExtent(t,e){return this.getResolutionForExtentInternal(on(t,this.getProjection()),e)}getResolutionForExtentInternal(t,e){e=e||this.getViewportSizeMinusPadding_();const i=Se(t)/e[0],n=_e(t)/e[1];return Math.max(i,n)}getResolutionForValueFunction(t){t=t||2;const e=this.getConstrainedResolution(this.maxResolution_),i=this.minResolution_,n=Math.log(e/i)/Math.log(t);return function(i){return e/Math.pow(t,i*n)}}getRotation(){return this.get(Io.ROTATION)}getValueForResolutionFunction(t){const e=Math.log(t||2),i=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,r=Math.log(i/n)/e;return function(t){return Math.log(i/t)/e/r}}getViewportSizeMinusPadding_(t){let e=this.getViewportSize_(t);const i=this.padding_;return i&&(e=[e[0]-i[1]-i[3],e[1]-i[0]-i[2]]),e}getState(){const t=this.getProjection(),e=this.getResolution(),i=this.getRotation();let n=this.getCenterInternal();const r=this.padding_;if(r){const t=this.getViewportSizeMinusPadding_();n=Ko(n,this.getViewportSize_(),[t[0]/2+r[3],t[1]/2+r[0]],e,i)}return{center:n.slice(0),projection:void 0!==t?t:null,resolution:e,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:i,zoom:this.getZoom()}}getZoom(){let t;const e=this.getResolution();return void 0!==e&&(t=this.getZoomForResolution(e)),t}getZoomForResolution(t){let e,i,n=this.minZoom_||0;if(this.resolutions_){const r=l(this.resolutions_,t,1);n=r,e=this.resolutions_[r],i=r==this.resolutions_.length-1?2:e/this.resolutions_[r+1]}else e=this.maxResolution_,i=this.zoomFactor_;return n+Math.log(e/t)/Math.log(i)}getResolutionForZoom(t){if(this.resolutions_){if(this.resolutions_.length<=1)return 0;const e=ii(Math.floor(t),0,this.resolutions_.length-2),i=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(i,ii(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)}fit(t,e){let i;if(at(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,24),Array.isArray(t)){at(!Ee(t),25);i=gr(on(t,this.getProjection()))}else if("Circle"===t.getType()){const e=on(t.getExtent(),this.getProjection());i=gr(e),i.rotate(this.getRotation(),ge(e))}else{const e=en();i=e?t.clone().transform(e,this.getProjection()):t}this.fitInternal(i,e)}rotatedExtentForGeometry(t){const e=this.getRotation(),i=Math.cos(e),n=Math.sin(-e),r=t.getFlatCoordinates(),s=t.getStride();let o=1/0,a=1/0,l=-1/0,h=-1/0;for(let t=0,e=r.length;t<e;t+=s){const e=r[t]*i-r[t+1]*n,s=r[t]*n+r[t+1]*i;o=Math.min(o,e),a=Math.min(a,s),l=Math.max(l,e),h=Math.max(h,s)}return[o,a,l,h]}fitInternal(t,e){let i=(e=e||{}).size;i||(i=this.getViewportSizeMinusPadding_());const n=void 0!==e.padding?e.padding:[0,0,0,0],r=void 0!==e.nearest&&e.nearest;let s;s=void 0!==e.minResolution?e.minResolution:void 0!==e.maxZoom?this.getResolutionForZoom(e.maxZoom):0;const o=this.rotatedExtentForGeometry(t);let a=this.getResolutionForExtentInternal(o,[i[0]-n[1]-n[3],i[1]-n[0]-n[2]]);a=isNaN(a)?s:Math.max(a,s),a=this.getConstrainedResolution(a,r?0:1);const l=this.getRotation(),h=Math.sin(l),c=Math.cos(l),u=ge(o);u[0]+=(n[1]-n[3])/2*a,u[1]+=(n[0]-n[2])/2*a;const d=u[0]*c-u[1]*h,g=u[1]*c+u[0]*h,f=this.getConstrainedCenter([d,g],a),m=e.callback?e.callback:p;void 0!==e.duration?this.animateInternal({resolution:a,center:f,duration:e.duration,easing:e.easing},m):(this.targetResolution_=a,this.targetCenter_=f,this.applyTargetState_(!1,!0),Xo(m,!0))}centerOn(t,e,i){this.centerOnInternal(rn(t,this.getProjection()),e,i)}centerOnInternal(t,e,i){this.setCenterInternal(Ko(t,e,i,this.getResolution(),this.getRotation()))}calculateCenterShift(t,e,i,n){let r;const s=this.padding_;if(s&&t){const o=this.getViewportSizeMinusPadding_(-i),a=Ko(t,n,[o[0]/2+s[3],o[1]/2+s[0]],e,i);r=[t[0]-a[0],t[1]-a[1]]}return r}isDef(){return!!this.getCenterInternal()&&void 0!==this.getResolution()}adjustCenter(t){const e=nn(this.targetCenter_,this.getProjection());this.setCenter([e[0]+t[0],e[1]+t[1]])}adjustCenterInternal(t){const e=this.targetCenter_;this.setCenterInternal([e[0]+t[0],e[1]+t[1]])}adjustResolution(t,e){e=e&&rn(e,this.getProjection()),this.adjustResolutionInternal(t,e)}adjustResolutionInternal(t,e){const i=this.getAnimating()||this.getInteracting(),n=this.getViewportSize_(this.getRotation()),r=this.constraints_.resolution(this.targetResolution_*t,0,n,i);e&&(this.targetCenter_=this.calculateCenterZoom(r,e)),this.targetResolution_*=t,this.applyTargetState_()}adjustZoom(t,e){this.adjustResolution(Math.pow(this.zoomFactor_,-t),e)}adjustRotation(t,e){e&&(e=rn(e,this.getProjection())),this.adjustRotationInternal(t,e)}adjustRotationInternal(t,e){const i=this.getAnimating()||this.getInteracting(),n=this.constraints_.rotation(this.targetRotation_+t,i);e&&(this.targetCenter_=this.calculateCenterRotate(n,e)),this.targetRotation_+=t,this.applyTargetState_()}setCenter(t){this.setCenterInternal(t?rn(t,this.getProjection()):t)}setCenterInternal(t){this.targetCenter_=t,this.applyTargetState_()}setHint(t,e){return this.hints_[t]+=e,this.changed(),this.hints_[t]}setResolution(t){this.targetResolution_=t,this.applyTargetState_()}setRotation(t){this.targetRotation_=t,this.applyTargetState_()}setZoom(t){this.setResolution(this.getResolutionForZoom(t))}applyTargetState_(t,e){const i=this.getAnimating()||this.getInteracting()||e,n=this.constraints_.rotation(this.targetRotation_,i),r=this.getViewportSize_(n),s=this.constraints_.resolution(this.targetResolution_,0,r,i),o=this.constraints_.center(this.targetCenter_,s,r,i,this.calculateCenterShift(this.targetCenter_,s,n,r));this.get(Io.ROTATION)!==n&&this.set(Io.ROTATION,n),this.get(Io.RESOLUTION)!==s&&(this.set(Io.RESOLUTION,s),this.set("zoom",this.getZoom(),!0)),o&&this.get(Io.CENTER)&&Si(this.get(Io.CENTER),o)||this.set(Io.CENTER,o),this.getAnimating()&&!t&&this.cancelAnimations(),this.cancelAnchor_=void 0}resolveConstraints(t,e,i){t=void 0!==t?t:200;const n=e||0,r=this.constraints_.rotation(this.targetRotation_),s=this.getViewportSize_(r),o=this.constraints_.resolution(this.targetResolution_,n,s),a=this.constraints_.center(this.targetCenter_,o,s,!1,this.calculateCenterShift(this.targetCenter_,o,r,s));if(0===t&&!this.cancelAnchor_)return this.targetResolution_=o,this.targetRotation_=r,this.targetCenter_=a,void this.applyTargetState_();i=i||(0===t?this.cancelAnchor_:void 0),this.cancelAnchor_=void 0,this.getResolution()===o&&this.getRotation()===r&&this.getCenterInternal()&&Si(this.getCenterInternal(),a)||(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:r,center:a,resolution:o,duration:t,easing:it,anchor:i}))}beginInteraction(){this.resolveConstraints(0),this.setHint(Po,1)}endInteraction(t,e,i){i=i&&rn(i,this.getProjection()),this.endInteractionInternal(t,e,i)}endInteractionInternal(t,e,i){this.setHint(Po,-1),this.resolveConstraints(t,e,i)}getConstrainedCenter(t,e){const i=this.getViewportSize_(this.getRotation());return this.constraints_.center(t,e||this.getResolution(),i)}getConstrainedZoom(t,e){const i=this.getResolutionForZoom(t);return this.getZoomForResolution(this.getConstrainedResolution(i,e))}getConstrainedResolution(t,e){e=e||0;const i=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(t,e,i)}}function Xo(t,e){setTimeout((function(){t(e)}),0)}function Vo(t){if(void 0!==t.extent){const e=void 0===t.smoothExtentConstraint||t.smoothExtentConstraint;return Mo(t.extent,t.constrainOnlyCenter,e)}const e=Wi(t.projection,"EPSG:3857");if(!0!==t.multiWorld&&e.isGlobal()){const t=e.getExtent().slice();return t[0]=-1/0,t[2]=1/0,Mo(t,!1,!1)}return Fo}function Wo(t){let e,i,n;let r=void 0!==t.minZoom?t.minZoom:0,s=void 0!==t.maxZoom?t.maxZoom:28;const o=void 0!==t.zoomFactor?t.zoomFactor:2,a=void 0!==t.multiWorld&&t.multiWorld,l=void 0===t.smoothResolutionConstraint||t.smoothResolutionConstraint,h=void 0!==t.showFullExtent&&t.showFullExtent,c=Wi(t.projection,"EPSG:3857"),u=c.getExtent();let d=t.constrainOnlyCenter,g=t.extent;if(a||g||!c.isGlobal()||(d=!1,g=u),void 0!==t.resolutions){const o=t.resolutions;i=o[r],n=void 0!==o[s]?o[s]:o[o.length-1],e=t.constrainResolution?No(o,l,!d&&g,h):ko(i,n,l,!d&&g,h)}else{const a=(u?Math.max(Se(u),_e(u)):360*Fe.degrees/c.getMetersPerUnit())/Lo/Math.pow(2,0),f=a/Math.pow(2,28);i=t.maxResolution,void 0!==i?r=0:i=a/Math.pow(o,r),n=t.minResolution,void 0===n&&(n=void 0!==t.maxZoom?void 0!==t.maxResolution?i/Math.pow(o,s):a/Math.pow(o,s):f),s=r+Math.floor(Math.log(i/n)/Math.log(o)),n=i/Math.pow(o,s-r),e=t.constrainResolution?Do(o,i,n,l,!d&&g,h):ko(i,n,l,!d&&g,h)}return{constraint:e,maxResolution:i,minResolution:n,minZoom:r,zoomFactor:o}}function Zo(t){if(void 0===t.enableRotation||t.enableRotation){const e=t.constrainRotation;return void 0===e||!0===e?Uo():!1===e?jo:"number"==typeof e?Bo(e):jo}return Go}function Yo(t){return!(t.sourceCenter&&t.targetCenter&&!Si(t.sourceCenter,t.targetCenter))&&(t.sourceResolution===t.targetResolution&&t.sourceRotation===t.targetRotation)}function Ko(t,e,i,n,r){const s=Math.cos(-r);let o=Math.sin(-r),a=t[0]*s-t[1]*o,l=t[1]*s+t[0]*o;a+=(e[0]/2-i[0])*n,l+=(i[1]-e[1]/2)*n,o=-o;return[a*s-l*o,l*s+a*o]}class qo extends V{constructor(t){super();const e=t.element;!e||t.target||e.style.pointerEvents||(e.style.pointerEvents="auto"),this.element=e||null,this.target_=null,this.map_=null,this.listenerKeys=[],t.render&&(this.render=t.render),t.target&&this.setTarget(t.target)}disposeInternal(){Ur(this.element),super.disposeInternal()}getMap(){return this.map_}setMap(t){this.map_&&Ur(this.element);for(let t=0,e=this.listenerKeys.length;t<e;++t)k(this.listenerKeys[t]);if(this.listenerKeys.length=0,this.map_=t,t){(this.target_?this.target_:t.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==p&&this.listenerKeys.push(N(t,fo,this.render,this)),t.render()}}render(t){}setTarget(t){this.target_="string"==typeof t?document.getElementById(t):t}}class Ho extends qo{constructor(t){t=t||{},super({element:document.createElement("div"),render:t.render,target:t.target}),this.ulElement_=document.createElement("ul"),this.collapsed_=void 0===t.collapsed||t.collapsed,this.userCollapsed_=this.collapsed_,this.overrideCollapsible_=void 0!==t.collapsible,this.collapsible_=void 0===t.collapsible||t.collapsible,this.collapsible_||(this.collapsed_=!1);const e=void 0!==t.className?t.className:"ol-attribution",i=void 0!==t.tipLabel?t.tipLabel:"Attributions",n=void 0!==t.expandClassName?t.expandClassName:e+"-expand",r=void 0!==t.collapseLabel?t.collapseLabel:"›",s=void 0!==t.collapseClassName?t.collapseClassName:e+"-collapse";"string"==typeof r?(this.collapseLabel_=document.createElement("span"),this.collapseLabel_.textContent=r,this.collapseLabel_.className=s):this.collapseLabel_=r;const o=void 0!==t.label?t.label:"i";"string"==typeof o?(this.label_=document.createElement("span"),this.label_.textContent=o,this.label_.className=n):this.label_=o;const a=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_;this.toggleButton_=document.createElement("button"),this.toggleButton_.setAttribute("type","button"),this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_)),this.toggleButton_.title=i,this.toggleButton_.appendChild(a),this.toggleButton_.addEventListener(T,this.handleClick_.bind(this),!1);const l=e+" "+"ol-unselectable "+Is+(this.collapsed_&&this.collapsible_?" ol-collapsed":"")+(this.collapsible_?"":" ol-uncollapsible"),h=this.element;h.className=l,h.appendChild(this.toggleButton_),h.appendChild(this.ulElement_),this.renderedAttributions_=[],this.renderedVisible_=!0}collectSourceAttributions_(t){const e={},i=[];let n=!0;const r=t.layerStatesArray;for(let s=0,o=r.length;s<o;++s){const o=r[s];if(!Ss(o,t.viewState))continue;const a=o.layer.getSource();if(!a)continue;const l=a.getAttributions();if(!l)continue;const h=l(t);if(h)if(n=n&&!1!==a.getAttributionsCollapsible(),Array.isArray(h))for(let t=0,n=h.length;t<n;++t)h[t]in e||(i.push(h[t]),e[h[t]]=!0);else h in e||(i.push(h),e[h]=!0)}return this.overrideCollapsible_||this.setCollapsible(n),i}updateElement_(t){if(!t)return void(this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1));const e=this.collectSourceAttributions_(t),i=e.length>0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!u(e,this.renderedAttributions_)){zr(this.ulElement_);for(let t=0,i=e.length;t<i;++t){const i=document.createElement("li");i.innerHTML=e[t],this.ulElement_.appendChild(i)}this.renderedAttributions_=e}}handleClick_(t){t.preventDefault(),this.handleToggle_(),this.userCollapsed_=this.collapsed_}handleToggle_(){this.element.classList.toggle(Ls),this.collapsed_?Br(this.collapseLabel_,this.label_):Br(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_,this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_))}getCollapsible(){return this.collapsible_}setCollapsible(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),this.userCollapsed_&&this.handleToggle_())}setCollapsed(t){this.userCollapsed_=t,this.collapsible_&&this.collapsed_!==t&&this.handleToggle_()}getCollapsed(){return this.collapsed_}render(t){this.updateElement_(t.frameState)}}class $o extends qo{constructor(t){t=t||{},super({element:document.createElement("div"),render:t.render,target:t.target});const e=void 0!==t.className?t.className:"ol-rotate",i=void 0!==t.label?t.label:"⇧",n=void 0!==t.compassClassName?t.compassClassName:"ol-compass";this.label_=null,"string"==typeof i?(this.label_=document.createElement("span"),this.label_.className=n,this.label_.textContent=i):(this.label_=i,this.label_.classList.add(n));const r=t.tipLabel?t.tipLabel:"Reset rotation",s=document.createElement("button");s.className=e+"-reset",s.setAttribute("type","button"),s.title=r,s.appendChild(this.label_),s.addEventListener(T,this.handleClick_.bind(this),!1);const o=e+" "+"ol-unselectable "+Is,a=this.element;a.className=o,a.appendChild(s),this.callResetNorth_=t.resetNorth?t.resetNorth:void 0,this.duration_=void 0!==t.duration?t.duration:250,this.autoHide_=void 0===t.autoHide||t.autoHide,this.rotation_=void 0,this.autoHide_&&this.element.classList.add(Cs)}handleClick_(t){t.preventDefault(),void 0!==this.callResetNorth_?this.callResetNorth_():this.resetNorth_()}resetNorth_(){const t=this.getMap().getView();if(!t)return;const e=t.getRotation();void 0!==e&&(this.duration_>0&&e%(2*Math.PI)!=0?t.animate({rotation:0,duration:this.duration_,easing:it}):t.setRotation(0))}render(t){const e=t.frameState;if(!e)return;const i=e.viewState.rotation;if(i!=this.rotation_){const t="rotate("+i+"rad)";if(this.autoHide_){const t=this.element.classList.contains(Cs);t||0!==i?t&&0!==i&&this.element.classList.remove(Cs):this.element.classList.add(Cs)}this.label_.style.transform=t}this.rotation_=i}}class Jo extends qo{constructor(t){t=t||{},super({element:document.createElement("div"),target:t.target});const e=void 0!==t.className?t.className:"ol-zoom",i=void 0!==t.delta?t.delta:1,n=void 0!==t.zoomInClassName?t.zoomInClassName:e+"-in",r=void 0!==t.zoomOutClassName?t.zoomOutClassName:e+"-out",s=void 0!==t.zoomInLabel?t.zoomInLabel:"+",o=void 0!==t.zoomOutLabel?t.zoomOutLabel:"–",a=void 0!==t.zoomInTipLabel?t.zoomInTipLabel:"Zoom in",l=void 0!==t.zoomOutTipLabel?t.zoomOutTipLabel:"Zoom out",h=document.createElement("button");h.className=n,h.setAttribute("type","button"),h.title=a,h.appendChild("string"==typeof s?document.createTextNode(s):s),h.addEventListener(T,this.handleClick_.bind(this,i),!1);const c=document.createElement("button");c.className=r,c.setAttribute("type","button"),c.title=l,c.appendChild("string"==typeof o?document.createTextNode(o):o),c.addEventListener(T,this.handleClick_.bind(this,-i),!1);const u=e+" "+"ol-unselectable "+Is,d=this.element;d.className=u,d.appendChild(h),d.appendChild(c),this.duration_=void 0!==t.duration?t.duration:250}handleClick_(t,e){e.preventDefault(),this.zoomByDelta_(t)}zoomByDelta_(t){const e=this.getMap().getView();if(!e)return;const i=e.getZoom();if(void 0!==i){const n=e.getConstrainedZoom(i+t);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({zoom:n,duration:this.duration_,easing:it})):e.setZoom(n)}}}function Qo(t){t=t||{};const e=new q;(void 0===t.zoom||t.zoom)&&e.push(new Jo(t.zoomOptions));(void 0===t.rotate||t.rotate)&&e.push(new $o(t.rotateOptions));return(void 0===t.attribution||t.attribution)&&e.push(new Ho(t.attributionOptions)),e}var ta="active";class ea extends V{constructor(t){super(),this.on,this.once,this.un,t&&t.handleEvent&&(this.handleEvent=t.handleEvent),this.map_=null,this.setActive(!0)}getActive(){return this.get(ta)}getMap(){return this.map_}handleEvent(t){return!0}setActive(t){this.set(ta,t)}setMap(t){this.map_=t}}function ia(t,e,i){const n=t.getCenterInternal();if(n){const r=[n[0]+e[0],n[1]+e[1]];t.animateInternal({duration:void 0!==i?i:250,easing:rt,center:t.getConstrainedCenter(r)})}}function na(t,e,i,n){const r=t.getZoom();if(void 0===r)return;const s=t.getConstrainedZoom(r+e),o=t.getResolutionForZoom(s);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:o,anchor:i,duration:void 0!==n?n:250,easing:it})}class ra extends ea{constructor(t){super(),t=t||{},this.delta_=t.delta?t.delta:1,this.duration_=void 0!==t.duration?t.duration:250}handleEvent(t){let e=!1;if(t.type==ao.DBLCLICK){const i=t.originalEvent,n=t.map,r=t.coordinate,s=i.shiftKey?-this.delta_:this.delta_;na(n.getView(),s,r,this.duration_),i.preventDefault(),e=!0}return!e}}class sa extends ea{constructor(t){super(t=t||{}),t.handleDownEvent&&(this.handleDownEvent=t.handleDownEvent),t.handleDragEvent&&(this.handleDragEvent=t.handleDragEvent),t.handleMoveEvent&&(this.handleMoveEvent=t.handleMoveEvent),t.handleUpEvent&&(this.handleUpEvent=t.handleUpEvent),t.stopDown&&(this.stopDown=t.stopDown),this.handlingDownUpSequence=!1,this.targetPointers=[]}getPointerCount(){return this.targetPointers.length}handleDownEvent(t){return!1}handleDragEvent(t){}handleEvent(t){if(!t.originalEvent)return!0;let e=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==ao.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==ao.POINTERUP){const e=this.handleUpEvent(t);this.handlingDownUpSequence=e&&this.targetPointers.length>0}}else if(t.type==ao.POINTERDOWN){const i=this.handleDownEvent(t);this.handlingDownUpSequence=i,e=this.stopDown(i)}else t.type==ao.POINTERMOVE&&this.handleMoveEvent(t);return!e}handleMoveEvent(t){}handleUpEvent(t){return!1}stopDown(t){return t}updateTrackedPointers_(t){t.activePointers&&(this.targetPointers=t.activePointers)}}function oa(t){const e=t.length;let i=0,n=0;for(let r=0;r<e;r++)i+=t[r].clientX,n+=t[r].clientY;return[i/e,n/e]}function aa(t){const e=arguments;return function(t){let i=!0;for(let n=0,r=e.length;n<r&&(i=i&&e[n](t),i);++n);return i}}const la=function(t){const e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},ha=function(t){const e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},ca=function(t){const e=t.map.getTargetElement(),i=t.map.getOwnerDocument().activeElement;return e.contains(i)},ua=function(t){return!t.map.getTargetElement().hasAttribute("tabindex")||ca(t)},da=g,ga=function(t){const e=t.originalEvent;return 0==e.button&&!(ft&&pt&&e.ctrlKey)},fa=f,pa=function(t){return t.type==ao.SINGLECLICK},ma=function(t){const e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},_a=function(t){const e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},ya=function(t){const e=t.originalEvent,i=e.target.tagName;return"INPUT"!==i&&"SELECT"!==i&&"TEXTAREA"!==i&&!e.target.isContentEditable},xa=function(t){const e=t.originalEvent;return at(void 0!==e,56),"mouse"==e.pointerType},va=function(t){const e=t.originalEvent;return at(void 0!==e,56),e.isPrimary&&0===e.button};class Sa extends sa{constructor(t){super({stopDown:f}),t=t||{},this.kinetic_=t.kinetic,this.lastCentroid=null,this.lastPointersCount_,this.panning_=!1;const e=t.condition?t.condition:aa(ma,va);this.condition_=t.onFocusOnly?aa(ua,e):e,this.noKinetic_=!1}handleDragEvent(t){this.panning_||(this.panning_=!0,this.getMap().getView().beginInteraction());const e=this.targetPointers,i=oa(e);if(e.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(i[0],i[1]),this.lastCentroid){const e=[this.lastCentroid[0]-i[0],i[1]-this.lastCentroid[1]],n=t.map.getView();Ei(e,n.getResolution()),wi(e,n.getRotation()),n.adjustCenterInternal(e)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=i,this.lastPointersCount_=e.length,t.originalEvent.preventDefault()}handleUpEvent(t){const e=t.map,i=e.getView();if(0===this.targetPointers.length){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){const t=this.kinetic_.getDistance(),n=this.kinetic_.getAngle(),r=i.getCenterInternal(),s=e.getPixelFromCoordinateInternal(r),o=e.getCoordinateFromPixelInternal([s[0]-t*Math.cos(n),s[1]-t*Math.sin(n)]);i.animateInternal({center:i.getConstrainedCenter(o),duration:500,easing:it})}return this.panning_&&(this.panning_=!1,i.endInteraction()),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0}handleDownEvent(t){if(this.targetPointers.length>0&&this.condition_(t)){const e=t.map.getView();return this.lastCentroid=null,e.getAnimating()&&e.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1}}class wa extends sa{constructor(t){t=t||{},super({stopDown:f}),this.condition_=t.condition?t.condition:ha,this.lastAngle_=void 0,this.duration_=void 0!==t.duration?t.duration:250}handleDragEvent(t){if(!xa(t))return;const e=t.map,i=e.getView();if(i.getConstraints().rotation===Go)return;const n=e.getSize(),r=t.pixel,s=Math.atan2(n[1]/2-r[1],r[0]-n[0]/2);if(void 0!==this.lastAngle_){const t=s-this.lastAngle_;i.adjustRotationInternal(-t)}this.lastAngle_=s}handleUpEvent(t){if(!xa(t))return!0;return t.map.getView().endInteraction(this.duration_),!1}handleDownEvent(t){if(!xa(t))return!1;if(ga(t)&&this.condition_(t)){return t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0}return!1}}class Ea extends s{constructor(t){super(),this.geometry_=null,this.element_=document.createElement("div"),this.element_.style.position="absolute",this.element_.style.pointerEvents="auto",this.element_.className="ol-box "+t,this.map_=null,this.startPixel_=null,this.endPixel_=null}disposeInternal(){this.setMap(null)}render_(){const t=this.startPixel_,e=this.endPixel_,i="px",n=this.element_.style;n.left=Math.min(t[0],e[0])+i,n.top=Math.min(t[1],e[1])+i,n.width=Math.abs(e[0]-t[0])+i,n.height=Math.abs(e[1]-t[1])+i}setMap(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);const t=this.element_.style;t.left="inherit",t.top="inherit",t.width="inherit",t.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)}setPixels(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()}createOrUpdateGeometry(){const t=this.startPixel_,e=this.endPixel_,i=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);i[4]=i[0].slice(),this.geometry_?this.geometry_.setCoordinates([i]):this.geometry_=new ur([i])}getGeometry(){return this.geometry_}}const Ta="boxstart",Ca="boxdrag",ba="boxend",Ra="boxcancel";class Pa extends i{constructor(t,e,i){super(t),this.coordinate=e,this.mapBrowserEvent=i}}class Ia extends sa{constructor(t){super(),this.on,this.once,this.un,t=t||{},this.box_=new Ea(t.className||"ol-dragbox"),this.minArea_=void 0!==t.minArea?t.minArea:64,t.onBoxEnd&&(this.onBoxEnd=t.onBoxEnd),this.startPixel_=null,this.condition_=t.condition?t.condition:ga,this.boxEndCondition_=t.boxEndCondition?t.boxEndCondition:this.defaultBoxEndCondition}defaultBoxEndCondition(t,e,i){const n=i[0]-e[0],r=i[1]-e[1];return n*n+r*r>=this.minArea_}getGeometry(){return this.box_.getGeometry()}handleDragEvent(t){this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new Pa(Ca,t.coordinate,t))}handleUpEvent(t){this.box_.setMap(null);const e=this.boxEndCondition_(t,this.startPixel_,t.pixel);return e&&this.onBoxEnd(t),this.dispatchEvent(new Pa(e?ba:Ra,t.coordinate,t)),!1}handleDownEvent(t){return!!this.condition_(t)&&(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new Pa(Ta,t.coordinate,t)),!0)}onBoxEnd(t){}}class La extends Ia{constructor(t){super({condition:(t=t||{}).condition?t.condition:_a,className:t.className||"ol-dragzoom",minArea:t.minArea}),this.duration_=void 0!==t.duration?t.duration:200,this.out_=void 0!==t.out&&t.out}onBoxEnd(t){const e=this.getMap().getView();let i=this.getGeometry();if(this.out_){const t=e.rotatedExtentForGeometry(i),n=e.getResolutionForExtentInternal(t),r=e.getResolution()/n;i=i.clone(),i.scale(r*r)}e.fitInternal(i,{duration:this.duration_,easing:it})}}var Ma=37,Fa=38,Aa=39,Oa=40;class Na extends ea{constructor(t){super(),t=t||{},this.defaultCondition_=function(t){return ma(t)&&ya(t)},this.condition_=void 0!==t.condition?t.condition:this.defaultCondition_,this.duration_=void 0!==t.duration?t.duration:100,this.pixelDelta_=void 0!==t.pixelDelta?t.pixelDelta:128}handleEvent(t){let e=!1;if(t.type==I){const i=t.originalEvent,n=i.keyCode;if(this.condition_(t)&&(n==Oa||n==Ma||n==Aa||n==Fa)){const r=t.map.getView(),s=r.getResolution()*this.pixelDelta_;let o=0,a=0;n==Oa?a=-s:n==Ma?o=-s:n==Aa?o=s:a=s;const l=[o,a];wi(l,r.getRotation()),ia(r,l,this.duration_),i.preventDefault(),e=!0}}return!e}}class Da extends ea{constructor(t){super(),t=t||{},this.condition_=t.condition?t.condition:ya,this.delta_=t.delta?t.delta:1,this.duration_=void 0!==t.duration?t.duration:100}handleEvent(t){let e=!1;if(t.type==I||t.type==L){const i=t.originalEvent,n=i.charCode;if(this.condition_(t)&&(n=="+".charCodeAt(0)||n=="-".charCodeAt(0))){const r=t.map,s=n=="+".charCodeAt(0)?this.delta_:-this.delta_;na(r.getView(),s,void 0,this.duration_),i.preventDefault(),e=!0}}return!e}}class ka extends ea{constructor(t){super(t=t||{}),this.totalDelta_=0,this.lastDelta_=0,this.maxDelta_=void 0!==t.maxDelta?t.maxDelta:1,this.duration_=void 0!==t.duration?t.duration:250,this.timeout_=void 0!==t.timeout?t.timeout:80,this.useAnchor_=void 0===t.useAnchor||t.useAnchor,this.constrainResolution_=void 0!==t.constrainResolution&&t.constrainResolution;const e=t.condition?t.condition:da;this.condition_=t.onFocusOnly?aa(ua,e):e,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_,this.mode_=void 0,this.trackpadEventGap_=400,this.trackpadTimeoutId_,this.deltaPerZoom_=300}endInteraction_(){this.trackpadTimeoutId_=void 0;const t=this.getMap();if(!t)return;t.getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_)}handleEvent(t){if(!this.condition_(t))return!0;if(t.type!==O)return!0;const e=t.map,i=t.originalEvent;let n;if(i.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.coordinate),t.type==O&&(n=i.deltaY,ut&&i.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(n/=mt),i.deltaMode===WheelEvent.DOM_DELTA_LINE&&(n*=40)),0===n)return!1;this.lastDelta_=n;const r=Date.now();void 0===this.startTime_&&(this.startTime_=r),(!this.mode_||r-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(n)<4?"trackpad":"wheel");const s=e.getView();if("trackpad"===this.mode_&&!s.getConstrainResolution()&&!this.constrainResolution_)return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(s.getAnimating()&&s.cancelAnimations(),s.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),s.adjustZoom(-n/this.deltaPerZoom_,this.lastAnchor_),this.startTime_=r,!1;this.totalDelta_+=n;const o=Math.max(this.timeout_-(r-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,e),o),!1}handleWheelZoom_(t){const e=t.getView();e.getAnimating()&&e.cancelAnimations();let i=-ii(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),na(e,i,this.lastAnchor_,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0}setMouseAnchor(t){this.useAnchor_=t,t||(this.lastAnchor_=null)}}class Ga extends sa{constructor(t){const e=t=t||{};e.stopDown||(e.stopDown=f),super(e),this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.threshold_=void 0!==t.threshold?t.threshold:.3,this.duration_=void 0!==t.duration?t.duration:250}handleDragEvent(t){let e=0;const i=this.targetPointers[0],n=this.targetPointers[1],r=Math.atan2(n.clientY-i.clientY,n.clientX-i.clientX);if(void 0!==this.lastAngle_){const t=r-this.lastAngle_;this.rotationDelta_+=t,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=t}this.lastAngle_=r;const s=t.map,o=s.getView();if(o.getConstraints().rotation===Go)return;const a=s.getViewport().getBoundingClientRect(),l=oa(this.targetPointers);l[0]-=a.left,l[1]-=a.top,this.anchor_=s.getCoordinateFromPixelInternal(l),this.rotating_&&(s.render(),o.adjustRotationInternal(e,this.anchor_))}handleUpEvent(t){if(this.targetPointers.length<2){return t.map.getView().endInteraction(this.duration_),!1}return!0}handleDownEvent(t){if(this.targetPointers.length>=2){const e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1}}class ja extends sa{constructor(t){const e=t=t||{};e.stopDown||(e.stopDown=f),super(e),this.anchor_=null,this.duration_=void 0!==t.duration?t.duration:400,this.lastDistance_=void 0,this.lastScaleDelta_=1}handleDragEvent(t){let e=1;const i=this.targetPointers[0],n=this.targetPointers[1],r=i.clientX-n.clientX,s=i.clientY-n.clientY,o=Math.sqrt(r*r+s*s);void 0!==this.lastDistance_&&(e=this.lastDistance_/o),this.lastDistance_=o;const a=t.map,l=a.getView();1!=e&&(this.lastScaleDelta_=e);const h=a.getViewport().getBoundingClientRect(),c=oa(this.targetPointers);c[0]-=h.left,c[1]-=h.top,this.anchor_=a.getCoordinateFromPixelInternal(c),a.render(),l.adjustResolutionInternal(e,this.anchor_)}handleUpEvent(t){if(this.targetPointers.length<2){const e=t.map.getView(),i=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,i),!1}return!0}handleDownEvent(t){if(this.targetPointers.length>=2){const e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1}}function Ba(t){t=t||{};const e=new q,i=new Wr(-.005,.05,100);(void 0===t.altShiftDragRotate||t.altShiftDragRotate)&&e.push(new wa);(void 0===t.doubleClickZoom||t.doubleClickZoom)&&e.push(new ra({delta:t.zoomDelta,duration:t.zoomDuration}));(void 0===t.dragPan||t.dragPan)&&e.push(new Sa({onFocusOnly:t.onFocusOnly,kinetic:i}));(void 0===t.pinchRotate||t.pinchRotate)&&e.push(new Ga);(void 0===t.pinchZoom||t.pinchZoom)&&e.push(new ja({duration:t.zoomDuration}));(void 0===t.keyboard||t.keyboard)&&(e.push(new Na),e.push(new Da({delta:t.zoomDelta,duration:t.zoomDuration})));(void 0===t.mouseWheelZoom||t.mouseWheelZoom)&&e.push(new ka({onFocusOnly:t.onFocusOnly,duration:t.zoomDuration}));return(void 0===t.shiftDragZoom||t.shiftDragZoom)&&e.push(new La({duration:t.zoomDuration})),e}function Ua(t,e,i){return void 0===i&&(i=[0,0]),i[0]=t[0]+2*e,i[1]=t[1]+2*e,i}function za(t){return t[0]>0&&t[1]>0}function Xa(t,e,i){return void 0===i&&(i=[0,0]),i[0]=t[0]*e+.5|0,i[1]=t[1]*e+.5|0,i}function Va(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:(e[0]=t,e[1]=t),e)}function Wa(t){t instanceof vs?t.setMapInternal(null):t instanceof ro&&t.getLayers().forEach(Wa)}function Za(t,e){if(t instanceof vs)t.setMapInternal(e);else if(t instanceof ro){const i=t.getLayers().getArray();for(let t=0,n=i.length;t<n;++t)Za(i[t],e)}}class Ya extends V{constructor(t){super(),t=t||{},this.on,this.once,this.un;const e=function(t){let e=null;void 0!==t.keyboardEventTarget&&(e="string"==typeof t.keyboardEventTarget?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget);const i={},n=t.layers&&"function"==typeof t.layers.getLayers?t.layers:new ro({layers:t.layers});let r,s,o;i[xo]=n,i[So]=t.target,i[wo]=t.view instanceof zo?t.view:new zo,void 0!==t.controls&&(Array.isArray(t.controls)?r=new q(t.controls.slice()):(at("function"==typeof t.controls.getArray,47),r=t.controls));void 0!==t.interactions&&(Array.isArray(t.interactions)?s=new q(t.interactions.slice()):(at("function"==typeof t.interactions.getArray,48),s=t.interactions));void 0!==t.overlays?Array.isArray(t.overlays)?o=new q(t.overlays.slice()):(at("function"==typeof t.overlays.getArray,49),o=t.overlays):o=new q;return{controls:r,interactions:s,keyboardEventTarget:e,overlays:o,values:i}}(t);this.renderComplete_,this.loaded_=!0,this.boundHandleBrowserEvent_=this.handleBrowserEvent.bind(this),this.maxTilesLoading_=void 0!==t.maxTilesLoading?t.maxTilesLoading:16,this.pixelRatio_=void 0!==t.pixelRatio?t.pixelRatio:mt,this.postRenderTimeoutHandle_,this.animationDelayKey_,this.animationDelay_=this.animationDelay_.bind(this),this.coordinateToPixelTransform_=[1,0,0,1,0,0],this.pixelToCoordinateTransform_=[1,0,0,1,0,0],this.frameIndex_=0,this.frameState_=null,this.previousExtent_=null,this.viewPropertyListenerKey_=null,this.viewChangeListenerKey_=null,this.layerGroupPropertyListenerKeys_=null,this.viewport_=document.createElement("div"),this.viewport_.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),this.viewport_.style.position="relative",this.viewport_.style.overflow="hidden",this.viewport_.style.width="100%",this.viewport_.style.height="100%",this.overlayContainer_=document.createElement("div"),this.overlayContainer_.style.position="absolute",this.overlayContainer_.style.zIndex="0",this.overlayContainer_.style.width="100%",this.overlayContainer_.style.height="100%",this.overlayContainer_.style.pointerEvents="none",this.overlayContainer_.className="ol-overlaycontainer",this.viewport_.appendChild(this.overlayContainer_),this.overlayContainerStopEvent_=document.createElement("div"),this.overlayContainerStopEvent_.style.position="absolute",this.overlayContainerStopEvent_.style.zIndex="0",this.overlayContainerStopEvent_.style.width="100%",this.overlayContainerStopEvent_.style.height="100%",this.overlayContainerStopEvent_.style.pointerEvents="none",this.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent",this.viewport_.appendChild(this.overlayContainerStopEvent_),this.mapBrowserEventHandler_=null,this.moveTolerance_=t.moveTolerance,this.keyboardEventTarget_=e.keyboardEventTarget,this.targetChangeHandlerKeys_=null,this.controls=e.controls||Qo(),this.interactions=e.interactions||Ba({onFocusOnly:!0}),this.overlays_=e.overlays,this.overlayIdIndex_={},this.renderer_=null,this.postRenderFunctions_=[],this.tileQueue_=new Co(this.getTilePriority.bind(this),this.handleTileChange_.bind(this)),this.addChangeListener(xo,this.handleLayerGroupChanged_),this.addChangeListener(wo,this.handleViewChanged_),this.addChangeListener(vo,this.handleSizeChanged_),this.addChangeListener(So,this.handleTargetChanged_),this.setProperties(e.values);const i=this;!t.view||t.view instanceof zo||t.view.then((function(t){i.setView(new zo(t))})),this.controls.addEventListener(W,function(t){t.element.setMap(this)}.bind(this)),this.controls.addEventListener(Z,function(t){t.element.setMap(null)}.bind(this)),this.interactions.addEventListener(W,function(t){t.element.setMap(this)}.bind(this)),this.interactions.addEventListener(Z,function(t){t.element.setMap(null)}.bind(this)),this.overlays_.addEventListener(W,function(t){this.addOverlayInternal_(t.element)}.bind(this)),this.overlays_.addEventListener(Z,function(t){const e=t.element.getId();void 0!==e&&delete this.overlayIdIndex_[e.toString()],t.element.setMap(null)}.bind(this)),this.controls.forEach(function(t){t.setMap(this)}.bind(this)),this.interactions.forEach(function(t){t.setMap(this)}.bind(this)),this.overlays_.forEach(this.addOverlayInternal_.bind(this))}addControl(t){this.getControls().push(t)}addInteraction(t){this.getInteractions().push(t)}addLayer(t){this.getLayerGroup().getLayers().push(t)}handleLayerAdd_(t){Za(t.layer,this)}addOverlay(t){this.getOverlays().push(t)}addOverlayInternal_(t){const e=t.getId();void 0!==e&&(this.overlayIdIndex_[e.toString()]=t),t.setMap(this)}disposeInternal(){this.controls.clear(),this.interactions.clear(),this.overlays_.clear(),this.setTarget(null),super.disposeInternal()}forEachFeatureAtPixel(t,e,i){if(!this.frameState_||!this.renderer_)return;const n=this.getCoordinateFromPixelInternal(t),r=void 0!==(i=void 0!==i?i:{}).hitTolerance?i.hitTolerance:0,s=void 0!==i.layerFilter?i.layerFilter:g,o=!1!==i.checkWrapped;return this.renderer_.forEachFeatureAtCoordinate(n,this.frameState_,r,o,e,null,s,null)}getFeaturesAtPixel(t,e){const i=[];return this.forEachFeatureAtPixel(t,(function(t){i.push(t)}),e),i}getAllLayers(){const t=[];return function e(i){i.forEach((function(i){i instanceof ro?e(i.getLayers()):t.push(i)}))}(this.getLayers()),t}hasFeatureAtPixel(t,e){if(!this.frameState_||!this.renderer_)return!1;const i=this.getCoordinateFromPixelInternal(t),n=void 0!==(e=void 0!==e?e:{}).layerFilter?e.layerFilter:g,r=void 0!==e.hitTolerance?e.hitTolerance:0,s=!1!==e.checkWrapped;return this.renderer_.hasFeatureAtCoordinate(i,this.frameState_,r,s,n,null)}getEventCoordinate(t){return this.getCoordinateFromPixel(this.getEventPixel(t))}getEventCoordinateInternal(t){return this.getCoordinateFromPixelInternal(this.getEventPixel(t))}getEventPixel(t){const e=this.viewport_.getBoundingClientRect(),i="changedTouches"in t?t.changedTouches[0]:t;return[i.clientX-e.left,i.clientY-e.top]}getTarget(){return this.get(So)}getTargetElement(){const t=this.getTarget();return void 0!==t?"string"==typeof t?document.getElementById(t):t:null}getCoordinateFromPixel(t){return nn(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())}getCoordinateFromPixelInternal(t){const e=this.frameState_;return e?bt(e.pixelToCoordinateTransform,t.slice()):null}getControls(){return this.controls}getOverlays(){return this.overlays_}getOverlayById(t){const e=this.overlayIdIndex_[t.toString()];return void 0!==e?e:null}getInteractions(){return this.interactions}getLayerGroup(){return this.get(xo)}setLayers(t){const e=this.getLayerGroup();if(t instanceof q)return void e.setLayers(t);const i=e.getLayers();i.clear(),i.extend(t)}getLayers(){return this.getLayerGroup().getLayers()}getLoadingOrNotReady(){const t=this.getLayerGroup().getLayerStatesArray();for(let e=0,i=t.length;e<i;++e){const i=t[e];if(!i.visible)continue;const n=i.layer.getRenderer();if(n&&!n.ready)return!0;const r=i.layer.getSource();if(r&&r.loading)return!0}return!1}getPixelFromCoordinate(t){const e=rn(t,this.getView().getProjection());return this.getPixelFromCoordinateInternal(e)}getPixelFromCoordinateInternal(t){const e=this.frameState_;return e?bt(e.coordinateToPixelTransform,t.slice(0,2)):null}getRenderer(){return this.renderer_}getSize(){return this.get(vo)}getView(){return this.get(wo)}getViewport(){return this.viewport_}getOverlayContainer(){return this.overlayContainer_}getOverlayContainerStopEvent(){return this.overlayContainerStopEvent_}getOwnerDocument(){const t=this.getTargetElement();return t?t.ownerDocument:document}getTilePriority(t,e,i,n){return bo(this.frameState_,t,e,i,n)}handleBrowserEvent(t,e){e=e||t.type;const i=new oo(e,this,t);this.handleMapBrowserEvent(i)}handleMapBrowserEvent(t){if(!this.frameState_)return;const e=t.originalEvent,i=e.type;if(i===ho||i===O||i===I){const t=this.getOwnerDocument(),i=this.viewport_.getRootNode?this.viewport_.getRootNode():t,n=e.target;if(this.overlayContainerStopEvent_.contains(n)||!(i===t?t.documentElement:i).contains(n))return}if(t.frameState=this.frameState_,!1!==this.dispatchEvent(t)){const e=this.getInteractions().getArray().slice();for(let i=e.length-1;i>=0;i--){const n=e[i];if(n.getMap()!==this||!n.getActive()||!this.getTargetElement())continue;if(!n.handleEvent(t)||t.propagationStopped)break}}}handlePostRender(){const t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){let i=this.maxTilesLoading_,n=i;if(t){const e=t.viewHints;if(e[Ro]||e[Po]){const e=Date.now()-t.time>8;i=e?0:8,n=e?0:2}}e.getTilesLoading()<i&&(e.reprioritize(),e.loadMoreTiles(i,n))}t&&this.renderer_&&!t.animate&&(!0===this.renderComplete_?(this.hasListener(xs)&&this.renderer_.dispatchRenderEvent(xs,t),!1===this.loaded_&&(this.loaded_=!0,this.dispatchEvent(new so(yo,this,t)))):!0===this.loaded_&&(this.loaded_=!1,this.dispatchEvent(new so(_o,this,t))));const i=this.postRenderFunctions_;for(let e=0,n=i.length;e<n;++e)i[e](this,t);i.length=0}handleSizeChanged_(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()}handleTargetChanged_(){if(this.mapBrowserEventHandler_){for(let t=0,e=this.targetChangeHandlerKeys_.length;t<e;++t)k(this.targetChangeHandlerKeys_[t]);this.targetChangeHandlerKeys_=null,this.viewport_.removeEventListener(E,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(O,this.boundHandleBrowserEvent_),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,Ur(this.viewport_)}const t=this.getTargetElement();if(t){t.appendChild(this.viewport_),this.renderer_||(this.renderer_=new eo(this)),this.mapBrowserEventHandler_=new go(this,this.moveTolerance_);for(const t in ao)this.mapBrowserEventHandler_.addEventListener(ao[t],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(E,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(O,this.boundHandleBrowserEvent_,!!xt&&{passive:!1});const e=this.getOwnerDocument().defaultView,i=this.keyboardEventTarget_?this.keyboardEventTarget_:t;this.targetChangeHandlerKeys_=[N(i,I,this.handleBrowserEvent,this),N(i,L,this.handleBrowserEvent,this),N(e,F,this.updateSize,this)]}else this.renderer_&&(clearTimeout(this.postRenderTimeoutHandle_),this.postRenderTimeoutHandle_=void 0,this.postRenderFunctions_.length=0,this.renderer_.dispose(),this.renderer_=null),this.animationDelayKey_&&(cancelAnimationFrame(this.animationDelayKey_),this.animationDelayKey_=void 0);this.updateSize()}handleTileChange_(){this.render()}handleViewPropertyChanged_(){this.render()}handleViewChanged_(){this.viewPropertyListenerKey_&&(k(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(k(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);const t=this.getView();t&&(this.updateViewportSize_(),this.viewPropertyListenerKey_=N(t,r,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=N(t,S,this.handleViewPropertyChanged_,this),t.resolveConstraints(0)),this.render()}handleLayerGroupChanged_(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(k),this.layerGroupPropertyListenerKeys_=null);const t=this.getLayerGroup();t&&(this.handleLayerAdd_(new io("addlayer",t)),this.layerGroupPropertyListenerKeys_=[N(t,r,this.render,this),N(t,S,this.render,this),N(t,"addlayer",this.handleLayerAdd_,this),N(t,"removelayer",this.handleLayerRemove_,this)]),this.render()}isRendered(){return!!this.frameState_}animationDelay_(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}renderSync(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()}redrawText(){const t=this.getLayerGroup().getLayerStatesArray();for(let e=0,i=t.length;e<i;++e){const i=t[e].layer;i.hasRenderer()&&i.getRenderer().handleFontsChanged()}}render(){this.renderer_&&void 0===this.animationDelayKey_&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))}removeControl(t){return this.getControls().remove(t)}removeInteraction(t){return this.getInteractions().remove(t)}removeLayer(t){return this.getLayerGroup().getLayers().remove(t)}handleLayerRemove_(t){Wa(t.layer)}removeOverlay(t){return this.getOverlays().remove(t)}renderFrame_(t){const e=this.getSize(),i=this.getView(),n=this.frameState_;let r=null;if(void 0!==e&&za(e)&&i&&i.isDef()){const n=i.getHints(this.frameState_?this.frameState_.viewHints:void 0),s=i.getState();if(r={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutterTree:null,extent:pe(s.center,s.resolution,s.rotation,e),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:e,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:s,viewHints:n,wantedTiles:{},mapId:z(this),renderTargets:{}},s.nextCenter&&s.nextResolution){const t=isNaN(s.nextRotation)?s.rotation:s.nextRotation;r.nextExtent=pe(s.nextCenter,s.nextResolution,t,e)}}if(this.frameState_=r,this.renderer_.renderFrame(r),r){if(r.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,r.postRenderFunctions),n){(!this.previousExtent_||!Ee(this.previousExtent_)&&!ee(r.extent,this.previousExtent_))&&(this.dispatchEvent(new so(po,this,n)),this.previousExtent_=Jt(this.previousExtent_))}this.previousExtent_&&!r.viewHints[Ro]&&!r.viewHints[Po]&&!ee(r.extent,this.previousExtent_)&&(this.dispatchEvent(new so(mo,this,r)),Vt(r.extent,this.previousExtent_))}this.dispatchEvent(new so(fo,this,r)),this.renderComplete_=this.hasListener(_o)||this.hasListener(yo)||this.hasListener(xs)?!this.tileQueue_.getTilesLoading()&&!this.tileQueue_.getCount()&&!this.getLoadingOrNotReady():void 0,this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout((()=>{this.postRenderTimeoutHandle_=void 0,this.handlePostRender()}),0))}setLayerGroup(t){const e=this.getLayerGroup();e&&this.handleLayerRemove_(new io("removelayer",e)),this.set(xo,t)}setSize(t){this.set(vo,t)}setTarget(t){this.set(So,t)}setView(t){if(!t||t instanceof zo)return void this.set(wo,t);this.set(wo,new zo);const e=this;t.then((function(t){e.setView(new zo(t))}))}updateSize(){const t=this.getTargetElement();let e;if(t){const i=getComputedStyle(t),n=t.offsetWidth-parseFloat(i.borderLeftWidth)-parseFloat(i.paddingLeft)-parseFloat(i.paddingRight)-parseFloat(i.borderRightWidth),r=t.offsetHeight-parseFloat(i.borderTopWidth)-parseFloat(i.paddingTop)-parseFloat(i.paddingBottom)-parseFloat(i.borderBottomWidth);isNaN(n)||isNaN(r)||(e=[n,r],!za(e)&&(t.offsetWidth||t.offsetHeight||t.getClientRects().length)&&console.warn("No map visible because the map container's width or height are 0."))}this.setSize(e),this.updateViewportSize_()}updateViewportSize_(){const t=this.getView();if(t){let e;const i=getComputedStyle(this.viewport_);i.width&&i.height&&(e=[parseInt(i.width,10),parseInt(i.height,10)]),t.setViewportSize(e)}}}const Ka="element",qa="map",Ha="offset",$a="position",Ja="positioning";class Qa extends V{constructor(t){super(),this.on,this.once,this.un,this.options=t,this.id=t.id,this.insertFirst=void 0===t.insertFirst||t.insertFirst,this.stopEvent=void 0===t.stopEvent||t.stopEvent,this.element=document.createElement("div"),this.element.className=void 0!==t.className?t.className:"ol-overlay-container ol-selectable",this.element.style.position="absolute",this.element.style.pointerEvents="auto",this.autoPan=!0===t.autoPan?{}:t.autoPan||void 0,this.rendered={transform_:"",visible:!0},this.mapPostrenderListenerKey=null,this.addChangeListener(Ka,this.handleElementChanged),this.addChangeListener(qa,this.handleMapChanged),this.addChangeListener(Ha,this.handleOffsetChanged),this.addChangeListener($a,this.handlePositionChanged),this.addChangeListener(Ja,this.handlePositioningChanged),void 0!==t.element&&this.setElement(t.element),this.setOffset(void 0!==t.offset?t.offset:[0,0]),this.setPositioning(t.positioning||"top-left"),void 0!==t.position&&this.setPosition(t.position)}getElement(){return this.get(Ka)}getId(){return this.id}getMap(){return this.get(qa)||null}getOffset(){return this.get(Ha)}getPosition(){return this.get($a)}getPositioning(){return this.get(Ja)}handleElementChanged(){zr(this.element);const t=this.getElement();t&&this.element.appendChild(t)}handleMapChanged(){this.mapPostrenderListenerKey&&(Ur(this.element),k(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);const t=this.getMap();if(t){this.mapPostrenderListenerKey=N(t,fo,this.render,this),this.updatePixelPosition();const e=this.stopEvent?t.getOverlayContainerStopEvent():t.getOverlayContainer();this.insertFirst?e.insertBefore(this.element,e.childNodes[0]||null):e.appendChild(this.element),this.performAutoPan()}}render(){this.updatePixelPosition()}handleOffsetChanged(){this.updatePixelPosition()}handlePositionChanged(){this.updatePixelPosition(),this.performAutoPan()}handlePositioningChanged(){this.updatePixelPosition()}setElement(t){this.set(Ka,t)}setMap(t){this.set(qa,t)}setOffset(t){this.set(Ha,t)}setPosition(t){this.set($a,t)}performAutoPan(){this.autoPan&&this.panIntoView(this.autoPan)}panIntoView(t){const e=this.getMap();if(!e||!e.getTargetElement()||!this.get($a))return;const i=this.getRect(e.getTargetElement(),e.getSize()),n=this.getElement(),r=this.getRect(n,[Gr(n),jr(n)]),s=void 0===(t=t||{}).margin?20:t.margin;if(!Yt(i,r)){const n=r[0]-i[0],o=i[2]-r[2],a=r[1]-i[1],l=i[3]-r[3],h=[0,0];if(n<0?h[0]=n-s:o<0&&(h[0]=Math.abs(o)+s),a<0?h[1]=a-s:l<0&&(h[1]=Math.abs(l)+s),0!==h[0]||0!==h[1]){const i=e.getView().getCenterInternal(),n=e.getPixelFromCoordinateInternal(i);if(!n)return;const r=[n[0]+h[0],n[1]+h[1]],s=t.animation||{};e.getView().animateInternal({center:e.getCoordinateFromPixelInternal(r),duration:s.duration,easing:s.easing})}}}getRect(t,e){const i=t.getBoundingClientRect(),n=i.left+window.pageXOffset,r=i.top+window.pageYOffset;return[n,r,n+e[0],r+e[1]]}setPositioning(t){this.set(Ja,t)}setVisible(t){this.rendered.visible!==t&&(this.element.style.display=t?"":"none",this.rendered.visible=t)}updatePixelPosition(){const t=this.getMap(),e=this.getPosition();if(!t||!t.isRendered()||!e)return void this.setVisible(!1);const i=t.getPixelFromCoordinate(e),n=t.getSize();this.updateRenderedPosition(i,n)}updateRenderedPosition(t,e){const i=this.element.style,n=this.getOffset(),r=this.getPositioning();this.setVisible(!0);let s="0%",o="0%";"bottom-right"==r||"center-right"==r||"top-right"==r?s="-100%":"bottom-center"!=r&&"center-center"!=r&&"top-center"!=r||(s="-50%"),"bottom-left"==r||"bottom-center"==r||"bottom-right"==r?o="-100%":"center-left"!=r&&"center-center"!=r&&"center-right"!=r||(o="-50%");const a=`translate(${s}, ${o}) translate(${Math.round(t[0]+n[0])+"px"}, ${Math.round(t[1]+n[1])+"px"})`;this.rendered.transform_!=a&&(this.rendered.transform_=a,i.transform=a)}getOptions(){return this.options}}class tl{constructor(t){this.highWaterMark=void 0!==t?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}canExpireCache(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark}expireCache(t){for(;this.canExpireCache();)this.pop()}clear(){this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}containsKey(t){return this.entries_.hasOwnProperty(t)}forEach(t){let e=this.oldest_;for(;e;)t(e.value_,e.key_,this),e=e.newer}get(t,e){const i=this.entries_[t];return at(void 0!==i,15),i===this.newest_||(i===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(i.newer.older=i.older,i.older.newer=i.newer),i.newer=null,i.older=this.newest_,this.newest_.newer=i,this.newest_=i),i.value_}remove(t){const e=this.entries_[t];return at(void 0!==e,15),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_}getCount(){return this.count_}getKeys(){const t=new Array(this.count_);let e,i=0;for(e=this.newest_;e;e=e.older)t[i++]=e.key_;return t}getValues(){const t=new Array(this.count_);let e,i=0;for(e=this.newest_;e;e=e.older)t[i++]=e.value_;return t}peekLast(){return this.oldest_.value_}peekLastKey(){return this.oldest_.key_}peekFirstKey(){return this.newest_.key_}peek(t){if(this.containsKey(t))return this.entries_[t].value_}pop(){const t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_}replace(t,e){this.get(t),this.entries_[t].value_=e}set(t,e){at(!(t in this.entries_),16);const i={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=i:this.oldest_=i,this.newest_=i,this.entries_[t]=i,++this.count_}setSize(t){this.highWaterMark=t}}function el(t,e,i,n){return void 0!==n?(n[0]=t,n[1]=e,n[2]=i,n):[t,e,i]}function il(t,e,i){return t+"/"+e+"/"+i}function nl(t){return il(t[0],t[1],t[2])}function rl(t){const[e,i,n]=t.substring(t.lastIndexOf("/")+1,t.length).split(",").map(Number);return il(e,i,n)}function sl(t){return t.split("/").map(Number)}function ol(t){return(t[1]<<t[0])+t[2]}function al(t,e){const i=t[0],n=t[1],r=t[2];if(e.getMinZoom()>i||i>e.getMaxZoom())return!1;const s=e.getFullTileRange(i);return!s||s.containsXY(n,r)}class ll extends tl{clear(){for(;this.getCount()>0;)this.pop().release();super.clear()}expireCache(t){for(;this.canExpireCache();){if(this.peekLast().getKey()in t)break;this.pop().release()}}pruneExceptNewestZ(){if(0===this.getCount())return;const t=sl(this.peekFirstKey())[0];this.forEach(function(e){e.tileCoord[0]!==t&&(this.remove(nl(e.tileCoord)),e.release())}.bind(this))}}class hl{constructor(t,e,i,n){this.minX=t,this.maxX=e,this.minY=i,this.maxY=n}contains(t){return this.containsXY(t[1],t[2])}containsTileRange(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY}containsXY(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY}equals(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY}extend(t){t.minX<this.minX&&(this.minX=t.minX),t.maxX>this.maxX&&(this.maxX=t.maxX),t.minY<this.minY&&(this.minY=t.minY),t.maxY>this.maxY&&(this.maxY=t.maxY)}getHeight(){return this.maxY-this.minY+1}getSize(){return[this.getWidth(),this.getHeight()]}getWidth(){return this.maxX-this.minX+1}intersects(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY}}function cl(t,e,i,n,r){return void 0!==r?(r.minX=t,r.maxX=e,r.minY=i,r.maxY=n,r):new hl(t,e,i,n)}const ul=[];class dl extends st{constructor(t,e,i,n){super(t,e,{transition:0}),this.context_={},this.executorGroups={},this.declutterExecutorGroups={},this.loadingSourceTiles=0,this.hitDetectionImageData={},this.replayState_={},this.sourceTiles=[],this.errorTileKeys={},this.wantedResolution,this.getSourceTiles=n.bind(void 0,this),this.wrappedTileCoord=i}getContext(t){const e=z(t);return e in this.context_||(this.context_[e]=Dr(1,1,ul)),this.context_[e]}hasContext(t){return z(t)in this.context_}getImage(t){return this.hasContext(t)?this.getContext(t).canvas:null}getReplayState(t){const e=z(t);return e in this.replayState_||(this.replayState_[e]={dirty:!1,renderedRenderOrder:null,renderedResolution:NaN,renderedRevision:-1,renderedTileResolution:NaN,renderedTileRevision:-1,renderedTileZ:-1}),this.replayState_[e]}load(){this.getSourceTiles()}release(){for(const t in this.context_){const e=this.context_[t];kr(e),ul.push(e.canvas),delete this.context_[t]}super.release()}}class gl extends st{constructor(t,e,i,n,r,s){super(t,e,s),this.extent=null,this.format_=n,this.features_=null,this.loader_,this.projection=null,this.resolution,this.tileLoadFunction_=r,this.url_=i,this.key=i}getFormat(){return this.format_}getFeatures(){return this.features_}load(){this.state==H&&(this.setState($),this.tileLoadFunction_(this,this.url_),this.loader_&&this.loader_(this.extent,this.resolution,this.projection))}onLoad(t,e){this.setFeatures(t)}onError(){this.setState(Q)}setFeatures(t){this.features_=t,this.setState(J)}setLoader(t){this.loader_=t}}function fl(t){return Array.isArray(t)?Qr(t):t}let pl,ml=!1;function _l(t,e,i,n,r,s,o){const a=new XMLHttpRequest;a.open("GET","function"==typeof t?t(i,n,r):t,!0),"arraybuffer"==e.getType()&&(a.responseType="arraybuffer"),a.withCredentials=ml,a.onload=function(t){if(!a.status||a.status>=200&&a.status<300){const t=e.getType();let n;"json"==t||"text"==t?n=a.responseText:"xml"==t?(n=a.responseXML,n||(n=(new DOMParser).parseFromString(a.responseText,"application/xml"))):"arraybuffer"==t&&(n=a.response),n?s(e.readFeatures(n,{extent:i,featureProjection:r}),e.readProjection(n)):o()}else o()},a.onerror=o,a.send()}function yl(t,e){return function(i,n,r,s,o){const a=this;_l(t,e,i,n,r,(function(t,e){a.addFeatures(t),void 0!==s&&s(t)}),o||p)}}function xl(t,e){return[[-1/0,-1/0,1/0,1/0]]}function vl(t,e,i,n){const r=document.createElement("script"),s="olc_"+z(e);function o(){delete window[s],r.parentNode.removeChild(r)}r.async=!0,r.src=t+(t.includes("?")?"&":"?")+(n||"callback")+"="+s;const a=setTimeout((function(){o(),i&&i()}),1e4);window[s]=function(t){clearTimeout(a),o(),e(t)},document.head.appendChild(r)}class Sl extends Error{constructor(t){super("Unexpected response status: "+t.status),this.name="ResponseError",this.response=t}}class wl extends Error{constructor(t){super("Failed to issue request"),this.name="ClientError",this.client=t}}function El(t){return new Promise((function(e,i){const n=new XMLHttpRequest;n.addEventListener("load",(function(t){const n=t.target;if(!n.status||n.status>=200&&n.status<300){let t;try{t=JSON.parse(n.responseText)}catch(t){const e="Error parsing response text as JSON: "+t.message;return void i(new Error(e))}e(t)}else i(new Sl(n))})),n.addEventListener("error",(function(t){i(new wl(t.target))})),n.open("GET",t),n.setRequestHeader("Accept","application/json"),n.send()}))}function Tl(t,e){return e.includes("://")?e:new URL(e,t).href}class Cl{drawCustom(t,e,i,n){}drawGeometry(t){}setStyle(t){}drawCircle(t,e){}drawFeature(t,e){}drawGeometryCollection(t,e){}drawLineString(t,e){}drawMultiLineString(t,e){}drawMultiPoint(t,e){}drawMultiPolygon(t,e){}drawPoint(t,e){}drawPolygon(t,e){}drawText(t,e){}setFillStrokeStyle(t,e){}setImageStyle(t,e){}setTextStyle(t,e){}}class bl extends Cl{constructor(t,e,i,n,r,s,o){super(),this.context_=t,this.pixelRatio_=e,this.extent_=i,this.transform_=n,this.viewRotation_=r,this.squaredTolerance_=s,this.userTransform_=o,this.contextFillState_=null,this.contextStrokeState_=null,this.contextTextState_=null,this.fillState_=null,this.strokeState_=null,this.image_=null,this.imageAnchorX_=0,this.imageAnchorY_=0,this.imageHeight_=0,this.imageOpacity_=0,this.imageOriginX_=0,this.imageOriginY_=0,this.imageRotateWithView_=!1,this.imageRotation_=0,this.imageScale_=[0,0],this.imageWidth_=0,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=!1,this.textRotation_=0,this.textScale_=[0,0],this.textFillState_=null,this.textStrokeState_=null,this.textState_=null,this.pixelCoordinates_=[],this.tmpLocalTransform_=[1,0,0,1,0,0]}drawImages_(t,e,i,n){if(!this.image_)return;const r=un(t,e,i,n,this.transform_,this.pixelCoordinates_),s=this.context_,o=this.tmpLocalTransform_,a=s.globalAlpha;1!=this.imageOpacity_&&(s.globalAlpha=a*this.imageOpacity_);let l=this.imageRotation_;this.imageRotateWithView_&&(l+=this.viewRotation_);for(let t=0,e=r.length;t<e;t+=2){const e=r[t]-this.imageAnchorX_,i=r[t+1]-this.imageAnchorY_;if(0!==l||1!=this.imageScale_[0]||1!=this.imageScale_[1]){const t=e+this.imageAnchorX_,n=i+this.imageAnchorY_;Mt(o,t,n,1,1,l,-t,-n),s.setTransform.apply(s,o),s.translate(t,n),s.scale(this.imageScale_[0],this.imageScale_[1]),s.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),s.setTransform(1,0,0,1,0,0)}else s.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,e,i,this.imageWidth_,this.imageHeight_)}1!=this.imageOpacity_&&(s.globalAlpha=a)}drawText_(t,e,i,n){if(!this.textState_||""===this.text_)return;this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);const r=un(t,e,i,n,this.transform_,this.pixelCoordinates_),s=this.context_;let o=this.textRotation_;for(this.textRotateWithView_&&(o+=this.viewRotation_);e<i;e+=n){const t=r[e]+this.textOffsetX_,i=r[e+1]+this.textOffsetY_;0!==o||1!=this.textScale_[0]||1!=this.textScale_[1]?(s.translate(t-this.textOffsetX_,i-this.textOffsetY_),s.rotate(o),s.translate(this.textOffsetX_,this.textOffsetY_),s.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&s.strokeText(this.text_,0,0),this.textFillState_&&s.fillText(this.text_,0,0),s.setTransform(1,0,0,1,0,0)):(this.textStrokeState_&&s.strokeText(this.text_,t,i),this.textFillState_&&s.fillText(this.text_,t,i))}}moveToLineTo_(t,e,i,n,r){const s=this.context_,o=un(t,e,i,n,this.transform_,this.pixelCoordinates_);s.moveTo(o[0],o[1]);let a=o.length;r&&(a-=2);for(let t=2;t<a;t+=2)s.lineTo(o[t],o[t+1]);return r&&s.closePath(),i}drawRings_(t,e,i,n){for(let r=0,s=i.length;r<s;++r)e=this.moveToLineTo_(t,e,i[r],n,!0);return e}drawCircle(t){if(we(this.extent_,t.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const e=xn(t,this.transform_,this.pixelCoordinates_),i=e[2]-e[0],n=e[3]-e[1],r=Math.sqrt(i*i+n*n),s=this.context_;s.beginPath(),s.arc(e[0],e[1],r,0,2*Math.PI),this.fillState_&&s.fill(),this.strokeState_&&s.stroke()}""!==this.text_&&this.drawText_(t.getCenter(),0,2,2)}}setStyle(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())}setTransform(t){this.transform_=t}drawGeometry(t){switch(t.getType()){case"Point":this.drawPoint(t);break;case"LineString":this.drawLineString(t);break;case"Polygon":this.drawPolygon(t);break;case"MultiPoint":this.drawMultiPoint(t);break;case"MultiLineString":this.drawMultiLineString(t);break;case"MultiPolygon":this.drawMultiPolygon(t);break;case"GeometryCollection":this.drawGeometryCollection(t);break;case"Circle":this.drawCircle(t)}}drawFeature(t,e){const i=e.getGeometryFunction()(t);i&&we(this.extent_,i.getExtent())&&(this.setStyle(e),this.drawGeometry(i))}drawGeometryCollection(t){const e=t.getGeometriesArray();for(let t=0,i=e.length;t<i;++t)this.drawGeometry(e[t])}drawPoint(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const e=t.getFlatCoordinates(),i=t.getStride();this.image_&&this.drawImages_(e,0,e.length,i),""!==this.text_&&this.drawText_(e,0,e.length,i)}drawMultiPoint(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const e=t.getFlatCoordinates(),i=t.getStride();this.image_&&this.drawImages_(e,0,e.length,i),""!==this.text_&&this.drawText_(e,0,e.length,i)}drawLineString(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),we(this.extent_,t.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);const e=this.context_,i=t.getFlatCoordinates();e.beginPath(),this.moveToLineTo_(i,0,i.length,t.getStride(),!1),e.stroke()}if(""!==this.text_){const e=t.getFlatMidpoint();this.drawText_(e,0,2,2)}}}drawMultiLineString(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const e=t.getExtent();if(we(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);const e=this.context_,i=t.getFlatCoordinates();let n=0;const r=t.getEnds(),s=t.getStride();e.beginPath();for(let t=0,e=r.length;t<e;++t)n=this.moveToLineTo_(i,n,r[t],s,!1);e.stroke()}if(""!==this.text_){const e=t.getFlatMidpoints();this.drawText_(e,0,e.length,2)}}}drawPolygon(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),we(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const e=this.context_;e.beginPath(),this.drawRings_(t.getOrientedFlatCoordinates(),0,t.getEnds(),t.getStride()),this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){const e=t.getFlatInteriorPoint();this.drawText_(e,0,2,2)}}}drawMultiPolygon(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),we(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const e=this.context_,i=t.getOrientedFlatCoordinates();let n=0;const r=t.getEndss(),s=t.getStride();e.beginPath();for(let t=0,e=r.length;t<e;++t){const e=r[t];n=this.drawRings_(i,n,e,s)}this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){const e=t.getFlatInteriorPoints();this.drawText_(e,0,e.length,2)}}}setContextFillState_(t){const e=this.context_,i=this.contextFillState_;i?i.fillStyle!=t.fillStyle&&(i.fillStyle=t.fillStyle,e.fillStyle=t.fillStyle):(e.fillStyle=t.fillStyle,this.contextFillState_={fillStyle:t.fillStyle})}setContextStrokeState_(t){const e=this.context_,i=this.contextStrokeState_;i?(i.lineCap!=t.lineCap&&(i.lineCap=t.lineCap,e.lineCap=t.lineCap),u(i.lineDash,t.lineDash)||e.setLineDash(i.lineDash=t.lineDash),i.lineDashOffset!=t.lineDashOffset&&(i.lineDashOffset=t.lineDashOffset,e.lineDashOffset=t.lineDashOffset),i.lineJoin!=t.lineJoin&&(i.lineJoin=t.lineJoin,e.lineJoin=t.lineJoin),i.lineWidth!=t.lineWidth&&(i.lineWidth=t.lineWidth,e.lineWidth=t.lineWidth),i.miterLimit!=t.miterLimit&&(i.miterLimit=t.miterLimit,e.miterLimit=t.miterLimit),i.strokeStyle!=t.strokeStyle&&(i.strokeStyle=t.strokeStyle,e.strokeStyle=t.strokeStyle)):(e.lineCap=t.lineCap,e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset,e.lineJoin=t.lineJoin,e.lineWidth=t.lineWidth,e.miterLimit=t.miterLimit,e.strokeStyle=t.strokeStyle,this.contextStrokeState_={lineCap:t.lineCap,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,lineJoin:t.lineJoin,lineWidth:t.lineWidth,miterLimit:t.miterLimit,strokeStyle:t.strokeStyle})}setContextTextState_(t){const e=this.context_,i=this.contextTextState_,n=t.textAlign?t.textAlign:Us;i?(i.font!=t.font&&(i.font=t.font,e.font=t.font),i.textAlign!=n&&(i.textAlign=n,e.textAlign=n),i.textBaseline!=t.textBaseline&&(i.textBaseline=t.textBaseline,e.textBaseline=t.textBaseline)):(e.font=t.font,e.textAlign=n,e.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:n,textBaseline:t.textBaseline})}setFillStrokeStyle(t,e){if(t){const e=t.getColor();this.fillState_={fillStyle:fl(e||Ns)}}else this.fillState_=null;if(e){const t=e.getColor(),i=e.getLineCap(),n=e.getLineDash(),r=e.getLineDashOffset(),s=e.getLineJoin(),o=e.getWidth(),a=e.getMiterLimit(),l=n||ks;this.strokeState_={lineCap:void 0!==i?i:Ds,lineDash:1===this.pixelRatio_?l:l.map((t=>t*this.pixelRatio_)),lineDashOffset:(r||0)*this.pixelRatio_,lineJoin:void 0!==s?s:Gs,lineWidth:(void 0!==o?o:1)*this.pixelRatio_,miterLimit:void 0!==a?a:js,strokeStyle:fl(t||Bs)}}else this.strokeState_=null}setImageStyle(t){let e;if(!t||!(e=t.getSize()))return void(this.image_=null);const i=t.getPixelRatio(this.pixelRatio_),n=t.getAnchor(),r=t.getOrigin();this.image_=t.getImage(this.pixelRatio_),this.imageAnchorX_=n[0]*i,this.imageAnchorY_=n[1]*i,this.imageHeight_=e[1]*i,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=r[0],this.imageOriginY_=r[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation();const s=t.getScaleArray();this.imageScale_=[s[0]*this.pixelRatio_/i,s[1]*this.pixelRatio_/i],this.imageWidth_=e[0]*i}setTextStyle(t){if(t){const e=t.getFill();if(e){const t=e.getColor();this.textFillState_={fillStyle:fl(t||Ns)}}else this.textFillState_=null;const i=t.getStroke();if(i){const t=i.getColor(),e=i.getLineCap(),n=i.getLineDash(),r=i.getLineDashOffset(),s=i.getLineJoin(),o=i.getWidth(),a=i.getMiterLimit();this.textStrokeState_={lineCap:void 0!==e?e:Ds,lineDash:n||ks,lineDashOffset:r||0,lineJoin:void 0!==s?s:Gs,lineWidth:void 0!==o?o:1,miterLimit:void 0!==a?a:js,strokeStyle:fl(t||Bs)}}else this.textStrokeState_=null;const n=t.getFont(),r=t.getOffsetX(),s=t.getOffsetY(),o=t.getRotateWithView(),a=t.getRotation(),l=t.getScaleArray(),h=t.getText(),c=t.getTextAlign(),u=t.getTextBaseline();this.textState_={font:void 0!==n?n:Os,textAlign:void 0!==c?c:Us,textBaseline:void 0!==u?u:zs},this.text_=void 0!==h?Array.isArray(h)?h.reduce(((t,e,i)=>t+(i%2?" ":e)),""):h:"",this.textOffsetX_=void 0!==r?this.pixelRatio_*r:0,this.textOffsetY_=void 0!==s?this.pixelRatio_*s:0,this.textRotateWithView_=void 0!==o&&o,this.textRotation_=void 0!==a?a:0,this.textScale_=[this.pixelRatio_*l[0],this.pixelRatio_*l[1]]}else this.text_=""}}const Rl={Point:function(t,e,i,n,r){const s=i.getImage(),o=i.getText();let a;if(s){if(s.getImageState()!=Lr)return;let l=t;if(r){const h=s.getDeclutterMode();if("none"!==h)if(l=r,"obstacle"===h){const r=t.getBuilder(i.getZIndex(),"Image");r.setImageStyle(s,a),r.drawPoint(e,n)}else o&&o.getText()&&(a={})}const h=l.getBuilder(i.getZIndex(),"Image");h.setImageStyle(s,a),h.drawPoint(e,n)}if(o&&o.getText()){let s=t;r&&(s=r);const l=s.getBuilder(i.getZIndex(),"Text");l.setTextStyle(o,a),l.drawText(e,n)}},LineString:function(t,e,i,n,r){const s=i.getStroke();if(s){const r=t.getBuilder(i.getZIndex(),"LineString");r.setFillStrokeStyle(null,s),r.drawLineString(e,n)}const o=i.getText();if(o&&o.getText()){const s=(r||t).getBuilder(i.getZIndex(),"Text");s.setTextStyle(o),s.drawText(e,n)}},Polygon:function(t,e,i,n,r){const s=i.getFill(),o=i.getStroke();if(s||o){const r=t.getBuilder(i.getZIndex(),"Polygon");r.setFillStrokeStyle(s,o),r.drawPolygon(e,n)}const a=i.getText();if(a&&a.getText()){const s=(r||t).getBuilder(i.getZIndex(),"Text");s.setTextStyle(a),s.drawText(e,n)}},MultiPoint:function(t,e,i,n,r){const s=i.getImage(),o=i.getText();let a;if(s){if(s.getImageState()!=Lr)return;let l=t;if(r){const h=s.getDeclutterMode();if("none"!==h)if(l=r,"obstacle"===h){const r=t.getBuilder(i.getZIndex(),"Image");r.setImageStyle(s,a),r.drawMultiPoint(e,n)}else o&&o.getText()&&(a={})}const h=l.getBuilder(i.getZIndex(),"Image");h.setImageStyle(s,a),h.drawMultiPoint(e,n)}if(o&&o.getText()){let s=t;r&&(s=r);const l=s.getBuilder(i.getZIndex(),"Text");l.setTextStyle(o,a),l.drawText(e,n)}},MultiLineString:function(t,e,i,n,r){const s=i.getStroke();if(s){const r=t.getBuilder(i.getZIndex(),"LineString");r.setFillStrokeStyle(null,s),r.drawMultiLineString(e,n)}const o=i.getText();if(o&&o.getText()){const s=(r||t).getBuilder(i.getZIndex(),"Text");s.setTextStyle(o),s.drawText(e,n)}},MultiPolygon:function(t,e,i,n,r){const s=i.getFill(),o=i.getStroke();if(o||s){const r=t.getBuilder(i.getZIndex(),"Polygon");r.setFillStrokeStyle(s,o),r.drawMultiPolygon(e,n)}const a=i.getText();if(a&&a.getText()){const s=(r||t).getBuilder(i.getZIndex(),"Text");s.setTextStyle(a),s.drawText(e,n)}},GeometryCollection:function(t,e,i,n,r){const s=e.getGeometriesArray();let o,a;for(o=0,a=s.length;o<a;++o){(0,Rl[s[o].getType()])(t,s[o],i,n,r)}},Circle:function(t,e,i,n,r){const s=i.getFill(),o=i.getStroke();if(s||o){const r=t.getBuilder(i.getZIndex(),"Circle");r.setFillStrokeStyle(s,o),r.drawCircle(e,n)}const a=i.getText();if(a&&a.getText()){const s=(r||t).getBuilder(i.getZIndex(),"Text");s.setTextStyle(a),s.drawText(e,n)}}};function Pl(t,e){return parseInt(z(t),10)-parseInt(z(e),10)}function Il(t,e){const i=Ll(t,e);return i*i}function Ll(t,e){return.5*t/e}function Ml(t,e,i,n,r,s,o){let a=!1;const l=i.getImage();if(l){const t=l.getImageState();t==Lr||t==Mr?l.unlistenImageChange(r):(t==Pr&&l.load(),l.listenImageChange(r),a=!0)}return function(t,e,i,n,r,s){const o=i.getGeometryFunction()(e);if(!o)return;const a=o.simplifyTransformed(n,r);if(i.getRenderer())Fl(t,a,i,e);else{(0,Rl[a.getType()])(t,a,i,e,s)}}(t,e,i,n,s,o),a}function Fl(t,e,i,n){if("GeometryCollection"==e.getType()){const r=e.getGeometries();for(let e=0,s=r.length;e<s;++e)Fl(t,r[e],i,n);return}t.getBuilder(i.getZIndex(),"Default").drawCustom(e,n,i.getRenderer(),i.getHitDetectionRenderer())}function Al(t){if(!(t.context instanceof CanvasRenderingContext2D))throw new Error("Only works for render events from Canvas 2D layers");const e=t.inversePixelTransform[0],i=t.frameState,n=Et(t.inversePixelTransform.slice(),i.coordinateToPixelTransform),r=Il(i.viewState.resolution,e);let s;const o=en();return o&&(s=qi(o,i.viewState.projection)),new bl(t.context,e,i.extent,n,i.viewState.rotation,r,s)}let Ol;const Nl=[];function Dl(t,e,i,n,r){t.beginPath(),t.moveTo(0,0),t.lineTo(e,i),t.lineTo(n,r),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,n)+1,Math.max(i,r)),t.restore()}function kl(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function Gl(t,e,i,n){const r=$i(i,e,t);let s=zi(e,n,i);const o=e.getMetersPerUnit();void 0!==o&&(s*=o);const a=t.getMetersPerUnit();void 0!==a&&(s/=a);const l=t.getExtent();if(!l||Zt(l,r)){const e=zi(t,s,r)/s;isFinite(e)&&e>0&&(s/=e)}return s}function jl(t,e,i,n){const r=ge(i);let s=Gl(t,e,r,n);return(!isFinite(s)||s<=0)&&he(i,(function(i){return s=Gl(t,e,i,n),isFinite(s)&&s>0})),s}function Bl(t,e,i,n,r,s,o,a,l,h,c,u){const d=Dr(Math.round(i*t),Math.round(i*e),Nl);if(u||(d.imageSmoothingEnabled=!1),0===l.length)return d.canvas;function g(t){return Math.round(t*i)/i}d.scale(i,i),d.globalCompositeOperation="lighter";const f=[1/0,1/0,-1/0,-1/0];l.forEach((function(t,e,i){ne(f,t.extent)}));const p=Se(f),m=_e(f),_=Dr(Math.round(i*p/n),Math.round(i*m/n));u||(_.imageSmoothingEnabled=!1);const y=i/n;l.forEach((function(t,e,i){const n=t.extent[0]-f[0],r=-(t.extent[3]-f[3]),s=Se(t.extent),o=_e(t.extent);t.image.width>0&&t.image.height>0&&_.drawImage(t.image,h,h,t.image.width-2*h,t.image.height-2*h,n*y,r*y,s*y,o*y)}));const x=xe(o);return a.getTriangles().forEach((function(t,e,r){const o=t.source,a=t.target;let l=o[0][0],h=o[0][1],c=o[1][0],p=o[1][1],m=o[2][0],y=o[2][1];const v=g((a[0][0]-x[0])/s),S=g(-(a[0][1]-x[1])/s),w=g((a[1][0]-x[0])/s),E=g(-(a[1][1]-x[1])/s),T=g((a[2][0]-x[0])/s),C=g(-(a[2][1]-x[1])/s),b=l,R=h;l=0,h=0,c-=b,p-=R,m-=b,y-=R;const P=si([[c,p,0,0,w-v],[m,y,0,0,T-v],[0,0,c,p,E-S],[0,0,m,y,C-S]]);if(P){if(d.save(),d.beginPath(),function(){if(void 0===Ol){const t=document.createElement("canvas").getContext("2d");t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",Dl(t,4,5,4,0),Dl(t,4,5,0,5);const e=t.getImageData(0,0,3,3).data;Ol=kl(e,0)||kl(e,4)||kl(e,8)}return Ol}()||!u){d.moveTo(w,E);const t=4,e=v-w,i=S-E;for(let n=0;n<t;n++)d.lineTo(w+g((n+1)*e/t),E+g(n*i/(t-1))),n!=t-1&&d.lineTo(w+g((n+1)*e/t),E+g((n+1)*i/(t-1)));d.lineTo(T,C)}else d.moveTo(w,E),d.lineTo(v,S),d.lineTo(T,C);d.clip(),d.transform(P[0],P[2],P[1],P[3],v,S),d.translate(f[0]-b,f[3]-R),d.scale(n/i,-n/i),d.drawImage(_.canvas,0,0),d.restore()}})),c&&(d.save(),d.globalCompositeOperation="source-over",d.strokeStyle="black",d.lineWidth=1,a.getTriangles().forEach((function(t,e,i){const n=t.target,r=(n[0][0]-x[0])/s,o=-(n[0][1]-x[1])/s,a=(n[1][0]-x[0])/s,l=-(n[1][1]-x[1])/s,h=(n[2][0]-x[0])/s,c=-(n[2][1]-x[1])/s;d.beginPath(),d.moveTo(a,l),d.lineTo(r,o),d.lineTo(h,c),d.closePath(),d.stroke()})),d.restore()),d.canvas}class Ul{constructor(t,e,i,n,r,s){this.sourceProj_=t,this.targetProj_=e;let o={};const a=Hi(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){const e=t[0]+"/"+t[1];return o[e]||(o[e]=a(t)),o[e]},this.maxSourceExtent_=n,this.errorThresholdSquared_=r*r,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!n&&!!this.sourceProj_.getExtent()&&Se(n)==Se(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?Se(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?Se(this.targetProj_.getExtent()):null;const l=xe(i),h=ve(i),c=de(i),u=ue(i),d=this.transformInv_(l),g=this.transformInv_(h),f=this.transformInv_(c),p=this.transformInv_(u),m=10+(s?Math.max(0,Math.ceil(Math.log2(ce(i)/(s*s*256*256)))):0);if(this.addQuad_(l,h,c,u,d,g,f,p,m),this.wrapsXInSource_){let t=1/0;this.triangles_.forEach((function(e,i,n){t=Math.min(t,e.source[0][0],e.source[1][0],e.source[2][0])})),this.triangles_.forEach(function(e){if(Math.max(e.source[0][0],e.source[1][0],e.source[2][0])-t>this.sourceWorldWidth_/2){const i=[[e.source[0][0],e.source[0][1]],[e.source[1][0],e.source[1][1]],[e.source[2][0],e.source[2][1]]];i[0][0]-t>this.sourceWorldWidth_/2&&(i[0][0]-=this.sourceWorldWidth_),i[1][0]-t>this.sourceWorldWidth_/2&&(i[1][0]-=this.sourceWorldWidth_),i[2][0]-t>this.sourceWorldWidth_/2&&(i[2][0]-=this.sourceWorldWidth_);const n=Math.min(i[0][0],i[1][0],i[2][0]);Math.max(i[0][0],i[1][0],i[2][0])-n<this.sourceWorldWidth_/2&&(e.source=i)}}.bind(this))}o={}}addTriangle_(t,e,i,n,r,s){this.triangles_.push({source:[n,r,s],target:[t,e,i]})}addQuad_(t,e,i,n,r,s,o,a,l){const h=zt([r,s,o,a]),c=this.sourceWorldWidth_?Se(h)/this.sourceWorldWidth_:null,u=this.sourceWorldWidth_,d=this.sourceProj_.canWrapX()&&c>.5&&c<1;let g=!1;if(l>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){g=Se(zt([t,e,i,n]))/this.targetWorldWidth_>.25||g}!d&&this.sourceProj_.isGlobal()&&c&&(g=c>.25||g)}if(!g&&this.maxSourceExtent_&&isFinite(h[0])&&isFinite(h[1])&&isFinite(h[2])&&isFinite(h[3])&&!we(h,this.maxSourceExtent_))return;let f=0;if(!(g||isFinite(r[0])&&isFinite(r[1])&&isFinite(s[0])&&isFinite(s[1])&&isFinite(o[0])&&isFinite(o[1])&&isFinite(a[0])&&isFinite(a[1])))if(l>0)g=!0;else if(f=(isFinite(r[0])&&isFinite(r[1])?0:8)+(isFinite(s[0])&&isFinite(s[1])?0:4)+(isFinite(o[0])&&isFinite(o[1])?0:2)+(isFinite(a[0])&&isFinite(a[1])?0:1),1!=f&&2!=f&&4!=f&&8!=f)return;if(l>0){if(!g){const e=[(t[0]+i[0])/2,(t[1]+i[1])/2],n=this.transformInv_(e);let s;if(d){s=(li(r[0],u)+li(o[0],u))/2-li(n[0],u)}else s=(r[0]+o[0])/2-n[0];const a=(r[1]+o[1])/2-n[1];g=s*s+a*a>this.errorThresholdSquared_}if(g){if(Math.abs(t[0]-i[0])<=Math.abs(t[1]-i[1])){const h=[(e[0]+i[0])/2,(e[1]+i[1])/2],c=this.transformInv_(h),u=[(n[0]+t[0])/2,(n[1]+t[1])/2],d=this.transformInv_(u);this.addQuad_(t,e,h,u,r,s,c,d,l-1),this.addQuad_(u,h,i,n,d,c,o,a,l-1)}else{const h=[(t[0]+e[0])/2,(t[1]+e[1])/2],c=this.transformInv_(h),u=[(i[0]+n[0])/2,(i[1]+n[1])/2],d=this.transformInv_(u);this.addQuad_(t,h,u,n,r,c,d,a,l-1),this.addQuad_(h,e,i,u,c,s,o,d,l-1)}return}}if(d){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}0==(11&f)&&this.addTriangle_(t,i,n,r,o,a),0==(14&f)&&this.addTriangle_(t,i,e,r,o,s),f&&(0==(13&f)&&this.addTriangle_(e,n,t,s,a,r),0==(7&f)&&this.addTriangle_(e,n,i,s,a,o))}calculateSourceExtent(){const t=[1/0,1/0,-1/0,-1/0];return this.triangles_.forEach((function(e,i,n){const r=e.source;re(t,r[0]),re(t,r[1]),re(t,r[2])})),t}getTriangles(){return this.triangles_}}class zl extends st{constructor(t,e,i,n,r,s,o,a,l,h,c,u){super(r,H,{interpolate:!!u}),this.renderEdges_=void 0!==c&&c,this.pixelRatio_=o,this.gutter_=a,this.canvas_=null,this.sourceTileGrid_=e,this.targetTileGrid_=n,this.wrappedTileCoord_=s||r,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0;const d=n.getTileCoordExtent(this.wrappedTileCoord_),g=this.targetTileGrid_.getExtent();let f=this.sourceTileGrid_.getExtent();const p=g?ye(d,g):d;if(0===ce(p))return void(this.state=tt);const m=t.getExtent();m&&(f=f?ye(f,m):m);const _=n.getResolution(this.wrappedTileCoord_[0]),y=jl(t,i,p,_);if(!isFinite(y)||y<=0)return void(this.state=tt);const x=void 0!==h?h:.5;if(this.triangulation_=new Ul(t,i,p,f,y*x,_),0===this.triangulation_.getTriangles().length)return void(this.state=tt);this.sourceZ_=e.getZForResolution(y);let v=this.triangulation_.calculateSourceExtent();if(f&&(t.canWrapX()?(v[1]=ii(v[1],f[1],f[3]),v[3]=ii(v[3],f[1],f[3])):v=ye(v,f)),ce(v)){const t=e.getTileRangeForExtentAndZ(v,this.sourceZ_);for(let e=t.minX;e<=t.maxX;e++)for(let i=t.minY;i<=t.maxY;i++){const t=l(this.sourceZ_,e,i,o);t&&this.sourceTiles_.push(t)}0===this.sourceTiles_.length&&(this.state=tt)}else this.state=tt}getImage(){return this.canvas_}reproject_(){const t=[];if(this.sourceTiles_.forEach(function(e,i,n){e&&e.getState()==J&&t.push({extent:this.sourceTileGrid_.getTileCoordExtent(e.tileCoord),image:e.getImage()})}.bind(this)),this.sourceTiles_.length=0,0===t.length)this.state=Q;else{const e=this.wrappedTileCoord_[0],i=this.targetTileGrid_.getTileSize(e),n="number"==typeof i?i:i[0],r="number"==typeof i?i:i[1],s=this.targetTileGrid_.getResolution(e),o=this.sourceTileGrid_.getResolution(this.sourceZ_),a=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=Bl(n,r,this.pixelRatio_,o,this.sourceTileGrid_.getExtent(),s,a,this.triangulation_,t,this.gutter_,this.renderEdges_,this.interpolate),this.state=J}this.changed()}load(){if(this.state==H){this.state=$,this.changed();let t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(function(e,i,n){const r=e.getState();if(r==H||r==$){t++;const i=N(e,S,(function(n){const r=e.getState();r!=J&&r!=Q&&r!=tt||(k(i),t--,0===t&&(this.unlistenSources_(),this.reproject_()))}),this);this.sourcesListenerKeys_.push(i)}}.bind(this)),0===t?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach((function(t,e,i){t.getState()==H&&t.load()}))}}unlistenSources_(){this.sourcesListenerKeys_.forEach(k),this.sourcesListenerKeys_=null}release(){this.canvas_&&(kr(this.canvas_.getContext("2d")),Nl.push(this.canvas_),this.canvas_=null),super.release()}}var Xl="tileloadstart",Vl="tileloadend",Wl="tileloaderror";class Zl extends V{constructor(t){super(),this.projection=Ui(t.projection),this.attributions_=Yl(t.attributions),this.attributionsCollapsible_=void 0===t.attributionsCollapsible||t.attributionsCollapsible,this.loading=!1,this.state_=void 0!==t.state?t.state:"ready",this.wrapX_=void 0!==t.wrapX&&t.wrapX,this.interpolate_=!!t.interpolate,this.viewResolver=null,this.viewRejector=null;const e=this;this.viewPromise_=new Promise((function(t,i){e.viewResolver=t,e.viewRejector=i}))}getAttributions(){return this.attributions_}getAttributionsCollapsible(){return this.attributionsCollapsible_}getProjection(){return this.projection}getResolutions(){return B()}getView(){return this.viewPromise_}getState(){return this.state_}getWrapX(){return this.wrapX_}getInterpolate(){return this.interpolate_}refresh(){this.changed()}setAttributions(t){this.attributions_=Yl(t),this.changed()}setState(t){this.state_=t,this.changed()}}function Yl(t){return t?Array.isArray(t)?function(e){return t}:"function"==typeof t?t:function(e){return[t]}:null}const Kl=[0,0,0];class ql{constructor(t){let e;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,at(d(this.resolutions_,(function(t,e){return e-t}),!0),17),!t.origins)for(let t=0,i=this.resolutions_.length-1;t<i;++t)if(e){if(this.resolutions_[t]/this.resolutions_[t+1]!==e){e=void 0;break}}else e=this.resolutions_[t]/this.resolutions_[t+1];this.zoomFactor_=e,this.maxZoom=this.resolutions_.length-1,this.origin_=void 0!==t.origin?t.origin:null,this.origins_=null,void 0!==t.origins&&(this.origins_=t.origins,at(this.origins_.length==this.resolutions_.length,20));const i=t.extent;void 0===i||this.origin_||this.origins_||(this.origin_=xe(i)),at(!this.origin_&&this.origins_||this.origin_&&!this.origins_,18),this.tileSizes_=null,void 0!==t.tileSizes&&(this.tileSizes_=t.tileSizes,at(this.tileSizes_.length==this.resolutions_.length,19)),this.tileSize_=void 0!==t.tileSize?t.tileSize:this.tileSizes_?null:Lo,at(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,22),this.extent_=void 0!==i?i:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],void 0!==t.sizes?this.fullTileRanges_=t.sizes.map((function(t,e){const n=new hl(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1));if(i){const t=this.getTileRangeForExtentAndZ(i,e);n.minX=Math.max(t.minX,n.minX),n.maxX=Math.min(t.maxX,n.maxX),n.minY=Math.max(t.minY,n.minY),n.maxY=Math.min(t.maxY,n.maxY)}return n}),this):i&&this.calculateTileRanges_(i)}forEachTileCoord(t,e,i){const n=this.getTileRangeForExtentAndZ(t,e);for(let t=n.minX,r=n.maxX;t<=r;++t)for(let r=n.minY,s=n.maxY;r<=s;++r)i([e,t,r])}forEachTileCoordParentTileRange(t,e,i,n){let r,s,o,a=null,l=t[0]-1;for(2===this.zoomFactor_?(s=t[1],o=t[2]):a=this.getTileCoordExtent(t,n);l>=this.minZoom;){if(2===this.zoomFactor_?(s=Math.floor(s/2),o=Math.floor(o/2),r=cl(s,s,o,o,i)):r=this.getTileRangeForExtentAndZ(a,l,i),e(l,r))return!0;--l}return!1}getExtent(){return this.extent_}getMaxZoom(){return this.maxZoom}getMinZoom(){return this.minZoom}getOrigin(t){return this.origin_?this.origin_:this.origins_[t]}getResolution(t){return this.resolutions_[t]}getResolutions(){return this.resolutions_}getTileCoordChildTileRange(t,e,i){if(t[0]<this.maxZoom){if(2===this.zoomFactor_){const i=2*t[1],n=2*t[2];return cl(i,i+1,n,n+1,e)}const n=this.getTileCoordExtent(t,i||this.tmpExtent_);return this.getTileRangeForExtentAndZ(n,t[0]+1,e)}return null}getTileRangeForTileCoordAndZ(t,e,i){if(e>this.maxZoom||e<this.minZoom)return null;const n=t[0],r=t[1],s=t[2];if(e===n)return cl(r,s,r,s,i);if(this.zoomFactor_){const t=Math.pow(this.zoomFactor_,e-n),o=Math.floor(r*t),a=Math.floor(s*t);if(e<n)return cl(o,o,a,a,i);return cl(o,Math.floor(t*(r+1))-1,a,Math.floor(t*(s+1))-1,i)}const o=this.getTileCoordExtent(t,this.tmpExtent_);return this.getTileRangeForExtentAndZ(o,e,i)}getTileRangeExtent(t,e,i){const n=this.getOrigin(t),r=this.getResolution(t),s=Va(this.getTileSize(t),this.tmpSize_),o=n[0]+e.minX*s[0]*r,a=n[0]+(e.maxX+1)*s[0]*r;return $t(o,n[1]+e.minY*s[1]*r,a,n[1]+(e.maxY+1)*s[1]*r,i)}getTileRangeForExtentAndZ(t,e,i){const n=Kl;this.getTileCoordForXYAndZ_(t[0],t[3],e,!1,n);const r=n[1],s=n[2];return this.getTileCoordForXYAndZ_(t[2],t[1],e,!0,n),cl(r,n[1],s,n[2],i)}getTileCoordCenter(t){const e=this.getOrigin(t[0]),i=this.getResolution(t[0]),n=Va(this.getTileSize(t[0]),this.tmpSize_);return[e[0]+(t[1]+.5)*n[0]*i,e[1]-(t[2]+.5)*n[1]*i]}getTileCoordExtent(t,e){const i=this.getOrigin(t[0]),n=this.getResolution(t[0]),r=Va(this.getTileSize(t[0]),this.tmpSize_),s=i[0]+t[1]*r[0]*n,o=i[1]-(t[2]+1)*r[1]*n;return $t(s,o,s+r[0]*n,o+r[1]*n,e)}getTileCoordForCoordAndResolution(t,e,i){return this.getTileCoordForXYAndResolution_(t[0],t[1],e,!1,i)}getTileCoordForXYAndResolution_(t,e,i,n,r){const s=this.getZForResolution(i),o=i/this.getResolution(s),a=this.getOrigin(s),l=Va(this.getTileSize(s),this.tmpSize_);let h=o*(t-a[0])/i/l[0],c=o*(a[1]-e)/i/l[1];return n?(h=gi(h,5)-1,c=gi(c,5)-1):(h=di(h,5),c=di(c,5)),el(s,h,c,r)}getTileCoordForXYAndZ_(t,e,i,n,r){const s=this.getOrigin(i),o=this.getResolution(i),a=Va(this.getTileSize(i),this.tmpSize_);let l=(t-s[0])/o/a[0],h=(s[1]-e)/o/a[1];return n?(l=gi(l,5)-1,h=gi(h,5)-1):(l=di(l,5),h=di(h,5)),el(i,l,h,r)}getTileCoordForCoordAndZ(t,e,i){return this.getTileCoordForXYAndZ_(t[0],t[1],e,!1,i)}getTileCoordResolution(t){return this.resolutions_[t[0]]}getTileSize(t){return this.tileSize_?this.tileSize_:this.tileSizes_[t]}getFullTileRange(t){return this.fullTileRanges_?this.fullTileRanges_[t]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,t):null}getZForResolution(t,e){return ii(l(this.resolutions_,t,e||0),this.minZoom,this.maxZoom)}tileCoordIntersectsViewport(t,e){return er(e,0,e.length,2,this.getTileCoordExtent(t))}calculateTileRanges_(t){const e=this.resolutions_.length,i=new Array(e);for(let n=this.minZoom;n<e;++n)i[n]=this.getTileRangeForExtentAndZ(t,n);this.fullTileRanges_=i}}function Hl(t){let e=t.getDefaultTileGrid();return e||(e=eh(t),t.setDefaultTileGrid(e)),e}function $l(t,e,i){const n=e[0],r=t.getTileCoordCenter(e),s=ih(i);if(Zt(s,r))return e;{const e=Se(s),i=Math.ceil((s[0]-r[0])/e);return r[0]+=e*i,t.getTileCoordForCoordAndZ(r,n)}}function Jl(t,e,i,n){n=void 0!==n?n:"top-left";const r=th(t,e,i);return new ql({extent:t,origin:fe(t,n),resolutions:r,tileSize:i})}function Ql(t){const e=t||{},i=e.extent||Ui("EPSG:3857").getExtent(),n={extent:i,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:th(i,e.maxZoom,e.tileSize,e.maxResolution)};return new ql(n)}function th(t,e,i,n){e=void 0!==e?e:42,i=Va(void 0!==i?i:Lo);const r=_e(t),s=Se(t);n=n>0?n:Math.max(s/i[0],r/i[1]);const o=e+1,a=new Array(o);for(let t=0;t<o;++t)a[t]=n/Math.pow(2,t);return a}function eh(t,e,i,n){return Jl(ih(t),e,i,n)}function ih(t){let e=(t=Ui(t)).getExtent();if(!e){const i=180*Fe.degrees/t.getMetersPerUnit();e=$t(-i,-i,i,i)}return e}class nh extends Zl{constructor(t){super({attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,projection:t.projection,state:t.state,wrapX:t.wrapX,interpolate:t.interpolate}),this.on,this.once,this.un,this.opaque_=void 0!==t.opaque&&t.opaque,this.tilePixelRatio_=void 0!==t.tilePixelRatio?t.tilePixelRatio:1,this.tileGrid=void 0!==t.tileGrid?t.tileGrid:null;const e=[256,256];this.tileGrid&&Va(this.tileGrid.getTileSize(this.tileGrid.getMinZoom()),e),this.tileCache=new ll(t.cacheSize||0),this.tmpSize=[0,0],this.key_=t.key||"",this.tileOptions={transition:t.transition,interpolate:t.interpolate},this.zDirection=t.zDirection?t.zDirection:0}canExpireCache(){return this.tileCache.canExpireCache()}expireCache(t,e){const i=this.getTileCacheForProjection(t);i&&i.expireCache(e)}forEachLoadedTile(t,e,i,n){const r=this.getTileCacheForProjection(t);if(!r)return!1;let s,o,a,l=!0;for(let t=i.minX;t<=i.maxX;++t)for(let h=i.minY;h<=i.maxY;++h)o=il(e,t,h),a=!1,r.containsKey(o)&&(s=r.get(o),a=s.getState()===J,a&&(a=!1!==n(s))),a||(l=!1);return l}getGutterForProjection(t){return 0}getKey(){return this.key_}setKey(t){this.key_!==t&&(this.key_=t,this.changed())}getOpaque(t){return this.opaque_}getResolutions(){return this.tileGrid?this.tileGrid.getResolutions():null}getTile(t,e,i,n,r){return B()}getTileGrid(){return this.tileGrid}getTileGridForProjection(t){return this.tileGrid?this.tileGrid:Hl(t)}getTileCacheForProjection(t){const e=this.getProjection();return at(null===e||Ki(e,t),68),this.tileCache}getTilePixelRatio(t){return this.tilePixelRatio_}getTilePixelSize(t,e,i){const n=this.getTileGridForProjection(i),r=this.getTilePixelRatio(e),s=Va(n.getTileSize(t),this.tmpSize);return 1==r?s:Xa(s,r,this.tmpSize)}getTileCoordForTileUrlFunction(t,e){e=void 0!==e?e:this.getProjection();const i=this.getTileGridForProjection(e);return this.getWrapX()&&e.isGlobal()&&(t=$l(i,t,e)),al(t,i)?t:null}clear(){this.tileCache.clear()}refresh(){this.clear(),super.refresh()}updateCacheSize(t,e){const i=this.getTileCacheForProjection(e);t>i.highWaterMark&&(i.highWaterMark=t)}useTile(t,e,i,n){}}class rh extends i{constructor(t,e){super(t),this.tile=e}}function sh(t,e){const i=/\{z\}/g,n=/\{x\}/g,r=/\{y\}/g,s=/\{-y\}/g;return function(o,a,l){return o?t.replace(i,o[0].toString()).replace(n,o[1].toString()).replace(r,o[2].toString()).replace(s,(function(){const t=o[0],i=e.getFullTileRange(t);at(i,55);return(i.getHeight()-o[2]-1).toString()})):void 0}}function oh(t,e){const i=t.length,n=new Array(i);for(let r=0;r<i;++r)n[r]=sh(t[r],e);return ah(n)}function ah(t){return 1===t.length?t[0]:function(e,i,n){if(e){const r=li(ol(e),t.length);return t[r](e,i,n)}}}function lh(t,e,i){}function hh(t){const e=[];let i=/\{([a-z])-([a-z])\}/.exec(t);if(i){const n=i[1].charCodeAt(0),r=i[2].charCodeAt(0);let s;for(s=n;s<=r;++s)e.push(t.replace(i[0],String.fromCharCode(s)));return e}if(i=/\{(\d+)-(\d+)\}/.exec(t),i){const n=parseInt(i[2],10);for(let r=parseInt(i[1],10);r<=n;r++)e.push(t.replace(i[0],r.toString()));return e}return e.push(t),e}class ch extends nh{constructor(t){super({attributions:t.attributions,cacheSize:t.cacheSize,opaque:t.opaque,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tilePixelRatio:t.tilePixelRatio,wrapX:t.wrapX,transition:t.transition,interpolate:t.interpolate,key:t.key,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.generateTileUrlFunction_=this.tileUrlFunction===ch.prototype.tileUrlFunction,this.tileLoadFunction=t.tileLoadFunction,t.tileUrlFunction&&(this.tileUrlFunction=t.tileUrlFunction),this.urls=null,t.urls?this.setUrls(t.urls):t.url&&this.setUrl(t.url),this.tileLoadingKeys_={}}getTileLoadFunction(){return this.tileLoadFunction}getTileUrlFunction(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction}getUrls(){return this.urls}handleTileChange(t){const e=t.target,i=z(e),n=e.getState();let r;n==$?(this.tileLoadingKeys_[i]=!0,r=Xl):i in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[i],r=n==Q?Wl:n==J?Vl:void 0),null!=r&&this.dispatchEvent(new rh(r,e))}setTileLoadFunction(t){this.tileCache.clear(),this.tileLoadFunction=t,this.changed()}setTileUrlFunction(t,e){this.tileUrlFunction=t,this.tileCache.pruneExceptNewestZ(),void 0!==e?this.setKey(e):this.changed()}setUrl(t){const e=hh(t);this.urls=e,this.setUrls(e)}setUrls(t){this.urls=t;const e=t.join("\n");this.generateTileUrlFunction_?this.setTileUrlFunction(oh(t,this.tileGrid),e):this.setKey(e)}tileUrlFunction(t,e,i){}useTile(t,e,i){const n=il(t,e,i);this.tileCache.containsKey(n)&&this.tileCache.get(n)}}class uh extends ch{constructor(t){super({attributions:t.attributions,cacheSize:t.cacheSize,opaque:t.opaque,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction?t.tileLoadFunction:dh,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX,transition:t.transition,interpolate:void 0===t.interpolate||t.interpolate,key:t.key,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.crossOrigin=void 0!==t.crossOrigin?t.crossOrigin:null,this.tileClass=void 0!==t.tileClass?t.tileClass:Vr,this.tileCacheForProjection={},this.tileGridForProjection={},this.reprojectionErrorThreshold_=t.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}canExpireCache(){if(this.tileCache.canExpireCache())return!0;for(const t in this.tileCacheForProjection)if(this.tileCacheForProjection[t].canExpireCache())return!0;return!1}expireCache(t,e){const i=this.getTileCacheForProjection(t);this.tileCache.expireCache(this.tileCache==i?e:{});for(const t in this.tileCacheForProjection){const n=this.tileCacheForProjection[t];n.expireCache(n==i?e:{})}}getGutterForProjection(t){return this.getProjection()&&t&&!Ki(this.getProjection(),t)?0:this.getGutter()}getGutter(){return 0}getKey(){let t=super.getKey();return this.getInterpolate()||(t+=":disable-interpolation"),t}getOpaque(t){return!(this.getProjection()&&t&&!Ki(this.getProjection(),t))&&super.getOpaque(t)}getTileGridForProjection(t){const e=this.getProjection();if(!this.tileGrid||e&&!Ki(e,t)){const e=z(t);return e in this.tileGridForProjection||(this.tileGridForProjection[e]=Hl(t)),this.tileGridForProjection[e]}return this.tileGrid}getTileCacheForProjection(t){const e=this.getProjection();if(!e||Ki(e,t))return this.tileCache;{const e=z(t);return e in this.tileCacheForProjection||(this.tileCacheForProjection[e]=new ll(this.tileCache.highWaterMark)),this.tileCacheForProjection[e]}}createTile_(t,e,i,n,r,s){const o=[t,e,i],a=this.getTileCoordForTileUrlFunction(o,r),l=a?this.tileUrlFunction(a,n,r):void 0,h=new this.tileClass(o,void 0!==l?H:tt,void 0!==l?l:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return h.key=s,h.addEventListener(S,this.handleTileChange.bind(this)),h}getTile(t,e,i,n,r){const s=this.getProjection();if(s&&r&&!Ki(s,r)){const o=this.getTileCacheForProjection(r),a=[t,e,i];let l;const h=nl(a);o.containsKey(h)&&(l=o.get(h));const c=this.getKey();if(l&&l.key==c)return l;{const t=this.getTileGridForProjection(s),e=this.getTileGridForProjection(r),i=this.getTileCoordForTileUrlFunction(a,r),u=new zl(s,t,r,e,a,i,this.getTilePixelRatio(n),this.getGutter(),function(t,e,i,n){return this.getTileInternal(t,e,i,n,s)}.bind(this),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.getInterpolate());return u.key=c,l?(u.interimTile=l,u.refreshInterimChain(),o.replace(h,u)):o.set(h,u),u}}return this.getTileInternal(t,e,i,n,s||r)}getTileInternal(t,e,i,n,r){let s=null;const o=il(t,e,i),a=this.getKey();if(this.tileCache.containsKey(o)){if(s=this.tileCache.get(o),s.key!=a){const l=s;s=this.createTile_(t,e,i,n,r,a),l.getState()==H?s.interimTile=l.interimTile:s.interimTile=l,s.refreshInterimChain(),this.tileCache.replace(o,s)}}else s=this.createTile_(t,e,i,n,r,a),this.tileCache.set(o,s);return s}setRenderReprojectionEdges(t){if(this.renderReprojectionEdges_!=t){this.renderReprojectionEdges_=t;for(const t in this.tileCacheForProjection)this.tileCacheForProjection[t].clear();this.changed()}}setTileGridForProjection(t,e){const i=Ui(t);if(i){const t=z(i);t in this.tileGridForProjection||(this.tileGridForProjection[t]=e)}}clear(){super.clear();for(const t in this.tileCacheForProjection)this.tileCacheForProjection[t].clear()}}function dh(t,e){t.getImage().src=e}function gh(t){const e=t[0],i=new Array(e);let n,r,s=1<<e-1;for(n=0;n<e;++n)r=48,t[1]&s&&(r+=1),t[2]&s&&(r+=2),i[n]=String.fromCharCode(r),s>>=1;return i.join("")}class fh extends uh{constructor(t){const e=void 0!==(t=t||{}).projection?t.projection:"EPSG:3857",i=void 0!==t.tileGrid?t.tileGrid:Ql({extent:ih(e),maxResolution:t.maxResolution,maxZoom:t.maxZoom,minZoom:t.minZoom,tileSize:t.tileSize});super({attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,opaque:t.opaque,projection:e,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileGrid:i,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:void 0===t.wrapX||t.wrapX,transition:t.transition,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.gutter_=void 0!==t.gutter?t.gutter:0}getGutter(){return this.gutter_}}function ph(t,e,i,n,r){mh(t,e,i||0,n||t.length-1,r||yh)}function mh(t,e,i,n,r){for(;n>i;){if(n-i>600){var s=n-i+1,o=e-i+1,a=Math.log(s),l=.5*Math.exp(2*a/3),h=.5*Math.sqrt(a*l*(s-l)/s)*(o-s/2<0?-1:1);mh(t,e,Math.max(i,Math.floor(e-o*l/s+h)),Math.min(n,Math.floor(e+(s-o)*l/s+h)),r)}var c=t[e],u=i,d=n;for(_h(t,i,e),r(t[n],c)>0&&_h(t,i,n);u<d;){for(_h(t,u,d),u++,d--;r(t[u],c)<0;)u++;for(;r(t[d],c)>0;)d--}0===r(t[i],c)?_h(t,i,d):_h(t,++d,n),d<=e&&(i=d+1),e<=d&&(n=d-1)}}function _h(t,e,i){var n=t[e];t[e]=t[i],t[i]=n}function yh(t,e){return t<e?-1:t>e?1:0}class xh{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data;const i=[];if(!Lh(t,e))return i;const n=this.toBBox,r=[];for(;e;){for(let s=0;s<e.children.length;s++){const o=e.children[s],a=e.leaf?n(o):o;Lh(t,a)&&(e.leaf?i.push(o):Ih(t,a)?this._all(o,i):r.push(o))}e=r.pop()}return i}collides(t){let e=this.data;if(!Lh(t,e))return!1;const i=[];for(;e;){for(let n=0;n<e.children.length;n++){const r=e.children[n],s=e.leaf?this.toBBox(r):r;if(Lh(t,s)){if(e.leaf||Ih(t,s))return!0;i.push(r)}}e=i.pop()}return!1}load(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(let e=0;e<t.length;e++)this.insert(t[e]);return this}let e=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(this.data.height<e.height){const t=this.data;this.data=e,e=t}this._insert(e,this.data.height-e.height-1,!0)}else this.data=e;return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=Mh([]),this}remove(t,e){if(!t)return this;let i=this.data;const n=this.toBBox(t),r=[],s=[];let o,a,l;for(;i||r.length;){if(i||(i=r.pop(),a=r[r.length-1],o=s.pop(),l=!0),i.leaf){const n=vh(t,i.children,e);if(-1!==n)return i.children.splice(n,1),r.push(i),this._condense(r),this}l||i.leaf||!Ih(i,n)?a?(o++,i=a.children[o],l=!1):i=null:(r.push(i),s.push(o),o=0,a=i,i=i.children[0])}return this}toBBox(t){return t}compareMinX(t,e){return t.minX-e.minX}compareMinY(t,e){return t.minY-e.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,e){const i=[];for(;t;)t.leaf?e.push(...t.children):i.push(...t.children),t=i.pop();return e}_build(t,e,i,n){const r=i-e+1;let s,o=this._maxEntries;if(r<=o)return s=Mh(t.slice(e,i+1)),Sh(s,this.toBBox),s;n||(n=Math.ceil(Math.log(r)/Math.log(o)),o=Math.ceil(r/Math.pow(o,n-1))),s=Mh([]),s.leaf=!1,s.height=n;const a=Math.ceil(r/o),l=a*Math.ceil(Math.sqrt(o));Fh(t,e,i,l,this.compareMinX);for(let r=e;r<=i;r+=l){const e=Math.min(r+l-1,i);Fh(t,r,e,a,this.compareMinY);for(let i=r;i<=e;i+=a){const r=Math.min(i+a-1,e);s.children.push(this._build(t,i,r,n-1))}}return Sh(s,this.toBBox),s}_chooseSubtree(t,e,i,n){for(;n.push(e),!e.leaf&&n.length-1!==i;){let i,n=1/0,o=1/0;for(let a=0;a<e.children.length;a++){const l=e.children[a],h=bh(l),c=(r=t,s=l,(Math.max(s.maxX,r.maxX)-Math.min(s.minX,r.minX))*(Math.max(s.maxY,r.maxY)-Math.min(s.minY,r.minY))-h);c<o?(o=c,n=h<n?h:n,i=l):c===o&&h<n&&(n=h,i=l)}e=i||e.children[0]}var r,s;return e}_insert(t,e,i){const n=i?t:this.toBBox(t),r=[],s=this._chooseSubtree(n,this.data,e,r);for(s.children.push(t),Eh(s,n);e>=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(n,r,e)}_split(t,e){const i=t[e],n=i.children.length,r=this._minEntries;this._chooseSplitAxis(i,r,n);const s=this._chooseSplitIndex(i,r,n),o=Mh(i.children.splice(s,i.children.length-s));o.height=i.height,o.leaf=i.leaf,Sh(i,this.toBBox),Sh(o,this.toBBox),e?t[e-1].children.push(o):this._splitRoot(i,o)}_splitRoot(t,e){this.data=Mh([t,e]),this.data.height=t.height+1,this.data.leaf=!1,Sh(this.data,this.toBBox)}_chooseSplitIndex(t,e,i){let n,r=1/0,s=1/0;for(let o=e;o<=i-e;o++){const e=wh(t,0,o,this.toBBox),a=wh(t,o,i,this.toBBox),l=Ph(e,a),h=bh(e)+bh(a);l<r?(r=l,n=o,s=h<s?h:s):l===r&&h<s&&(s=h,n=o)}return n||i-e}_chooseSplitAxis(t,e,i){const n=t.leaf?this.compareMinX:Th,r=t.leaf?this.compareMinY:Ch;this._allDistMargin(t,e,i,n)<this._allDistMargin(t,e,i,r)&&t.children.sort(n)}_allDistMargin(t,e,i,n){t.children.sort(n);const r=this.toBBox,s=wh(t,0,e,r),o=wh(t,i-e,i,r);let a=Rh(s)+Rh(o);for(let n=e;n<i-e;n++){const e=t.children[n];Eh(s,t.leaf?r(e):e),a+=Rh(s)}for(let n=i-e-1;n>=e;n--){const e=t.children[n];Eh(o,t.leaf?r(e):e),a+=Rh(o)}return a}_adjustParentBBoxes(t,e,i){for(let n=i;n>=0;n--)Eh(e[n],t)}_condense(t){for(let e,i=t.length-1;i>=0;i--)0===t[i].children.length?i>0?(e=t[i-1].children,e.splice(e.indexOf(t[i]),1)):this.clear():Sh(t[i],this.toBBox)}}function vh(t,e,i){if(!i)return e.indexOf(t);for(let n=0;n<e.length;n++)if(i(t,e[n]))return n;return-1}function Sh(t,e){wh(t,0,t.children.length,e,t)}function wh(t,e,i,n,r){r||(r=Mh(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(let s=e;s<i;s++){const e=t.children[s];Eh(r,t.leaf?n(e):e)}return r}function Eh(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function Th(t,e){return t.minX-e.minX}function Ch(t,e){return t.minY-e.minY}function bh(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function Rh(t){return t.maxX-t.minX+(t.maxY-t.minY)}function Ph(t,e){const i=Math.max(t.minX,e.minX),n=Math.max(t.minY,e.minY),r=Math.min(t.maxX,e.maxX),s=Math.min(t.maxY,e.maxY);return Math.max(0,r-i)*Math.max(0,s-n)}function Ih(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function Lh(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function Mh(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Fh(t,e,i,n,r){const s=[e,i];for(;s.length;){if((i=s.pop())-(e=s.pop())<=n)continue;const o=e+Math.ceil((i-e)/n/2)*n;ph(t,o,e,i,r),s.push(e,o,o,i)}}class Ah{constructor(t){this.rbush_=new xh(t),this.items_={}}insert(t,e){const i={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(i),this.items_[z(e)]=i}load(t,e){const i=new Array(e.length);for(let n=0,r=e.length;n<r;n++){const r=t[n],s=e[n],o={minX:r[0],minY:r[1],maxX:r[2],maxY:r[3],value:s};i[n]=o,this.items_[z(s)]=o}this.rbush_.load(i)}remove(t){const e=z(t),i=this.items_[e];return delete this.items_[e],null!==this.rbush_.remove(i)}update(t,e){const i=this.items_[z(e)];ee([i.minX,i.minY,i.maxX,i.maxY],t)||(this.remove(e),this.insert(t,e))}getAll(){return this.rbush_.all().map((function(t){return t.value}))}getInExtent(t){const e={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]};return this.rbush_.search(e).map((function(t){return t.value}))}forEach(t){return this.forEach_(this.getAll(),t)}forEachInExtent(t,e){return this.forEach_(this.getInExtent(t),e)}forEach_(t,e){let i;for(let n=0,r=t.length;n<r;n++)if(i=e(t[n]),i)return i;return i}isEmpty(){return x(this.items_)}clear(){this.rbush_.clear(),this.items_={}}getExtent(t){const e=this.rbush_.toJSON();return $t(e.minX,e.minY,e.maxX,e.maxY,t)}concat(t){this.rbush_.load(t.rbush_.all());for(const e in t.items_)this.items_[e]=t.items_[e]}}var Oh="addfeature",Nh="changefeature",Dh="clear",kh="removefeature",Gh="featuresloadstart",jh="featuresloadend",Bh="featuresloaderror";class Uh extends i{constructor(t,e,i){super(t),this.feature=e,this.features=i}}class zh extends Zl{constructor(t){super({attributions:(t=t||{}).attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:void 0===t.wrapX||t.wrapX}),this.on,this.once,this.un,this.loader_=p,this.format_=t.format,this.overlaps_=void 0===t.overlaps||t.overlaps,this.url_=t.url,void 0!==t.loader?this.loader_=t.loader:void 0!==this.url_&&(at(this.format_,7),this.loader_=yl(this.url_,this.format_)),this.strategy_=void 0!==t.strategy?t.strategy:xl;const e=void 0===t.useSpatialIndex||t.useSpatialIndex;let i,n;this.featuresRtree_=e?new Ah:null,this.loadedExtentsRtree_=new Ah,this.loadingExtentsCount_=0,this.nullGeometryFeatures_={},this.idIndex_={},this.uidIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null,Array.isArray(t.features)?n=t.features:t.features&&(i=t.features,n=i.getArray()),e||void 0!==i||(i=new q(n)),void 0!==n&&this.addFeaturesInternal(n),void 0!==i&&this.bindFeaturesCollection_(i)}addFeature(t){this.addFeatureInternal(t),this.changed()}addFeatureInternal(t){const e=z(t);if(!this.addToIndex_(e,t))return void(this.featuresCollection_&&this.featuresCollection_.remove(t));this.setupChangeEvents_(e,t);const i=t.getGeometry();if(i){const e=i.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(e,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new Uh(Oh,t))}setupChangeEvents_(t,e){this.featureChangeKeys_[t]=[N(e,S,this.handleFeatureChange_,this),N(e,r,this.handleFeatureChange_,this)]}addToIndex_(t,e){let i=!0;const n=e.getId();return void 0!==n&&(n.toString()in this.idIndex_?i=!1:this.idIndex_[n.toString()]=e),i&&(at(!(t in this.uidIndex_),30),this.uidIndex_[t]=e),i}addFeatures(t){this.addFeaturesInternal(t),this.changed()}addFeaturesInternal(t){const e=[],i=[],n=[];for(let e=0,n=t.length;e<n;e++){const n=t[e],r=z(n);this.addToIndex_(r,n)&&i.push(n)}for(let t=0,r=i.length;t<r;t++){const r=i[t],s=z(r);this.setupChangeEvents_(s,r);const o=r.getGeometry();if(o){const t=o.getExtent();e.push(t),n.push(r)}else this.nullGeometryFeatures_[s]=r}if(this.featuresRtree_&&this.featuresRtree_.load(e,n),this.hasListener(Oh))for(let t=0,e=i.length;t<e;t++)this.dispatchEvent(new Uh(Oh,i[t]))}bindFeaturesCollection_(t){let e=!1;this.addEventListener(Oh,(function(i){e||(e=!0,t.push(i.feature),e=!1)})),this.addEventListener(kh,(function(i){e||(e=!0,t.remove(i.feature),e=!1)})),t.addEventListener(W,function(t){e||(e=!0,this.addFeature(t.element),e=!1)}.bind(this)),t.addEventListener(Z,function(t){e||(e=!0,this.removeFeature(t.element),e=!1)}.bind(this)),this.featuresCollection_=t}clear(t){if(t){for(const t in this.featureChangeKeys_){this.featureChangeKeys_[t].forEach(k)}this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){const t=function(t){this.removeFeatureInternal(t)}.bind(this);this.featuresRtree_.forEach(t);for(const t in this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[t])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};const e=new Uh(Dh);this.dispatchEvent(e),this.changed()}forEachFeature(t){if(this.featuresRtree_)return this.featuresRtree_.forEach(t);this.featuresCollection_&&this.featuresCollection_.forEach(t)}forEachFeatureAtCoordinateDirect(t,e){const i=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(i,(function(i){return i.getGeometry().intersectsCoordinate(t)?e(i):void 0}))}forEachFeatureInExtent(t,e){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(t,e);this.featuresCollection_&&this.featuresCollection_.forEach(e)}forEachFeatureIntersectingExtent(t,e){return this.forEachFeatureInExtent(t,(function(i){if(i.getGeometry().intersectsExtent(t)){const t=e(i);if(t)return t}}))}getFeaturesCollection(){return this.featuresCollection_}getFeatures(){let t;return this.featuresCollection_?t=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(t=this.featuresRtree_.getAll(),x(this.nullGeometryFeatures_)||c(t,Object.values(this.nullGeometryFeatures_))),t}getFeaturesAtCoordinate(t){const e=[];return this.forEachFeatureAtCoordinateDirect(t,(function(t){e.push(t)})),e}getFeaturesInExtent(t,e){if(this.featuresRtree_){if(!(e&&e.canWrapX()&&this.getWrapX()))return this.featuresRtree_.getInExtent(t);const i=Ie(t,e);return[].concat(...i.map((t=>this.featuresRtree_.getInExtent(t))))}return this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]}getClosestFeatureToCoordinate(t,e){const i=t[0],n=t[1];let r=null;const s=[NaN,NaN];let o=1/0;const a=[-1/0,-1/0,1/0,1/0];return e=e||g,this.featuresRtree_.forEachInExtent(a,(function(t){if(e(t)){const e=t.getGeometry(),l=o;if(o=e.closestPointXY(i,n,s,o),o<l){r=t;const e=Math.sqrt(o);a[0]=i-e,a[1]=n-e,a[2]=i+e,a[3]=n+e}}})),r}getExtent(t){return this.featuresRtree_.getExtent(t)}getFeatureById(t){const e=this.idIndex_[t.toString()];return void 0!==e?e:null}getFeatureByUid(t){const e=this.uidIndex_[t];return void 0!==e?e:null}getFormat(){return this.format_}getOverlaps(){return this.overlaps_}getUrl(){return this.url_}handleFeatureChange_(t){const e=t.target,i=z(e),n=e.getGeometry();if(n){const t=n.getExtent();i in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[i],this.featuresRtree_&&this.featuresRtree_.insert(t,e)):this.featuresRtree_&&this.featuresRtree_.update(t,e)}else i in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(e),this.nullGeometryFeatures_[i]=e);const r=e.getId();if(void 0!==r){const t=r.toString();this.idIndex_[t]!==e&&(this.removeFromIdIndex_(e),this.idIndex_[t]=e)}else this.removeFromIdIndex_(e),this.uidIndex_[i]=e;this.changed(),this.dispatchEvent(new Uh(Nh,e))}hasFeature(t){const e=t.getId();return void 0!==e?e in this.idIndex_:z(t)in this.uidIndex_}isEmpty(){return this.featuresRtree_?this.featuresRtree_.isEmpty()&&x(this.nullGeometryFeatures_):!this.featuresCollection_||0===this.featuresCollection_.getLength()}loadFeatures(t,e,i){const n=this.loadedExtentsRtree_,r=this.strategy_(t,e,i);for(let t=0,s=r.length;t<s;++t){const s=r[t];n.forEachInExtent(s,(function(t){return Yt(t.extent,s)}))||(++this.loadingExtentsCount_,this.dispatchEvent(new Uh(Gh)),this.loader_.call(this,s,e,i,function(t){--this.loadingExtentsCount_,this.dispatchEvent(new Uh(jh,void 0,t))}.bind(this),function(){--this.loadingExtentsCount_,this.dispatchEvent(new Uh(Bh))}.bind(this)),n.insert(s,{extent:s.slice()}))}this.loading=!(this.loader_.length<4)&&this.loadingExtentsCount_>0}refresh(){this.clear(!0),this.loadedExtentsRtree_.clear(),super.refresh()}removeLoadedExtent(t){const e=this.loadedExtentsRtree_;let i;e.forEachInExtent(t,(function(e){if(ee(e.extent,t))return i=e,!0})),i&&e.remove(i)}removeFeature(t){if(!t)return;const e=z(t);e in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[e]:this.featuresRtree_&&this.featuresRtree_.remove(t);this.removeFeatureInternal(t)&&this.changed()}removeFeatureInternal(t){const e=z(t),i=this.featureChangeKeys_[e];if(!i)return;i.forEach(k),delete this.featureChangeKeys_[e];const n=t.getId();return void 0!==n&&delete this.idIndex_[n.toString()],delete this.uidIndex_[e],this.dispatchEvent(new Uh(kh,t)),t}removeFromIdIndex_(t){let e=!1;for(const i in this.idIndex_)if(this.idIndex_[i]===t){delete this.idIndex_[i],e=!0;break}return e}setLoader(t){this.loader_=t}setUrl(t){at(this.format_,7),this.url_=t,this.setLoader(yl(t,this.format_))}}class Xh extends nh{constructor(t){const e=void 0===t.projection?"EPSG:3857":t.projection;let i=t.tileGrid;void 0===i&&e&&(i=Ql({extent:ih(e),maxResolution:t.maxResolution,maxZoom:t.maxZoom,minZoom:t.minZoom,tileSize:t.tileSize})),super({cacheSize:.1,attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,projection:e,tileGrid:i,opaque:t.opaque,state:t.state,wrapX:t.wrapX,transition:t.transition,interpolate:t.interpolate}),this.gutter_=void 0!==t.gutter?t.gutter:0,this.tileSize_=t.tileSize?Va(t.tileSize):null,this.tileSizes_=null,this.tileLoadingKeys_={},this.loader_=t.loader,this.handleTileChange_=this.handleTileChange_.bind(this),this.bandCount=void 0===t.bandCount?4:t.bandCount}setTileSizes(t){this.tileSizes_=t}getTileSize(t){if(this.tileSizes_)return this.tileSizes_[t];if(this.tileSize_)return this.tileSize_;const e=this.getTileGrid();return e?Va(e.getTileSize(t)):[256,256]}getGutterForProjection(t){return this.gutter_}setLoader(t){this.loader_=t}getTile(t,e,i,n,r){const s=this.getTileSize(t),o=il(t,e,i);if(this.tileCache.containsKey(o))return this.tileCache.get(o);const a=this.loader_;const l=Object.assign({tileCoord:[t,e,i],loader:function(){return _((function(){return a(t,e,i)}))},size:s},this.tileOptions),h=new ot(l);return h.key=this.getKey(),h.addEventListener(S,this.handleTileChange_),this.tileCache.set(o,h),h}handleTileChange_(t){const e=t.target,i=z(e),n=e.getState();let r;n==$?(this.tileLoadingKeys_[i]=!0,r=Xl):i in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[i],r=n==Q?Wl:n==J?Vl:void 0),r&&this.dispatchEvent(new rh(r,e))}}function Vh(t,e){if(!t)return!1;if(!0===t)return!0;if(3!==e.getSamplesPerPixel())return!1;const i=e.fileDirectory.PhotometricInterpretation,n=GeoTIFF.globals.photometricInterpretations;return i===n.CMYK||i===n.YCbCr||i===n.CIELab||i===n.ICCLab}const Wh="STATISTICS_MAXIMUM",Zh="STATISTICS_MINIMUM";let Yh;function Kh(t){try{return t.getBoundingBox()}catch(e){const i=t.fileDirectory;return[0,0,i.ImageWidth,i.ImageLength]}}function qh(t){try{return t.getOrigin().slice(0,2)}catch(e){return[0,t.fileDirectory.ImageLength]}}function Hh(t,e){try{return t.getResolution(e)}catch(i){return[e.fileDirectory.ImageWidth/t.fileDirectory.ImageWidth,e.fileDirectory.ImageHeight/t.fileDirectory.ImageHeight]}}function $h(t){const e=t.geoKeys;if(!e)return null;if(e.ProjectedCSTypeGeoKey){const t="EPSG:"+e.ProjectedCSTypeGeoKey;let i=Ui(t);if(!i){const n=Me(e.ProjLinearUnitsGeoKey);n&&(i=new Ae({code:t,units:n}))}return i}if(e.GeographicTypeGeoKey){const t="EPSG:"+e.GeographicTypeGeoKey;let i=Ui(t);if(!i){const n=Me(e.GeogAngularUnitsGeoKey);n&&(i=new Ae({code:t,units:n}))}return i}return null}function Jh(t){return t.getImageCount().then((function(e){const i=new Array(e);for(let n=0;n<e;++n)i[n]=t.getImage(n);return Promise.all(i)}))}function Qh(t,e){let i;return i=t.blob?GeoTIFF.fromBlob(t.blob):t.overviews?GeoTIFF.fromUrls(t.url,t.overviews,e):GeoTIFF.fromUrl(t.url,e),i.then(Jh)}function tc(t,e,i,n,r){if(Array.isArray(t)){const s=t.length;if(!Array.isArray(e)||s!=e.length){const t=new Error(n);throw r(t),t}for(let o=0;o<s;++o)tc(t[o],e[o],i,n,r)}else if(Math.abs(t-e)>i*t)throw new Error(n)}function ec(t){return t instanceof Int8Array?127:t instanceof Uint8Array||t instanceof Uint8ClampedArray?255:t instanceof Int16Array?32767:t instanceof Uint16Array?65535:t instanceof Int32Array?2147483647:t instanceof Uint32Array?4294967295:t instanceof Float32Array?34e37:255}class ic extends Xh{constructor(t){super({state:"loading",tileGrid:null,projection:null,opaque:t.opaque,transition:t.transition,interpolate:!1!==t.interpolate,wrapX:t.wrapX}),this.sourceInfo_=t.sources;const e=this.sourceInfo_.length;this.sourceOptions_=t.sourceOptions,this.sourceImagery_=new Array(e),this.sourceMasks_=new Array(e),this.resolutionFactors_=new Array(e),this.samplesPerPixel_,this.nodataValues_,this.metadata_,this.normalize_=!1!==t.normalize,this.addAlpha_=!1,this.error_=null,this.convertToRGB_=t.convertToRGB||!1,this.setKey(this.sourceInfo_.map((t=>t.url)).join(","));const i=this,n=new Array(e);for(let t=0;t<e;++t)n[t]=Qh(this.sourceInfo_[t],this.sourceOptions_);Promise.all(n).then((function(t){i.configure_(t)})).catch((function(t){console.error(t),i.error_=t,i.setState("error")}))}getError(){return this.error_}configure_(t){let e,i,n,r,s;const o=new Array(t.length),a=new Array(t.length),l=new Array(t.length);let h=0;const c=t.length;for(let u=0;u<c;++u){const c=[],d=[];t[u].forEach((t=>{4==(4&(t.fileDirectory.NewSubfileType||0))?d.push(t):c.push(t)}));const g=c.length;if(d.length>0&&d.length!==g)throw new Error(`Expected one mask per image found ${d.length} masks and ${g} images`);let f,p;const m=new Array(g),_=new Array(g),y=new Array(g);a[u]=new Array(g),l[u]=new Array(g);for(let t=0;t<g;++t){const e=c[t],i=e.getGDALNoData();l[u][t]=e.getGDALMetadata(0),a[u][t]=i;const n=this.sourceInfo_[u].bands;o[u]=n?n.length:e.getSamplesPerPixel();const r=g-(t+1);f||(f=Kh(e)),p||(p=qh(e));const s=Hh(e,c[0]);y[r]=s[0];const h=[e.getTileWidth(),e.getTileHeight()];m[r]=h;const d=s[0]/Math.abs(s[1]);_[r]=[h[0],h[1]/d]}if(e?ye(e,f,e):e=f,i){tc(i,p,0,`Origin mismatch for source ${u}, got [${p}] but expected [${i}]`,this.viewRejector)}else i=p;if(s){s.length-h>y.length&&(h=s.length-y.length);const t=s[s.length-1]/y[y.length-1];this.resolutionFactors_[u]=t;const e=y.map((e=>e*t)),i=`Resolution mismatch for source ${u}, got [${e}] but expected [${s}]`;tc(s.slice(h,s.length),e,.02,i,this.viewRejector)}else s=y,this.resolutionFactors_[u]=1;n?tc(n.slice(h,n.length),_,.01,`Tile size mismatch for source ${u}`,this.viewRejector):n=_,r?tc(r.slice(h,r.length),m,0,`Tile size mismatch for source ${u}`,this.viewRejector):r=m,this.sourceImagery_[u]=c.reverse(),this.sourceMasks_[u]=d.reverse()}for(let t=0,e=this.sourceImagery_.length;t<e;++t){const e=this.sourceImagery_[t];for(;e.length<s.length;)e.unshift(void 0)}if(!this.getProjection()){const e=t[0];for(let t=e.length-1;t>=0;--t){const i=$h(e[t]);if(i){this.projection=i;break}}}this.samplesPerPixel_=o,this.nodataValues_=a,this.metadata_=l;t:for(let t=0;t<c;++t){if(void 0!==this.sourceInfo_[t].nodata){this.addAlpha_=!0;break}if(this.sourceMasks_[t].length){this.addAlpha_=!0;break}const e=a[t],i=this.sourceInfo_[t].bands;if(i){for(let t=0;t<i.length;++t)if(null!==e[i[t]-1]){this.addAlpha_=!0;break t}}else for(let t=0;t<e.length;++t)if(null!==e[t]){this.addAlpha_=!0;break t}}let u=this.addAlpha_?1:0;for(let t=0;t<c;++t)u+=o[t];this.bandCount=u;const d=new ql({extent:e,minZoom:h,origin:i,resolutions:s,tileSizes:n});this.tileGrid=d,this.setTileSizes(r),this.setLoader(this.loadTile_.bind(this)),this.setState("ready");let g=0;1===s.length&&(s=[2*s[0],s[0]],g=1),this.viewResolver({showFullExtent:!0,projection:this.projection,resolutions:s,center:nn(ge(e),this.projection),extent:sn(e,this.projection),zoom:g})}loadTile_(t,e,i){const n=this.getTileSize(t),r=this.sourceImagery_.length,s=new Array(2*r),o=this.nodataValues_,a=this.sourceInfo_,l=(Yh||(Yh=new GeoTIFF.Pool),Yh);for(let h=0;h<r;++h){const c=a[h],u=this.resolutionFactors_[h],d=[Math.round(e*(n[0]*u)),Math.round(i*(n[1]*u)),Math.round((e+1)*(n[0]*u)),Math.round((i+1)*(n[1]*u))],g=this.sourceImagery_[h][t];let f,p;c.bands&&(f=c.bands.map((function(t){return t-1}))),p="nodata"in c&&null!==c.nodata?c.nodata:f?f.map((function(t){return o[h][t]})):o[h];const m={window:d,width:n[0],height:n[1],samples:f,fillValue:p,pool:l,interleave:!1};Vh(this.convertToRGB_,g)?s[h]=g.readRGB(m):s[h]=g.readRasters(m);const _=r+h,y=this.sourceMasks_[h][t];y?s[_]=y.readRasters({window:d,width:n[0],height:n[1],samples:[0],pool:l,interleave:!1}):s[_]=Promise.resolve(null)}return Promise.all(s).then(this.composeTile_.bind(this,n)).catch((function(t){throw console.error(t),t}))}composeTile_(t,e){const i=this.metadata_,n=this.sourceInfo_,r=this.sourceImagery_.length,s=this.bandCount,o=this.samplesPerPixel_,a=this.nodataValues_,l=this.normalize_,h=this.addAlpha_,c=t[0]*t[1],u=c*s;let d;d=l?new Uint8Array(u):new Float32Array(u);let g=0;for(let t=0;t<c;++t){let s=h;for(let c=0;c<r;++c){const u=n[c];let p,m,_=u.min,y=u.max;if(l){const t=i[c][0];void 0===_&&(_=t&&Zh in t?parseFloat(t.STATISTICS_MINIMUM):(f=e[c][0])instanceof Int8Array?-128:f instanceof Int16Array?-32768:f instanceof Int32Array?-2147483648:f instanceof Float32Array?12e-39:0),void 0===y&&(y=t&&Wh in t?parseFloat(t.STATISTICS_MAXIMUM):ec(e[c][0])),p=255/(y-_),m=-_*p}for(let i=0;i<o[c];++i){const n=e[c][i][t];let r;if(r=l?ii(p*n+m,0,255):n,h){let t=u.nodata;if(void 0===t){let e;e=u.bands?u.bands[i]-1:i,t=a[c][e]}const e=isNaN(t);(!e&&n!==t||e&&!isNaN(n))&&(s=!1,d[g]=r)}else d[g]=r;g++}if(!s){const i=e[r+c];i&&!i[0][t]&&(s=!0)}}h&&(s||(d[g]=255),g++)}var f;return d}}ic.prototype.getView;class nc extends Vr{constructor(t,e,i,n,r,s,o){super(e,i,n,r,s,o),this.zoomifyImage_=null,this.tileSize_=t}getImage(){if(this.zoomifyImage_)return this.zoomifyImage_;const t=super.getImage();if(this.state==J){const e=this.tileSize_;if(t.width==e[0]&&t.height==e[1])return this.zoomifyImage_=t,t;{const i=Dr(e[0],e[1]);return i.drawImage(t,0,0),this.zoomifyImage_=i.canvas,i.canvas}}return t}}const rc="version1",sc="version2",oc="version3",ac={};ac[rc]={level0:{supports:[],formats:[],qualities:["native"]},level1:{supports:["regionByPx","sizeByW","sizeByH","sizeByPct"],formats:["jpg"],qualities:["native"]},level2:{supports:["regionByPx","regionByPct","sizeByW","sizeByH","sizeByPct","sizeByConfinedWh","sizeByWh"],formats:["jpg","png"],qualities:["native","color","grey","bitonal"]}},ac[sc]={level0:{supports:[],formats:["jpg"],qualities:["default"]},level1:{supports:["regionByPx","sizeByW","sizeByH","sizeByPct"],formats:["jpg"],qualities:["default"]},level2:{supports:["regionByPx","regionByPct","sizeByW","sizeByH","sizeByPct","sizeByConfinedWh","sizeByDistortedWh","sizeByWh"],formats:["jpg","png"],qualities:["default","bitonal"]}},ac[oc]={level0:{supports:[],formats:["jpg"],qualities:["default"]},level1:{supports:["regionByPx","regionSquare","sizeByW","sizeByH","sizeByWh"],formats:["jpg"],qualities:["default"]},level2:{supports:["regionByPx","regionSquare","regionByPct","sizeByW","sizeByH","sizeByPct","sizeByConfinedWh","sizeByWh"],formats:["jpg","png"],qualities:["default"]}},ac.none={none:{supports:[],formats:[],qualities:[]}};const lc=/^https?:\/\/library\.stanford\.edu\/iiif\/image-api\/(?:1\.1\/)?compliance\.html#level[0-2]$/,hc=/^https?:\/\/iiif\.io\/api\/image\/2\/level[0-2](?:\.json)?$/,cc=/(^https?:\/\/iiif\.io\/api\/image\/3\/level[0-2](?:\.json)?$)|(^level[0-2]$)/;const uc={};uc[rc]=function(t){let e=t.getComplianceLevelSupportedFeatures();return void 0===e&&(e=ac[rc].level0),{url:void 0===t.imageInfo["@id"]?void 0:t.imageInfo["@id"].replace(/\/?(?:info\.json)?$/g,""),supports:e.supports,formats:[...e.formats,void 0===t.imageInfo.formats?[]:t.imageInfo.formats],qualities:[...e.qualities,void 0===t.imageInfo.qualities?[]:t.imageInfo.qualities],resolutions:t.imageInfo.scale_factors,tileSize:void 0!==t.imageInfo.tile_width?void 0!==t.imageInfo.tile_height?[t.imageInfo.tile_width,t.imageInfo.tile_height]:[t.imageInfo.tile_width,t.imageInfo.tile_width]:null!=t.imageInfo.tile_height?[t.imageInfo.tile_height,t.imageInfo.tile_height]:void 0}},uc[sc]=function(t){const e=t.getComplianceLevelSupportedFeatures(),i=Array.isArray(t.imageInfo.profile)&&t.imageInfo.profile.length>1,n=i&&t.imageInfo.profile[1].supports?t.imageInfo.profile[1].supports:[],r=i&&t.imageInfo.profile[1].formats?t.imageInfo.profile[1].formats:[],s=i&&t.imageInfo.profile[1].qualities?t.imageInfo.profile[1].qualities:[];return{url:t.imageInfo["@id"].replace(/\/?(?:info\.json)?$/g,""),sizes:void 0===t.imageInfo.sizes?void 0:t.imageInfo.sizes.map((function(t){return[t.width,t.height]})),tileSize:void 0===t.imageInfo.tiles?void 0:[t.imageInfo.tiles.map((function(t){return t.width}))[0],t.imageInfo.tiles.map((function(t){return void 0===t.height?t.width:t.height}))[0]],resolutions:void 0===t.imageInfo.tiles?void 0:t.imageInfo.tiles.map((function(t){return t.scaleFactors}))[0],supports:[...e.supports,...n],formats:[...e.formats,...r],qualities:[...e.qualities,...s]}},uc[oc]=function(t){const e=t.getComplianceLevelSupportedFeatures(),i=void 0===t.imageInfo.extraFormats?e.formats:[...e.formats,...t.imageInfo.extraFormats],n=void 0!==t.imageInfo.preferredFormats&&Array.isArray(t.imageInfo.preferredFormats)&&t.imageInfo.preferredFormats.length>0?t.imageInfo.preferredFormats.filter((function(t){return["jpg","png","gif"].includes(t)})).reduce((function(t,e){return void 0===t&&i.includes(e)?e:t}),void 0):void 0;return{url:t.imageInfo.id,sizes:void 0===t.imageInfo.sizes?void 0:t.imageInfo.sizes.map((function(t){return[t.width,t.height]})),tileSize:void 0===t.imageInfo.tiles?void 0:[t.imageInfo.tiles.map((function(t){return t.width}))[0],t.imageInfo.tiles.map((function(t){return t.height}))[0]],resolutions:void 0===t.imageInfo.tiles?void 0:t.imageInfo.tiles.map((function(t){return t.scaleFactors}))[0],supports:void 0===t.imageInfo.extraFeatures?e.supports:[...e.supports,...t.imageInfo.extraFeatures],formats:i,qualities:void 0===t.imageInfo.extraQualities?e.qualities:[...e.qualities,...t.imageInfo.extraQualities],preferredFormat:n}};function dc(t){return t.toLocaleString("en",{maximumFractionDigits:10})}class gc extends Rr{constructor(t,e,i,n,r,s,o){const a=t.getExtent(),l=e.getExtent(),h=l?ye(i,l):i,c=Gl(t,e,ge(h),n),u=new Ul(t,e,h,a,.5*c,n),d=s(u.calculateSourceExtent(),c,r),g=d?Pr:Fr,f=d?d.getPixelRatio():1;super(i,n,f,g),this.targetProj_=e,this.maxSourceExtent_=a,this.triangulation_=u,this.targetResolution_=n,this.targetExtent_=i,this.sourceImage_=d,this.sourcePixelRatio_=f,this.interpolate_=o,this.canvas_=null,this.sourceListenerKey_=null}disposeInternal(){this.state==Ir&&this.unlistenSource_(),super.disposeInternal()}getImage(){return this.canvas_}getProjection(){return this.targetProj_}reproject_(){const t=this.sourceImage_.getState();if(t==Lr){const t=Se(this.targetExtent_)/this.targetResolution_,e=_e(this.targetExtent_)/this.targetResolution_;this.canvas_=Bl(t,e,this.sourcePixelRatio_,this.sourceImage_.getResolution(),this.maxSourceExtent_,this.targetResolution_,this.targetExtent_,this.triangulation_,[{extent:this.sourceImage_.getExtent(),image:this.sourceImage_.getImage()}],0,void 0,this.interpolate_)}this.state=t,this.changed()}load(){if(this.state==Pr){this.state=Ir,this.changed();const t=this.sourceImage_.getState();t==Lr||t==Mr?this.reproject_():(this.sourceListenerKey_=N(this.sourceImage_,S,(function(t){const e=this.sourceImage_.getState();e!=Lr&&e!=Mr||(this.unlistenSource_(),this.reproject_())}),this),this.sourceImage_.load())}}unlistenSource_(){k(this.sourceListenerKey_),this.sourceListenerKey_=null}}const fc="imageloadstart",pc="imageloadend",mc="imageloaderror";class _c extends i{constructor(t,e){super(t),this.image=e}}class yc extends Zl{constructor(t){super({attributions:t.attributions,projection:t.projection,state:t.state,interpolate:void 0===t.interpolate||t.interpolate}),this.on,this.once,this.un,this.resolutions_=void 0!==t.resolutions?t.resolutions:null,this.reprojectedImage_=null,this.reprojectedRevision_=0}getResolutions(){return this.resolutions_}findNearestResolution(t){if(this.resolutions_){const e=l(this.resolutions_,t,0);t=this.resolutions_[e]}return t}getImage(t,e,i,n){const r=this.getProjection();if(r&&n&&!Ki(r,n)){if(this.reprojectedImage_){if(this.reprojectedRevision_==this.getRevision()&&Ki(this.reprojectedImage_.getProjection(),n)&&this.reprojectedImage_.getResolution()==e&&ee(this.reprojectedImage_.getExtent(),t))return this.reprojectedImage_;this.reprojectedImage_.dispose(),this.reprojectedImage_=null}return this.reprojectedImage_=new gc(r,n,t,e,i,function(t,e,i){return this.getImageInternal(t,e,i,r)}.bind(this),this.getInterpolate()),this.reprojectedRevision_=this.getRevision(),this.reprojectedImage_}return r&&(n=r),this.getImageInternal(t,e,i,n)}getImageInternal(t,e,i,n){return B()}handleImageChange(t){const e=t.target;let i;switch(e.getState()){case Ir:this.loading=!0,i=fc;break;case Lr:this.loading=!1,i=pc;break;case Mr:this.loading=!1,i=mc;break;default:return}this.hasListener(i)&&this.dispatchEvent(new _c(i,e))}}function xc(t,e){t.getImage().src=e}function vc(t,e){const i=[];Object.keys(e).forEach((function(t){null!==e[t]&&void 0!==e[t]&&i.push(t+"="+encodeURIComponent(e[t]))}));const n=i.join("&");return t=t.replace(/[?&]$/,""),(t+=t.includes("?")?"&":"?")+n}const Sc="1.3.0",wc=[101,101];const Ec='© <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.';class Tc extends vs{constructor(t){super(t=t||{})}}class Cc extends G{constructor(t){super(),this.ready=!0,this.boundHandleImageChange_=this.handleImageChange_.bind(this),this.layer_=t,this.declutterExecutorGroup=null}getFeatures(t){return B()}getData(t){return null}prepareFrame(t){return B()}renderFrame(t,e){return B()}loadedTileCallback(t,e,i){t[e]||(t[e]={}),t[e][i.tileCoord.toString()]=i}createLoadedTileFinder(t,e,i){return function(n,r){const s=this.loadedTileCallback.bind(this,i,n);return t.forEachLoadedTile(e,n,r,s)}.bind(this)}forEachFeatureAtCoordinate(t,e,i,n,r){}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(t){t.target.getState()===Lr&&this.renderIfReadyAndVisible()}loadImage(t){let e=t.getState();return e!=Lr&&e!=Mr&&t.addEventListener(S,this.boundHandleImageChange_),e==Pr&&(t.load(),e=t.getState()),e==Lr}renderIfReadyAndVisible(){const t=this.getLayer();t&&t.getVisible()&&"ready"===t.getSourceState()&&t.changed()}disposeInternal(){delete this.layer_,super.disposeInternal()}}const bc=[];let Rc=null;class Pc extends Cc{constructor(t){super(t),this.container=null,this.renderedResolution,this.tempTransform=[1,0,0,1,0,0],this.pixelTransform=[1,0,0,1,0,0],this.inversePixelTransform=[1,0,0,1,0,0],this.context=null,this.containerReused=!1,this.pixelContext_=null,this.frameState=null}getImageData(t,e,i){let n;Rc||function(){const t=document.createElement("canvas");t.width=1,t.height=1,Rc=t.getContext("2d")}(),Rc.clearRect(0,0,1,1);try{Rc.drawImage(t,e,i,1,1,0,0,1,1),n=Rc.getImageData(0,0,1,1).data}catch(t){return Rc=null,null}return n}getBackground(t){let e=this.getLayer().getBackground();return"function"==typeof e&&(e=e(t.viewState.resolution)),e||void 0}useContainer(t,e,i){const n=this.getLayer().getClassName();let r,s;if(t&&t.className===n&&(!i||t&&t.style.backgroundColor&&u($r(t.style.backgroundColor),$r(i)))){const e=t.firstElementChild;e instanceof HTMLCanvasElement&&(s=e.getContext("2d"))}if(s&&s.canvas.style.transform===e?(this.container=t,this.context=s,this.containerReused=!0):this.containerReused&&(this.container=null,this.context=null,this.containerReused=!1),!this.container){r=document.createElement("div"),r.className=n;let t=r.style;t.position="absolute",t.width="100%",t.height="100%",s=Dr();const e=s.canvas;r.appendChild(e),t=e.style,t.position="absolute",t.left="0",t.transformOrigin="top left",this.container=r,this.context=s}this.containerReused||!i||this.container.style.backgroundColor||(this.container.style.backgroundColor=i)}clipUnrotated(t,e,i){const n=xe(i),r=ve(i),s=de(i),o=ue(i);bt(e.coordinateToPixelTransform,n),bt(e.coordinateToPixelTransform,r),bt(e.coordinateToPixelTransform,s),bt(e.coordinateToPixelTransform,o);const a=this.inversePixelTransform;bt(a,n),bt(a,r),bt(a,s),bt(a,o),t.save(),t.beginPath(),t.moveTo(Math.round(n[0]),Math.round(n[1])),t.lineTo(Math.round(r[0]),Math.round(r[1])),t.lineTo(Math.round(s[0]),Math.round(s[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.clip()}dispatchRenderEvent_(t,e,i){const n=this.getLayer();if(n.hasListener(t)){const r=new Ts(t,this.inversePixelTransform,i,e);n.dispatchEvent(r)}}preRender(t,e){this.frameState=e,this.dispatchRenderEvent_(ps,t,e)}postRender(t,e){this.dispatchRenderEvent_(ms,t,e)}getRenderTransform(t,e,i,n,r,s,o){const a=r/2,l=s/2,h=n/e,c=-h,u=-t[0]+o,d=-t[1];return Mt(this.tempTransform,a,l,h,c,-i,u,d)}disposeInternal(){delete this.frameState,super.disposeInternal()}}class Ic extends Pc{constructor(t){super(t),this.image_=null}getImage(){return this.image_?this.image_.getImage():null}prepareFrame(t){const e=t.layerStatesArray[t.layerIndex],i=t.pixelRatio,n=t.viewState,r=n.resolution,s=this.getLayer().getSource(),o=t.viewHints;let a=t.extent;if(void 0!==e.extent&&(a=ye(a,on(e.extent,n.projection))),!o[Ro]&&!o[Po]&&!Ee(a))if(s){const t=n.projection,e=s.getImage(a,r,i,t);e&&(this.loadImage(e)?this.image_=e:e.getState()===Fr&&(this.image_=null))}else this.image_=null;return!!this.image_}getData(t){const e=this.frameState;if(!e)return null;const i=this.getLayer(),n=bt(e.pixelToCoordinateTransform,t.slice()),r=i.getExtent();if(r&&!Zt(r,n))return null;const s=this.image_.getExtent(),o=this.image_.getImage(),a=Se(s),l=Math.floor(o.width*((n[0]-s[0])/a));if(l<0||l>=o.width)return null;const h=_e(s),c=Math.floor(o.height*((s[3]-n[1])/h));return c<0||c>=o.height?null:this.getImageData(o,l,c)}renderFrame(t,e){const i=this.image_,n=i.getExtent(),r=i.getResolution(),s=i.getPixelRatio(),o=t.layerStatesArray[t.layerIndex],a=t.pixelRatio,l=t.viewState,h=l.center,c=a*r/(l.resolution*s),u=t.extent,d=l.resolution,g=l.rotation,f=Math.round(Se(u)/d*a),p=Math.round(_e(u)/d*a);Mt(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/a,1/a,g,-f/2,-p/2),Ft(this.inversePixelTransform,this.pixelTransform);const m=Nt(this.pixelTransform);this.useContainer(e,m,this.getBackground(t));const _=this.context,y=_.canvas;y.width!=f||y.height!=p?(y.width=f,y.height=p):this.containerReused||_.clearRect(0,0,f,p);let x=!1,v=!0;if(o.extent){const e=on(o.extent,l.projection);v=we(e,t.extent),x=v&&!Yt(e,t.extent),x&&this.clipUnrotated(_,t,e)}const S=i.getImage(),w=Mt(this.tempTransform,f/2,p/2,c,c,0,s*(n[0]-h[0])/r,s*(h[1]-n[3])/r);this.renderedResolution=r*a/s;const E=S.width*w[0],T=S.height*w[3];if(this.getLayer().getSource().getInterpolate()||(_.imageSmoothingEnabled=!1),this.preRender(_,t),v&&E>=.5&&T>=.5){const t=w[4],e=w[5],i=o.opacity;let n;1!==i&&(n=_.globalAlpha,_.globalAlpha=i),_.drawImage(S,0,0,+S.width,+S.height,t,e,E,T),1!==i&&(_.globalAlpha=n)}return this.postRender(_,t),x&&_.restore(),_.imageSmoothingEnabled=!0,m!==y.style.transform&&(y.style.transform=m),this.container}}class Lc extends Tc{constructor(t){super(t)}createRenderer(){return new Ic(this)}getData(t){return super.getData(t)}}var Mc="preload",Fc="useInterimTilesOnError";class Ac extends vs{constructor(t){t=t||{};const e=Object.assign({},t);delete e.preload,delete e.useInterimTilesOnError,super(e),this.on,this.once,this.un,this.setPreload(void 0!==t.preload?t.preload:0),this.setUseInterimTilesOnError(void 0===t.useInterimTilesOnError||t.useInterimTilesOnError)}getPreload(){return this.get(Mc)}setPreload(t){this.set(Mc,t)}getUseInterimTilesOnError(){return this.get(Fc)}setUseInterimTilesOnError(t){this.set(Fc,t)}getData(t){return super.getData(t)}}class Oc extends Pc{constructor(t){super(t),this.extentChanged=!0,this.renderedExtent_=null,this.renderedPixelRatio,this.renderedProjection=null,this.renderedRevision,this.renderedTiles=[],this.newTiles_=!1,this.tmpExtent=[1/0,1/0,-1/0,-1/0],this.tmpTileRange_=new hl(0,0,0,0)}isDrawableTile(t){const e=this.getLayer(),i=t.getState(),n=e.getUseInterimTilesOnError();return i==J||i==tt||i==Q&&!n}getTile(t,e,i,n){const r=n.pixelRatio,s=n.viewState.projection,o=this.getLayer();let a=o.getSource().getTile(t,e,i,r,s);return a.getState()==Q&&o.getUseInterimTilesOnError()&&o.getPreload()>0&&(this.newTiles_=!0),this.isDrawableTile(a)||(a=a.getInterimTile()),a}getData(t){const e=this.frameState;if(!e)return null;const i=this.getLayer(),n=bt(e.pixelToCoordinateTransform,t.slice()),r=i.getExtent();if(r&&!Zt(r,n))return null;const s=e.pixelRatio,o=e.viewState.projection,a=e.viewState,l=i.getRenderSource(),h=l.getTileGridForProjection(a.projection),c=l.getTilePixelRatio(e.pixelRatio);for(let t=h.getZForResolution(a.resolution);t>=h.getMinZoom();--t){const e=h.getTileCoordForCoordAndZ(n,t),i=l.getTile(t,e[1],e[2],s,o);if(!(i instanceof Vr||i instanceof zl)||i instanceof zl&&i.getState()===tt)return null;if(i.getState()!==J)continue;const r=h.getOrigin(t),u=Va(h.getTileSize(t)),d=h.getResolution(t),g=Math.floor(c*((n[0]-r[0])/d-e[1]*u[0])),f=Math.floor(c*((r[1]-n[1])/d-e[2]*u[1])),p=Math.round(c*l.getGutterForProjection(a.projection));return this.getImageData(i.getImage(),g+p,f+p)}return null}loadedTileCallback(t,e,i){return!!this.isDrawableTile(i)&&super.loadedTileCallback(t,e,i)}prepareFrame(t){return!!this.getLayer().getSource()}renderFrame(t,e){const i=t.layerStatesArray[t.layerIndex],n=t.viewState,r=n.projection,s=n.resolution,o=n.center,l=n.rotation,h=t.pixelRatio,c=this.getLayer(),u=c.getSource(),d=u.getRevision(),g=u.getTileGridForProjection(r),f=g.getZForResolution(s,u.zDirection),p=g.getResolution(f);let m=t.extent;const _=t.viewState.resolution,y=u.getTilePixelRatio(h),x=Math.round(Se(m)/_*h),v=Math.round(_e(m)/_*h),S=i.extent&&on(i.extent,r);S&&(m=ye(m,on(i.extent,r)));const w=p*x/2/y,E=p*v/2/y,T=[o[0]-w,o[1]-E,o[0]+w,o[1]+E],C=g.getTileRangeForExtentAndZ(m,f),b={};b[f]={};const R=this.createLoadedTileFinder(u,r,b),P=this.tmpExtent,I=this.tmpTileRange_;this.newTiles_=!1;const L=l?me(n.center,_,l,t.size):void 0;for(let e=C.minX;e<=C.maxX;++e)for(let n=C.minY;n<=C.maxY;++n){if(l&&!g.tileCoordIntersectsViewport([f,e,n],L))continue;const r=this.getTile(f,e,n,t);if(this.isDrawableTile(r)){const e=z(this);if(r.getState()==J){b[f][r.tileCoord.toString()]=r;let t=r.inTransition(e);t&&1!==i.opacity&&(r.endTransition(e),t=!1),this.newTiles_||!t&&this.renderedTiles.includes(r)||(this.newTiles_=!0)}if(1===r.getAlpha(e,t.time))continue}const s=g.getTileCoordChildTileRange(r.tileCoord,I,P);let o=!1;s&&(o=R(f+1,s)),o||g.forEachTileCoordParentTileRange(r.tileCoord,R,I,P)}const M=p/s*h/y;Mt(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/h,1/h,l,-x/2,-v/2);const F=Nt(this.pixelTransform);this.useContainer(e,F,this.getBackground(t));const A=this.context,O=A.canvas;Ft(this.inversePixelTransform,this.pixelTransform),Mt(this.tempTransform,x/2,v/2,M,M,0,-x/2,-v/2),O.width!=x||O.height!=v?(O.width=x,O.height=v):this.containerReused||A.clearRect(0,0,x,v),S&&this.clipUnrotated(A,t,S),u.getInterpolate()||(A.imageSmoothingEnabled=!1),this.preRender(A,t),this.renderedTiles.length=0;let N,D,k,G=Object.keys(b).map(Number);G.sort(a),1!==i.opacity||this.containerReused&&!u.getOpaque(t.viewState.projection)?(N=[],D=[]):G=G.reverse();for(let e=G.length-1;e>=0;--e){const i=G[e],n=u.getTilePixelSize(i,h,r),s=g.getResolution(i)/p,o=n[0]*s*M,a=n[1]*s*M,l=g.getTileCoordForCoordAndZ(xe(T),i),c=g.getTileCoordExtent(l),d=bt(this.tempTransform,[y*(c[0]-T[0])/p,y*(T[3]-c[3])/p]),m=y*u.getGutterForProjection(r),_=b[i];for(const e in _){const n=_[e],r=n.tileCoord,s=l[1]-r[1],h=Math.round(d[0]-(s-1)*o),c=l[2]-r[2],g=Math.round(d[1]-(c-1)*a),p=Math.round(d[0]-s*o),y=Math.round(d[1]-c*a),x=h-p,v=g-y,S=f===i,w=S&&1!==n.getAlpha(z(this),t.time);let E=!1;if(!w)if(N){k=[p,y,p+x,y,p+x,y+v,p,y+v];for(let t=0,e=N.length;t<e;++t)if(f!==i&&i<D[t]){const e=N[t];we([p,y,p+x,y+v],[e[0],e[3],e[4],e[7]])&&(E||(A.save(),E=!0),A.beginPath(),A.moveTo(k[0],k[1]),A.lineTo(k[2],k[3]),A.lineTo(k[4],k[5]),A.lineTo(k[6],k[7]),A.moveTo(e[6],e[7]),A.lineTo(e[4],e[5]),A.lineTo(e[2],e[3]),A.lineTo(e[0],e[1]),A.clip())}N.push(k),D.push(i)}else A.clearRect(p,y,x,v);this.drawTileImage(n,t,p,y,x,v,m,S),N&&!w?(E&&A.restore(),this.renderedTiles.unshift(n)):this.renderedTiles.push(n),this.updateUsedTiles(t.usedTiles,u,n)}}return this.renderedRevision=d,this.renderedResolution=p,this.extentChanged=!this.renderedExtent_||!ee(this.renderedExtent_,T),this.renderedExtent_=T,this.renderedPixelRatio=h,this.renderedProjection=r,this.manageTilePyramid(t,u,g,h,r,m,f,c.getPreload()),this.scheduleExpireCache(t,u),this.postRender(A,t),i.extent&&A.restore(),A.imageSmoothingEnabled=!0,F!==O.style.transform&&(O.style.transform=F),this.container}drawTileImage(t,e,i,n,r,s,o,a){const l=this.getTileImage(t);if(!l)return;const h=z(this),c=e.layerStatesArray[e.layerIndex],u=c.opacity*(a?t.getAlpha(h,e.time):1),d=u!==this.context.globalAlpha;d&&(this.context.save(),this.context.globalAlpha=u),this.context.drawImage(l,o,o,l.width-2*o,l.height-2*o,i,n,r,s),d&&this.context.restore(),u!==c.opacity?e.animate=!0:a&&t.endTransition(h)}getImage(){const t=this.context;return t?t.canvas:null}getTileImage(t){return t.getImage()}scheduleExpireCache(t,e){if(e.canExpireCache()){const i=function(t,e,i){const n=z(t);n in i.usedTiles&&t.expireCache(i.viewState.projection,i.usedTiles[n])}.bind(null,e);t.postRenderFunctions.push(i)}}updateUsedTiles(t,e,i){const n=z(e);n in t||(t[n]={}),t[n][i.getKey()]=!0}manageTilePyramid(t,e,i,n,r,s,o,a,l){const h=z(e);h in t.wantedTiles||(t.wantedTiles[h]={});const c=t.wantedTiles[h],u=t.tileQueue,d=i.getMinZoom(),g=t.viewState.rotation,f=g?me(t.viewState.center,t.viewState.resolution,g,t.size):void 0;let p,m,_,y,x,v,S=0;for(v=d;v<=o;++v)for(m=i.getTileRangeForExtentAndZ(s,v,m),_=i.getResolution(v),y=m.minX;y<=m.maxX;++y)for(x=m.minY;x<=m.maxY;++x)g&&!i.tileCoordIntersectsViewport([v,y,x],f)||(o-v<=a?(++S,p=e.getTile(v,y,x,n,r),p.getState()==H&&(c[p.getKey()]=!0,u.isKeyQueued(p.getKey())||u.enqueue([p,h,i.getTileCoordCenter(p.tileCoord),_])),void 0!==l&&l(p)):e.useTile(v,y,x,r));e.updateCacheSize(S,r)}}class Nc extends Ac{constructor(t){super(t)}createRenderer(){return new Oc(this)}}let Dc,kc=!0;try{new ImageData(10,10)}catch(t){kc=!1}function Gc(t,e,i){if(kc)return new ImageData(t,e,i);Dc||(Dc=document.createElement("canvas").getContext("2d"));const n=Dc.createImageData(e,i);return n.data.set(t),n}function jc(t){let e=!0;try{new ImageData(10,10)}catch(t){e=!1}function i(t,i,n){return e?new ImageData(t,i,n):{data:t,width:i,height:n}}return function(e){const n=e.buffers,r=e.meta,s=e.imageOps,o=e.width,a=e.height,l=n.length,h=n[0].byteLength;if(s){const e=new Array(l);for(let t=0;t<l;++t)e[t]=i(new Uint8ClampedArray(n[t]),o,a);return t(e,r).data.buffer}const c=new Uint8ClampedArray(h),u=new Array(l),d=new Array(l);for(let t=0;t<l;++t)u[t]=new Uint8ClampedArray(n[t]),d[t]=[0,0,0,0];for(let e=0;e<h;e+=4){for(let t=0;t<l;++t){const i=u[t];d[t][0]=i[e],d[t][1]=i[e+1],d[t][2]=i[e+2],d[t][3]=i[e+3]}const i=t(d,r);c[e]=i[0],c[e+1]=i[1],c[e+2]=i[2],c[e+3]=i[3]}return c.buffer}}function Bc(t,e){const i=Object.keys(t.lib||{}).map((function(e){return"const "+e+" = "+t.lib[e].toString()+";"})).concat(["const __minion__ = ("+jc.toString()+")(",t.operation.toString(),");",'self.addEventListener("message", function(event) {'," const buffer = __minion__(event.data);"," self.postMessage({buffer: buffer, meta: event.data.meta}, [buffer]);","});"]),n=new Worker("undefined"==typeof Blob?"data:text/javascript;base64,"+Buffer.from(i.join("\n"),"binary").toString("base64"):URL.createObjectURL(new Blob(i,{type:"text/javascript"})));return n.addEventListener("message",e),n}class Uc extends s{constructor(t){let e;super(),this._imageOps=!!t.imageOps,e=0===t.threads?0:this._imageOps?1:t.threads||1;const i=new Array(e);if(e)for(let n=0;n<e;++n)i[n]=Bc(t,this._onWorkerMessage.bind(this,n));else i[0]=function(t,e){const i=jc(t.operation);let n=!1;return{postMessage:function(t){setTimeout((function(){n||e({data:{buffer:i(t),meta:t.meta}})}),0)},terminate:function(){n=!0}}}(t,this._onWorkerMessage.bind(this,0));this._workers=i,this._queue=[],this._maxQueueLength=t.queue||1/0,this._running=0,this._dataLookup={},this._job=null}process(t,e,i){this._enqueue({inputs:t,meta:e,callback:i}),this._dispatch()}_enqueue(t){for(this._queue.push(t);this._queue.length>this._maxQueueLength;)this._queue.shift().callback(null,null)}_dispatch(){if(this._running||0===this._queue.length)return;const t=this._queue.shift();this._job=t;const e=t.inputs[0].width,i=t.inputs[0].height,n=t.inputs.map((function(t){return t.data.buffer})),r=this._workers.length;if(this._running=r,1===r)return void this._workers[0].postMessage({buffers:n,meta:t.meta,imageOps:this._imageOps,width:e,height:i},n);const s=t.inputs[0].data.length,o=4*Math.ceil(s/4/r);for(let s=0;s<r;++s){const r=s*o,a=[];for(let t=0,e=n.length;t<e;++t)a.push(n[t].slice(r,r+o));this._workers[s].postMessage({buffers:a,meta:t.meta,imageOps:this._imageOps,width:e,height:i},a)}}_onWorkerMessage(t,e){this.disposed||(this._dataLookup[t]=e.data,--this._running,0===this._running&&this._resolveJob())}_resolveJob(){const t=this._job,e=this._workers.length;let i,n;if(1===e)i=new Uint8ClampedArray(this._dataLookup[0].buffer),n=this._dataLookup[0].meta;else{const r=t.inputs[0].data.length;i=new Uint8ClampedArray(r),n=new Array(e);const s=4*Math.ceil(r/4/e);for(let t=0;t<e;++t){const e=this._dataLookup[t].buffer,r=t*s;i.set(new Uint8ClampedArray(e),r),n[t]=this._dataLookup[t].meta}}this._job=null,this._dataLookup={},t.callback(null,Gc(i,t.inputs[0].width,t.inputs[0].height),n),this._dispatch()}disposeInternal(){for(let t=0;t<this._workers.length;++t)this._workers[t].terminate();this._workers.length=0}}const zc="beforeoperations",Xc="afteroperations";class Vc extends i{constructor(t,e,i){super(t),this.extent=e.extent,this.resolution=e.viewState.resolution/e.pixelRatio,this.data=i}}class Wc extends yc{constructor(t){super({projection:null}),this.on,this.once,this.un,this.processor_=null,this.operationType_=void 0!==t.operationType?t.operationType:"pixel",this.threads_=void 0!==t.threads?t.threads:1,this.layers_=function(t){const e=t.length,i=new Array(e);for(let n=0;n<e;++n)i[n]=Kc(t[n]);return i}(t.sources);const e=this.changed.bind(this);for(let t=0,i=this.layers_.length;t<i;++t)this.layers_[t].addEventListener(S,e);var i;this.tileQueue_=new Co((function(){return 1}),this.changed.bind(this)),this.requestedFrameState_,this.renderedImageCanvas_=null,this.renderedRevision_,this.frameState_={animate:!1,coordinateToPixelTransform:[1,0,0,1,0,0],declutterTree:null,extent:null,index:0,layerIndex:0,layerStatesArray:(i=this.layers_,i.map((function(t){return t.getLayerState()}))),pixelRatio:1,pixelToCoordinateTransform:[1,0,0,1,0,0],postRenderFunctions:[],size:[0,0],tileQueue:this.tileQueue_,time:Date.now(),usedTiles:{},viewState:{rotation:0},viewHints:[],wantedTiles:{},mapId:z(this),renderTargets:{}},this.setAttributions((function(e){const i=[];for(let n=0,r=t.sources.length;n<r;++n){const r=t.sources[n],s=(r instanceof Zl?r:r.getSource()).getAttributions();if("function"==typeof s){const t=s(e);i.push.apply(i,t)}}return 0!==i.length?i:null})),void 0!==t.operation&&this.setOperation(t.operation,t.lib)}setOperation(t,e){this.processor_&&this.processor_.dispose(),this.processor_=new Uc({operation:t,imageOps:"image"===this.operationType_,queue:1,lib:e,threads:this.threads_}),this.changed()}updateFrameState_(t,e,i){const n=Object.assign({},this.frameState_);n.viewState=Object.assign({},n.viewState);const r=ge(t);n.extent=t.slice(),n.size[0]=Math.round(Se(t)/e),n.size[1]=Math.round(_e(t)/e),n.time=Date.now();const s=n.viewState;return s.center=r,s.projection=i,s.resolution=e,n}allSourcesReady_(){let t,e=!0;for(let i=0,n=this.layers_.length;i<n;++i)if(t=this.layers_[i].getSource(),"ready"!==t.getState()){e=!1;break}return e}getImage(t,e,i,n){if(!this.allSourcesReady_())return null;const r=this.updateFrameState_(t,e,n);if(this.requestedFrameState_=r,this.renderedImageCanvas_){const i=this.renderedImageCanvas_.getResolution(),n=this.renderedImageCanvas_.getExtent();e===i&&ee(t,n)||(this.renderedImageCanvas_=null)}return this.renderedImageCanvas_&&this.getRevision()===this.renderedRevision_||this.processSources_(),r.tileQueue.loadMoreTiles(16,16),r.animate&&requestAnimationFrame(this.changed.bind(this)),this.renderedImageCanvas_}processSources_(){const t=this.requestedFrameState_,e=this.layers_.length,i=new Array(e);for(let n=0;n<e;++n){t.layerIndex=n;const e=Yc(this.layers_[n],t);if(!e)return;i[n]=e}const n={};this.dispatchEvent(new Vc(zc,t,n)),this.processor_.process(i,n,this.onWorkerComplete_.bind(this,t))}onWorkerComplete_(t,e,i,n){if(e||!i)return;const r=t.extent,s=t.viewState.resolution;if(s!==this.requestedFrameState_.viewState.resolution||!ee(r,this.requestedFrameState_.extent))return;let o;if(this.renderedImageCanvas_)o=this.renderedImageCanvas_.getImage().getContext("2d");else{o=Dr(Math.round(Se(r)/s),Math.round(_e(r)/s)),this.renderedImageCanvas_=new Nr(r,s,1,o.canvas)}o.putImageData(i,0,0),this.changed(),this.renderedRevision_=this.getRevision(),this.dispatchEvent(new Vc(Xc,t,n)),t.animate&&requestAnimationFrame(this.changed.bind(this))}disposeInternal(){this.processor_&&this.processor_.dispose(),super.disposeInternal()}}Wc.prototype.dispose;let Zc=null;function Yc(t,e){const i=t.getRenderer();if(!i)throw new Error("Unsupported layer type: "+t);if(!i.prepareFrame(e))return null;const n=e.size[0],r=e.size[1];if(0===n||0===r)return null;const s=i.renderFrame(e,null);let o;if(s instanceof HTMLCanvasElement)o=s;else{if(s&&(o=s.firstElementChild),!(o instanceof HTMLCanvasElement))throw new Error("Unsupported rendered element: "+o);if(o.width===n&&o.height===r){return o.getContext("2d").getImageData(0,0,n,r)}}if(Zc){const t=Zc.canvas;t.width!==n||t.height!==r?Zc=Dr(n,r):Zc.clearRect(0,0,n,r)}else Zc=Dr(n,r);return Zc.drawImage(o,0,0,n,r),Zc.getImageData(0,0,n,r)}function Kc(t){let e;return t instanceof Zl?t instanceof nh?e=new Nc({source:t}):t instanceof yc&&(e=new Lc({source:t})):e=t,e}const qc=['Map tiles by <a href="https://stamen.com/" target="_blank">Stamen Design</a>, under <a href="https://creativecommons.org/licenses/by/3.0/" target="_blank">CC BY 3.0</a>.',Ec],Hc={terrain:{extension:"jpg",opaque:!0},"terrain-background":{extension:"jpg",opaque:!0},"terrain-labels":{extension:"png",opaque:!1},"terrain-lines":{extension:"png",opaque:!1},"toner-background":{extension:"png",opaque:!0},toner:{extension:"png",opaque:!0},"toner-hybrid":{extension:"png",opaque:!1},"toner-labels":{extension:"png",opaque:!1},"toner-lines":{extension:"png",opaque:!1},"toner-lite":{extension:"png",opaque:!0},watercolor:{extension:"jpg",opaque:!0}},$c={terrain:{minZoom:0,maxZoom:18},toner:{minZoom:0,maxZoom:20},watercolor:{minZoom:0,maxZoom:18}};class Jc extends st{constructor(t,e,i,n,r,s){super(t,e),this.src_=i,this.extent_=n,this.preemptive_=r,this.grid_=null,this.keys_=null,this.data_=null,this.jsonp_=s}getImage(){return null}getData(t){if(!this.grid_||!this.keys_)return null;const e=(t[0]-this.extent_[0])/(this.extent_[2]-this.extent_[0]),i=(t[1]-this.extent_[1])/(this.extent_[3]-this.extent_[1]),n=this.grid_[Math.floor((1-i)*this.grid_.length)];if("string"!=typeof n)return null;let r=n.charCodeAt(Math.floor(e*n.length));r>=93&&r--,r>=35&&r--,r-=32;let s=null;if(r in this.keys_){const t=this.keys_[r];s=this.data_&&t in this.data_?this.data_[t]:t}return s}forDataAtCoordinate(t,e,i){this.state==tt&&!0===i?(this.state=H,D(this,S,(function(i){e(this.getData(t))}),this),this.loadInternal_()):!0===i?setTimeout(function(){e(this.getData(t))}.bind(this),0):e(this.getData(t))}getKey(){return this.src_}handleError_(){this.state=Q,this.changed()}handleLoad_(t){this.grid_=t.grid,this.keys_=t.keys,this.data_=t.data,this.state=J,this.changed()}loadInternal_(){if(this.state==H)if(this.state=$,this.jsonp_)vl(this.src_,this.handleLoad_.bind(this),this.handleError_.bind(this));else{const t=new XMLHttpRequest;t.addEventListener("load",this.onXHRLoad_.bind(this)),t.addEventListener("error",this.onXHRError_.bind(this)),t.open("GET",this.src_),t.send()}}onXHRLoad_(t){const e=t.target;if(!e.status||e.status>=200&&e.status<300){let t;try{t=JSON.parse(e.responseText)}catch(t){return void this.handleError_()}this.handleLoad_(t)}else this.handleError_()}onXHRError_(t){this.handleError_()}load(){this.preemptive_?this.loadInternal_():this.setState(tt)}}class Qc extends ch{constructor(t){const e=t.projection||"EPSG:3857",i=t.extent||ih(e),n=t.tileGrid||Ql({extent:i,maxResolution:t.maxResolution,maxZoom:void 0!==t.maxZoom?t.maxZoom:22,minZoom:t.minZoom,tileSize:t.tileSize||512});super({attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,cacheSize:t.cacheSize,interpolate:!0,opaque:!1,projection:e,state:t.state,tileGrid:n,tileLoadFunction:t.tileLoadFunction?t.tileLoadFunction:tu,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:void 0===t.wrapX||t.wrapX,transition:t.transition,zDirection:void 0===t.zDirection?1:t.zDirection}),this.format_=t.format?t.format:null,this.sourceTileCache=new ll(this.tileCache.highWaterMark),this.overlaps_=null==t.overlaps||t.overlaps,this.tileClass=t.tileClass?t.tileClass:gl,this.tileGrids_={}}getFeaturesInExtent(t){const e=[],i=this.tileCache;if(0===i.getCount())return e;const n=sl(i.peekFirstKey())[0],r=this.tileGrid;return i.forEach((function(i){if(i.tileCoord[0]!==n||i.getState()!==J)return;const s=i.getSourceTiles();for(let i=0,n=s.length;i<n;++i){const n=s[i],o=n.tileCoord;if(we(t,r.getTileCoordExtent(o))){const i=n.getFeatures();if(i)for(let n=0,r=i.length;n<r;++n){const r=i[n],s=r.getGeometry();we(t,s.getExtent())&&e.push(r)}}}})),e}getOverlaps(){return this.overlaps_}clear(){this.tileCache.clear(),this.sourceTileCache.clear()}expireCache(t,e){const i=this.getTileCacheForProjection(t),n=Object.keys(e).reduce(((t,e)=>{const n=rl(e),r=i.peek(n);if(r){const e=r.sourceTiles;for(let i=0,n=e.length;i<n;++i)t[e[i].getKey()]=!0}return t}),{});super.expireCache(t,e),this.sourceTileCache.expireCache(n)}getSourceTiles(t,e,i){if(i.getState()===H){i.setState($);const n=i.wrappedTileCoord,r=this.getTileGridForProjection(e),s=r.getTileCoordExtent(n),o=n[0],a=r.getResolution(o);Xt(s,-a,s);const l=this.tileGrid,h=l.getExtent();h&&ye(s,h,s);const c=l.getZForResolution(a,this.zDirection);l.forEachTileCoord(s,c,(n=>{const r=this.tileUrlFunction(n,t,e),s=this.sourceTileCache.containsKey(r)?this.sourceTileCache.get(r):new this.tileClass(n,r?H:tt,r,this.format_,this.tileLoadFunction);i.sourceTiles.push(s);const o=s.getState();if(o<J){const t=e=>{this.handleTileChange(e);const n=s.getState();if(n===J||n===Q){const e=s.getKey();e in i.errorTileKeys?s.getState()===J&&delete i.errorTileKeys[e]:i.loadingSourceTiles--,n===Q?i.errorTileKeys[e]=!0:s.removeEventListener(S,t),0===i.loadingSourceTiles&&i.setState(x(i.errorTileKeys)?J:Q)}};s.addEventListener(S,t),i.loadingSourceTiles++}o===H&&(s.extent=l.getTileCoordExtent(n),s.projection=e,s.resolution=l.getResolution(n[0]),this.sourceTileCache.set(r,s),s.load())})),i.loadingSourceTiles||i.setState(i.sourceTiles.some((t=>t.getState()===Q))?Q:J)}return i.sourceTiles}getTile(t,e,i,n,r){const s=il(t,e,i),o=this.getKey();let a;if(this.tileCache.containsKey(s)&&(a=this.tileCache.get(s),a.key===o))return a;const l=[t,e,i];let h=this.getTileCoordForTileUrlFunction(l,r);const c=this.getTileGrid().getExtent(),u=this.getTileGridForProjection(r);if(h&&c){const e=u.getTileCoordExtent(h);Xt(e,-u.getResolution(t),e),we(c,e)||(h=null)}let d=!0;if(null!==h){const e=this.tileGrid,i=u.getResolution(t),s=e.getZForResolution(i,1),o=u.getTileCoordExtent(h);Xt(o,-i,o),e.forEachTileCoord(o,s,function(t){d=d&&!this.tileUrlFunction(t,n,r)}.bind(this))}const g=new dl(l,d?tt:H,h,this.getSourceTiles.bind(this,n,r));return g.key=o,a?(g.interimTile=a,g.refreshInterimChain(),this.tileCache.replace(s,g)):this.tileCache.set(s,g),g}getTileGridForProjection(t){const e=t.getCode();let i=this.tileGrids_[e];if(!i){const t=this.tileGrid,n=t.getResolutions().slice(),r=n.map((function(e,i){return t.getOrigin(i)})),s=n.map((function(e,i){return t.getTileSize(i)})),o=43;for(let t=n.length;t<o;++t)n.push(n[t-1]/2),r.push(r[t-1]),s.push(s[t-1]);i=new ql({extent:t.getExtent(),origins:r,resolutions:n,tileSizes:s}),this.tileGrids_[e]=i}return i}getTilePixelRatio(t){return t}getTilePixelSize(t,e,i){const n=Va(this.getTileGridForProjection(i).getTileSize(t),this.tmpSize);return[Math.round(n[0]*e),Math.round(n[1]*e)]}updateCacheSize(t,e){super.updateCacheSize(2*t,e),this.sourceTileCache.highWaterMark=this.getTileCacheForProjection(e).highWaterMark}}function tu(t,e){t.setLoader((function(i,n,r){_l(e,t.getFormat(),i,n,r,t.onLoad.bind(t),t.onError.bind(t))}))}class eu extends ql{constructor(t){super({extent:t.extent,origin:t.origin,origins:t.origins,resolutions:t.resolutions,tileSize:t.tileSize,tileSizes:t.tileSizes,sizes:t.sizes}),this.matrixIds_=t.matrixIds}getMatrixId(t){return this.matrixIds_[t]}getMatrixIds(){return this.matrixIds_}}function iu(t,e,i){const n=[],r=[],s=[],o=[],a=[];i=void 0!==i?i:[];const l=Ui(t.SupportedCRS),h=l.getMetersPerUnit(),c="ne"==l.getAxisOrientation().substr(0,2);return t.TileMatrix.sort((function(t,e){return e.ScaleDenominator-t.ScaleDenominator})),t.TileMatrix.forEach((function(e){let l;if(l=!(i.length>0)||i.find((function(i){return e.Identifier==i.TileMatrix||!e.Identifier.includes(":")&&t.Identifier+":"+e.Identifier===i.TileMatrix})),l){r.push(e.Identifier);const t=28e-5*e.ScaleDenominator/h,i=e.TileWidth,l=e.TileHeight;c?s.push([e.TopLeftCorner[1],e.TopLeftCorner[0]]):s.push(e.TopLeftCorner),n.push(t),o.push(i==l?i:[i,l]),a.push([e.MatrixWidth,e.MatrixHeight])}})),new eu({extent:e,origins:s,resolutions:n,matrixIds:r,tileSizes:o,sizes:a})}const nu=34962,ru=34963,su=35044,ou=35048,au=5126,lu=["experimental-webgl","webgl","webkit-3d","moz-webgl"];function hu(t,e){e=Object.assign({preserveDrawingBuffer:!0,antialias:!gt},e);const i=lu.length;for(let n=0;n<i;++n)try{const i=t.getContext(lu[n],e);if(i)return i}catch(t){}return null}let cu;const uu="http://www.w3.org/2001/XMLSchema-instance";function du(t,e){return Du().createElementNS(t,e)}function gu(t,e){return fu(t,e,[]).join("")}function fu(t,e,i){if(t.nodeType==Node.CDATA_SECTION_NODE||t.nodeType==Node.TEXT_NODE)e?i.push(String(t.nodeValue).replace(/(\r\n|\r|\n)/g,"")):i.push(t.nodeValue);else{let n;for(n=t.firstChild;n;n=n.nextSibling)fu(n,e,i)}return i}function pu(t){return"documentElement"in t}function mu(t,e,i){return t.getAttributeNS(e,i)||""}function _u(t){return(new DOMParser).parseFromString(t,"application/xml")}function yu(t,e){return function(i,n){const r=t.call(void 0!==e?e:this,i,n);if(void 0!==r){c(n[n.length-1],r)}}}function xu(t,e){return function(i,n){const r=t.call(void 0!==e?e:this,i,n);if(void 0!==r){n[n.length-1].push(r)}}}function vu(t,e){return function(i,n){const r=t.call(void 0!==e?e:this,i,n);void 0!==r&&(n[n.length-1]=r)}}function Su(t,e,i){return function(n,r){const s=t.call(void 0!==i?i:this,n,r);if(void 0!==s){const t=r[r.length-1],i=void 0!==e?e:n.localName;let o;i in t?o=t[i]:(o=[],t[i]=o),o.push(s)}}}function wu(t,e,i){return function(n,r){const s=t.call(void 0!==i?i:this,n,r);if(void 0!==s){r[r.length-1][void 0!==e?e:n.localName]=s}}}function Eu(t,e){return function(i,n,r){t.call(void 0!==e?e:this,i,n,r);r[r.length-1].node.appendChild(i)}}function Tu(t,e){let i,n;return function(e,r,s){if(void 0===i){i={};const r={};r[e.localName]=t,i[e.namespaceURI]=r,n=Cu(e.localName)}Mu(i,n,r,s)}}function Cu(t,e){return function(i,n,r){const s=n[n.length-1].node;let o=t;void 0===o&&(o=r);return du(void 0!==e?e:s.namespaceURI,o)}}const bu=Cu();function Ru(t,e){const i=e.length,n=new Array(i);for(let r=0;r<i;++r)n[r]=t[e[r]];return n}function Pu(t,e,i){let n,r;for(i=void 0!==i?i:{},n=0,r=t.length;n<r;++n)i[t[n]]=e;return i}function Iu(t,e,i,n){let r;for(r=e.firstElementChild;r;r=r.nextElementSibling){const e=t[r.namespaceURI];if(void 0!==e){const t=e[r.localName];void 0!==t&&t.call(n,r,i)}}}function Lu(t,e,i,n,r){return n.push(t),Iu(e,i,n,r),n.pop()}function Mu(t,e,i,n,r,s){const o=(void 0!==r?r:i).length;let a,l;for(let h=0;h<o;++h)a=i[h],void 0!==a&&(l=e.call(void 0!==s?s:this,a,n,void 0!==r?r[h]:void 0),void 0!==l&&t[l.namespaceURI][l.localName].call(s,l,a,n))}function Fu(t,e,i,n,r,s,o){return r.push(t),Mu(e,i,n,r,s,o),r.pop()}let Au,Ou;function Nu(){return void 0===Au&&"undefined"!=typeof XMLSerializer&&(Au=new XMLSerializer),Au}function Du(){return void 0===Ou&&"undefined"!=typeof document&&(Ou=document.implementation.createDocument("","",null)),Ou}const ku=su;class Gu{constructor(t,e){this.array=null,this.type=t,at(t===nu||t===ru,62),this.usage=void 0!==e?e:ku}ofSize(t){this.array=new(ju(this.type))(t)}fromArray(t){this.array=ju(this.type).from(t)}fromArrayBuffer(t){this.array=new(ju(this.type))(t)}getType(){return this.type}getArray(){return this.array}getUsage(){return this.usage}getSize(){return this.array?this.array.length:0}}function ju(t){switch(t){case nu:return Float32Array;case ru:return Uint32Array;default:return Float32Array}}var Bu="webglcontextlost",Uu="webglcontextrestored";class zu{constructor(t){this.gl_=t.webGlContext;const e=this.gl_;this.scaleRatio_=t.scaleRatio||1,this.renderTargetTexture_=e.createTexture(),this.renderTargetTextureSize_=null,this.frameBuffer_=e.createFramebuffer();const i=e.createShader(e.VERTEX_SHADER);e.shaderSource(i,t.vertexShader||"\n precision mediump float;\n \n attribute vec2 a_position;\n varying vec2 v_texCoord;\n varying vec2 v_screenCoord;\n \n uniform vec2 u_screenSize;\n \n void main() {\n v_texCoord = a_position * 0.5 + 0.5;\n v_screenCoord = v_texCoord * u_screenSize;\n gl_Position = vec4(a_position, 0.0, 1.0);\n }\n"),e.compileShader(i);const n=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(n,t.fragmentShader||"\n precision mediump float;\n \n uniform sampler2D u_image;\n uniform float u_opacity;\n \n varying vec2 v_texCoord;\n \n void main() {\n gl_FragColor = texture2D(u_image, v_texCoord) * u_opacity;\n }\n"),e.compileShader(n),this.renderTargetProgram_=e.createProgram(),e.attachShader(this.renderTargetProgram_,i),e.attachShader(this.renderTargetProgram_,n),e.linkProgram(this.renderTargetProgram_),this.renderTargetVerticesBuffer_=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,this.renderTargetVerticesBuffer_),e.bufferData(e.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,1,-1,1,1,-1,1]),e.STATIC_DRAW),this.renderTargetAttribLocation_=e.getAttribLocation(this.renderTargetProgram_,"a_position"),this.renderTargetUniformLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_screenSize"),this.renderTargetOpacityLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_opacity"),this.renderTargetTextureLocation_=e.getUniformLocation(this.renderTargetProgram_,"u_image"),this.uniforms_=[],t.uniforms&&Object.keys(t.uniforms).forEach(function(i){this.uniforms_.push({value:t.uniforms[i],location:e.getUniformLocation(this.renderTargetProgram_,i)})}.bind(this))}getGL(){return this.gl_}init(t){const e=this.getGL(),i=[e.drawingBufferWidth*this.scaleRatio_,e.drawingBufferHeight*this.scaleRatio_];if(e.bindFramebuffer(e.FRAMEBUFFER,this.getFrameBuffer()),e.viewport(0,0,i[0],i[1]),!this.renderTargetTextureSize_||this.renderTargetTextureSize_[0]!==i[0]||this.renderTargetTextureSize_[1]!==i[1]){this.renderTargetTextureSize_=i;const t=0,n=e.RGBA,r=0,s=e.RGBA,o=e.UNSIGNED_BYTE,a=null;e.bindTexture(e.TEXTURE_2D,this.renderTargetTexture_),e.texImage2D(e.TEXTURE_2D,t,n,i[0],i[1],r,s,o,a),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.renderTargetTexture_,0)}}apply(t,e,i,n){const r=this.getGL(),s=t.size;if(r.bindFramebuffer(r.FRAMEBUFFER,e?e.getFrameBuffer():null),r.activeTexture(r.TEXTURE0),r.bindTexture(r.TEXTURE_2D,this.renderTargetTexture_),!e){const e=z(r.canvas);if(!t.renderTargets[e]){const i=r.getContextAttributes();i&&i.preserveDrawingBuffer&&(r.clearColor(0,0,0,0),r.clear(r.COLOR_BUFFER_BIT)),t.renderTargets[e]=!0}}r.enable(r.BLEND),r.blendFunc(r.ONE,r.ONE_MINUS_SRC_ALPHA),r.viewport(0,0,r.drawingBufferWidth,r.drawingBufferHeight),r.bindBuffer(r.ARRAY_BUFFER,this.renderTargetVerticesBuffer_),r.useProgram(this.renderTargetProgram_),r.enableVertexAttribArray(this.renderTargetAttribLocation_),r.vertexAttribPointer(this.renderTargetAttribLocation_,2,r.FLOAT,!1,0,0),r.uniform2f(this.renderTargetUniformLocation_,s[0],s[1]),r.uniform1i(this.renderTargetTextureLocation_,0);const o=t.layerStatesArray[t.layerIndex].opacity;r.uniform1f(this.renderTargetOpacityLocation_,o),this.applyUniforms(t),i&&i(r,t),r.drawArrays(r.TRIANGLES,0,6),n&&n(r,t)}getFrameBuffer(){return this.frameBuffer_}applyUniforms(t){const e=this.getGL();let i,n=1;this.uniforms_.forEach((function(r){if(i="function"==typeof r.value?r.value(t):r.value,i instanceof HTMLCanvasElement||i instanceof ImageData)r.texture||(r.texture=e.createTexture()),e.activeTexture(e[`TEXTURE${n}`]),e.bindTexture(e.TEXTURE_2D,r.texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),i instanceof ImageData?e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,i.width,i.height,0,e.UNSIGNED_BYTE,new Uint8Array(i.data)):e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,i),e.uniform1i(r.location,n++);else if(Array.isArray(i))switch(i.length){case 2:return void e.uniform2f(r.location,i[0],i[1]);case 3:return void e.uniform3f(r.location,i[0],i[1],i[2]);case 4:return void e.uniform4f(r.location,i[0],i[1],i[2],i[3]);default:return}else"number"==typeof i&&e.uniform1f(r.location,i)}))}}function Xu(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function Vu(t,e){return t[0]=e[0],t[1]=e[1],t[4]=e[2],t[5]=e[3],t[12]=e[4],t[13]=e[5],t}const Wu="u_projectionMatrix",Zu="u_offsetScaleMatrix",Yu="u_offsetRotateMatrix",Ku="u_time",qu="u_zoom",Hu="u_resolution",$u="u_sizePx",Ju="u_pixelRatio",Qu={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125,FLOAT:au},td={};function ed(t){return"shared/"+t}let id=0;class nd extends s{constructor(t){super(),t=t||{},this.boundHandleWebGLContextLost_=this.handleWebGLContextLost.bind(this),this.boundHandleWebGLContextRestored_=this.handleWebGLContextRestored.bind(this),this.canvasCacheKey_=t.canvasCacheKey?ed(t.canvasCacheKey):function(){const t="unique/"+id;return id+=1,t}(),this.canvas_=function(t){let e=td[t];if(!e){const i=document.createElement("canvas");i.style.position="absolute",i.style.left="0",e={users:0,canvas:i},td[t]=e}return e.users+=1,e.canvas}(this.canvasCacheKey_),this.gl_=hu(this.canvas_),this.bufferCache_={},this.extensionCache_={},this.currentProgram_=null,this.canvas_.addEventListener(Bu,this.boundHandleWebGLContextLost_),this.canvas_.addEventListener(Uu,this.boundHandleWebGLContextRestored_),this.offsetRotateMatrix_=[1,0,0,1,0,0],this.offsetScaleMatrix_=[1,0,0,1,0,0],this.tmpMat4_=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],this.uniformLocations_={},this.attribLocations_={},this.uniforms_=[],t.uniforms&&this.setUniforms(t.uniforms);const e=this.getGL();this.postProcessPasses_=t.postProcesses?t.postProcesses.map((function(t){return new zu({webGlContext:e,scaleRatio:t.scaleRatio,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,uniforms:t.uniforms})})):[new zu({webGlContext:e})],this.shaderCompileErrors_=null,this.startTime_=Date.now()}setUniforms(t){this.uniforms_=[];for(const e in t)this.uniforms_.push({name:e,value:t[e]});this.uniformLocations_={}}canvasCacheKeyMatches(t){return this.canvasCacheKey_===ed(t)}getExtension(t){if(t in this.extensionCache_)return this.extensionCache_[t];const e=this.gl_.getExtension(t);return this.extensionCache_[t]=e,e}bindBuffer(t){const e=this.getGL(),i=z(t);let n=this.bufferCache_[i];if(!n){n={buffer:t,webGlBuffer:e.createBuffer()},this.bufferCache_[i]=n}e.bindBuffer(t.getType(),n.webGlBuffer)}flushBufferData(t){const e=this.getGL();this.bindBuffer(t),e.bufferData(t.getType(),t.getArray(),t.getUsage())}deleteBuffer(t){const e=this.getGL(),i=z(t),n=this.bufferCache_[i];n&&!e.isContextLost()&&e.deleteBuffer(n.webGlBuffer),delete this.bufferCache_[i]}disposeInternal(){this.canvas_.removeEventListener(Bu,this.boundHandleWebGLContextLost_),this.canvas_.removeEventListener(Uu,this.boundHandleWebGLContextRestored_),function(t){const e=td[t];if(!e)return;if(e.users-=1,e.users>0)return;const i=hu(e.canvas).getExtension("WEBGL_lose_context");i&&i.loseContext(),delete td[t]}(this.canvasCacheKey_),delete this.gl_,delete this.canvas_}prepareDraw(t,e){const i=this.getGL(),n=this.getCanvas(),r=t.size,s=t.pixelRatio;n.width=r[0]*s,n.height=r[1]*s,n.style.width=r[0]+"px",n.style.height=r[1]+"px";for(let e=this.postProcessPasses_.length-1;e>=0;e--)this.postProcessPasses_[e].init(t);i.bindTexture(i.TEXTURE_2D,null),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.enable(i.BLEND),i.blendFunc(i.ONE,e?i.ZERO:i.ONE_MINUS_SRC_ALPHA)}prepareDrawToRenderTarget(t,e,i){const n=this.getGL(),r=e.getSize();n.bindFramebuffer(n.FRAMEBUFFER,e.getFramebuffer()),n.viewport(0,0,r[0],r[1]),n.bindTexture(n.TEXTURE_2D,e.getTexture()),n.clearColor(0,0,0,0),n.clear(n.COLOR_BUFFER_BIT),n.enable(n.BLEND),n.blendFunc(n.ONE,i?n.ZERO:n.ONE_MINUS_SRC_ALPHA)}drawElements(t,e){const i=this.getGL();this.getExtension("OES_element_index_uint");const n=i.UNSIGNED_INT,r=e-t,s=4*t;i.drawElements(i.TRIANGLES,r,n,s)}finalizeDraw(t,e,i){for(let n=0,r=this.postProcessPasses_.length;n<r;n++)n===r-1?this.postProcessPasses_[n].apply(t,null,e,i):this.postProcessPasses_[n].apply(t,this.postProcessPasses_[n+1])}getCanvas(){return this.canvas_}getGL(){return this.gl_}applyFrameState(t){const e=t.size,i=t.viewState.rotation,n=t.pixelRatio,r=wt(this.offsetScaleMatrix_);Pt(r,2/e[0],2/e[1]);const s=wt(this.offsetRotateMatrix_);0!==i&&Rt(s,-i),this.setUniformMatrixValue(Zu,Vu(this.tmpMat4_,r)),this.setUniformMatrixValue(Yu,Vu(this.tmpMat4_,s)),this.setUniformFloatValue(Ku,.001*(Date.now()-this.startTime_)),this.setUniformFloatValue(qu,t.viewState.zoom),this.setUniformFloatValue(Hu,t.viewState.resolution),this.setUniformFloatValue(Ju,n),this.setUniformFloatVec2($u,[e[0],e[1]])}applyUniforms(t){const e=this.getGL();let i,n=0;this.uniforms_.forEach(function(r){if(i="function"==typeof r.value?r.value(t):r.value,i instanceof HTMLCanvasElement||i instanceof HTMLImageElement||i instanceof ImageData){r.texture||(r.prevValue=void 0,r.texture=e.createTexture()),e.activeTexture(e[`TEXTURE${n}`]),e.bindTexture(e.TEXTURE_2D,r.texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE);(!(i instanceof HTMLImageElement)||i.complete)&&r.prevValue!==i&&(r.prevValue=i,e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,i)),e.uniform1i(this.getUniformLocation(r.name),n++)}else if(Array.isArray(i)&&6===i.length)this.setUniformMatrixValue(r.name,Vu(this.tmpMat4_,i));else if(Array.isArray(i)&&i.length<=4)switch(i.length){case 2:return void e.uniform2f(this.getUniformLocation(r.name),i[0],i[1]);case 3:return void e.uniform3f(this.getUniformLocation(r.name),i[0],i[1],i[2]);case 4:return void e.uniform4f(this.getUniformLocation(r.name),i[0],i[1],i[2],i[3]);default:return}else"number"==typeof i&&e.uniform1f(this.getUniformLocation(r.name),i)}.bind(this))}useProgram(t,e){this.getGL().useProgram(t),this.currentProgram_=t,this.uniformLocations_={},this.attribLocations_={},this.applyFrameState(e),this.applyUniforms(e)}compileShader(t,e){const i=this.getGL(),n=i.createShader(e);return i.shaderSource(n,t),i.compileShader(n),n}getProgram(t,e){const i=this.getGL(),n=this.compileShader(t,i.FRAGMENT_SHADER),r=this.compileShader(e,i.VERTEX_SHADER),s=i.createProgram();if(i.attachShader(s,n),i.attachShader(s,r),i.linkProgram(s),!i.getShaderParameter(n,i.COMPILE_STATUS)){const t=`Fragment shader compliation failed: ${i.getShaderInfoLog(n)}`;throw new Error(t)}if(i.deleteShader(n),!i.getShaderParameter(r,i.COMPILE_STATUS)){const t=`Vertex shader compilation failed: ${i.getShaderInfoLog(r)}`;throw new Error(t)}if(i.deleteShader(r),!i.getProgramParameter(s,i.LINK_STATUS)){const t=`GL program linking failed: ${i.getShaderInfoLog(r)}`;throw new Error(t)}return s}getUniformLocation(t){return void 0===this.uniformLocations_[t]&&(this.uniformLocations_[t]=this.getGL().getUniformLocation(this.currentProgram_,t)),this.uniformLocations_[t]}getAttributeLocation(t){return void 0===this.attribLocations_[t]&&(this.attribLocations_[t]=this.getGL().getAttribLocation(this.currentProgram_,t)),this.attribLocations_[t]}makeProjectionTransform(t,e){const i=t.size,n=t.viewState.rotation,r=t.viewState.resolution,s=t.viewState.center;return wt(e),Mt(e,0,0,2/(r*i[0]),2/(r*i[1]),-n,-s[0],-s[1]),e}setUniformFloatValue(t,e){this.getGL().uniform1f(this.getUniformLocation(t),e)}setUniformFloatVec2(t,e){this.getGL().uniform2fv(this.getUniformLocation(t),e)}setUniformFloatVec4(t,e){this.getGL().uniform4fv(this.getUniformLocation(t),e)}setUniformMatrixValue(t,e){this.getGL().uniformMatrix4fv(this.getUniformLocation(t),!1,e)}enableAttributeArray_(t,e,i,n,r){const s=this.getAttributeLocation(t);s<0||(this.getGL().enableVertexAttribArray(s),this.getGL().vertexAttribPointer(s,e,i,!1,n,r))}enableAttributes(t){const e=rd(t);let i=0;for(let n=0;n<t.length;n++){const r=t[n];this.enableAttributeArray_(r.name,r.size,r.type||au,e,i),i+=r.size*sd(r.type)}}handleWebGLContextLost(){y(this.bufferCache_),this.currentProgram_=null}handleWebGLContextRestored(){}createTexture(t,e,i){const n=this.getGL();i=i||n.createTexture();const r=n.RGBA,s=n.RGBA,o=n.UNSIGNED_BYTE;return n.bindTexture(n.TEXTURE_2D,i),e?n.texImage2D(n.TEXTURE_2D,0,r,s,o,e):n.texImage2D(n.TEXTURE_2D,0,r,t[0],t[1],0,s,o,null),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),i}}function rd(t){let e=0;for(let i=0;i<t.length;i++){const n=t[i];e+=n.size*sd(n.type)}return e}function sd(t){switch(t){case Qu.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Qu.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Qu.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case Qu.FLOAT:default:return Float32Array.BYTES_PER_ELEMENT}}class od{constructor(t,e){this.name=t,this.data=e,this.texture_=null}getTexture(t){if(!this.texture_){const e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this.data.length/4,1,0,t.RGBA,t.UNSIGNED_BYTE,this.data),this.texture_=e}return this.texture_}}const ad=new Uint8Array(4);class ld{constructor(t,e){this.helper_=t;const i=t.getGL();this.texture_=i.createTexture(),this.framebuffer_=i.createFramebuffer(),this.size_=e||[1,1],this.data_=new Uint8Array(0),this.dataCacheDirty_=!0,this.updateSize_()}setSize(t){u(t,this.size_)||(this.size_[0]=t[0],this.size_[1]=t[1],this.updateSize_())}getSize(){return this.size_}clearCachedData(){this.dataCacheDirty_=!0}readAll(){if(this.dataCacheDirty_){const t=this.size_,e=this.helper_.getGL();e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer_),e.readPixels(0,0,t[0],t[1],e.RGBA,e.UNSIGNED_BYTE,this.data_),this.dataCacheDirty_=!1}return this.data_}readPixel(t,e){if(t<0||e<0||t>this.size_[0]||e>=this.size_[1])return ad[0]=0,ad[1]=0,ad[2]=0,ad[3]=0,ad;this.readAll();const i=Math.floor(t)+(this.size_[1]-Math.floor(e)-1)*this.size_[0];return ad[0]=this.data_[4*i],ad[1]=this.data_[4*i+1],ad[2]=this.data_[4*i+2],ad[3]=this.data_[4*i+3],ad}getTexture(){return this.texture_}getFramebuffer(){return this.framebuffer_}updateSize_(){const t=this.size_,e=this.helper_.getGL();this.texture_=this.helper_.createTexture(t,null,this.texture_),e.bindFramebuffer(e.FRAMEBUFFER,this.framebuffer_),e.viewport(0,0,t[0],t[1]),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,this.texture_,0),this.data_=new Uint8Array(t[0]*t[1]*4)}}function hd(t,e,i){const n=i?t.LINEAR:t.NEAREST;t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,n),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,n)}function cd(t,e,i,n,r,s){const o=t.getGL();let a,l;if(i instanceof Float32Array){a=o.FLOAT,t.getExtension("OES_texture_float");l=null!==t.getExtension("OES_texture_float_linear")}else a=o.UNSIGNED_BYTE,l=!0;hd(o,e,s&&l);const h=i.byteLength/n[1];let c,u=1;switch(h%8==0?u=8:h%4==0?u=4:h%2==0&&(u=2),r){case 1:c=o.LUMINANCE;break;case 2:c=o.LUMINANCE_ALPHA;break;case 3:c=o.RGB;break;case 4:c=o.RGBA;break;default:throw new Error(`Unsupported number of bands: ${r}`)}const d=o.getParameter(o.UNPACK_ALIGNMENT);o.pixelStorei(o.UNPACK_ALIGNMENT,u),o.texImage2D(o.TEXTURE_2D,0,c,n[0],n[1],0,c,a,i),o.pixelStorei(o.UNPACK_ALIGNMENT,d)}let ud=null;class dd extends v{constructor(t){super(),this.tile,this.textures=[],this.handleTileChange_=this.handleTileChange_.bind(this),this.renderSize_=Va(t.grid.getTileSize(t.tile.tileCoord[0])),this.gutter_=t.gutter||0,this.bandCount=NaN,this.helper_=t.helper;const e=new Gu(nu,su);e.fromArray([0,1,1,1,1,0,0,0]),this.helper_.flushBufferData(e),this.coords=e,this.setTile(t.tile)}setTile(t){if(t!==this.tile)if(this.tile&&this.tile.removeEventListener(S,this.handleTileChange_),this.tile=t,this.textures.length=0,this.loaded=t.getState()===J,this.loaded)this.uploadTile_();else{if(t instanceof Vr){const e=t.getImage();e instanceof Image&&!e.crossOrigin&&(e.crossOrigin="anonymous")}t.addEventListener(S,this.handleTileChange_)}}uploadTile_(){const t=this.helper_,e=t.getGL(),i=this.tile;if(i instanceof Vr||i instanceof zl){const t=e.createTexture();return this.textures.push(t),this.bandCount=4,void function(t,e,i,n){hd(t,e,n),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,i)}(e,t,i.getImage(),i.interpolate)}const n=i.getSize(),r=[n[0]+2*this.gutter_,n[1]+2*this.gutter_],s=i.getData(),o=s instanceof Float32Array,a=r[0]*r[1],l=o?Float32Array:Uint8Array,h=l.BYTES_PER_ELEMENT,c=s.byteLength/r[1];this.bandCount=Math.floor(c/h/r[0]);const u=Math.ceil(this.bandCount/4);if(1===u){const n=e.createTexture();return this.textures.push(n),void cd(t,n,s,r,this.bandCount,i.interpolate)}const d=new Array(u);for(let t=0;t<u;++t){const i=e.createTexture();this.textures.push(i);const n=t<u-1?4:(this.bandCount-1)%4+1;d[t]=new l(a*n)}let g=0,f=0;const p=r[0]*this.bandCount;for(let t=0;t<r[1];++t){for(let t=0;t<p;++t){const e=s[f+t],i=Math.floor(g/this.bandCount),n=t%this.bandCount,r=d[Math.floor(n/4)];r[i*(r.length/a)+n%4]=e,++g}f+=c/h}for(let e=0;e<u;++e){const n=this.textures[e],s=d[e];cd(t,n,s,r,s.length/a,i.interpolate)}}handleTileChange_(){this.tile.getState()===J&&(this.loaded=!0,this.uploadTile_(),this.dispatchEvent(S))}disposeInternal(){const t=this.helper_.getGL();this.helper_.deleteBuffer(this.coords);for(let e=0;e<this.textures.length;++e)t.deleteTexture(this.textures[e]);this.tile.removeEventListener(S,this.handleTileChange_)}getPixelData(t,e){if(!this.loaded)return null;const i=this.renderSize_[0],n=this.renderSize_[1],r=this.gutter_;if(this.tile instanceof ot){const s=this.tile.getSize(),o=s[0],a=s[1],l=o+2*r,h=a+2*r,c=r+Math.floor(o*(t/i)),u=r+Math.floor(a*(e/n)),d=this.tile.getData();if(d instanceof DataView){const t=d.byteLength/(l*h),e=t*(u*l+c),i=d.buffer.slice(e,e+t);return new DataView(i)}const g=this.bandCount*(u*l+c);return d.slice(g,g+this.bandCount)}ud||function(){const t=document.createElement("canvas");t.width=1,t.height=1,ud=t.getContext("2d")}(),ud.clearRect(0,0,1,1);const s=this.tile.getImage(),o=s.width-2*r,a=s.height-2*r,l=r+Math.floor(o*(t/i)),h=r+Math.floor(a*(e/n));let c;try{ud.drawImage(s,l,h,1,1,0,0,1,1),c=ud.getImageData(0,0,1,1).data}catch(t){return ud=null,null}return c}}class gd extends Cc{constructor(t,e){super(t),e=e||{},this.inversePixelTransform_=[1,0,0,1,0,0],this.pixelContext_=null,this.postProcesses_=e.postProcesses,this.uniforms_=e.uniforms,this.helper,t.addChangeListener(gs,this.removeHelper.bind(this)),this.dispatchPreComposeEvent=this.dispatchPreComposeEvent.bind(this),this.dispatchPostComposeEvent=this.dispatchPostComposeEvent.bind(this)}dispatchPreComposeEvent(t,e){const i=this.getLayer();if(i.hasListener(_s)){const n=new Ts(_s,void 0,e,t);i.dispatchEvent(n)}}dispatchPostComposeEvent(t,e){const i=this.getLayer();if(i.hasListener(ys)){const n=new Ts(ys,void 0,e,t);i.dispatchEvent(n)}}reset(t){this.uniforms_=t.uniforms,this.helper&&this.helper.setUniforms(this.uniforms_)}removeHelper(){this.helper&&(this.helper.dispose(),delete this.helper)}prepareFrame(t){if(this.getLayer().getRenderSource()){let e,i=!0,n=-1;for(let r=0,s=t.layerStatesArray.length;r<s;r++){const s=t.layerStatesArray[r].layer,o=s.getRenderer();if(!(o instanceof gd)){i=!0;continue}const a=s.getClassName();if((i||a!==e)&&(n+=1,i=!1),e=a,o===this)break}const r="map/"+t.mapId+"/group/"+n;this.helper&&this.helper.canvasCacheKeyMatches(r)||(this.removeHelper(),this.helper=new nd({postProcesses:this.postProcesses_,uniforms:this.uniforms_,canvasCacheKey:r}),e&&(this.helper.getCanvas().className=e),this.afterHelperCreated())}return this.prepareFrameInternal(t)}afterHelperCreated(){}prepareFrameInternal(t){return!0}disposeInternal(){this.removeHelper(),super.disposeInternal()}dispatchRenderEvent_(t,e,i){const n=this.getLayer();if(n.hasListener(t)){Mt(this.inversePixelTransform_,0,0,i.pixelRatio,-i.pixelRatio,0,0,-i.size[1]);const r=new Ts(t,this.inversePixelTransform_,i,e);n.dispatchEvent(r)}}preRender(t,e){this.dispatchRenderEvent_(ps,t,e)}postRender(t,e){this.dispatchRenderEvent_(ms,t,e)}}const fd={TILE_TEXTURE_ARRAY:"u_tileTextures",TILE_TRANSFORM:"u_tileTransform",TRANSITION_ALPHA:"u_transitionAlpha",DEPTH:"u_depth",TEXTURE_PIXEL_WIDTH:"u_texturePixelWidth",TEXTURE_PIXEL_HEIGHT:"u_texturePixelHeight",TEXTURE_RESOLUTION:"u_textureResolution",TEXTURE_ORIGIN_X:"u_textureOriginX",TEXTURE_ORIGIN_Y:"u_textureOriginY",RENDER_EXTENT:"u_renderExtent",RESOLUTION:"u_resolution",ZOOM:"u_zoom"},pd={TEXTURE_COORD:"a_textureCoord"},md=[{name:pd.TEXTURE_COORD,size:2,type:Qu.FLOAT}],_d={};function yd(t){return 2*(1-1/(t+1))-1}function xd(t,e,i){i in t||(t[i]=[]),t[i].push(e)}function vd(t,e){const i=t.layerStatesArray[t.layerIndex];i.extent&&(e=ye(e,on(i.extent,t.viewState.projection)));const n=i.layer.getRenderSource();if(!n.getWrapX()){const i=n.getTileGridForProjection(t.viewState.projection).getExtent();i&&(e=ye(e,i))}return e}function Sd(t,e){return`${t.getKey()},${nl(e)}`}class wd extends gd{constructor(t,e){super(t,{uniforms:e.uniforms}),this.renderComplete=!1,this.tileTransform_=[1,0,0,1,0,0],this.tempMat4_=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],this.tempTileRange_=new hl(0,0,0,0),this.tempTileCoord_=el(0,0,0),this.tempSize_=[0,0],this.program_,this.vertexShader_=e.vertexShader,this.fragmentShader_=e.fragmentShader,this.indices_=new Gu(ru,su),this.indices_.fromArray([0,1,3,1,2,3]);const i=void 0!==e.cacheSize?e.cacheSize:512;this.tileTextureCache_=new tl(i),this.paletteTextures_=e.paletteTextures||[],this.frameState_=null,this.projection_=void 0}reset(t){super.reset({uniforms:t.uniforms}),this.vertexShader_=t.vertexShader,this.fragmentShader_=t.fragmentShader,this.paletteTextures_=t.paletteTextures||[],this.helper&&(this.program_=this.helper.getProgram(this.fragmentShader_,this.vertexShader_))}afterHelperCreated(){this.program_=this.helper.getProgram(this.fragmentShader_,this.vertexShader_),this.helper.flushBufferData(this.indices_)}isDrawableTile_(t){const e=this.getLayer(),i=t.getState(),n=e.getUseInterimTilesOnError();return i==J||i==tt||i==Q&&!n}prepareFrameInternal(t){this.projection_?t.viewState.projection!==this.projection_&&(this.clearCache(),this.projection_=t.viewState.projection):this.projection_=t.viewState.projection;const e=this.getLayer().getRenderSource();return!!e&&(!Ee(vd(t,t.extent))&&"ready"===e.getState())}enqueueTiles(t,e,i,n,r){const s=t.viewState,o=this.getLayer(),a=o.getRenderSource(),l=a.getTileGridForProjection(s.projection),h=a.getGutterForProjection(s.projection),c=z(a);c in t.wantedTiles||(t.wantedTiles[c]={});const u=t.wantedTiles[c],d=this.tileTextureCache_,g=o.getMapInternal(),f=Math.max(i-r,l.getMinZoom(),l.getZForResolution(Math.min(o.getMaxResolution(),g?g.getView().getResolutionForZoom(Math.max(o.getMinZoom(),0)):l.getResolution(0)),a.zDirection));for(let r=i;r>=f;--r){const i=l.getTileRangeForExtentAndZ(e,r,this.tempTileRange_),o=l.getResolution(r);for(let e=i.minX;e<=i.maxX;++e)for(let g=i.minY;g<=i.maxY;++g){const i=el(r,e,g,this.tempTileCoord_),f=Sd(a,i);let p,m;if(d.containsKey(f)&&(p=d.get(f),m=p.tile),!p||p.tile.key!==a.getKey())if(m=a.getTile(r,e,g,t.pixelRatio,s.projection),p)if(this.isDrawableTile_(m))p.setTile(m);else{const t=m.getInterimTile();p.setTile(t)}else p=new dd({tile:m,grid:l,helper:this.helper,gutter:h}),d.set(f,p);xd(n,p,r);const _=m.getKey();u[_]=!0,m.getState()===H&&(t.tileQueue.isKeyQueued(_)||t.tileQueue.enqueue([m,c,l.getTileCoordCenter(i),o]))}}}renderFrame(t){this.frameState_=t,this.renderComplete=!0;const e=this.helper.getGL();this.preRender(e,t);const i=t.viewState,n=this.getLayer(),r=n.getRenderSource(),s=r.getTileGridForProjection(i.projection),o=r.getGutterForProjection(i.projection),l=vd(t,t.extent),h=s.getZForResolution(i.resolution,r.zDirection),c={},u=n.getPreload();if(t.nextExtent){const e=s.getZForResolution(i.nextResolution,r.zDirection),n=vd(t,t.nextExtent);this.enqueueTiles(t,n,e,c,u)}this.enqueueTiles(t,l,h,c,0),u>0&&setTimeout((()=>{this.enqueueTiles(t,l,h-1,c,u-1)}),0);const d={},g=z(this),f=t.time;let p=!1;const m=c[h];for(let t=0,e=m.length;t<e;++t){const e=m[t],i=e.tile;if(i instanceof zl&&i.getState()===tt)continue;const n=i.tileCoord;if(e.loaded){const t=i.getAlpha(g,f);if(1===t){i.endTransition(g);continue}p=!0;d[nl(n)]=t}this.renderComplete=!1;if(this.findAltTiles_(s,n,h+1,c))continue;const r=s.getMinZoom();for(let t=h-1;t>=r;--t){if(this.findAltTiles_(s,n,t,c))break}}this.helper.useProgram(this.program_,t),this.helper.prepareDraw(t,!p);const _=Object.keys(c).map(Number).sort(a),y=i.center[0],x=i.center[1];for(let n=0,r=_.length;n<r;++n){const r=_[n],a=s.getResolution(r),h=Va(s.getTileSize(r),this.tempSize_),u=s.getOrigin(r),g=h[0]+2*o,f=h[1]+2*o,p=g/f,m=(y-u[0])/(h[0]*a),v=(u[1]-x)/(h[1]*a),S=i.resolution/a,w=yd(r),E=c[r];for(let n=0,r=E.length;n<r;++n){const r=E[n];if(!r.loaded)continue;const c=r.tile.tileCoord,_=nl(c),y=c[1],x=c[2];wt(this.tileTransform_),Pt(this.tileTransform_,2/(t.size[0]*S/g),-2/(t.size[1]*S/g)),Rt(this.tileTransform_,i.rotation),Pt(this.tileTransform_,1,1/p),Lt(this.tileTransform_,(h[0]*(y-m)-o)/g,(h[1]*(x-v)-o)/f),this.helper.setUniformMatrixValue(fd.TILE_TRANSFORM,Vu(this.tempMat4_,this.tileTransform_)),this.helper.bindBuffer(r.coords),this.helper.bindBuffer(this.indices_),this.helper.enableAttributes(md);let T=0;for(;T<r.textures.length;){const t="TEXTURE"+T,i=`${fd.TILE_TEXTURE_ARRAY}[${T}]`;e.activeTexture(e[t]),e.bindTexture(e.TEXTURE_2D,r.textures[T]),e.uniform1i(this.helper.getUniformLocation(i),T),++T}for(let t=0;t<this.paletteTextures_.length;++t){const i=this.paletteTextures_[t];e.activeTexture(e["TEXTURE"+T]);const n=i.getTexture(e);e.bindTexture(e.TEXTURE_2D,n),e.uniform1i(this.helper.getUniformLocation(i.name),T),++T}const C=_ in d?d[_]:1;C<1&&(t.animate=!0),this.helper.setUniformFloatValue(fd.TRANSITION_ALPHA,C),this.helper.setUniformFloatValue(fd.DEPTH,w),this.helper.setUniformFloatValue(fd.TEXTURE_PIXEL_WIDTH,g),this.helper.setUniformFloatValue(fd.TEXTURE_PIXEL_HEIGHT,f),this.helper.setUniformFloatValue(fd.TEXTURE_RESOLUTION,a),this.helper.setUniformFloatValue(fd.TEXTURE_ORIGIN_X,u[0]+y*h[0]*a-o*a),this.helper.setUniformFloatValue(fd.TEXTURE_ORIGIN_Y,u[1]-x*h[1]*a+o*a);let b=l;o>0&&(b=s.getTileCoordExtent(c),ye(b,l,b)),this.helper.setUniformFloatVec4(fd.RENDER_EXTENT,b),this.helper.setUniformFloatValue(fd.RESOLUTION,i.resolution),this.helper.setUniformFloatValue(fd.ZOOM,i.zoom),this.helper.drawElements(0,this.indices_.getSize())}}this.helper.finalizeDraw(t,this.dispatchPreComposeEvent,this.dispatchPostComposeEvent);const v=this.helper.getCanvas(),S=this.tileTextureCache_;for(;S.canExpireCache();){S.pop().dispose()}return t.postRenderFunctions.push((function(t,e){r.updateCacheSize(.1,e.viewState.projection),r.expireCache(e.viewState.projection,_d)})),this.postRender(e,t),v}getData(t){if(!this.helper.getGL())return null;const e=this.frameState_;if(!e)return null;const i=this.getLayer(),n=bt(e.pixelToCoordinateTransform,t.slice()),r=e.viewState,s=i.getExtent();if(s&&!Zt(on(s,r.projection),n))return null;const o=i.getSources(zt([n]),r.resolution);let a,l,h;for(a=o.length-1;a>=0;--a)if(l=o[a],"ready"===l.getState()){if(h=l.getTileGridForProjection(r.projection),l.getWrapX())break;const t=h.getExtent();if(!t||Zt(t,n))break}if(a<0)return null;const c=this.tileTextureCache_;for(let t=h.getZForResolution(r.resolution);t>=h.getMinZoom();--t){const e=h.getTileCoordForCoordAndZ(n,t),i=Sd(l,e);if(!c.containsKey(i))continue;const r=c.get(i),s=r.tile;if(s instanceof zl&&s.getState()===tt)return null;if(!r.loaded)continue;const o=h.getOrigin(t),a=Va(h.getTileSize(t)),u=h.getResolution(t),d=(n[0]-o[0])/u-e[1]*a[0],g=(o[1]-n[1])/u-e[2]*a[1];return r.getPixelData(d,g)}return null}findAltTiles_(t,e,i,n){const r=t.getTileRangeForTileCoordAndZ(e,i,this.tempTileRange_);if(!r)return!1;let s=!0;const o=this.tileTextureCache_,a=this.getLayer().getRenderSource();for(let t=r.minX;t<=r.maxX;++t)for(let e=r.minY;e<=r.maxY;++e){const r=Sd(a,[i,t,e]);let l=!1;if(o.containsKey(r)){const t=o.get(r);t.loaded&&(xd(n,t,i),l=!0)}l||(s=!1)}return s}clearCache(){const t=this.tileTextureCache_;t.forEach((t=>t.dispose())),t.clear()}removeHelper(){this.helper&&this.clearCache(),super.removeHelper()}disposeInternal(){const t=this.helper;if(t){t.getGL().deleteProgram(this.program_),delete this.program_,t.deleteBuffer(this.indices_)}super.disposeInternal(),delete this.indices_,delete this.tileTextureCache_,delete this.frameState_}}const Ed=1,Td=2,Cd=4,bd=8,Rd=16,Pd=31,Id=0,Ld={};function Md(t){if("number"==typeof t)return Ed;if("boolean"==typeof t)return bd;if("string"==typeof t)return ts(t)?Cd|Td:Td;if(!Array.isArray(t))throw new Error(`Unhandled value type: ${JSON.stringify(t)}`);const e=t;if(e.every((function(t){return"number"==typeof t})))return 3===e.length||4===e.length?Cd|Rd:Rd;if("string"!=typeof e[0])throw new Error(`Expected an expression operator but received: ${JSON.stringify(e)}`);const i=Ld[e[0]];if(void 0===i)throw new Error(`Unrecognized expression operator: ${JSON.stringify(e)}`);return i.getReturnType(e.slice(1))}function Fd(t){return Math.log2(t)%1==0}function Ad(t){const e=t.toString();return e.includes(".")?e:e+".0"}function Od(t){if(t.length<2||t.length>4)throw new Error("`formatArray` can only output `vec2`, `vec3` or `vec4` arrays.");return`vec${t.length}(${t.map(Ad).join(", ")})`}function Nd(t){const e=$r(t).slice();return e.length<4&&e.push(1),Od(e.map((function(t,e){return e<3?t/255:t})))}function Dd(t,e){return void 0===t.stringLiteralsMap[e]&&(t.stringLiteralsMap[e]=Object.keys(t.stringLiteralsMap).length),t.stringLiteralsMap[e]}function kd(t,e){return Ad(Dd(t,e))}function Gd(t,e,i){if(Array.isArray(e)&&"string"==typeof e[0]){const n=Ld[e[0]];if(void 0===n)throw new Error(`Unrecognized expression operator: ${JSON.stringify(e)}`);return n.toGlsl(t,e.slice(1),i)}const n=Md(e);if((n&Ed)>0)return Ad(e);if((n&bd)>0)return e.toString();if((n&Td)>0&&(void 0===i||i==Td))return kd(t,e.toString());if((n&Cd)>0&&(void 0===i||i==Cd))return Nd(e);if((n&Rd)>0)return Od(e);throw new Error(`Unexpected expression ${e} (expected type ${i})`)}function jd(t){if(!(Md(t)&Ed))throw new Error(`A numeric value was expected, got ${JSON.stringify(t)} instead`)}function Bd(t){for(let e=0;e<t.length;e++)jd(t[e])}function Ud(t){if(!(Md(t)&Td))throw new Error(`A string value was expected, got ${JSON.stringify(t)} instead`)}function zd(t){if(!(Md(t)&bd))throw new Error(`A boolean value was expected, got ${JSON.stringify(t)} instead`)}function Xd(t,e){if(t.length!==e)throw new Error(`Exactly ${e} arguments were expected, got ${t.length} instead`)}function Vd(t,e){if(t.length<e)throw new Error(`At least ${e} arguments were expected, got ${t.length} instead`)}function Wd(t,e){if(t.length>e)throw new Error(`At most ${e} arguments were expected, got ${t.length} instead`)}function Zd(t){if(t.length%2!=0)throw new Error(`An even amount of arguments was expected, got ${t} instead`)}function Yd(t,e){if(!Fd(e))throw new Error(`Could not infer only one type from the following expression: ${JSON.stringify(t)}`)}function Kd(t){return"u_var_"+t}Ld.get={getReturnType:function(t){return Pd},toGlsl:function(t,e){Xd(e,1),Ud(e[0]);const i=e[0].toString();t.attributes.includes(i)||t.attributes.push(i);return(t.inFragmentShader?"v_":"a_")+i}},Ld.var={getReturnType:function(t){return Pd},toGlsl:function(t,e){Xd(e,1),Ud(e[0]);const i=e[0].toString();return t.variables.includes(i)||t.variables.push(i),Kd(i)}};const qd="u_paletteTextures";Ld.palette={getReturnType:function(t){return Cd},toGlsl:function(t,e){Xd(e,2),jd(e[0]);const i=Gd(t,e[0]),n=e[1];if(!Array.isArray(n))throw new Error("The second argument of palette must be an array");const r=n.length,s=new Uint8Array(4*r);for(let t=0;t<r;t++){const e=n[t];let i;if("string"==typeof e)i=Hr(e);else{if(!Array.isArray(e))throw new Error("The second argument of palette must be an array of strings or colors");const t=e.length;if(4===t)i=e;else{if(3!==t)throw new Error(`Expected palette color to have 3 or 4 values, got ${t}`);i=[e[0],e[1],e[2],1]}}const r=4*t;s[r]=i[0],s[r+1]=i[1],s[r+2]=i[2],s[r+3]=255*i[3]}t.paletteTextures||(t.paletteTextures=[]);const o=`u_paletteTextures[${t.paletteTextures.length}]`,a=new od(o,s);return t.paletteTextures.push(a),`texture2D(${o}, vec2((${i} + 0.5) / ${r}.0, 0.5))`}};const Hd="getBandValue";function $d(t){return{getReturnType:function(t){return bd},toGlsl:function(e,i){Xd(i,2);let n=Pd;for(let t=0;t<i.length;t++)n&=Md(i[t]);if(n===Id)throw new Error(`All arguments should be of compatible type, got ${JSON.stringify(i)} instead`);return n&=~Cd,`(${Gd(e,i[0],n)} ${t} ${Gd(e,i[1],n)})`}}}function Jd(t){return{getReturnType:function(t){return bd},toGlsl:function(e,i){Vd(i,2);for(let t=0;t<i.length;t++)zd(i[t]);let n="";return n=i.map((t=>Gd(e,t))).join(` ${t} `),n=`(${n})`,n}}}Ld.band={getReturnType:function(t){return Ed},toGlsl:function(t,e){Vd(e,1),Wd(e,3);const i=e[0];if(!(Hd in t.functions)){let e="";const i=t.bandCount||1;for(let t=0;t<i;t++){const n=Math.floor(t/4);let r=t%4;t===i-1&&1===r&&(r=3);e+=`\n if (band == ${t+1}.0) {\n return texture2D(${`${fd.TILE_TEXTURE_ARRAY}[${n}]`}, v_textureCoord + vec2(dx, dy))[${r}];\n }\n `}t.functions.getBandValue=`\n float getBandValue(float band, float xOffset, float yOffset) {\n float dx = xOffset / ${fd.TEXTURE_PIXEL_WIDTH};\n float dy = yOffset / ${fd.TEXTURE_PIXEL_HEIGHT};\n ${e}\n }\n `}return`getBandValue(${Gd(t,i)}, ${Gd(t,e[1]||0)}, ${Gd(t,e[2]||0)})`}},Ld.time={getReturnType:function(t){return Ed},toGlsl:function(t,e){return Xd(e,0),"u_time"}},Ld.zoom={getReturnType:function(t){return Ed},toGlsl:function(t,e){return Xd(e,0),"u_zoom"}},Ld.resolution={getReturnType:function(t){return Ed},toGlsl:function(t,e){return Xd(e,0),"u_resolution"}},Ld["*"]={getReturnType:function(t){return Ed},toGlsl:function(t,e){return Xd(e,2),Bd(e),`(${Gd(t,e[0])} * ${Gd(t,e[1])})`}},Ld["/"]={getReturnType:function(t){return Ed},toGlsl:function(t,e){return Xd(e,2),Bd(e),`(${Gd(t,e[0])} / ${Gd(t,e[1])})`}},Ld["+"]={getReturnType:function(t){return Ed},toGlsl:function(t,e){return Xd(e,2),Bd(e),`(${Gd(t,e[0])} + ${Gd(t,e[1])})`}},Ld["-"]={getReturnType:function(t){return Ed},toGlsl:function(t,e){return Xd(e,2),Bd(e),`(${Gd(t,e[0])} - ${Gd(t,e[1])})`}},Ld.clamp={getReturnType:function(t){return Ed},toGlsl:function(t,e){Xd(e,3),Bd(e);const i=Gd(t,e[1]),n=Gd(t,e[2]);return`clamp(${Gd(t,e[0])}, ${i}, ${n})`}},Ld["%"]={getReturnType:function(t){return Ed},toGlsl:function(t,e){return Xd(e,2),Bd(e),`mod(${Gd(t,e[0])}, ${Gd(t,e[1])})`}},Ld["^"]={getReturnType:function(t){return Ed},toGlsl:function(t,e){return Xd(e,2),Bd(e),`pow(${Gd(t,e[0])}, ${Gd(t,e[1])})`}},Ld.abs={getReturnType:function(t){return Ed},toGlsl:function(t,e){return Xd(e,1),Bd(e),`abs(${Gd(t,e[0])})`}},Ld.floor={getReturnType:function(t){return Ed},toGlsl:function(t,e){return Xd(e,1),Bd(e),`floor(${Gd(t,e[0])})`}},Ld.round={getReturnType:function(t){return Ed},toGlsl:function(t,e){return Xd(e,1),Bd(e),`floor(${Gd(t,e[0])} + 0.5)`}},Ld.ceil={getReturnType:function(t){return Ed},toGlsl:function(t,e){return Xd(e,1),Bd(e),`ceil(${Gd(t,e[0])})`}},Ld.sin={getReturnType:function(t){return Ed},toGlsl:function(t,e){return Xd(e,1),Bd(e),`sin(${Gd(t,e[0])})`}},Ld.cos={getReturnType:function(t){return Ed},toGlsl:function(t,e){return Xd(e,1),Bd(e),`cos(${Gd(t,e[0])})`}},Ld.atan={getReturnType:function(t){return Ed},toGlsl:function(t,e){return Vd(e,1),Wd(e,2),Bd(e),2===e.length?`atan(${Gd(t,e[0])}, ${Gd(t,e[1])})`:`atan(${Gd(t,e[0])})`}},Ld[">"]={getReturnType:function(t){return bd},toGlsl:function(t,e){return Xd(e,2),Bd(e),`(${Gd(t,e[0])} > ${Gd(t,e[1])})`}},Ld[">="]={getReturnType:function(t){return bd},toGlsl:function(t,e){return Xd(e,2),Bd(e),`(${Gd(t,e[0])} >= ${Gd(t,e[1])})`}},Ld["<"]={getReturnType:function(t){return bd},toGlsl:function(t,e){return Xd(e,2),Bd(e),`(${Gd(t,e[0])} < ${Gd(t,e[1])})`}},Ld["<="]={getReturnType:function(t){return bd},toGlsl:function(t,e){return Xd(e,2),Bd(e),`(${Gd(t,e[0])} <= ${Gd(t,e[1])})`}},Ld["=="]=$d("=="),Ld["!="]=$d("!="),Ld["!"]={getReturnType:function(t){return bd},toGlsl:function(t,e){return Xd(e,1),zd(e[0]),`(!${Gd(t,e[0])})`}},Ld.all=Jd("&&"),Ld.any=Jd("||"),Ld.between={getReturnType:function(t){return bd},toGlsl:function(t,e){Xd(e,3),Bd(e);const i=Gd(t,e[1]),n=Gd(t,e[2]),r=Gd(t,e[0]);return`(${r} >= ${i} && ${r} <= ${n})`}},Ld.array={getReturnType:function(t){return Rd},toGlsl:function(t,e){Vd(e,2),Wd(e,4),Bd(e);const i=e.map((function(e){return Gd(t,e,Ed)}));return`vec${e.length}(${i.join(", ")})`}},Ld.color={getReturnType:function(t){return Cd},toGlsl:function(t,e){Vd(e,3),Wd(e,4),Bd(e);const i=e;3===e.length&&i.push(1);const n=e.map((function(e,i){return Gd(t,e,Ed)+(i<3?" / 255.0":"")}));return`vec${e.length}(${n.join(", ")})`}},Ld.interpolate={getReturnType:function(t){let e=Cd|Ed;for(let i=3;i<t.length;i+=2)e&=Md(t[i]);return e},toGlsl:function(t,e,i){Zd(e),Vd(e,6);const n=e[0];let r;switch(n[0]){case"linear":r=1;break;case"exponential":r=n[1];break;default:r=null}if(!r)throw new Error(`Invalid interpolation type for "interpolate" operator, received: ${JSON.stringify(n)}`);i=void 0!==i?i:Pd;const s=Ld.interpolate.getReturnType(e)&i;Yd(e,s);const o=Gd(t,e[1]),a=Ad(r);let l="";for(let i=2;i<e.length-2;i+=2){const n=Gd(t,e[i]),r=l||Gd(t,e[i+1],s),h=Gd(t,e[i+2]);l=`mix(${r}, ${Gd(t,e[i+3],s)}, pow(clamp((${o} - ${n}) / (${h} - ${n}), 0.0, 1.0), ${a}))`}return l}},Ld.match={getReturnType:function(t){let e=Pd;for(let i=2;i<t.length;i+=2)e&=Md(t[i]);return e&=Md(t[t.length-1]),e},toGlsl:function(t,e,i){Zd(e),Vd(e,4),i=void 0!==i?i:Pd;const n=Ld.match.getReturnType(e)&i;Yd(e,n);const r=Gd(t,e[0]),s=Gd(t,e[e.length-1],n);let o=null;for(let i=e.length-3;i>=1;i-=2){o=`(${r} == ${Gd(t,e[i])} ? ${Gd(t,e[i+1],n)} : ${o||s})`}return o}},Ld.case={getReturnType:function(t){let e=Pd;for(let i=1;i<t.length;i+=2)e&=Md(t[i]);return e&=Md(t[t.length-1]),e},toGlsl:function(t,e,i){!function(t){if(t.length%2==0)throw new Error(`An odd amount of arguments was expected, got ${t} instead`)}(e),Vd(e,3),i=void 0!==i?i:Pd;const n=Ld.case.getReturnType(e)&i;Yd(e,n);for(let t=0;t<e.length-1;t+=2)zd(e[t]);const r=Gd(t,e[e.length-1],n);let s=null;for(let i=e.length-3;i>=0;i-=2){s=`(${Gd(t,e[i])} ? ${Gd(t,e[i+1],n)} : ${s||r})`}return s}};class Qd{constructor(){this.uniforms=[],this.attributes=[],this.varyings=[],this.sizeExpression="vec2(1.0)",this.rotationExpression="0.0",this.offsetExpression="vec2(0.0)",this.colorExpression="vec4(1.0)",this.texCoordExpression="vec4(0.0, 0.0, 1.0, 1.0)",this.discardExpression="false",this.rotateWithView=!1}addUniform(t){return this.uniforms.push(t),this}addAttribute(t){return this.attributes.push(t),this}addVarying(t,e,i){return this.varyings.push({name:t,type:e,expression:i}),this}setSizeExpression(t){return this.sizeExpression=t,this}setRotationExpression(t){return this.rotationExpression=t,this}setSymbolOffsetExpression(t){return this.offsetExpression=t,this}setColorExpression(t){return this.colorExpression=t,this}setTextureCoordinateExpression(t){return this.texCoordExpression=t,this}setFragmentDiscardExpression(t){return this.discardExpression=t,this}setSymbolRotateWithView(t){return this.rotateWithView=t,this}getSizeExpression(){return this.sizeExpression}getOffsetExpression(){return this.offsetExpression}getColorExpression(){return this.colorExpression}getTextureCoordinateExpression(){return this.texCoordExpression}getFragmentDiscardExpression(){return this.discardExpression}getSymbolVertexShader(t){const e=this.rotateWithView?"u_offsetScaleMatrix * u_offsetRotateMatrix":"u_offsetScaleMatrix";let i=this.attributes,n=this.varyings;return t&&(i=i.concat("vec4 a_hitColor"),n=n.concat({name:"v_hitColor",type:"vec4",expression:"a_hitColor"})),`precision mediump float;\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_offsetScaleMatrix;\nuniform mat4 u_offsetRotateMatrix;\nuniform float u_time;\nuniform float u_zoom;\nuniform float u_resolution;\n${this.uniforms.map((function(t){return"uniform "+t+";"})).join("\n")}\nattribute vec2 a_position;\nattribute float a_index;\n${i.map((function(t){return"attribute "+t+";"})).join("\n")}\nvarying vec2 v_texCoord;\nvarying vec2 v_quadCoord;\n${n.map((function(t){return"varying "+t.type+" "+t.name+";"})).join("\n")}\nvoid main(void) {\n mat4 offsetMatrix = ${e};\n vec2 halfSize = ${this.sizeExpression} * 0.5;\n vec2 offset = ${this.offsetExpression};\n float angle = ${this.rotationExpression};\n float offsetX;\n float offsetY;\n if (a_index == 0.0) {\n offsetX = (offset.x - halfSize.x) * cos(angle) + (offset.y - halfSize.y) * sin(angle);\n offsetY = (offset.y - halfSize.y) * cos(angle) - (offset.x - halfSize.x) * sin(angle);\n } else if (a_index == 1.0) {\n offsetX = (offset.x + halfSize.x) * cos(angle) + (offset.y - halfSize.y) * sin(angle);\n offsetY = (offset.y - halfSize.y) * cos(angle) - (offset.x + halfSize.x) * sin(angle);\n } else if (a_index == 2.0) {\n offsetX = (offset.x + halfSize.x) * cos(angle) + (offset.y + halfSize.y) * sin(angle);\n offsetY = (offset.y + halfSize.y) * cos(angle) - (offset.x + halfSize.x) * sin(angle);\n } else {\n offsetX = (offset.x - halfSize.x) * cos(angle) + (offset.y + halfSize.y) * sin(angle);\n offsetY = (offset.y + halfSize.y) * cos(angle) - (offset.x - halfSize.x) * sin(angle);\n }\n vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n vec4 texCoord = ${this.texCoordExpression};\n float u = a_index == 0.0 || a_index == 3.0 ? texCoord.s : texCoord.p;\n float v = a_index == 2.0 || a_index == 3.0 ? texCoord.t : texCoord.q;\n v_texCoord = vec2(u, v);\n u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;\n v = a_index == 2.0 || a_index == 3.0 ? 0.0 : 1.0;\n v_quadCoord = vec2(u, v);\n${n.map((function(t){return" "+t.name+" = "+t.expression+";"})).join("\n")}\n}`}getSymbolFragmentShader(t){const e=t?" if (gl_FragColor.a < 0.1) { discard; } gl_FragColor = v_hitColor;":"";let i=this.varyings;return t&&(i=i.concat({name:"v_hitColor",type:"vec4",expression:"a_hitColor"})),`precision mediump float;\nuniform float u_time;\nuniform float u_zoom;\nuniform float u_resolution;\n${this.uniforms.map((function(t){return"uniform "+t+";"})).join("\n")}\nvarying vec2 v_texCoord;\nvarying vec2 v_quadCoord;\n${i.map((function(t){return"varying "+t.type+" "+t.name+";"})).join("\n")}\nvoid main(void) {\n if (${this.discardExpression}) { discard; }\n gl_FragColor = ${this.colorExpression};\n gl_FragColor.rgb *= gl_FragColor.a;\n${e}\n}`}}function tg(t){const e=t.symbol,i=void 0!==e.size?e.size:1,n=e.color||"white",r=e.textureCoord||[0,0,1,1],s=e.offset||[0,0],o=void 0!==e.opacity?e.opacity:1,a=void 0!==e.rotation?e.rotation:0,l={inFragmentShader:!1,variables:[],attributes:[],stringLiteralsMap:{},functions:{}},h=Gd(l,i,Rd|Ed),c=Gd(l,s,Rd),u=Gd(l,r,Rd),d=Gd(l,a,Ed),g={inFragmentShader:!0,variables:l.variables,attributes:[],stringLiteralsMap:l.stringLiteralsMap,functions:{}},f=Gd(g,n,Cd),p=Gd(g,o,Ed);let m="1.0";const _=`vec2(${Gd(g,i,Rd|Ed)}).x`;switch(e.symbolType){case"square":case"image":break;case"circle":m=`(1.0-smoothstep(1.-4./${_},1.,dot(v_quadCoord-.5,v_quadCoord-.5)*4.))`;break;case"triangle":const t="(v_quadCoord*2.-1.)",i=`(atan(${t}.x,${t}.y))`;m=`(1.0-smoothstep(.5-3./${_},.5,cos(floor(.5+${i}/2.094395102)*2.094395102-${i})*length(${t})))`;break;default:throw new Error("Unexpected symbol type: "+e.symbolType)}const y=(new Qd).setSizeExpression(`vec2(${h})`).setRotationExpression(d).setSymbolOffsetExpression(c).setTextureCoordinateExpression(u).setSymbolRotateWithView(!!e.rotateWithView).setColorExpression(`vec4(${f}.rgb, ${f}.a * ${p} * ${m})`);if(t.filter){const e=Gd(g,t.filter,bd);y.setFragmentDiscardExpression(`!${e}`)}const x={};if(g.variables.forEach((function(e){const i=Kd(e);y.addUniform(`float ${i}`),x[i]=function(){if(!t.variables||void 0===t.variables[e])throw new Error(`The following variable is missing from the style: ${e}`);let i=t.variables[e];return"string"==typeof i&&(i=Dd(l,i)),void 0!==i?i:-9999999}})),"image"===e.symbolType&&e.src){const t=new Image;t.crossOrigin=void 0===e.crossOrigin?"anonymous":e.crossOrigin,t.src=e.src,y.addUniform("sampler2D u_texture").setColorExpression(y.getColorExpression()+" * texture2D(u_texture, v_texCoord)"),x.u_texture=t}return g.attributes.forEach((function(t){l.attributes.includes(t)||l.attributes.push(t),y.addVarying(`v_${t}`,"float",`a_${t}`)})),l.attributes.forEach((function(t){y.addAttribute(`float a_${t}`)})),{builder:y,attributes:l.attributes.map((function(t){return{name:t,callback:function(e,i){let n=i[t];return"string"==typeof n&&(n=Dd(l,n)),void 0!==n?n:-9999999}}})),uniforms:x}}class eg{constructor(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=Va(t.scale),this.displacement_=t.displacement,this.declutterMode_=t.declutterMode}clone(){const t=this.getScale();return new eg({opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getOpacity(){return this.opacity_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getDisplacement(){return this.displacement_}getDeclutterMode(){return this.declutterMode_}getAnchor(){return B()}getImage(t){return B()}getHitDetectionImage(){return B()}getPixelRatio(t){return 1}getImageState(){return B()}getImageSize(){return B()}getOrigin(){return B()}getSize(){return B()}setDisplacement(t){this.displacement_=t}setOpacity(t){this.opacity_=t}setRotateWithView(t){this.rotateWithView_=t}setRotation(t){this.rotation_=t}setScale(t){this.scale_=t,this.scaleArray_=Va(t)}listenImageChange(t){B()}load(){B()}unlistenImageChange(t){B()}}class ig extends eg{constructor(t){super({opacity:1,rotateWithView:void 0!==t.rotateWithView&&t.rotateWithView,rotation:void 0!==t.rotation?t.rotation:0,scale:void 0!==t.scale?t.scale:1,displacement:void 0!==t.displacement?t.displacement:[0,0],declutterMode:t.declutterMode}),this.canvas_=void 0,this.hitDetectionCanvas_=null,this.fill_=void 0!==t.fill?t.fill:null,this.origin_=[0,0],this.points_=t.points,this.radius_=void 0!==t.radius?t.radius:t.radius1,this.radius2_=t.radius2,this.angle_=void 0!==t.angle?t.angle:0,this.stroke_=void 0!==t.stroke?t.stroke:null,this.size_=null,this.renderOptions_=null,this.render()}clone(){const t=this.getScale(),e=new ig({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return e.setOpacity(this.getOpacity()),e}getAnchor(){const t=this.size_;if(!t)return null;const e=this.getDisplacement(),i=this.getScaleArray();return[t[0]/2-e[0]/i[0],t[1]/2+e[1]/i[1]]}getAngle(){return this.angle_}getFill(){return this.fill_}setFill(t){this.fill_=t,this.render()}getHitDetectionImage(){return this.hitDetectionCanvas_||this.createHitDetectionCanvas_(this.renderOptions_),this.hitDetectionCanvas_}getImage(t){let e=this.canvas_[t];if(!e){const i=this.renderOptions_,n=Dr(i.size*t,i.size*t);this.draw_(i,n,t),e=n.canvas,this.canvas_[t]=e}return e}getPixelRatio(t){return t}getImageSize(){return this.size_}getImageState(){return Lr}getOrigin(){return this.origin_}getPoints(){return this.points_}getRadius(){return this.radius_}getRadius2(){return this.radius2_}getSize(){return this.size_}getStroke(){return this.stroke_}setStroke(t){this.stroke_=t,this.render()}listenImageChange(t){}load(){}unlistenImageChange(t){}calculateLineJoinSize_(t,e,i){if(0===e||this.points_===1/0||"bevel"!==t&&"miter"!==t)return e;let n=this.radius_,r=void 0===this.radius2_?n:this.radius2_;if(n<r){const t=n;n=r,r=t}const s=void 0===this.radius2_?this.points_:2*this.points_,o=2*Math.PI/s,a=r*Math.sin(o),l=n-Math.sqrt(r*r-a*a),h=Math.sqrt(a*a+l*l),c=h/a;if("miter"===t&&c<=i)return c*e;const u=e/2/c,d=e/2*(l/h),g=Math.sqrt((n+u)*(n+u)+d*d)-n;if(void 0===this.radius2_||"bevel"===t)return 2*g;const f=n*Math.sin(o),p=r-Math.sqrt(n*n-f*f),m=Math.sqrt(f*f+p*p)/f;if(m<=i){const t=m*e/2-r-n;return 2*Math.max(g,t)}return 2*g}createRenderOptions(){let t,e=Gs,i=0,n=null,r=0,s=0;this.stroke_&&(t=this.stroke_.getColor(),null===t&&(t=Bs),t=fl(t),s=this.stroke_.getWidth(),void 0===s&&(s=1),n=this.stroke_.getLineDash(),r=this.stroke_.getLineDashOffset(),e=this.stroke_.getLineJoin(),void 0===e&&(e=Gs),i=this.stroke_.getMiterLimit(),void 0===i&&(i=js));const o=this.calculateLineJoinSize_(e,s,i),a=Math.max(this.radius_,this.radius2_||0);return{strokeStyle:t,strokeWidth:s,size:Math.ceil(2*a+o),lineDash:n,lineDashOffset:r,lineJoin:e,miterLimit:i}}render(){this.renderOptions_=this.createRenderOptions();const t=this.renderOptions_.size;this.canvas_={},this.size_=[t,t]}draw_(t,e,i){if(e.scale(i,i),e.translate(t.size/2,t.size/2),this.createPath_(e),this.fill_){let t=this.fill_.getColor();null===t&&(t=Ns),e.fillStyle=fl(t),e.fill()}this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())}createHitDetectionCanvas_(t){if(this.fill_){let e=this.fill_.getColor(),i=0;if("string"==typeof e&&(e=$r(e)),null===e?i=1:Array.isArray(e)&&(i=4===e.length?e[3]:1),0===i){const e=Dr(t.size,t.size);this.hitDetectionCanvas_=e.canvas,this.drawHitDetectionCanvas_(t,e)}}this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.getImage(1))}createPath_(t){let e=this.points_;const i=this.radius_;if(e===1/0)t.arc(0,0,i,0,2*Math.PI);else{const n=void 0===this.radius2_?i:this.radius2_;void 0!==this.radius2_&&(e*=2);const r=this.angle_-Math.PI/2,s=2*Math.PI/e;for(let o=0;o<e;o++){const e=r+o*s,a=o%2==0?i:n;t.lineTo(a*Math.cos(e),a*Math.sin(e))}t.closePath()}}drawHitDetectionCanvas_(t,e){e.translate(t.size/2,t.size/2),this.createPath_(e),e.fillStyle=Ns,e.fill(),this.stroke_&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())}}class ng extends ig{constructor(t){super({points:1/0,fill:(t=t||{radius:5}).fill,radius:t.radius,stroke:t.stroke,scale:void 0!==t.scale?t.scale:1,rotation:void 0!==t.rotation?t.rotation:0,rotateWithView:void 0!==t.rotateWithView&&t.rotateWithView,displacement:void 0!==t.displacement?t.displacement:[0,0],declutterMode:t.declutterMode})}clone(){const t=this.getScale(),e=new ng({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return e.setOpacity(this.getOpacity()),e}setRadius(t){this.radius_=t,this.render()}}class rg{constructor(t){t=t||{},this.color_=void 0!==t.color?t.color:null}clone(){const t=this.getColor();return new rg({color:Array.isArray(t)?t.slice():t||void 0})}getColor(){return this.color_}setColor(t){this.color_=t}}let sg=null;class og extends v{constructor(t,e,i,n,r,s){super(),this.hitDetectionImage_=null,this.image_=t,this.crossOrigin_=n,this.canvas_={},this.color_=s,this.unlisten_=null,this.imageState_=r,this.size_=i,this.src_=e,this.tainted_}initializeImage_(){this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)}isTainted_(){if(void 0===this.tainted_&&this.imageState_===Lr){sg||(sg=Dr(1,1)),sg.drawImage(this.image_,0,0);try{sg.getImageData(0,0,1,1),this.tainted_=!1}catch(t){sg=null,this.tainted_=!0}}return!0===this.tainted_}dispatchChangeEvent_(){this.dispatchEvent(S)}handleImageError_(){this.imageState_=Mr,this.unlistenImage_(),this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=Lr,this.size_?(this.image_.width=this.size_[0],this.image_.height=this.size_[1]):this.size_=[this.image_.width,this.image_.height],this.unlistenImage_(),this.dispatchChangeEvent_()}getImage(t){return this.image_||this.initializeImage_(),this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_}getPixelRatio(t){return this.replaceColor_(t),this.canvas_[t]?t:1}getImageState(){return this.imageState_}getHitDetectionImage(){if(this.image_||this.initializeImage_(),!this.hitDetectionImage_)if(this.isTainted_()){const t=this.size_[0],e=this.size_[1],i=Dr(t,e);i.fillRect(0,0,t,e),this.hitDetectionImage_=i.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_===Pr){this.image_||this.initializeImage_(),this.imageState_=Ir;try{this.image_.src=this.src_}catch(t){this.handleImageError_()}this.unlisten_=Or(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this))}}replaceColor_(t){if(!this.color_||this.canvas_[t]||this.imageState_!==Lr)return;const e=this.image_,i=document.createElement("canvas");i.width=Math.ceil(e.width*t),i.height=Math.ceil(e.height*t);const n=i.getContext("2d");n.scale(t,t),n.drawImage(e,0,0),n.globalCompositeOperation="multiply",n.fillStyle=Kr(this.color_),n.fillRect(0,0,i.width/t,i.height/t),n.globalCompositeOperation="destination-in",n.drawImage(e,0,0),this.canvas_[t]=i}unlistenImage_(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}}function ag(t,e,i,n,r,s){let o=ns.get(e,n,s);return o||(o=new og(t,e,i,n,r,s),ns.set(e,n,s,o)),o}class lg extends eg{constructor(t){const e=void 0!==(t=t||{}).opacity?t.opacity:1,i=void 0!==t.rotation?t.rotation:0,n=void 0!==t.scale?t.scale:1,r=void 0!==t.rotateWithView&&t.rotateWithView;super({opacity:e,rotation:i,scale:n,displacement:void 0!==t.displacement?t.displacement:[0,0],rotateWithView:r,declutterMode:t.declutterMode}),this.anchor_=void 0!==t.anchor?t.anchor:[.5,.5],this.normalizedAnchor_=null,this.anchorOrigin_=void 0!==t.anchorOrigin?t.anchorOrigin:"top-left",this.anchorXUnits_=void 0!==t.anchorXUnits?t.anchorXUnits:"fraction",this.anchorYUnits_=void 0!==t.anchorYUnits?t.anchorYUnits:"fraction",this.crossOrigin_=void 0!==t.crossOrigin?t.crossOrigin:null;const s=void 0!==t.img?t.img:null;this.imgSize_=t.imgSize;let o=t.src;at(!(void 0!==o&&s),4),at(!s||s&&this.imgSize_,5),void 0!==o&&0!==o.length||!s||(o=s.src||z(s)),at(void 0!==o&&o.length>0,6);const a=void 0!==t.src?Pr:Lr;this.color_=void 0!==t.color?$r(t.color):null,this.iconImage_=ag(s,o,void 0!==this.imgSize_?this.imgSize_:null,this.crossOrigin_,a,this.color_),this.offset_=void 0!==t.offset?t.offset:[0,0],this.offsetOrigin_=void 0!==t.offsetOrigin?t.offsetOrigin:"top-left",this.origin_=null,this.size_=void 0!==t.size?t.size:null}clone(){const t=this.getScale();return new lg({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,imgSize:this.imgSize_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:Array.isArray(t)?t.slice():t,size:null!==this.size_?this.size_.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getAnchor(){let t=this.normalizedAnchor_;if(!t){t=this.anchor_;const e=this.getSize();if("fraction"==this.anchorXUnits_||"fraction"==this.anchorYUnits_){if(!e)return null;t=this.anchor_.slice(),"fraction"==this.anchorXUnits_&&(t[0]*=e[0]),"fraction"==this.anchorYUnits_&&(t[1]*=e[1])}if("top-left"!=this.anchorOrigin_){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),"top-right"!=this.anchorOrigin_&&"bottom-right"!=this.anchorOrigin_||(t[0]=-t[0]+e[0]),"bottom-left"!=this.anchorOrigin_&&"bottom-right"!=this.anchorOrigin_||(t[1]=-t[1]+e[1])}this.normalizedAnchor_=t}const e=this.getDisplacement(),i=this.getScaleArray();return[t[0]-e[0]/i[0],t[1]+e[1]/i[1]]}setAnchor(t){this.anchor_=t,this.normalizedAnchor_=null}getColor(){return this.color_}getImage(t){return this.iconImage_.getImage(t)}getPixelRatio(t){return this.iconImage_.getPixelRatio(t)}getImageSize(){return this.iconImage_.getSize()}getImageState(){return this.iconImage_.getImageState()}getHitDetectionImage(){return this.iconImage_.getHitDetectionImage()}getOrigin(){if(this.origin_)return this.origin_;let t=this.offset_;if("top-left"!=this.offsetOrigin_){const e=this.getSize(),i=this.iconImage_.getSize();if(!e||!i)return null;t=t.slice(),"top-right"!=this.offsetOrigin_&&"bottom-right"!=this.offsetOrigin_||(t[0]=i[0]-e[0]-t[0]),"bottom-left"!=this.offsetOrigin_&&"bottom-right"!=this.offsetOrigin_||(t[1]=i[1]-e[1]-t[1])}return this.origin_=t,this.origin_}getSrc(){return this.iconImage_.getSrc()}getSize(){return this.size_?this.size_:this.iconImage_.getSize()}listenImageChange(t){this.iconImage_.addEventListener(S,t)}load(){this.iconImage_.load()}unlistenImageChange(t){this.iconImage_.removeEventListener(S,t)}}class hg{constructor(t){t=t||{},this.color_=void 0!==t.color?t.color:null,this.lineCap_=t.lineCap,this.lineDash_=void 0!==t.lineDash?t.lineDash:null,this.lineDashOffset_=t.lineDashOffset,this.lineJoin_=t.lineJoin,this.miterLimit_=t.miterLimit,this.width_=t.width}clone(){const t=this.getColor();return new hg({color:Array.isArray(t)?t.slice():t||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})}getColor(){return this.color_}getLineCap(){return this.lineCap_}getLineDash(){return this.lineDash_}getLineDashOffset(){return this.lineDashOffset_}getLineJoin(){return this.lineJoin_}getMiterLimit(){return this.miterLimit_}getWidth(){return this.width_}setColor(t){this.color_=t}setLineCap(t){this.lineCap_=t}setLineDash(t){this.lineDash_=t}setLineDashOffset(t){this.lineDashOffset_=t}setLineJoin(t){this.lineJoin_=t}setMiterLimit(t){this.miterLimit_=t}setWidth(t){this.width_=t}}class cg{constructor(t){t=t||{},this.geometry_=null,this.geometryFunction_=pg,void 0!==t.geometry&&this.setGeometry(t.geometry),this.fill_=void 0!==t.fill?t.fill:null,this.image_=void 0!==t.image?t.image:null,this.renderer_=void 0!==t.renderer?t.renderer:null,this.hitDetectionRenderer_=void 0!==t.hitDetectionRenderer?t.hitDetectionRenderer:null,this.stroke_=void 0!==t.stroke?t.stroke:null,this.text_=void 0!==t.text?t.text:null,this.zIndex_=t.zIndex}clone(){let t=this.getGeometry();return t&&"object"==typeof t&&(t=t.clone()),new cg({geometry:t,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer(),stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})}getRenderer(){return this.renderer_}setRenderer(t){this.renderer_=t}setHitDetectionRenderer(t){this.hitDetectionRenderer_=t}getHitDetectionRenderer(){return this.hitDetectionRenderer_}getGeometry(){return this.geometry_}getGeometryFunction(){return this.geometryFunction_}getFill(){return this.fill_}setFill(t){this.fill_=t}getImage(){return this.image_}setImage(t){this.image_=t}getStroke(){return this.stroke_}setStroke(t){this.stroke_=t}getText(){return this.text_}setText(t){this.text_=t}getZIndex(){return this.zIndex_}setGeometry(t){"function"==typeof t?this.geometryFunction_=t:"string"==typeof t?this.geometryFunction_=function(e){return e.get(t)}:t?void 0!==t&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=pg,this.geometry_=t}setZIndex(t){this.zIndex_=t}}function ug(t){let e;if("function"==typeof t)e=t;else{let i;if(Array.isArray(t))i=t;else{at("function"==typeof t.getZIndex,41);i=[t]}e=function(){return i}}return e}let dg=null;function gg(t,e){if(!dg){const t=new rg({color:"rgba(255,255,255,0.4)"}),e=new hg({color:"#3399CC",width:1.25});dg=[new cg({image:new ng({fill:t,stroke:e,radius:5}),fill:t,stroke:e})]}return dg}function fg(){const t={},e=[255,255,255,1],i=[0,153,255,1];return t.Polygon=[new cg({fill:new rg({color:[255,255,255,.5]})})],t.MultiPolygon=t.Polygon,t.LineString=[new cg({stroke:new hg({color:e,width:5})}),new cg({stroke:new hg({color:i,width:3})})],t.MultiLineString=t.LineString,t.Circle=t.Polygon.concat(t.LineString),t.Point=[new cg({image:new ng({radius:6,fill:new rg({color:i}),stroke:new hg({color:e,width:1.5})}),zIndex:1/0})],t.MultiPoint=t.Point,t.GeometryCollection=t.Polygon.concat(t.LineString,t.Point),t}function pg(t){return t.getGeometry()}class mg{constructor(t){t=t||{},this.font_=t.font,this.rotation_=t.rotation,this.rotateWithView_=t.rotateWithView,this.scale_=t.scale,this.scaleArray_=Va(void 0!==t.scale?t.scale:1),this.text_=t.text,this.textAlign_=t.textAlign,this.justify_=t.justify,this.textBaseline_=t.textBaseline,this.fill_=void 0!==t.fill?t.fill:new rg({color:"#333"}),this.maxAngle_=void 0!==t.maxAngle?t.maxAngle:Math.PI/4,this.placement_=void 0!==t.placement?t.placement:"point",this.overflow_=!!t.overflow,this.stroke_=void 0!==t.stroke?t.stroke:null,this.offsetX_=void 0!==t.offsetX?t.offsetX:0,this.offsetY_=void 0!==t.offsetY?t.offsetY:0,this.backgroundFill_=t.backgroundFill?t.backgroundFill:null,this.backgroundStroke_=t.backgroundStroke?t.backgroundStroke:null,this.padding_=void 0===t.padding?null:t.padding}clone(){const t=this.getScale();return new mg({font:this.getFont(),placement:this.getPlacement(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,text:this.getText(),textAlign:this.getTextAlign(),justify:this.getJustify(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()||void 0})}getOverflow(){return this.overflow_}getFont(){return this.font_}getMaxAngle(){return this.maxAngle_}getPlacement(){return this.placement_}getOffsetX(){return this.offsetX_}getOffsetY(){return this.offsetY_}getFill(){return this.fill_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getStroke(){return this.stroke_}getText(){return this.text_}getTextAlign(){return this.textAlign_}getJustify(){return this.justify_}getTextBaseline(){return this.textBaseline_}getBackgroundFill(){return this.backgroundFill_}getBackgroundStroke(){return this.backgroundStroke_}getPadding(){return this.padding_}setOverflow(t){this.overflow_=t}setFont(t){this.font_=t}setMaxAngle(t){this.maxAngle_=t}setOffsetX(t){this.offsetX_=t}setOffsetY(t){this.offsetY_=t}setPlacement(t){this.placement_=t}setRotateWithView(t){this.rotateWithView_=t}setFill(t){this.fill_=t}setRotation(t){this.rotation_=t}setScale(t){this.scale_=t,this.scaleArray_=Va(void 0!==t?t:1)}setStroke(t){this.stroke_=t}setText(t){this.text_=t}setTextAlign(t){this.textAlign_=t}setJustify(t){this.justify_=t}setTextBaseline(t){this.textBaseline_=t}setBackgroundFill(t){this.backgroundFill_=t}setBackgroundStroke(t){this.backgroundStroke_=t}setPadding(t){this.padding_=t}}function _g(t){return new cg({fill:yg(t,""),stroke:xg(t,""),text:vg(t),image:Sg(t)})}function yg(t,e){const i=t[e+"fill-color"];if(i)return new rg({color:i})}function xg(t,e){const i=t[e+"stroke-width"],n=t[e+"stroke-color"];if(i||n)return new hg({width:i,color:n,lineCap:t[e+"stroke-line-cap"],lineJoin:t[e+"stroke-line-join"],lineDash:t[e+"stroke-line-dash"],lineDashOffset:t[e+"stroke-line-dash-offset"],miterLimit:t[e+"stroke-miter-limit"]})}function vg(t){const e=t["text-value"];if(!e)return;return new mg({text:e,font:t["text-font"],maxAngle:t["text-max-angle"],offsetX:t["text-offset-x"],offsetY:t["text-offset-y"],overflow:t["text-overflow"],placement:t["text-placement"],scale:t["text-scale"],rotateWithView:t["text-rotate-with-view"],rotation:t["text-rotation"],textAlign:t["text-align"],justify:t["text-justify"],textBaseline:t["text-baseline"],padding:t["text-padding"],fill:yg(t,"text-"),backgroundFill:yg(t,"text-background-"),stroke:xg(t,"text-"),backgroundStroke:xg(t,"text-background-")})}function Sg(t){const e=t["icon-src"],i=t["icon-img"];if(e||i){return new lg({src:e,img:i,imgSize:t["icon-img-size"],anchor:t["icon-anchor"],anchorOrigin:t["icon-anchor-origin"],anchorXUnits:t["icon-anchor-x-units"],anchorYUnits:t["icon-anchor-y-units"],color:t["icon-color"],crossOrigin:t["icon-cross-origin"],offset:t["icon-offset"],displacement:t["icon-displacement"],opacity:t["icon-opacity"],scale:t["icon-scale"],rotation:t["icon-rotation"],rotateWithView:t["icon-rotate-with-view"],size:t["icon-size"],declutterMode:t["icon-declutter-mode"]})}const n=t["shape-points"];if(n){const e="shape-";return new ig({points:n,fill:yg(t,e),stroke:xg(t,e),radius:t["shape-radius"],radius1:t["shape-radius1"],radius2:t["shape-radius2"],angle:t["shape-angle"],displacement:t["shape-displacement"],rotation:t["shape-rotation"],rotateWithView:t["shape-rotate-with-view"],scale:t["shape-scale"],declutterMode:t["shape-declutter-mode"]})}const r=t["circle-radius"];if(r){const e="circle-";return new ng({radius:r,fill:yg(t,e),stroke:xg(t,e),displacement:t["circle-displacement"],scale:t["circle-scale"],rotation:t["circle-rotation"],rotateWithView:t["circle-rotate-with-view"],declutterMode:t["circle-declutter-mode"]})}}const wg={"image/png":!0,"image/jpeg":!0,"image/gif":!0,"image/webp":!0},Eg={"application/vnd.mapbox-vector-tile":!0,"application/geo+json":!0};function Tg(t,e){let i,n;for(let r=0;r<t.length;++r){const s=t[r];if("item"===s.rel){if(s.type===e){i=s.href;break}(wg[s.type]||!n&&s.type.startsWith("image/"))&&(n=s.href)}}if(!i){if(!n)throw new Error('Could not find "item" link');i=n}return i}function Cg(t,e,i){let n,r;const s={};for(let i=0;i<t.length;++i){const o=t[i];if(s[o.type]=o.href,"item"===o.rel){if(o.type===e){n=o.href;break}Eg[o.type]&&(r=o.href)}}if(!n&&i)for(let t=0;t<i.length;++t){const e=i[t];if(s[e]){n=s[e];break}}if(!n){if(!r)throw new Error('Could not find "item" link');n=r}return n}function bg(t,e,i,n){let r=t.projection;if(!r&&(r=Ui(e.crs),!r))throw new Error(`Unsupported CRS: ${e.crs}`);const s="en"!==r.getAxisOrientation().substr(0,2),o=e.tileMatrices,a={};for(let t=0;t<o.length;++t){const e=o[t];a[e.id]=e}const l={},h=[];if(n)for(let t=0;t<n.length;++t){const e=n[t],i=e.tileMatrix;h.push(i),l[i]=e}else for(let t=0;t<o.length;++t){const e=o[t].id;h.push(e)}const c=h.length,u=new Array(c),d=new Array(c),g=new Array(c),f=new Array(c),p=[-1/0,-1/0,1/0,1/0];for(let t=0;t<c;++t){const e=h[t],i=a[e],n=i.pointOfOrigin;u[t]=s?[n[1],n[0]]:n,d[t]=i.cellSize,g[t]=[i.matrixWidth,i.matrixHeight],f[t]=[i.tileWidth,i.tileHeight];const r=l[e];if(r){const e=i.cellSize*i.tileWidth,n=u[t][0]+r.minTileCol*e,s=u[t][0]+(r.maxTileCol+1)*e,o=i.cellSize*i.tileHeight;let a,l;"bottomLeft"===i.cornerOfOrigin?(a=u[t][1]+r.minTileRow*o,l=u[t][1]+(r.maxTileRow+1)*o):(a=u[t][1]-(r.maxTileRow+1)*o,l=u[t][1]-r.minTileRow*o),ye(p,[n,a,s,l],p)}}const m=new ql({origins:u,resolutions:d,sizes:g,tileSizes:f,extent:n?p:void 0}),_=t.context,y=t.url;return{grid:m,urlTemplate:i,urlFunction:function(t,e,r){if(!t)return;const s=h[t[0]],o=a[s],c="bottomLeft"===o.cornerOfOrigin,u={tileMatrix:s,tileCol:t[1],tileRow:c?-t[2]-1:t[2]};if(n){const t=l[o.id];if(u.tileCol<t.minTileCol||u.tileCol>t.maxTileCol||u.tileRow<t.minTileRow||u.tileRow>t.maxTileRow)return}Object.assign(u,_);const d=i.replace(/\{(\w+?)\}/g,(function(t,e){return u[e]}));return Tl(y,d)}}}function Rg(t){return El(t.url).then((function(e){return function(t,e){const i=e.tileMatrixSetLimits;let n;if("map"===e.dataType)n=Tg(e.links,t.mediaType);else{if("vector"!==e.dataType)throw new Error('Expected tileset data type to be "map" or "vector"');n=Cg(e.links,t.mediaType,t.supportedMediaTypes)}if(e.tileMatrixSet)return bg(t,e.tileMatrixSet,n,i);const r=e.links.find((t=>"http://www.opengis.net/def/rel/ogc/1.0/tiling-scheme"===t.rel));if(!r)throw new Error("Expected http://www.opengis.net/def/rel/ogc/1.0/tiling-scheme link or tileMatrixSet");const s=r.href;return El(Tl(t.url,s)).then((function(e){return bg(t,e,n,i)}))}(t,e)}))}const Pg="renderOrder";class Ig extends vs{constructor(t){t=t||{};const e=Object.assign({},t);delete e.style,delete e.renderBuffer,delete e.updateWhileAnimating,delete e.updateWhileInteracting,super(e),this.declutter_=void 0!==t.declutter&&t.declutter,this.renderBuffer_=void 0!==t.renderBuffer?t.renderBuffer:100,this.style_=null,this.styleFunction_=void 0,this.setStyle(t.style),this.updateWhileAnimating_=void 0!==t.updateWhileAnimating&&t.updateWhileAnimating,this.updateWhileInteracting_=void 0!==t.updateWhileInteracting&&t.updateWhileInteracting}getDeclutter(){return this.declutter_}getFeatures(t){return super.getFeatures(t)}getRenderBuffer(){return this.renderBuffer_}getRenderOrder(){return this.get(Pg)}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}getUpdateWhileAnimating(){return this.updateWhileAnimating_}getUpdateWhileInteracting(){return this.updateWhileInteracting_}renderDeclutter(t){t.declutterTree||(t.declutterTree=new xh(9)),this.getRenderer().renderDeclutter(t)}setRenderOrder(t){this.set(Pg,t)}setStyle(t){let e;if(void 0===t)e=gg;else if(null===t)e=null;else if("function"==typeof t)e=t;else if(t instanceof cg)e=t;else if(Array.isArray(t)){const i=t.length,n=new Array(i);for(let e=0;e<i;++e){const i=t[e];n[e]=i instanceof cg?i:_g(i)}e=n}else e=_g(t);this.style_=e,this.styleFunction_=null===t?void 0:ug(this.style_),this.changed()}}const Lg="GENERATE_POLYGON_BUFFERS",Mg="GENERATE_POINT_BUFFERS",Fg="GENERATE_LINE_STRING_BUFFERS";var Ag={exports:{}};function Og(t,e,i){i=i||2;var n,r,s,o,a,l,h,c=e&&e.length,u=c?e[0]*i:t.length,d=Ng(t,0,u,i,!0),g=[];if(!d||d.next===d.prev)return g;if(c&&(d=function(t,e,i,n){var r,s,o,a=[];for(r=0,s=e.length;r<s;r++)(o=Ng(t,e[r]*n,r<s-1?e[r+1]*n:t.length,n,!1))===o.next&&(o.steiner=!0),a.push(Zg(o));for(a.sort(zg),r=0;r<a.length;r++)i=Dg(i=Xg(a[r],i),i.next);return i}(t,e,d,i)),t.length>80*i){n=s=t[0],r=o=t[1];for(var f=i;f<u;f+=i)(a=t[f])<n&&(n=a),(l=t[f+1])<r&&(r=l),a>s&&(s=a),l>o&&(o=l);h=0!==(h=Math.max(s-n,o-r))?1/h:0}return kg(d,g,i,n,r,h),g}function Ng(t,e,i,n,r){var s,o;if(r===of(t,e,i,n)>0)for(s=e;s<i;s+=n)o=nf(s,t[s],t[s+1],o);else for(s=i-n;s>=e;s-=n)o=nf(s,t[s],t[s+1],o);return o&&Hg(o,o.next)&&(rf(o),o=o.next),o}function Dg(t,e){if(!t)return t;e||(e=t);var i,n=t;do{if(i=!1,n.steiner||!Hg(n,n.next)&&0!==qg(n.prev,n,n.next))n=n.next;else{if(rf(n),(n=e=n.prev)===n.next)break;i=!0}}while(i||n!==e);return e}function kg(t,e,i,n,r,s,o){if(t){!o&&s&&function(t,e,i,n){var r=t;do{null===r.z&&(r.z=Wg(r.x,r.y,e,i,n)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,function(t){var e,i,n,r,s,o,a,l,h=1;do{for(i=t,t=null,s=null,o=0;i;){for(o++,n=i,a=0,e=0;e<h&&(a++,n=n.nextZ);e++);for(l=h;a>0||l>0&&n;)0!==a&&(0===l||!n||i.z<=n.z)?(r=i,i=i.nextZ,a--):(r=n,n=n.nextZ,l--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;i=n}s.nextZ=null,h*=2}while(o>1)}(r)}(t,n,r,s);for(var a,l,h=t;t.prev!==t.next;)if(a=t.prev,l=t.next,s?jg(t,n,r,s):Gg(t))e.push(a.i/i),e.push(t.i/i),e.push(l.i/i),rf(t),t=l.next,h=l.next;else if((t=l)===h){o?1===o?kg(t=Bg(Dg(t),e,i),e,i,n,r,s,2):2===o&&Ug(t,e,i,n,r,s):kg(Dg(t),e,i,n,r,s,1);break}}}function Gg(t){var e=t.prev,i=t,n=t.next;if(qg(e,i,n)>=0)return!1;for(var r=t.next.next;r!==t.prev;){if(Yg(e.x,e.y,i.x,i.y,n.x,n.y,r.x,r.y)&&qg(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function jg(t,e,i,n){var r=t.prev,s=t,o=t.next;if(qg(r,s,o)>=0)return!1;for(var a=r.x<s.x?r.x<o.x?r.x:o.x:s.x<o.x?s.x:o.x,l=r.y<s.y?r.y<o.y?r.y:o.y:s.y<o.y?s.y:o.y,h=r.x>s.x?r.x>o.x?r.x:o.x:s.x>o.x?s.x:o.x,c=r.y>s.y?r.y>o.y?r.y:o.y:s.y>o.y?s.y:o.y,u=Wg(a,l,e,i,n),d=Wg(h,c,e,i,n),g=t.prevZ,f=t.nextZ;g&&g.z>=u&&f&&f.z<=d;){if(g!==t.prev&&g!==t.next&&Yg(r.x,r.y,s.x,s.y,o.x,o.y,g.x,g.y)&&qg(g.prev,g,g.next)>=0)return!1;if(g=g.prevZ,f!==t.prev&&f!==t.next&&Yg(r.x,r.y,s.x,s.y,o.x,o.y,f.x,f.y)&&qg(f.prev,f,f.next)>=0)return!1;f=f.nextZ}for(;g&&g.z>=u;){if(g!==t.prev&&g!==t.next&&Yg(r.x,r.y,s.x,s.y,o.x,o.y,g.x,g.y)&&qg(g.prev,g,g.next)>=0)return!1;g=g.prevZ}for(;f&&f.z<=d;){if(f!==t.prev&&f!==t.next&&Yg(r.x,r.y,s.x,s.y,o.x,o.y,f.x,f.y)&&qg(f.prev,f,f.next)>=0)return!1;f=f.nextZ}return!0}function Bg(t,e,i){var n=t;do{var r=n.prev,s=n.next.next;!Hg(r,s)&&$g(r,n,n.next,s)&&tf(r,s)&&tf(s,r)&&(e.push(r.i/i),e.push(n.i/i),e.push(s.i/i),rf(n),rf(n.next),n=t=s),n=n.next}while(n!==t);return Dg(n)}function Ug(t,e,i,n,r,s){var o=t;do{for(var a=o.next.next;a!==o.prev;){if(o.i!==a.i&&Kg(o,a)){var l=ef(o,a);return o=Dg(o,o.next),l=Dg(l,l.next),kg(o,e,i,n,r,s),void kg(l,e,i,n,r,s)}a=a.next}o=o.next}while(o!==t)}function zg(t,e){return t.x-e.x}function Xg(t,e){var i=function(t,e){var i,n=e,r=t.x,s=t.y,o=-1/0;do{if(s<=n.y&&s>=n.next.y&&n.next.y!==n.y){var a=n.x+(s-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(a<=r&&a>o){if(o=a,a===r){if(s===n.y)return n;if(s===n.next.y)return n.next}i=n.x<n.next.x?n:n.next}}n=n.next}while(n!==e);if(!i)return null;if(r===o)return i;var l,h=i,c=i.x,u=i.y,d=1/0;n=i;do{r>=n.x&&n.x>=c&&r!==n.x&&Yg(s<u?r:o,s,c,u,s<u?o:r,s,n.x,n.y)&&(l=Math.abs(s-n.y)/(r-n.x),tf(n,t)&&(l<d||l===d&&(n.x>i.x||n.x===i.x&&Vg(i,n)))&&(i=n,d=l)),n=n.next}while(n!==h);return i}(t,e);if(!i)return e;var n=ef(i,t),r=Dg(i,i.next);return Dg(n,n.next),e===i?r:e}function Vg(t,e){return qg(t.prev,t,e.prev)<0&&qg(e.next,t,t.next)<0}function Wg(t,e,i,n,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*r)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*r)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function Zg(t){var e=t,i=t;do{(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next}while(e!==t);return i}function Yg(t,e,i,n,r,s,o,a){return(r-o)*(e-a)-(t-o)*(s-a)>=0&&(t-o)*(n-a)-(i-o)*(e-a)>=0&&(i-o)*(s-a)-(r-o)*(n-a)>=0}function Kg(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&$g(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(tf(t,e)&&tf(e,t)&&function(t,e){var i=t,n=!1,r=(t.x+e.x)/2,s=(t.y+e.y)/2;do{i.y>s!=i.next.y>s&&i.next.y!==i.y&&r<(i.next.x-i.x)*(s-i.y)/(i.next.y-i.y)+i.x&&(n=!n),i=i.next}while(i!==t);return n}(t,e)&&(qg(t.prev,t,e.prev)||qg(t,e.prev,e))||Hg(t,e)&&qg(t.prev,t,t.next)>0&&qg(e.prev,e,e.next)>0)}function qg(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function Hg(t,e){return t.x===e.x&&t.y===e.y}function $g(t,e,i,n){var r=Qg(qg(t,e,i)),s=Qg(qg(t,e,n)),o=Qg(qg(i,n,t)),a=Qg(qg(i,n,e));return r!==s&&o!==a||(!(0!==r||!Jg(t,i,e))||(!(0!==s||!Jg(t,n,e))||(!(0!==o||!Jg(i,t,n))||!(0!==a||!Jg(i,e,n)))))}function Jg(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function Qg(t){return t>0?1:t<0?-1:0}function tf(t,e){return qg(t.prev,t,t.next)<0?qg(t,e,t.next)>=0&&qg(t,t.prev,e)>=0:qg(t,e,t.prev)<0||qg(t,t.next,e)<0}function ef(t,e){var i=new sf(t.i,t.x,t.y),n=new sf(e.i,e.x,e.y),r=t.next,s=e.prev;return t.next=e,e.prev=t,i.next=r,r.prev=i,n.next=i,i.prev=n,s.next=n,n.prev=s,n}function nf(t,e,i,n){var r=new sf(t,e,i);return n?(r.next=n.next,r.prev=n,n.next.prev=r,n.next=r):(r.prev=r,r.next=r),r}function rf(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function sf(t,e,i){this.i=t,this.x=e,this.y=i,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function of(t,e,i,n){for(var r=0,s=e,o=i-n;s<i;s+=n)r+=(t[o]-t[s])*(t[s+1]+t[o+1]),o=s;return r}Ag.exports=Og,Ag.exports.default=Og,Og.deviation=function(t,e,i,n){var r=e&&e.length,s=r?e[0]*i:t.length,o=Math.abs(of(t,0,s,i));if(r)for(var a=0,l=e.length;a<l;a++){var h=e[a]*i,c=a<l-1?e[a+1]*i:t.length;o-=Math.abs(of(t,h,c,i))}var u=0;for(a=0;a<n.length;a+=3){var d=n[a]*i,g=n[a+1]*i,f=n[a+2]*i;u+=Math.abs((t[d]-t[f])*(t[g+1]-t[d+1])-(t[d]-t[g])*(t[f+1]-t[d+1]))}return 0===o&&0===u?0:Math.abs((u-o)/o)},Og.flatten=function(t){for(var e=t[0][0].length,i={vertices:[],holes:[],dimensions:e},n=0,r=0;r<t.length;r++){for(var s=0;s<t[r].length;s++)for(var o=0;o<e;o++)i.vertices.push(t[r][s][o]);r>0&&(n+=t[r-1].length,i.holes.push(n))}return i};const af=[],lf={vertexPosition:0,indexPosition:0};function hf(t,e,i,n,r){t[e+0]=i,t[e+1]=n,t[e+2]=r}function cf(t,e){const i=256,n=255;return(e=e||[])[0]=Math.floor(t/i/i/i)/n,e[1]=Math.floor(t/i/i)%i/n,e[2]=Math.floor(t/i)%i/n,e[3]=t%i/n,e}function uf(t){let e=0;const i=256,n=255;return e+=Math.round(t[0]*i*i*i*n),e+=Math.round(t[1]*i*i*n),e+=Math.round(t[2]*i*n),e+=Math.round(t[3]*n),e}function df(){const t='const e="GENERATE_POLYGON_BUFFERS",t="GENERATE_POINT_BUFFERS",n="GENERATE_LINE_STRING_BUFFERS",r="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"";r.includes("firefox");r.includes("safari")&&!r.includes("chrom")&&(r.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(r)),r.includes("webkit")&&r.includes("edge"),r.includes("macintosh"),"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&(self,WorkerGlobalScope),function(){let e=!1;try{const t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("_",null,t),window.removeEventListener("_",null,t)}catch(e){}}();const o={1:"The view center is not defined",2:"The view resolution is not defined",3:"The view rotation is not defined",4:"`image` and `src` cannot be provided at the same time",5:"`imgSize` must be set when `image` is provided",7:"`format` must be set when `url` is set",8:"Unknown `serverType` configured",9:"`url` must be configured or set using `#setUrl()`",10:"The default `geometryFunction` can only handle `Point` geometries",11:"`options.featureTypes` must be an Array",12:"`options.geometryName` must also be provided when `options.bbox` is set",13:"Invalid corner",14:"Invalid color",15:"Tried to get a value for a key that does not exist in the cache",16:"Tried to set a value for a key that is used already",17:"`resolutions` must be sorted in descending order",18:"Either `origin` or `origins` must be configured, never both",19:"Number of `tileSizes` and `resolutions` must be equal",20:"Number of `origins` and `resolutions` must be equal",22:"Either `tileSize` or `tileSizes` must be configured, never both",24:"Invalid extent or geometry provided as `geometry`",25:"Cannot fit empty extent provided as `geometry`",26:"Features must have an id set",27:"Features must have an id set",28:\'`renderMode` must be `"hybrid"` or `"vector"`\',30:"The passed `feature` was already added to the source",31:"Tried to enqueue an `element` that was already added to the queue",32:"Transformation matrix cannot be inverted",33:"Invalid units",34:"Invalid geometry layout",36:"Unknown SRS type",37:"Unknown geometry type found",38:"`styleMapValue` has an unknown type",39:"Unknown geometry type",40:"Expected `feature` to have a geometry",41:"Expected an `ol/style/Style` or an array of `ol/style/Style.js`",42:"Question unknown, the answer is 42",43:"Expected `layers` to be an array or a `Collection`",47:"Expected `controls` to be an array or an `ol/Collection`",48:"Expected `interactions` to be an array or an `ol/Collection`",49:"Expected `overlays` to be an array or an `ol/Collection`",50:"`options.featureTypes` should be an Array",51:"Either `url` or `tileJSON` options must be provided",52:"Unknown `serverType` configured",53:"Unknown `tierSizeCalculation` configured",55:"The {-y} placeholder requires a tile grid with extent",56:"mapBrowserEvent must originate from a pointer event",57:"At least 2 conditions are required",59:"Invalid command found in the PBF",60:"Missing or invalid `size`",61:"Cannot determine IIIF Image API version from provided image information JSON",62:"A `WebGLArrayBuffer` must either be of type `ELEMENT_ARRAY_BUFFER` or `ARRAY_BUFFER`",64:"Layer opacity must be a number",66:"`forEachFeatureAtCoordinate` cannot be used on a WebGL layer if the hit detection logic has not been enabled. This is done by providing adequate shaders using the `hitVertexShader` and `hitFragmentShader` properties of `WebGLPointsLayerRenderer`",67:"A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both",68:"A VectorTile source can only be rendered if it has a projection compatible with the view projection"};class i extends Error{constructor(e){const t=o[e];super(t),this.code=e,this.name="AssertionError",this.message=t}}function s(e,t){const n=t[0],r=t[1];return t[0]=e[0]*n+e[2]*r+e[4],t[1]=e[1]*n+e[3]*r+e[5],t}function a(e,t){const n=(r=t)[0]*r[3]-r[1]*r[2];var r;!function(e,t){if(!e)throw new i(t)}(0!==n,32);const o=t[0],s=t[1],a=t[2],u=t[3],x=t[4],f=t[5];return e[0]=u/n,e[1]=-s/n,e[2]=-a/n,e[3]=o/n,e[4]=(a*f-u*x)/n,e[5]=-(o*f-s*x)/n,e}new Array(6);var u={exports:{}};function x(e,t,n){n=n||2;var r,o,i,s,a,u,x,y=t&&t.length,d=y?t[0]*n:e.length,h=f(e,0,d,n,!0),v=[];if(!h||h.next===h.prev)return v;if(y&&(h=function(e,t,n,r){var o,i,s,a=[];for(o=0,i=t.length;o<i;o++)(s=f(e,t[o]*r,o<i-1?t[o+1]*r:e.length,r,!1))===s.next&&(s.steiner=!0),a.push(w(s));for(a.sort(p),o=0;o<a.length;o++)n=l(n=g(a[o],n),n.next);return n}(e,t,h,n)),e.length>80*n){r=i=e[0],o=s=e[1];for(var b=n;b<d;b+=n)(a=e[b])<r&&(r=a),(u=e[b+1])<o&&(o=u),a>i&&(i=a),u>s&&(s=u);x=0!==(x=Math.max(i-r,s-o))?1/x:0}return c(h,v,n,r,o,x),v}function f(e,t,n,r,o){var i,s;if(o===B(e,t,n,r)>0)for(i=t;i<n;i+=r)s=U(i,e[i],e[i+1],s);else for(i=n-r;i>=t;i-=r)s=U(i,e[i],e[i+1],s);return s&&M(s,s.next)&&(z(s),s=s.next),s}function l(e,t){if(!e)return e;t||(t=e);var n,r=e;do{if(n=!1,r.steiner||!M(r,r.next)&&0!==Z(r.prev,r,r.next))r=r.next;else{if(z(r),(r=t=r.prev)===r.next)break;n=!0}}while(n||r!==t);return t}function c(e,t,n,r,o,i,s){if(e){!s&&i&&function(e,t,n,r){var o=e;do{null===o.z&&(o.z=m(o.x,o.y,t,n,r)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next}while(o!==e);o.prevZ.nextZ=null,o.prevZ=null,function(e){var t,n,r,o,i,s,a,u,x=1;do{for(n=e,e=null,i=null,s=0;n;){for(s++,r=n,a=0,t=0;t<x&&(a++,r=r.nextZ);t++);for(u=x;a>0||u>0&&r;)0!==a&&(0===u||!r||n.z<=r.z)?(o=n,n=n.nextZ,a--):(o=r,r=r.nextZ,u--),i?i.nextZ=o:e=o,o.prevZ=i,i=o;n=r}i.nextZ=null,x*=2}while(s>1)}(o)}(e,r,o,i);for(var a,u,x=e;e.prev!==e.next;)if(a=e.prev,u=e.next,i?d(e,r,o,i):y(e))t.push(a.i/n),t.push(e.i/n),t.push(u.i/n),z(e),e=u.next,x=u.next;else if((e=u)===x){s?1===s?c(e=h(l(e),t,n),t,n,r,o,i,2):2===s&&v(e,t,n,r,o,i):c(l(e),t,n,r,o,i,1);break}}}function y(e){var t=e.prev,n=e,r=e.next;if(Z(t,n,r)>=0)return!1;for(var o=e.next.next;o!==e.prev;){if(A(t.x,t.y,n.x,n.y,r.x,r.y,o.x,o.y)&&Z(o.prev,o,o.next)>=0)return!1;o=o.next}return!0}function d(e,t,n,r){var o=e.prev,i=e,s=e.next;if(Z(o,i,s)>=0)return!1;for(var a=o.x<i.x?o.x<s.x?o.x:s.x:i.x<s.x?i.x:s.x,u=o.y<i.y?o.y<s.y?o.y:s.y:i.y<s.y?i.y:s.y,x=o.x>i.x?o.x>s.x?o.x:s.x:i.x>s.x?i.x:s.x,f=o.y>i.y?o.y>s.y?o.y:s.y:i.y>s.y?i.y:s.y,l=m(a,u,t,n,r),c=m(x,f,t,n,r),y=e.prevZ,d=e.nextZ;y&&y.z>=l&&d&&d.z<=c;){if(y!==e.prev&&y!==e.next&&A(o.x,o.y,i.x,i.y,s.x,s.y,y.x,y.y)&&Z(y.prev,y,y.next)>=0)return!1;if(y=y.prevZ,d!==e.prev&&d!==e.next&&A(o.x,o.y,i.x,i.y,s.x,s.y,d.x,d.y)&&Z(d.prev,d,d.next)>=0)return!1;d=d.nextZ}for(;y&&y.z>=l;){if(y!==e.prev&&y!==e.next&&A(o.x,o.y,i.x,i.y,s.x,s.y,y.x,y.y)&&Z(y.prev,y,y.next)>=0)return!1;y=y.prevZ}for(;d&&d.z<=c;){if(d!==e.prev&&d!==e.next&&A(o.x,o.y,i.x,i.y,s.x,s.y,d.x,d.y)&&Z(d.prev,d,d.next)>=0)return!1;d=d.nextZ}return!0}function h(e,t,n){var r=e;do{var o=r.prev,i=r.next.next;!M(o,i)&&F(o,r,r.next,i)&&k(o,i)&&k(i,o)&&(t.push(o.i/n),t.push(r.i/n),t.push(i.i/n),z(r),z(r.next),r=e=i),r=r.next}while(r!==e);return l(r)}function v(e,t,n,r,o,i){var s=e;do{for(var a=s.next.next;a!==s.prev;){if(s.i!==a.i&&E(s,a)){var u=S(s,a);return s=l(s,s.next),u=l(u,u.next),c(s,t,n,r,o,i),void c(u,t,n,r,o,i)}a=a.next}s=s.next}while(s!==e)}function p(e,t){return e.x-t.x}function g(e,t){var n=function(e,t){var n,r=t,o=e.x,i=e.y,s=-1/0;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){var a=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(a<=o&&a>s){if(s=a,a===o){if(i===r.y)return r;if(i===r.next.y)return r.next}n=r.x<r.next.x?r:r.next}}r=r.next}while(r!==t);if(!n)return null;if(o===s)return n;var u,x=n,f=n.x,l=n.y,c=1/0;r=n;do{o>=r.x&&r.x>=f&&o!==r.x&&A(i<l?o:s,i,f,l,i<l?s:o,i,r.x,r.y)&&(u=Math.abs(i-r.y)/(o-r.x),k(r,e)&&(u<c||u===c&&(r.x>n.x||r.x===n.x&&b(n,r)))&&(n=r,c=u)),r=r.next}while(r!==x);return n}(e,t);if(!n)return t;var r=S(n,e),o=l(n,n.next);return l(r,r.next),t===n?o:t}function b(e,t){return Z(e.prev,e,t.prev)<0&&Z(t.next,e,e.next)<0}function m(e,t,n,r,o){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-n)*o)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*o)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function w(e){var t=e,n=e;do{(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next}while(t!==e);return n}function A(e,t,n,r,o,i,s,a){return(o-s)*(t-a)-(e-s)*(i-a)>=0&&(e-s)*(r-a)-(n-s)*(t-a)>=0&&(n-s)*(i-a)-(o-s)*(r-a)>=0}function E(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&F(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}(e,t)&&(k(e,t)&&k(t,e)&&function(e,t){var n=e,r=!1,o=(e.x+t.x)/2,i=(e.y+t.y)/2;do{n.y>i!=n.next.y>i&&n.next.y!==n.y&&o<(n.next.x-n.x)*(i-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==e);return r}(e,t)&&(Z(e.prev,e,t.prev)||Z(e,t.prev,t))||M(e,t)&&Z(e.prev,e,e.next)>0&&Z(t.prev,t,t.next)>0)}function Z(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function M(e,t){return e.x===t.x&&e.y===t.y}function F(e,t,n,r){var o=I(Z(e,t,n)),i=I(Z(e,t,r)),s=I(Z(n,r,e)),a=I(Z(n,r,t));return o!==i&&s!==a||(!(0!==o||!T(e,n,t))||(!(0!==i||!T(e,r,t))||(!(0!==s||!T(n,e,r))||!(0!==a||!T(n,t,r)))))}function T(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function I(e){return e>0?1:e<0?-1:0}function k(e,t){return Z(e.prev,e,e.next)<0?Z(e,t,e.next)>=0&&Z(e,e.prev,t)>=0:Z(e,t,e.prev)<0||Z(e,e.next,t)<0}function S(e,t){var n=new R(e.i,e.x,e.y),r=new R(t.i,t.x,t.y),o=e.next,i=t.prev;return e.next=t,t.prev=e,n.next=o,o.prev=n,r.next=n,n.prev=r,i.next=r,r.prev=i,r}function U(e,t,n,r){var o=new R(e,t,n);return r?(o.next=r.next,o.prev=r,r.next.prev=o,r.next=o):(o.prev=o,o.next=o),o}function z(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function R(e,t,n){this.i=e,this.x=t,this.y=n,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function B(e,t,n,r){for(var o=0,i=t,s=n-r;i<n;i+=r)o+=(e[s]-e[i])*(e[i+1]+e[s+1]),s=i;return o}u.exports=x,u.exports.default=x,x.deviation=function(e,t,n,r){var o=t&&t.length,i=o?t[0]*n:e.length,s=Math.abs(B(e,0,i,n));if(o)for(var a=0,u=t.length;a<u;a++){var x=t[a]*n,f=a<u-1?t[a+1]*n:e.length;s-=Math.abs(B(e,x,f,n))}var l=0;for(a=0;a<r.length;a+=3){var c=r[a]*n,y=r[a+1]*n,d=r[a+2]*n;l+=Math.abs((e[c]-e[d])*(e[y+1]-e[c+1])-(e[c]-e[y])*(e[d+1]-e[c+1]))}return 0===s&&0===l?0:Math.abs((l-s)/s)},x.flatten=function(e){for(var t=e[0][0].length,n={vertices:[],holes:[],dimensions:t},r=0,o=0;o<e.length;o++){for(var i=0;i<e[o].length;i++)for(var s=0;s<t;s++)n.vertices.push(e[o][i][s]);o>0&&(r+=e[o-1].length,n.holes.push(r))}return n};const P=[],C={vertexPosition:0,indexPosition:0};function N(e,t,n,r,o){e[t+0]=n,e[t+1]=r,e[t+2]=o}function _(e,t,n,r,o,i){const s=3+o,a=e[t+0],u=e[t+1],x=P;x.length=o;for(let n=0;n<x.length;n++)x[n]=e[t+2+n];let f=i?i.vertexPosition:0,l=i?i.indexPosition:0;const c=f/s;return N(n,f,a,u,0),x.length&&n.set(x,f+3),f+=s,N(n,f,a,u,1),x.length&&n.set(x,f+3),f+=s,N(n,f,a,u,2),x.length&&n.set(x,f+3),f+=s,N(n,f,a,u,3),x.length&&n.set(x,f+3),f+=s,r[l++]=c,r[l++]=c+1,r[l++]=c+3,r[l++]=c+1,r[l++]=c+2,r[l++]=c+3,C.vertexPosition=f,C.indexPosition=l,C}function L(e,t,n,r,o,i,a,u,x,f){const l=5+u.length,c=i.length/l,y=[e[t+0],e[t+1]],d=[e[n],e[n+1]],h=s(f,[...y]),v=s(f,[...d]);function p(e,t,n){const r=1e4;return Math.round(1500*t)+Math.round(1500*n)*r+e*r*r}function g(e,t,n){const r=Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])),o=[(t[0]-e[0])/r,(t[1]-e[1])/r],i=[-o[1],o[0]],s=Math.sqrt((n[0]-e[0])*(n[0]-e[0])+(n[1]-e[1])*(n[1]-e[1])),a=[(n[0]-e[0])/s,(n[1]-e[1])/s],u=0===r||0===s?0:Math.acos((x=a[0]*o[0]+a[1]*o[1],f=-1,l=1,Math.min(Math.max(x,f),l)));var x,f,l;return a[0]*i[0]+a[1]*i[1]>0?u:2*Math.PI-u}const b=null!==o;let m=0,w=0;if(null!==r){m=g(h,v,s(f,[...[e[r],e[r+1]]]))}if(b){w=g(v,h,s(f,[...[e[o],e[o+1]]]))}i.push(y[0],y[1],d[0],d[1],p(0,m,w)),i.push(...u),i.push(y[0],y[1],d[0],d[1],p(1,m,w)),i.push(...u),i.push(y[0],y[1],d[0],d[1],p(2,m,w)),i.push(...u),i.push(y[0],y[1],d[0],d[1],p(3,m,w)),i.push(...u),a.push(c,c+1,c+2,c+1,c+3,c+2)}function G(e,t,n,r,o){const i=2+o;let s=t;const a=e.slice(s,s+o);s+=o;const x=e[s++];let f=0;const l=new Array(x-1);for(let t=0;t<x;t++)f+=e[s++],t<x-1&&(l[t]=f);const c=e.slice(s,s+2*f),y=u.exports(c,l,2);for(let e=0;e<y.length;e++)r.push(y[e]+n.length/i);for(let e=0;e<c.length;e+=2)n.push(c[e],c[e+1],...a);return s+2*f}const O=self;O.onmessage=r=>{const o=r.data;switch(o.type){case t:{const e=3,t=2,n=o.customAttributesCount,r=t+n,i=new Float32Array(o.renderInstructions),s=i.length/r,a=4*s*(n+e),u=new Uint32Array(6*s),x=new Float32Array(a);let f;for(let e=0;e<i.length;e+=r)f=_(i,e,x,u,n,f);const l=Object.assign({vertexBuffer:x.buffer,indexBuffer:u.buffer,renderInstructions:i.buffer},o);O.postMessage(l,[x.buffer,u.buffer,i.buffer]);break}case n:{const e=[],t=[],n=o.customAttributesCount,r=2,i=new Float32Array(o.renderInstructions);let s=0;const u=o.renderInstructionsTransform,x=[1,0,0,1,0,0];let f,l;for(a(x,u);s<i.length;){l=Array.from(i.slice(s,s+n)),s+=n,f=i[s++];for(let n=0;n<f-1;n++)L(i,s+n*r,s+(n+1)*r,n>0?s+(n-1)*r:null,n<f-2?s+(n+2)*r:null,e,t,l,0,x);s+=f*r}const c=Uint32Array.from(t),y=Float32Array.from(e),d=Object.assign({vertexBuffer:y.buffer,indexBuffer:c.buffer,renderInstructions:i.buffer},o);O.postMessage(d,[y.buffer,c.buffer,i.buffer]);break}case e:{const e=[],t=[],n=o.customAttributesCount,r=new Float32Array(o.renderInstructions);let i=0;for(;i<r.length;)i=G(r,i,e,t,n);const s=Uint32Array.from(t),a=Float32Array.from(e),u=Object.assign({vertexBuffer:a.buffer,indexBuffer:s.buffer,renderInstructions:r.buffer},o);O.postMessage(u,[a.buffer,s.buffer,r.buffer]);break}}};';return new Worker("undefined"==typeof Blob?"data:application/javascript;base64,"+Buffer.from(t,"binary").toString("base64"):URL.createObjectURL(new Blob([t],{type:"application/javascript"})))}class gf extends gd{constructor(t,e){const i=e.uniforms||{},n=[1,0,0,1,0,0];i[Wu]=n,super(t,{uniforms:i,postProcesses:e.postProcesses}),this.ready=!1,this.sourceRevision_=-1,this.verticesBuffer_=new Gu(nu,ou),this.hitVerticesBuffer_=new Gu(nu,ou),this.indicesBuffer_=new Gu(ru,ou),this.vertexShader_=e.vertexShader,this.fragmentShader_=e.fragmentShader,this.program_,this.hitDetectionEnabled_=!(!e.hitFragmentShader||!e.hitVertexShader),this.hitVertexShader_=e.hitVertexShader,this.hitFragmentShader_=e.hitFragmentShader,this.hitProgram_;const r=e.attributes?e.attributes.map((function(t){return{name:"a_"+t.name,size:1,type:Qu.FLOAT}})):[];this.attributes=[{name:"a_position",size:2,type:Qu.FLOAT},{name:"a_index",size:1,type:Qu.FLOAT}].concat(r),this.hitDetectionAttributes=[{name:"a_position",size:2,type:Qu.FLOAT},{name:"a_index",size:1,type:Qu.FLOAT},{name:"a_hitColor",size:4,type:Qu.FLOAT},{name:"a_featureUid",size:1,type:Qu.FLOAT}].concat(r),this.customAttributes=e.attributes?e.attributes:[],this.previousExtent_=[1/0,1/0,-1/0,-1/0],this.currentTransform_=n,this.renderTransform_=[1,0,0,1,0,0],this.invertRenderTransform_=[1,0,0,1,0,0],this.renderInstructions_=new Float32Array(0),this.hitRenderInstructions_=new Float32Array(0),this.hitRenderTarget_,this.generateBuffersRun_=0,this.worker_=df(),this.worker_.addEventListener("message",function(t){const e=t.data;if(e.type===Mg){const i=e.projectionTransform;e.hitDetection?(this.hitVerticesBuffer_.fromArrayBuffer(e.vertexBuffer),this.helper.flushBufferData(this.hitVerticesBuffer_)):(this.verticesBuffer_.fromArrayBuffer(e.vertexBuffer),this.helper.flushBufferData(this.verticesBuffer_)),this.indicesBuffer_.fromArrayBuffer(e.indexBuffer),this.helper.flushBufferData(this.indicesBuffer_),this.renderTransform_=i,Ft(this.invertRenderTransform_,this.renderTransform_),e.hitDetection?this.hitRenderInstructions_=new Float32Array(t.data.renderInstructions):(this.renderInstructions_=new Float32Array(t.data.renderInstructions),e.generateBuffersRun===this.generateBuffersRun_&&(this.ready=!0)),this.getLayer().changed()}}.bind(this)),this.featureCache_={},this.featureCount_=0;const s=this.getLayer().getSource();this.sourceListenKeys_=[N(s,Oh,this.handleSourceFeatureAdded_,this),N(s,Nh,this.handleSourceFeatureChanged_,this),N(s,kh,this.handleSourceFeatureDelete_,this),N(s,Dh,this.handleSourceFeatureClear_,this)],s.forEachFeature(function(t){this.featureCache_[z(t)]={feature:t,properties:t.getProperties(),geometry:t.getGeometry()},this.featureCount_++}.bind(this))}afterHelperCreated(){this.program_=this.helper.getProgram(this.fragmentShader_,this.vertexShader_),this.hitDetectionEnabled_&&(this.hitProgram_=this.helper.getProgram(this.hitFragmentShader_,this.hitVertexShader_),this.hitRenderTarget_=new ld(this.helper))}handleSourceFeatureAdded_(t){const e=t.feature;this.featureCache_[z(e)]={feature:e,properties:e.getProperties(),geometry:e.getGeometry()},this.featureCount_++}handleSourceFeatureChanged_(t){const e=t.feature;this.featureCache_[z(e)]={feature:e,properties:e.getProperties(),geometry:e.getGeometry()}}handleSourceFeatureDelete_(t){const e=t.feature;delete this.featureCache_[z(e)],this.featureCount_--}handleSourceFeatureClear_(){this.featureCache_={},this.featureCount_=0}renderFrame(t){const e=this.helper.getGL();this.preRender(e,t);const i=t.viewState.projection,n=this.getLayer().getSource().getWrapX()&&i.canWrapX(),r=i.getExtent(),s=t.extent,o=n?Se(r):null,a=n?Math.ceil((s[2]-r[2])/o)+1:1,l=n?Math.floor((s[0]-r[0])/o):0;let h=l;const c=this.indicesBuffer_.getSize();do{this.helper.makeProjectionTransform(t,this.currentTransform_),Lt(this.currentTransform_,h*o,0),Et(this.currentTransform_,this.invertRenderTransform_),this.helper.applyUniforms(t),this.helper.drawElements(0,c)}while(++h<a);this.helper.finalizeDraw(t,this.dispatchPreComposeEvent,this.dispatchPostComposeEvent);const u=this.helper.getCanvas();return this.hitDetectionEnabled_&&(this.renderHitDetection(t,l,a,o),this.hitRenderTarget_.clearCachedData()),this.postRender(e,t),u}prepareFrameInternal(t){const e=this.getLayer(),i=e.getSource(),n=t.viewState,r=!t.viewHints[Ro]&&!t.viewHints[Po],s=!ee(this.previousExtent_,t.extent),o=this.sourceRevision_<i.getRevision();if(o&&(this.sourceRevision_=i.getRevision()),r&&(s||o)){const r=n.projection,s=n.resolution,o=e instanceof Ig?e.getRenderBuffer():0,a=Xt(t.extent,o*s);i.loadFeatures(a,s,r),this.rebuildBuffers_(t),this.previousExtent_=t.extent.slice()}return this.helper.useProgram(this.program_,t),this.helper.prepareDraw(t),this.helper.bindBuffer(this.verticesBuffer_),this.helper.bindBuffer(this.indicesBuffer_),this.helper.enableAttributes(this.attributes),!0}rebuildBuffers_(t){const e=[1,0,0,1,0,0];this.helper.makeProjectionTransform(t,e);const i=(2+this.customAttributes.length)*this.featureCount_;if(this.renderInstructions_&&this.renderInstructions_.length===i||(this.renderInstructions_=new Float32Array(i)),this.hitDetectionEnabled_){const t=(7+this.customAttributes.length)*this.featureCount_;this.hitRenderInstructions_&&this.hitRenderInstructions_.length===t||(this.hitRenderInstructions_=new Float32Array(t))}let n,r;const s=[],o=[];let a,l=0,h=0;for(const t in this.featureCache_){if(n=this.featureCache_[t],r=n.geometry,!r||"Point"!==r.getType())continue;let i;s[0]=r.getFlatCoordinates()[0],s[1]=r.getFlatCoordinates()[1],bt(e,s),a=cf(h+6,o),this.renderInstructions_[l++]=s[0],this.renderInstructions_[l++]=s[1],this.hitDetectionEnabled_&&(this.hitRenderInstructions_[h++]=s[0],this.hitRenderInstructions_[h++]=s[1],this.hitRenderInstructions_[h++]=a[0],this.hitRenderInstructions_[h++]=a[1],this.hitRenderInstructions_[h++]=a[2],this.hitRenderInstructions_[h++]=a[3],this.hitRenderInstructions_[h++]=Number(t));for(let t=0;t<this.customAttributes.length;t++)i=this.customAttributes[t].callback(n.feature,n.properties),this.renderInstructions_[l++]=i,this.hitDetectionEnabled_&&(this.hitRenderInstructions_[h++]=i)}const c={id:0,type:Mg,renderInstructions:this.renderInstructions_.buffer,customAttributesCount:this.customAttributes.length};if(c.projectionTransform=e,c.generateBuffersRun=++this.generateBuffersRun_,this.ready=!1,this.worker_.postMessage(c,[this.renderInstructions_.buffer]),this.renderInstructions_=null,this.hitDetectionEnabled_){const t={id:0,type:Mg,renderInstructions:this.hitRenderInstructions_.buffer,customAttributesCount:5+this.customAttributes.length};t.projectionTransform=e,t.hitDetection=!0,this.worker_.postMessage(t,[this.hitRenderInstructions_.buffer]),this.hitRenderInstructions_=null}}forEachFeatureAtCoordinate(t,e,i,n,r){if(at(this.hitDetectionEnabled_,66),!this.hitRenderInstructions_)return;const s=bt(e.coordinateToPixelTransform,t.slice()),o=this.hitRenderTarget_.readPixel(s[0]/2,s[1]/2),a=uf([o[0]/255,o[1]/255,o[2]/255,o[3]/255]),l=this.hitRenderInstructions_[a],h=Math.floor(l).toString(),c=this.getLayer().getSource().getFeatureByUid(h);return c?n(c,this.getLayer(),null):void 0}renderHitDetection(t,e,i,n){if(!this.hitVerticesBuffer_.getSize())return;let r=e;this.hitRenderTarget_.setSize([Math.floor(t.size[0]/2),Math.floor(t.size[1]/2)]),this.helper.useProgram(this.hitProgram_,t),this.helper.prepareDrawToRenderTarget(t,this.hitRenderTarget_,!0),this.helper.bindBuffer(this.hitVerticesBuffer_),this.helper.bindBuffer(this.indicesBuffer_),this.helper.enableAttributes(this.hitDetectionAttributes);do{this.helper.makeProjectionTransform(t,this.currentTransform_),Lt(this.currentTransform_,r*n,0),Et(this.currentTransform_,this.invertRenderTransform_),this.helper.applyUniforms(t);const e=this.indicesBuffer_.getSize();this.helper.drawElements(0,e)}while(++r<i)}disposeInternal(){this.worker_.terminate(),this.layer_=null,this.sourceListenKeys_.forEach((function(t){k(t)})),this.sourceListenKeys_=null,super.disposeInternal()}}let ff=0;class pf{constructor(t,e,i,n,r){this.helper_=t,this.worker_=e,this.program_=this.helper_.getProgram(n,i),this.attributes=[],this.customAttributes=r}rebuild(t,e,i,n){t.renderInstructionsTransform=this.helper_.makeProjectionTransform(e,[1,0,0,1,0,0]),this.generateRenderInstructions(t),this.generateBuffers_(t,i,n)}render(t,e,i,n){this.helper_.makeProjectionTransform(i,e),Lt(e,n,0),Et(e,t.invertVerticesBufferTransform),this.helper_.useProgram(this.program_,i),this.helper_.bindBuffer(t.verticesBuffer),this.helper_.bindBuffer(t.indicesBuffer),this.helper_.enableAttributes(this.attributes);const r=t.indicesBuffer.getSize();this.helper_.drawElements(0,r)}generateRenderInstructions(t){B()}generateBuffers_(t,e,i){const n=ff++;let r;switch(e){case"Polygon":r=Lg;break;case"Point":r=Mg;break;case"LineString":r=Fg}const s={id:n,type:r,renderInstructions:t.renderInstructions.buffer,renderInstructionsTransform:t.renderInstructionsTransform,customAttributesCount:this.customAttributes.length};this.worker_.postMessage(s,[t.renderInstructions.buffer]),t.renderInstructions=null;const o=function(e){const r=e.data;r.id===n&&(this.worker_.removeEventListener("message",o),t.verticesBufferTransform=r.renderInstructionsTransform,Ft(t.invertVerticesBufferTransform,t.verticesBufferTransform),t.verticesBuffer.fromArrayBuffer(r.vertexBuffer),this.helper_.flushBufferData(t.verticesBuffer),t.indicesBuffer.fromArrayBuffer(r.indexBuffer),this.helper_.flushBufferData(t.indicesBuffer),t.renderInstructions=new Float32Array(r.renderInstructions),i())}.bind(this);this.worker_.addEventListener("message",o)}}const mf={SEGMENT_START:"a_segmentStart",SEGMENT_END:"a_segmentEnd",PARAMETERS:"a_parameters"};class _f extends pf{constructor(t,e,i,n,r){super(t,e,i,n,r),this.attributes=[{name:mf.SEGMENT_START,size:2,type:Qu.FLOAT},{name:mf.SEGMENT_END,size:2,type:Qu.FLOAT},{name:mf.PARAMETERS,size:1,type:Qu.FLOAT}].concat(r.map((function(t){return{name:"a_"+t.name,size:1,type:Qu.FLOAT}})))}generateRenderInstructions(t){const e=2*t.verticesCount+(1+this.customAttributes.length)*t.geometriesCount;let i;t.renderInstructions&&t.renderInstructions.length===e||(t.renderInstructions=new Float32Array(e));const n=[];let r,s=0;for(const e in t.entries){i=t.entries[e];for(let e=0,o=i.flatCoordss.length;e<o;e++){n.length=i.flatCoordss[e].length,un(i.flatCoordss[e],0,n.length,2,t.renderInstructionsTransform,n);for(let e=0,n=this.customAttributes.length;e<n;e++)r=this.customAttributes[e].callback(i.feature),t.renderInstructions[s++]=r;t.renderInstructions[s++]=n.length/2;for(let e=0,i=n.length;e<i;e+=2)t.renderInstructions[s++]=n[e],t.renderInstructions[s++]=n[e+1]}}}}class yf{constructor(){this.polygonBatch={entries:{},geometriesCount:0,verticesCount:0,ringsCount:0,renderInstructions:new Float32Array(0),verticesBuffer:new Gu(nu,ou),indicesBuffer:new Gu(ru,ou),renderInstructionsTransform:[1,0,0,1,0,0],verticesBufferTransform:[1,0,0,1,0,0],invertVerticesBufferTransform:[1,0,0,1,0,0]},this.pointBatch={entries:{},geometriesCount:0,renderInstructions:new Float32Array(0),verticesBuffer:new Gu(nu,ou),indicesBuffer:new Gu(ru,ou),renderInstructionsTransform:[1,0,0,1,0,0],verticesBufferTransform:[1,0,0,1,0,0],invertVerticesBufferTransform:[1,0,0,1,0,0]},this.lineStringBatch={entries:{},geometriesCount:0,verticesCount:0,renderInstructions:new Float32Array(0),verticesBuffer:new Gu(nu,ou),indicesBuffer:new Gu(ru,ou),renderInstructionsTransform:[1,0,0,1,0,0],verticesBufferTransform:[1,0,0,1,0,0],invertVerticesBufferTransform:[1,0,0,1,0,0]}}addFeatures(t){for(let e=0;e<t.length;e++)this.addFeature(t[e])}addFeature(t){const e=t.getGeometry();e&&this.addGeometry_(e,t)}addFeatureEntryInPointBatch_(t){const e=z(t);return e in this.pointBatch.entries||(this.pointBatch.entries[e]={feature:t,flatCoordss:[]}),this.pointBatch.entries[e]}addFeatureEntryInLineStringBatch_(t){const e=z(t);return e in this.lineStringBatch.entries||(this.lineStringBatch.entries[e]={feature:t,flatCoordss:[],verticesCount:0}),this.lineStringBatch.entries[e]}addFeatureEntryInPolygonBatch_(t){const e=z(t);return e in this.polygonBatch.entries||(this.polygonBatch.entries[e]={feature:t,flatCoordss:[],verticesCount:0,ringsCount:0,ringsVerticesCounts:[]}),this.polygonBatch.entries[e]}clearFeatureEntryInPointBatch_(t){const e=this.pointBatch.entries[z(t)];e&&(this.pointBatch.geometriesCount-=e.flatCoordss.length,delete this.pointBatch.entries[z(t)])}clearFeatureEntryInLineStringBatch_(t){const e=this.lineStringBatch.entries[z(t)];e&&(this.lineStringBatch.verticesCount-=e.verticesCount,this.lineStringBatch.geometriesCount-=e.flatCoordss.length,delete this.lineStringBatch.entries[z(t)])}clearFeatureEntryInPolygonBatch_(t){const e=this.polygonBatch.entries[z(t)];e&&(this.polygonBatch.verticesCount-=e.verticesCount,this.polygonBatch.ringsCount-=e.ringsCount,this.polygonBatch.geometriesCount-=e.flatCoordss.length,delete this.polygonBatch.entries[z(t)])}addGeometry_(t,e){let i,n,r;switch(t.getType()){case"GeometryCollection":t.getGeometries().map((t=>this.addGeometry_(t,e)));break;case"MultiPolygon":t.getPolygons().map((t=>this.addGeometry_(t,e)));break;case"MultiLineString":t.getLineStrings().map((t=>this.addGeometry_(t,e)));break;case"MultiPoint":t.getPoints().map((t=>this.addGeometry_(t,e)));break;case"Polygon":const s=t;r=this.addFeatureEntryInPolygonBatch_(e),i=s.getFlatCoordinates(),n=i.length/2;const o=s.getLinearRingCount(),a=s.getEnds().map(((t,e,i)=>e>0?(t-i[e-1])/2:t/2));this.polygonBatch.verticesCount+=n,this.polygonBatch.ringsCount+=o,this.polygonBatch.geometriesCount++,r.flatCoordss.push(i),r.ringsVerticesCounts.push(a),r.verticesCount+=n,r.ringsCount+=o,s.getLinearRings().map((t=>this.addGeometry_(t,e)));break;case"Point":const l=t;r=this.addFeatureEntryInPointBatch_(e),i=l.getFlatCoordinates(),this.pointBatch.geometriesCount++,r.flatCoordss.push(i);break;case"LineString":case"LinearRing":const h=t;r=this.addFeatureEntryInLineStringBatch_(e),i=h.getFlatCoordinates(),n=i.length/2,this.lineStringBatch.verticesCount+=n,this.lineStringBatch.geometriesCount++,r.flatCoordss.push(i),r.verticesCount+=n}}changeFeature(t){this.clearFeatureEntryInPointBatch_(t),this.clearFeatureEntryInPolygonBatch_(t),this.clearFeatureEntryInLineStringBatch_(t);const e=t.getGeometry();e&&this.addGeometry_(e,t)}removeFeature(t){this.clearFeatureEntryInPointBatch_(t),this.clearFeatureEntryInPolygonBatch_(t),this.clearFeatureEntryInLineStringBatch_(t)}clear(){this.polygonBatch.entries={},this.polygonBatch.geometriesCount=0,this.polygonBatch.verticesCount=0,this.polygonBatch.ringsCount=0,this.lineStringBatch.entries={},this.lineStringBatch.geometriesCount=0,this.lineStringBatch.verticesCount=0,this.pointBatch.entries={},this.pointBatch.geometriesCount=0}}const xf={POSITION:"a_position",INDEX:"a_index"};class vf extends pf{constructor(t,e,i,n,r){super(t,e,i,n,r),this.attributes=[{name:xf.POSITION,size:2,type:Qu.FLOAT},{name:xf.INDEX,size:1,type:Qu.FLOAT}].concat(r.map((function(t){return{name:"a_"+t.name,size:1,type:Qu.FLOAT}})))}generateRenderInstructions(t){const e=(2+this.customAttributes.length)*t.geometriesCount;let i;t.renderInstructions&&t.renderInstructions.length===e||(t.renderInstructions=new Float32Array(e));const n=[];let r,s=0;for(const e in t.entries){i=t.entries[e];for(let e=0,o=i.flatCoordss.length;e<o;e++){n[0]=i.flatCoordss[e][0],n[1]=i.flatCoordss[e][1],bt(t.renderInstructionsTransform,n),t.renderInstructions[s++]=n[0],t.renderInstructions[s++]=n[1];for(let e=0,n=this.customAttributes.length;e<n;e++)r=this.customAttributes[e].callback(i.feature),t.renderInstructions[s++]=r}}}}const Sf={POSITION:"a_position"};class wf extends pf{constructor(t,e,i,n,r){super(t,e,i,n,r),this.attributes=[{name:Sf.POSITION,size:2,type:Qu.FLOAT}].concat(r.map((function(t){return{name:"a_"+t.name,size:1,type:Qu.FLOAT}})))}generateRenderInstructions(t){const e=2*t.verticesCount+(1+this.customAttributes.length)*t.geometriesCount+t.ringsCount;let i;t.renderInstructions&&t.renderInstructions.length===e||(t.renderInstructions=new Float32Array(e));const n=[];let r,s=0;for(const e in t.entries){i=t.entries[e];for(let e=0,o=i.flatCoordss.length;e<o;e++){n.length=i.flatCoordss[e].length,un(i.flatCoordss[e],0,n.length,2,t.renderInstructionsTransform,n);for(let e=0,n=this.customAttributes.length;e<n;e++)r=this.customAttributes[e].callback(i.feature),t.renderInstructions[s++]=r;t.renderInstructions[s++]=i.ringsVerticesCounts[e].length;for(let n=0,r=i.ringsVerticesCounts[e].length;n<r;n++)t.renderInstructions[s++]=i.ringsVerticesCounts[e][n];for(let e=0,i=n.length;e<i;e+=2)t.renderInstructions[s++]=n[e],t.renderInstructions[s++]=n[e+1]}}}}function Ef(t){const e=$r(t);return 256*e[0]*256+256*e[1]+e[2]}const Tf="vec3(\n fract(floor(a_color / 256.0 / 256.0) / 256.0),\n fract(floor(a_color / 256.0) / 256.0),\n fract(a_color / 256.0)\n);",Cf=`\n precision mediump float;\n uniform mat4 u_projectionMatrix;\n attribute vec2 a_position;\n attribute float a_color;\n attribute float a_opacity;\n varying vec3 v_color;\n varying float v_opacity;\n\n void main(void) {\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0);\n v_color = ${Tf}\n v_opacity = a_opacity;\n }`,bf="\n precision mediump float;\n varying vec3 v_color;\n varying float v_opacity;\n\n void main(void) {\n gl_FragColor = vec4(v_color, 1.0) * v_opacity;\n }",Rf=`\n precision mediump float;\n uniform mat4 u_projectionMatrix;\n uniform vec2 u_sizePx;\n attribute vec2 a_segmentStart;\n attribute vec2 a_segmentEnd;\n attribute float a_parameters;\n attribute float a_color;\n attribute float a_opacity;\n attribute float a_width;\n varying vec2 v_segmentStart;\n varying vec2 v_segmentEnd;\n varying float v_angleStart;\n varying float v_angleEnd;\n varying vec3 v_color;\n varying float v_opacity;\n varying float v_width;\n\n vec2 worldToPx(vec2 worldPos) {\n vec4 screenPos = u_projectionMatrix * vec4(worldPos, 0.0, 1.0);\n return (0.5 * screenPos.xy + 0.5) * u_sizePx;\n }\n\n vec4 pxToScreen(vec2 pxPos) {\n vec2 screenPos = pxPos * 4.0 / u_sizePx;\n return vec4(screenPos.xy, 0.0, 0.0);\n }\n\n vec2 getOffsetDirection(vec2 normalPx, vec2 tangentPx, float joinAngle) {\n if (cos(joinAngle) > 0.93) return normalPx - tangentPx;\n float halfAngle = joinAngle / 2.0;\n vec2 angleBisectorNormal = vec2(\n sin(halfAngle) * normalPx.x + cos(halfAngle) * normalPx.y,\n -cos(halfAngle) * normalPx.x + sin(halfAngle) * normalPx.y\n );\n float length = 1.0 / sin(halfAngle);\n return angleBisectorNormal * length;\n }\n\n void main(void) {\n float anglePrecision = 1500.0;\n float paramShift = 10000.0;\n v_angleStart = fract(a_parameters / paramShift) * paramShift / anglePrecision;\n v_angleEnd = fract(floor(a_parameters / paramShift + 0.5) / paramShift) * paramShift / anglePrecision;\n float vertexNumber = floor(a_parameters / paramShift / paramShift + 0.0001);\n vec2 tangentPx = worldToPx(a_segmentEnd) - worldToPx(a_segmentStart);\n tangentPx = normalize(tangentPx);\n vec2 normalPx = vec2(-tangentPx.y, tangentPx.x);\n float normalDir = vertexNumber < 0.5 || (vertexNumber > 1.5 && vertexNumber < 2.5) ? 1.0 : -1.0;\n float tangentDir = vertexNumber < 1.5 ? 1.0 : -1.0;\n float angle = vertexNumber < 1.5 ? v_angleStart : v_angleEnd;\n vec2 offsetPx = getOffsetDirection(normalPx * normalDir, tangentDir * tangentPx, angle) * a_width * 0.5;\n vec2 position = vertexNumber < 1.5 ? a_segmentStart : a_segmentEnd;\n gl_Position = u_projectionMatrix * vec4(position, 0.0, 1.0) + pxToScreen(offsetPx);\n v_segmentStart = worldToPx(a_segmentStart);\n v_segmentEnd = worldToPx(a_segmentEnd);\n v_color = ${Tf}\n v_opacity = a_opacity;\n v_width = a_width;\n }`,Pf="\n precision mediump float;\n uniform float u_pixelRatio;\n varying vec2 v_segmentStart;\n varying vec2 v_segmentEnd;\n varying float v_angleStart;\n varying float v_angleEnd;\n varying vec3 v_color;\n varying float v_opacity;\n varying float v_width;\n\n float segmentDistanceField(vec2 point, vec2 start, vec2 end, float radius) {\n vec2 startToPoint = point - start;\n vec2 startToEnd = end - start;\n float ratio = clamp(dot(startToPoint, startToEnd) / dot(startToEnd, startToEnd), 0.0, 1.0);\n float dist = length(startToPoint - ratio * startToEnd);\n return 1.0 - smoothstep(radius - 1.0, radius, dist);\n }\n\n void main(void) {\n vec2 v_currentPoint = gl_FragCoord.xy / u_pixelRatio;\n gl_FragColor = vec4(v_color, 1.0) * v_opacity;\n gl_FragColor *= segmentDistanceField(v_currentPoint, v_segmentStart, v_segmentEnd, v_width);\n }",If=`\n precision mediump float;\n uniform mat4 u_projectionMatrix;\n uniform mat4 u_offsetScaleMatrix;\n attribute vec2 a_position;\n attribute float a_index;\n attribute float a_color;\n attribute float a_opacity;\n varying vec2 v_texCoord;\n varying vec3 v_color;\n varying float v_opacity;\n\n void main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix;\n float size = 6.0;\n float offsetX = a_index == 0.0 || a_index == 3.0 ? -size / 2.0 : size / 2.0;\n float offsetY = a_index == 0.0 || a_index == 1.0 ? -size / 2.0 : size / 2.0;\n vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n float u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;\n float v = a_index == 0.0 || a_index == 1.0 ? 0.0 : 1.0;\n v_texCoord = vec2(u, v);\n v_color = ${Tf}\n v_opacity = a_opacity;\n }`,Lf="\n precision mediump float;\n varying vec3 v_color;\n varying float v_opacity;\n\n void main(void) {\n gl_FragColor = vec4(v_color, 1.0) * v_opacity;\n }";function Mf(t){return Object.keys(t).map((e=>({name:e,callback:t[e]})))}const Ff=0,Af=1,Of=2,Nf=3,Df=4,kf=5,Gf=6,jf=7,Bf=8,Uf=9,zf=10,Xf=11,Vf=12,Wf=[Bf],Zf=[Vf],Yf=[Af],Kf=[Nf];class qf extends Cl{constructor(t,e,i,n){super(),this.tolerance=t,this.maxExtent=e,this.pixelRatio=n,this.maxLineWidth=0,this.resolution=i,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_=null,this.bufferedMaxExtent_=null,this.instructions=[],this.coordinates=[],this.tmpCoordinate_=[],this.hitDetectionInstructions=[],this.state={}}applyPixelRatio(t){const e=this.pixelRatio;return 1==e?t:t.map((function(t){return t*e}))}appendFlatPointCoordinates(t,e){const i=this.getBufferedMaxExtent(),n=this.tmpCoordinate_,r=this.coordinates;let s=r.length;for(let o=0,a=t.length;o<a;o+=e)n[0]=t[o],n[1]=t[o+1],Zt(i,n)&&(r[s++]=n[0],r[s++]=n[1]);return s}appendFlatLineCoordinates(t,e,i,n,r,s){const o=this.coordinates;let a=o.length;const l=this.getBufferedMaxExtent();s&&(e+=n);let h=t[e],c=t[e+1];const u=this.tmpCoordinate_;let d,g,f,p=!0;for(d=e+n;d<i;d+=n)u[0]=t[d],u[1]=t[d+1],f=qt(l,u),f!==g?(p&&(o[a++]=h,o[a++]=c,p=!1),o[a++]=u[0],o[a++]=u[1]):f===kt?(o[a++]=u[0],o[a++]=u[1],p=!1):p=!0,h=u[0],c=u[1],g=f;return(r&&p||d===e+n)&&(o[a++]=h,o[a++]=c),a}drawCustomCoordinates_(t,e,i,n,r){for(let s=0,o=i.length;s<o;++s){const o=i[s],a=this.appendFlatLineCoordinates(t,e,o,n,!1,!1);r.push(a),e=o}return e}drawCustom(t,e,i,n){this.beginGeometry(t,e);const r=t.getType(),s=t.getStride(),o=this.coordinates.length;let a,l,h,c,u;switch(r){case"MultiPolygon":a=t.getOrientedFlatCoordinates(),c=[];const e=t.getEndss();u=0;for(let t=0,i=e.length;t<i;++t){const i=[];u=this.drawCustomCoordinates_(a,u,e[t],s,i),c.push(i)}this.instructions.push([Df,o,c,t,i,Bn]),this.hitDetectionInstructions.push([Df,o,c,t,n||i,Bn]);break;case"Polygon":case"MultiLineString":h=[],a="Polygon"==r?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),u=this.drawCustomCoordinates_(a,0,t.getEnds(),s,h),this.instructions.push([Df,o,h,t,i,jn]),this.hitDetectionInstructions.push([Df,o,h,t,n||i,jn]);break;case"LineString":case"Circle":a=t.getFlatCoordinates(),l=this.appendFlatLineCoordinates(a,0,a.length,s,!1,!1),this.instructions.push([Df,o,l,t,i,Gn]),this.hitDetectionInstructions.push([Df,o,l,t,n||i,Gn]);break;case"MultiPoint":a=t.getFlatCoordinates(),l=this.appendFlatPointCoordinates(a,s),l>o&&(this.instructions.push([Df,o,l,t,i,Gn]),this.hitDetectionInstructions.push([Df,o,l,t,n||i,Gn]));break;case"Point":a=t.getFlatCoordinates(),this.coordinates.push(a[0],a[1]),l=this.coordinates.length,this.instructions.push([Df,o,l,t,i]),this.hitDetectionInstructions.push([Df,o,l,t,n||i])}this.endGeometry(e)}beginGeometry(t,e){this.beginGeometryInstruction1_=[Ff,e,0,t],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[Ff,e,0,t],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)}finish(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}}reverseHitDetectionInstructions(){const t=this.hitDetectionInstructions;let e;t.reverse();const i=t.length;let n,r,s=-1;for(e=0;e<i;++e)n=t[e],r=n[0],r==jf?s=e:r==Ff&&(n[2]=e,h(this.hitDetectionInstructions,s,e),s=-1)}setFillStrokeStyle(t,e){const i=this.state;if(t){const e=t.getColor();i.fillStyle=fl(e||Ns)}else i.fillStyle=void 0;if(e){const t=e.getColor();i.strokeStyle=fl(t||Bs);const n=e.getLineCap();i.lineCap=void 0!==n?n:Ds;const r=e.getLineDash();i.lineDash=r?r.slice():ks;const s=e.getLineDashOffset();i.lineDashOffset=s||0;const o=e.getLineJoin();i.lineJoin=void 0!==o?o:Gs;const a=e.getWidth();i.lineWidth=void 0!==a?a:1;const l=e.getMiterLimit();i.miterLimit=void 0!==l?l:js,i.lineWidth>this.maxLineWidth&&(this.maxLineWidth=i.lineWidth,this.bufferedMaxExtent_=null)}else i.strokeStyle=void 0,i.lineCap=void 0,i.lineDash=null,i.lineDashOffset=void 0,i.lineJoin=void 0,i.lineWidth=void 0,i.miterLimit=void 0}createFill(t){const e=t.fillStyle,i=[zf,e];return"string"!=typeof e&&i.push(!0),i}applyStroke(t){this.instructions.push(this.createStroke(t))}createStroke(t){return[Xf,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,this.applyPixelRatio(t.lineDash),t.lineDashOffset*this.pixelRatio]}updateFillStyle(t,e){const i=t.fillStyle;"string"==typeof i&&t.currentFillStyle==i||(void 0!==i&&this.instructions.push(e.call(this,t)),t.currentFillStyle=i)}updateStrokeStyle(t,e){const i=t.strokeStyle,n=t.lineCap,r=t.lineDash,s=t.lineDashOffset,o=t.lineJoin,a=t.lineWidth,l=t.miterLimit;(t.currentStrokeStyle!=i||t.currentLineCap!=n||r!=t.currentLineDash&&!u(t.currentLineDash,r)||t.currentLineDashOffset!=s||t.currentLineJoin!=o||t.currentLineWidth!=a||t.currentMiterLimit!=l)&&(void 0!==i&&e.call(this,t),t.currentStrokeStyle=i,t.currentLineCap=n,t.currentLineDash=r,t.currentLineDashOffset=s,t.currentLineJoin=o,t.currentLineWidth=a,t.currentMiterLimit=l)}endGeometry(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;const e=[jf,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)}getBufferedMaxExtent(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=Vt(this.maxExtent),this.maxLineWidth>0)){const t=this.resolution*(this.maxLineWidth+1)/2;Xt(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_}}class Hf extends qf{constructor(t,e,i,n){super(t,e,i,n),this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.width_=void 0,this.declutterMode_=void 0,this.declutterImageWithText_=void 0}drawPoint(t,e){if(!this.image_)return;this.beginGeometry(t,e);const i=t.getFlatCoordinates(),n=t.getStride(),r=this.coordinates.length,s=this.appendFlatPointCoordinates(i,n);this.instructions.push([Gf,r,s,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([Gf,r,s,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(e)}drawMultiPoint(t,e){if(!this.image_)return;this.beginGeometry(t,e);const i=t.getFlatCoordinates(),n=t.getStride(),r=this.coordinates.length,s=this.appendFlatPointCoordinates(i,n);this.instructions.push([Gf,r,s,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([Gf,r,s,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,this.opacity_,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(e)}finish(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,super.finish()}setImageStyle(t,e){const i=t.getAnchor(),n=t.getSize(),r=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=i[0],this.anchorY_=i[1],this.hitDetectionImage_=t.getHitDetectionImage(),this.image_=t.getImage(this.pixelRatio),this.height_=n[1],this.opacity_=t.getOpacity(),this.originX_=r[0],this.originY_=r[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=n[0],this.declutterMode_=t.getDeclutterMode(),this.declutterImageWithText_=e}}class $f extends qf{constructor(t,e,i,n){super(t,e,i,n)}drawFlatCoordinates_(t,e,i,n){const r=this.coordinates.length,s=this.appendFlatLineCoordinates(t,e,i,n,!1,!1),o=[Uf,r,s];return this.instructions.push(o),this.hitDetectionInstructions.push(o),i}drawLineString(t,e){const i=this.state,n=i.strokeStyle,r=i.lineWidth;if(void 0===n||void 0===r)return;this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([Xf,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,ks,0],Yf);const s=t.getFlatCoordinates(),o=t.getStride();this.drawFlatCoordinates_(s,0,s.length,o),this.hitDetectionInstructions.push(Zf),this.endGeometry(e)}drawMultiLineString(t,e){const i=this.state,n=i.strokeStyle,r=i.lineWidth;if(void 0===n||void 0===r)return;this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e),this.hitDetectionInstructions.push([Xf,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset],Yf);const s=t.getEnds(),o=t.getFlatCoordinates(),a=t.getStride();let l=0;for(let t=0,e=s.length;t<e;++t)l=this.drawFlatCoordinates_(o,l,s[t],a);this.hitDetectionInstructions.push(Zf),this.endGeometry(e)}finish(){const t=this.state;return null!=t.lastStroke&&t.lastStroke!=this.coordinates.length&&this.instructions.push(Zf),this.reverseHitDetectionInstructions(),this.state=null,super.finish()}applyStroke(t){null!=t.lastStroke&&t.lastStroke!=this.coordinates.length&&(this.instructions.push(Zf),t.lastStroke=this.coordinates.length),t.lastStroke=0,super.applyStroke(t),this.instructions.push(Yf)}}class Jf extends qf{constructor(t,e,i,n){super(t,e,i,n)}drawFlatCoordinatess_(t,e,i,n){const r=this.state,s=void 0!==r.fillStyle,o=void 0!==r.strokeStyle,a=i.length;this.instructions.push(Yf),this.hitDetectionInstructions.push(Yf);for(let r=0;r<a;++r){const s=i[r],a=this.coordinates.length,l=this.appendFlatLineCoordinates(t,e,s,n,!0,!o),h=[Uf,a,l];this.instructions.push(h),this.hitDetectionInstructions.push(h),o&&(this.instructions.push(Kf),this.hitDetectionInstructions.push(Kf)),e=s}return s&&(this.instructions.push(Wf),this.hitDetectionInstructions.push(Wf)),o&&(this.instructions.push(Zf),this.hitDetectionInstructions.push(Zf)),e}drawCircle(t,e){const i=this.state,n=i.fillStyle,r=i.strokeStyle;if(void 0===n&&void 0===r)return;this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([zf,Ns]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([Xf,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);const s=t.getFlatCoordinates(),o=t.getStride(),a=this.coordinates.length;this.appendFlatLineCoordinates(s,0,s.length,o,!1,!1);const l=[Of,a];this.instructions.push(Yf,l),this.hitDetectionInstructions.push(Yf,l),void 0!==i.fillStyle&&(this.instructions.push(Wf),this.hitDetectionInstructions.push(Wf)),void 0!==i.strokeStyle&&(this.instructions.push(Zf),this.hitDetectionInstructions.push(Zf)),this.endGeometry(e)}drawPolygon(t,e){const i=this.state,n=i.fillStyle,r=i.strokeStyle;if(void 0===n&&void 0===r)return;this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([zf,Ns]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([Xf,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);const s=t.getEnds(),o=t.getOrientedFlatCoordinates(),a=t.getStride();this.drawFlatCoordinatess_(o,0,s,a),this.endGeometry(e)}drawMultiPolygon(t,e){const i=this.state,n=i.fillStyle,r=i.strokeStyle;if(void 0===n&&void 0===r)return;this.setFillStrokeStyles_(),this.beginGeometry(t,e),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([zf,Ns]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([Xf,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,i.lineDash,i.lineDashOffset]);const s=t.getEndss(),o=t.getOrientedFlatCoordinates(),a=t.getStride();let l=0;for(let t=0,e=s.length;t<e;++t)l=this.drawFlatCoordinatess_(o,l,s[t],a);this.endGeometry(e)}finish(){this.reverseHitDetectionInstructions(),this.state=null;const t=this.tolerance;if(0!==t){const e=this.coordinates;for(let i=0,n=e.length;i<n;++i)e[i]=On(e[i],t)}return super.finish()}setFillStrokeStyles_(){const t=this.state;void 0!==t.fillStyle&&this.updateFillStyle(t,this.createFill),void 0!==t.strokeStyle&&this.updateStrokeStyle(t,this.applyStroke)}}function Qf(t,e,i,n,r){let s,o,a,l,h,c,u,d,g,f,p=i,m=i,_=0,y=0,x=i;for(o=i;o<n;o+=r){const i=e[o],n=e[o+1];void 0!==h&&(g=i-h,f=n-c,l=Math.sqrt(g*g+f*f),void 0!==u&&(y+=a,s=Math.acos((u*g+d*f)/(a*l)),s>t&&(y>_&&(_=y,p=x,m=o),y=0,x=o-r)),a=l,u=g,d=f),h=i,c=n}return y+=l,y>_?[x,o]:[p,m]}const tp={left:0,end:0,center:.5,right:1,start:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1};class ep extends qf{constructor(t,e,i,n){super(t,e,i,n),this.labels_=null,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",this.declutterImageWithText_=void 0}finish(){const t=super.finish();return t.textStates=this.textStates,t.fillStates=this.fillStates,t.strokeStates=this.strokeStates,t}drawText(t,e){const i=this.textFillState_,n=this.textStrokeState_,r=this.textState_;if(""===this.text_||!r||!i&&!n)return;const s=this.coordinates;let o=s.length;const a=t.getType();let l=null,h=t.getStride();if("line"!==r.placement||"LineString"!=a&&"MultiLineString"!=a&&"Polygon"!=a&&"MultiPolygon"!=a){let i=r.overflow?null:[];switch(a){case"Point":case"MultiPoint":l=t.getFlatCoordinates();break;case"LineString":l=t.getFlatMidpoint();break;case"Circle":l=t.getCenter();break;case"MultiLineString":l=t.getFlatMidpoints(),h=2;break;case"Polygon":l=t.getFlatInteriorPoint(),r.overflow||i.push(l[2]/this.resolution),h=3;break;case"MultiPolygon":const e=t.getFlatInteriorPoints();l=[];for(let t=0,n=e.length;t<n;t+=3)r.overflow||i.push(e[t+2]/this.resolution),l.push(e[t],e[t+1]);if(0===l.length)return;h=2}const n=this.appendFlatPointCoordinates(l,h);if(n===o)return;if(i&&(n-o)/2!=l.length/h){let t=o/2;i=i.filter(((e,i)=>{const n=s[2*(t+i)]===l[i*h]&&s[2*(t+i)+1]===l[i*h+1];return n||--t,n}))}this.saveTextStates_(),(r.backgroundFill||r.backgroundStroke)&&(this.setFillStrokeStyle(r.backgroundFill,r.backgroundStroke),r.backgroundFill&&(this.updateFillStyle(this.state,this.createFill),this.hitDetectionInstructions.push(this.createFill(this.state))),r.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e);let c=r.padding;if(c!=Xs&&(r.scale[0]<0||r.scale[1]<0)){let t=r.padding[0],e=r.padding[1],i=r.padding[2],n=r.padding[3];r.scale[0]<0&&(e=-e,n=-n),r.scale[1]<0&&(t=-t,i=-i),c=[t,e,i,n]}const u=this.pixelRatio;this.instructions.push([Gf,o,n,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,void 0,this.declutterImageWithText_,c==Xs?Xs:c.map((function(t){return t*u})),!!r.backgroundFill,!!r.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,i]);const d=1/u;this.hitDetectionInstructions.push([Gf,o,n,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[d,d],NaN,void 0,this.declutterImageWithText_,c,!!r.backgroundFill,!!r.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,i]),this.endGeometry(e)}else{if(!we(this.getBufferedMaxExtent(),t.getExtent()))return;let i;if(l=t.getFlatCoordinates(),"LineString"==a)i=[l.length];else if("MultiLineString"==a)i=t.getEnds();else if("Polygon"==a)i=t.getEnds().slice(0,1);else if("MultiPolygon"==a){const e=t.getEndss();i=[];for(let t=0,n=e.length;t<n;++t)i.push(e[t][0])}this.beginGeometry(t,e);const n=r.textAlign;let c,u=0;for(let t=0,e=i.length;t<e;++t){if(null==n){const e=Qf(r.maxAngle,l,u,i[t],h);u=e[0],c=e[1]}else c=i[t];for(let t=u;t<c;t+=h)s.push(l[t],l[t+1]);const e=s.length;u=i[t],this.drawChars_(o,e),o=e}this.endGeometry(e)}}saveTextStates_(){const t=this.textStrokeState_,e=this.textState_,i=this.textFillState_,n=this.strokeKey_;t&&(n in this.strokeStates||(this.strokeStates[n]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));const r=this.textKey_;r in this.textStates||(this.textStates[r]={font:e.font,textAlign:e.textAlign||Us,justify:e.justify,textBaseline:e.textBaseline||zs,scale:e.scale});const s=this.fillKey_;i&&(s in this.fillStates||(this.fillStates[s]={fillStyle:i.fillStyle}))}drawChars_(t,e){const i=this.textStrokeState_,n=this.textState_,r=this.strokeKey_,s=this.textKey_,o=this.fillKey_;this.saveTextStates_();const a=this.pixelRatio,l=tp[n.textBaseline],h=this.textOffsetY_*a,c=this.text_,u=i?i.lineWidth*Math.abs(n.scale[0])/2:0;this.instructions.push([kf,t,e,l,n.overflow,o,n.maxAngle,a,h,r,u*a,c,s,1]),this.hitDetectionInstructions.push([kf,t,e,l,n.overflow,o,n.maxAngle,1,h,r,u,c,s,1/a])}setTextStyle(t,e){let i,n,r;if(t){const e=t.getFill();e?(n=this.textFillState_,n||(n={},this.textFillState_=n),n.fillStyle=fl(e.getColor()||Ns)):(n=null,this.textFillState_=n);const s=t.getStroke();if(s){r=this.textStrokeState_,r||(r={},this.textStrokeState_=r);const t=s.getLineDash(),e=s.getLineDashOffset(),i=s.getWidth(),n=s.getMiterLimit();r.lineCap=s.getLineCap()||Ds,r.lineDash=t?t.slice():ks,r.lineDashOffset=void 0===e?0:e,r.lineJoin=s.getLineJoin()||Gs,r.lineWidth=void 0===i?1:i,r.miterLimit=void 0===n?js:n,r.strokeStyle=fl(s.getColor()||Bs)}else r=null,this.textStrokeState_=r;i=this.textState_;const o=t.getFont()||Os;Ks(o);const a=t.getScaleArray();i.overflow=t.getOverflow(),i.font=o,i.maxAngle=t.getMaxAngle(),i.placement=t.getPlacement(),i.textAlign=t.getTextAlign(),i.justify=t.getJustify(),i.textBaseline=t.getTextBaseline()||zs,i.backgroundFill=t.getBackgroundFill(),i.backgroundStroke=t.getBackgroundStroke(),i.padding=t.getPadding()||Xs,i.scale=void 0===a?[1,1]:a;const l=t.getOffsetX(),h=t.getOffsetY(),c=t.getRotateWithView(),u=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=void 0===l?0:l,this.textOffsetY_=void 0===h?0:h,this.textRotateWithView_=void 0!==c&&c,this.textRotation_=void 0===u?0:u,this.strokeKey_=r?("string"==typeof r.strokeStyle?r.strokeStyle:z(r.strokeStyle))+r.lineCap+r.lineDashOffset+"|"+r.lineWidth+r.lineJoin+r.miterLimit+"["+r.lineDash.join()+"]":"",this.textKey_=i.font+i.scale+(i.textAlign||"?")+(i.justify||"?")+(i.textBaseline||"?"),this.fillKey_=n?"string"==typeof n.fillStyle?n.fillStyle:"|"+z(n.fillStyle):""}else this.text_="";this.declutterImageWithText_=e}}const ip={Circle:Jf,Default:qf,Image:Hf,LineString:$f,Polygon:Jf,Text:ep};class np{constructor(t,e,i,n){this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=n,this.resolution_=i,this.buildersByZIndex_={}}finish(){const t={};for(const e in this.buildersByZIndex_){t[e]=t[e]||{};const i=this.buildersByZIndex_[e];for(const n in i){const r=i[n].finish();t[e][n]=r}}return t}getBuilder(t,e){const i=void 0!==t?t.toString():"0";let n=this.buildersByZIndex_[i];void 0===n&&(n={},this.buildersByZIndex_[i]=n);let r=n[e];if(void 0===r){r=new(0,ip[e])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),n[e]=r}return r}}function rp(t,e,i,n,r,s,o,a,l,h,c,u){let d=t[e],g=t[e+1],f=0,p=0,m=0,_=0;function y(){f=d,p=g,d=t[e+=n],g=t[e+1],_+=m,m=Math.sqrt((d-f)*(d-f)+(g-p)*(g-p))}do{y()}while(e<i-n&&_+m<s);let x=0===m?0:(s-_)/m;const v=hi(f,d,x),S=hi(p,g,x),w=e-n,E=_,T=s+a*l(h,r,c);for(;e<i-n&&_+m<T;)y();x=0===m?0:(T-_)/m;const C=hi(f,d,x),b=hi(p,g,x);let R;if(u){const t=[v,S,C,b];dn(t,0,4,2,u,t,t),R=t[0]>t[2]}else R=v>C;const P=Math.PI,I=[],L=w+n===e;let M;if(m=0,_=E,d=t[e=w],g=t[e+1],L){y(),M=Math.atan2(g-p,d-f),R&&(M+=M>0?-P:P);const t=(C+v)/2,e=(b+S)/2;return I[0]=[t,e,(T-s)/2,M,r],I}for(let t=0,u=(r=r.replace(/\n/g," ")).length;t<u;){y();let v=Math.atan2(g-p,d-f);if(R&&(v+=v>0?-P:P),void 0!==M){let t=v-M;if(t+=t>P?-2*P:t<-P?2*P:0,Math.abs(t)>o)return null}M=v;const S=t;let w=0;for(;t<u;++t){const o=a*l(h,r[R?u-t-1:t],c);if(e+n<i&&_+m<s+w+o/2)break;w+=o}if(t===S)continue;const E=R?r.substring(u-S,u-t):r.substring(S,t);x=0===m?0:(s+w/2-_)/m;const T=hi(f,d,x),C=hi(p,g,x);I.push([T,C,w/2,v,E]),s+=w}return I}function sp(t,e,i,n){let r=t[e],s=t[e+1],o=0;for(let a=e+n;a<i;a+=n){const e=t[a],i=t[a+1];o+=Math.sqrt((e-r)*(e-r)+(i-s)*(i-s)),r=e,s=i}return o}const op=[1/0,1/0,-1/0,-1/0],ap=[],lp=[],hp=[],cp=[];function up(t){return t[3].declutterBox}const dp=new RegExp("["+String.fromCharCode(1425)+"-"+String.fromCharCode(2303)+String.fromCharCode(64285)+"-"+String.fromCharCode(65023)+String.fromCharCode(65136)+"-"+String.fromCharCode(65276)+String.fromCharCode(67584)+"-"+String.fromCharCode(69631)+String.fromCharCode(124928)+"-"+String.fromCharCode(126975)+"]");function gp(t,e){return"start"!==e&&"end"!==e||dp.test(t)||(e="start"===e?"left":"right"),tp[e]}function fp(t,e,i){return i>0&&t.push("\n",""),t.push(e,""),t}class pp{constructor(t,e,i,n){this.overlaps=i,this.pixelRatio=e,this.resolution=t,this.alignFill_,this.instructions=n.instructions,this.coordinates=n.coordinates,this.coordinateCache_={},this.renderedTransform_=[1,0,0,1,0,0],this.hitDetectionInstructions=n.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=n.fillStates||{},this.strokeStates=n.strokeStates||{},this.textStates=n.textStates||{},this.widths_={},this.labels_={}}createLabel(t,e,i,n){const r=t+e+i+n;if(this.labels_[r])return this.labels_[r];const s=n?this.strokeStates[n]:null,o=i?this.fillStates[i]:null,a=this.textStates[e],l=this.pixelRatio,h=[a.scale[0]*l,a.scale[1]*l],c=Array.isArray(t),u=a.justify?tp[a.justify]:gp(Array.isArray(t)?t[0]:t,a.textAlign||Us),d=n&&s.lineWidth?s.lineWidth:0,g=c?t:t.split("\n").reduce(fp,[]),{width:f,height:p,widths:m,heights:_,lineWidths:y}=Qs(a,g),x=f+d,v=[],S=(x+2)*h[0],w=(p+d)*h[1],E={width:S<0?Math.floor(S):Math.ceil(S),height:w<0?Math.floor(w):Math.ceil(w),contextInstructions:v};1==h[0]&&1==h[1]||v.push("scale",h),n&&(v.push("strokeStyle",s.strokeStyle),v.push("lineWidth",d),v.push("lineCap",s.lineCap),v.push("lineJoin",s.lineJoin),v.push("miterLimit",s.miterLimit),v.push("setLineDash",[s.lineDash]),v.push("lineDashOffset",s.lineDashOffset)),i&&v.push("fillStyle",o.fillStyle),v.push("textBaseline","middle"),v.push("textAlign","center");const T=.5-u;let C=u*x+T*d;const b=[],R=[];let P,I=0,L=0,M=0,F=0;for(let t=0,e=g.length;t<e;t+=2){const e=g[t];if("\n"===e){L+=I,I=0,C=u*x+T*d,++F;continue}const r=g[t+1]||a.font;r!==P&&(n&&b.push("font",r),i&&R.push("font",r),P=r),I=Math.max(I,_[M]);const s=[e,C+T*m[M]+u*(m[M]-y[F]),.5*(d+I)+L];C+=m[M],n&&b.push("strokeText",s),i&&R.push("fillText",s),++M}return Array.prototype.push.apply(v,b),Array.prototype.push.apply(v,R),this.labels_[r]=E,E}replayTextBackground_(t,e,i,n,r,s,o){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,i),t.lineTo.apply(t,n),t.lineTo.apply(t,r),t.lineTo.apply(t,e),s&&(this.alignFill_=s[2],this.fill_(t)),o&&(this.setStrokeStyle_(t,o),t.stroke())}calculateImageOrLabelDimensions_(t,e,i,n,r,s,o,a,l,h,c,u,d,g,f,p){let m=i-(o*=u[0]),_=n-(a*=u[1]);const y=r+l>t?t-l:r,x=s+h>e?e-h:s,v=g[3]+y*u[0]+g[1],S=g[0]+x*u[1]+g[2],w=m-g[3],E=_-g[0];let T;return(f||0!==c)&&(ap[0]=w,cp[0]=w,ap[1]=E,lp[1]=E,lp[0]=w+v,hp[0]=lp[0],hp[1]=E+S,cp[1]=hp[1]),0!==c?(T=Mt([1,0,0,1,0,0],i,n,1,1,c,-i,-n),bt(T,ap),bt(T,lp),bt(T,hp),bt(T,cp),$t(Math.min(ap[0],lp[0],hp[0],cp[0]),Math.min(ap[1],lp[1],hp[1],cp[1]),Math.max(ap[0],lp[0],hp[0],cp[0]),Math.max(ap[1],lp[1],hp[1],cp[1]),op)):$t(Math.min(w,w+v),Math.min(E,E+S),Math.max(w,w+v),Math.max(E,E+S),op),d&&(m=Math.round(m),_=Math.round(_)),{drawImageX:m,drawImageY:_,drawImageW:y,drawImageH:x,originX:l,originY:h,declutterBox:{minX:op[0],minY:op[1],maxX:op[2],maxY:op[3],value:p},canvasTransform:T,scale:u}}replayImageOrLabel_(t,e,i,n,r,s,o){const a=!(!s&&!o),l=n.declutterBox,h=t.canvas,c=o?o[2]*n.scale[0]/2:0;return l.minX-c<=h.width/e&&l.maxX+c>=0&&l.minY-c<=h.height/e&&l.maxY+c>=0&&(a&&this.replayTextBackground_(t,ap,lp,hp,cp,s,o),to(t,n.canvasTransform,r,i,n.originX,n.originY,n.drawImageW,n.drawImageH,n.drawImageX,n.drawImageY,n.scale)),!0}fill_(t){if(this.alignFill_){const e=bt(this.renderedTransform_,[0,0]),i=512*this.pixelRatio;t.save(),t.translate(e[0]%i,e[1]%i),t.rotate(this.viewRotation_)}t.fill(),this.alignFill_&&t.restore()}setStrokeStyle_(t,e){t.strokeStyle=e[1],t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.lineDashOffset=e[7],t.setLineDash(e[6])}drawLabelWithPointPlacement_(t,e,i,n){const r=this.textStates[e],s=this.createLabel(t,e,n,i),o=this.strokeStates[i],a=this.pixelRatio,l=gp(Array.isArray(t)?t[0]:t,r.textAlign||Us),h=tp[r.textBaseline||zs],c=o&&o.lineWidth?o.lineWidth:0;return{label:s,anchorX:l*(s.width/a-2*r.scale[0])+2*(.5-l)*c,anchorY:h*s.height/a+2*(.5-h)*c}}execute_(t,e,i,n,r,s,o,a){let l;this.pixelCoordinates_&&u(i,this.renderedTransform_)?l=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),l=un(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_),Ct(this.renderedTransform_,i));let h=0;const c=n.length;let d,g,f,p,m,_,y,x,v,S,w,E,T=0,C=0,b=0,R=null,P=null;const I=this.coordinateCache_,L=this.viewRotation_,M=Math.round(1e12*Math.atan2(-i[1],i[0]))/1e12,F={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:L},A=this.instructions!=n||this.overlaps?0:200;let O,N,D,k;for(;h<c;){const i=n[h];switch(i[0]){case Ff:O=i[1],k=i[3],O.getGeometry()?void 0===o||we(o,k.getExtent())?++h:h=i[2]+1:h=i[2];break;case Af:C>A&&(this.fill_(t),C=0),b>A&&(t.stroke(),b=0),C||b||(t.beginPath(),p=NaN,m=NaN),++h;break;case Of:T=i[1];const n=l[T],c=l[T+1],u=l[T+2]-n,G=l[T+3]-c,j=Math.sqrt(u*u+G*G);t.moveTo(n+j,c),t.arc(n,c,j,0,2*Math.PI,!0),++h;break;case Nf:t.closePath(),++h;break;case Df:T=i[1],d=i[2];const B=i[3],U=i[4],z=6==i.length?i[5]:void 0;F.geometry=B,F.feature=O,h in I||(I[h]=[]);const X=I[h];z?z(l,T,d,2,X):(X[0]=l[T],X[1]=l[T+1],X.length=2),U(X,F),++h;break;case Gf:T=i[1],d=i[2],x=i[3],g=i[4],f=i[5];let V=i[6];const W=i[7],Z=i[8],Y=i[9],K=i[10];let q=i[11];const H=i[12];let $=i[13];const J=i[14],Q=i[15];if(!x&&i.length>=20){v=i[19],S=i[20],w=i[21],E=i[22];const t=this.drawLabelWithPointPlacement_(v,S,w,E);x=t.label,i[3]=x;const e=i[23];g=(t.anchorX-e)*this.pixelRatio,i[4]=g;const n=i[24];f=(t.anchorY-n)*this.pixelRatio,i[5]=f,V=x.height,i[6]=V,$=x.width,i[13]=$}let tt,et,it,nt;i.length>25&&(tt=i[25]),i.length>17?(et=i[16],it=i[17],nt=i[18]):(et=Xs,it=!1,nt=!1),K&&M?q+=L:K||M||(q-=L);let rt=0;for(;T<d;T+=2){if(tt&&tt[rt++]<$/this.pixelRatio)continue;const i=this.calculateImageOrLabelDimensions_(x.width,x.height,l[T],l[T+1],$,V,g,f,Z,Y,q,H,r,et,it||nt,O),n=[t,e,x,i,W,it?R:null,nt?P:null];if(a){if("none"===J)continue;if("obstacle"===J){a.insert(i.declutterBox);continue}{let t,e;if(Q){const i=d-T;if(!Q[i]){Q[i]=n;continue}if(t=Q[i],delete Q[i],e=up(t),a.collides(e))continue}if(a.collides(i.declutterBox))continue;t&&(a.insert(e),this.replayImageOrLabel_.apply(this,t)),a.insert(i.declutterBox)}}this.replayImageOrLabel_.apply(this,n)}++h;break;case kf:const st=i[1],ot=i[2],at=i[3],lt=i[4];E=i[5];const ht=i[6],ct=i[7],ut=i[8];w=i[9];const dt=i[10];v=i[11],S=i[12];const gt=[i[13],i[13]],ft=this.textStates[S],pt=ft.font,mt=[ft.scale[0]*ct,ft.scale[1]*ct];let _t;pt in this.widths_?_t=this.widths_[pt]:(_t={},this.widths_[pt]=_t);const yt=sp(l,st,ot,2),xt=Math.abs(mt[0])*Js(pt,v,_t);if(lt||xt<=yt){const i=this.textStates[S].textAlign,n=rp(l,st,ot,2,v,(yt-xt)*tp[i],ht,Math.abs(mt[0]),Js,pt,_t,M?0:this.viewRotation_);t:if(n){const i=[];let r,s,o,l,h;if(w)for(r=0,s=n.length;r<s;++r){h=n[r],o=h[4],l=this.createLabel(o,S,"",w),g=h[2]+(mt[0]<0?-dt:dt),f=at*l.height+2*(.5-at)*dt*mt[1]/mt[0]-ut;const s=this.calculateImageOrLabelDimensions_(l.width,l.height,h[0],h[1],l.width,l.height,g,f,0,0,h[3],gt,!1,Xs,!1,O);if(a&&a.collides(s.declutterBox))break t;i.push([t,e,l,s,1,null,null])}if(E)for(r=0,s=n.length;r<s;++r){h=n[r],o=h[4],l=this.createLabel(o,S,E,""),g=h[2],f=at*l.height-ut;const s=this.calculateImageOrLabelDimensions_(l.width,l.height,h[0],h[1],l.width,l.height,g,f,0,0,h[3],gt,!1,Xs,!1,O);if(a&&a.collides(s.declutterBox))break t;i.push([t,e,l,s,1,null,null])}a&&a.load(i.map(up));for(let t=0,e=i.length;t<e;++t)this.replayImageOrLabel_.apply(this,i[t])}}++h;break;case jf:if(void 0!==s){O=i[1];const t=s(O,k);if(t)return t}++h;break;case Bf:A?C++:this.fill_(t),++h;break;case Uf:for(T=i[1],d=i[2],N=l[T],D=l[T+1],_=N+.5|0,y=D+.5|0,_===p&&y===m||(t.moveTo(N,D),p=_,m=y),T+=2;T<d;T+=2)N=l[T],D=l[T+1],_=N+.5|0,y=D+.5|0,T!=d-2&&_===p&&y===m||(t.lineTo(N,D),p=_,m=y);++h;break;case zf:R=i,this.alignFill_=i[2],C&&(this.fill_(t),C=0,b&&(t.stroke(),b=0)),t.fillStyle=i[1],++h;break;case Xf:P=i,b&&(t.stroke(),b=0),this.setStrokeStyle_(t,i),++h;break;case Vf:A?b++:t.stroke(),++h;break;default:++h}}C&&this.fill_(t),b&&t.stroke()}execute(t,e,i,n,r,s){this.viewRotation_=n,this.execute_(t,e,i,this.instructions,r,void 0,void 0,s)}executeHitDetection(t,e,i,n,r){return this.viewRotation_=i,this.execute_(t,1,e,this.hitDetectionInstructions,!0,n,r)}}const mp=["Polygon","Circle","LineString","Image","Text","Default"];class _p{constructor(t,e,i,n,r,s){this.maxExtent_=t,this.overlaps_=n,this.pixelRatio_=i,this.resolution_=e,this.renderBuffer_=s,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=[1,0,0,1,0,0],this.createExecutors_(r)}clip(t,e){const i=this.getClipCoords(e);t.beginPath(),t.moveTo(i[0],i[1]),t.lineTo(i[2],i[3]),t.lineTo(i[4],i[5]),t.lineTo(i[6],i[7]),t.clip()}createExecutors_(t){for(const e in t){let i=this.executorsByZIndex_[e];void 0===i&&(i={},this.executorsByZIndex_[e]=i);const n=t[e];for(const t in n){const e=n[t];i[t]=new pp(this.resolution_,this.pixelRatio_,this.overlaps_,e)}}}hasExecutors(t){for(const e in this.executorsByZIndex_){const i=this.executorsByZIndex_[e];for(let e=0,n=t.length;e<n;++e)if(t[e]in i)return!0}return!1}forEachFeatureAtCoordinate(t,e,i,n,r,s){const o=2*(n=Math.round(n))+1,l=Mt(this.hitDetectionTransform_,n+.5,n+.5,1/e,-1/e,-i,-t[0],-t[1]),h=!this.hitDetectionContext_;h&&(this.hitDetectionContext_=Dr(o,o));const c=this.hitDetectionContext_;let u;c.canvas.width!==o||c.canvas.height!==o?(c.canvas.width=o,c.canvas.height=o):h||c.clearRect(0,0,o,o),void 0!==this.renderBuffer_&&(u=[1/0,1/0,-1/0,-1/0],re(u,t),Xt(u,e*(this.renderBuffer_+n),u));const d=xp(n);let g;function f(t,e){const i=c.getImageData(0,0,o,o).data;for(let a=0,l=d.length;a<l;a++)if(i[d[a]]>0){if(!s||"Image"!==g&&"Text"!==g||s.includes(t)){const i=(d[a]-3)/4,s=n-i%o,l=n-(i/o|0),h=r(t,e,s*s+l*l);if(h)return h}c.clearRect(0,0,o,o);break}}const p=Object.keys(this.executorsByZIndex_).map(Number);let m,_,y,x,v;for(p.sort(a),m=p.length-1;m>=0;--m){const t=p[m].toString();for(y=this.executorsByZIndex_[t],_=mp.length-1;_>=0;--_)if(g=mp[_],x=y[g],void 0!==x&&(v=x.executeHitDetection(c,l,i,f,u),v))return v}}getClipCoords(t){const e=this.maxExtent_;if(!e)return null;const i=e[0],n=e[1],r=e[2],s=e[3],o=[i,n,i,s,r,s,r,n];return un(o,0,8,2,t,o),o}isEmpty(){return x(this.executorsByZIndex_)}execute(t,e,i,n,r,s,o){const l=Object.keys(this.executorsByZIndex_).map(Number);let h,c,u,d,g,f;for(l.sort(a),this.maxExtent_&&(t.save(),this.clip(t,i)),s=s||mp,o&&l.reverse(),h=0,c=l.length;h<c;++h){const a=l[h].toString();for(g=this.executorsByZIndex_[a],u=0,d=s.length;u<d;++u){f=g[s[u]],void 0!==f&&f.execute(t,e,i,n,r,o)}}this.maxExtent_&&t.restore()}}const yp={};function xp(t){if(void 0!==yp[t])return yp[t];const e=2*t+1,i=t*t,n=new Array(i+1);for(let r=0;r<=t;++r)for(let s=0;s<=t;++s){const o=r*r+s*s;if(o>i)break;let a=n[o];a||(a=[],n[o]=a),a.push(4*((t+r)*e+(t+s))+3),r>0&&a.push(4*((t-r)*e+(t+s))+3),s>0&&(a.push(4*((t+r)*e+(t-s))+3),r>0&&a.push(4*((t-r)*e+(t-s))+3))}const r=[];for(let t=0,e=n.length;t<e;++t)n[t]&&r.push(...n[t]);return yp[t]=r,r}const vp=.5;function Sp(t,e,i,n,r,s,o){const l=Dr(t[0]*vp,t[1]*vp);l.imageSmoothingEnabled=!1;const h=l.canvas,c=new bl(l,vp,r,null,o),u=i.length,d=Math.floor(16777215/u),g={};for(let t=1;t<=u;++t){const e=i[t-1],o=e.getStyleFunction()||n;if(!n)continue;let a=o(e,s);if(!a)continue;Array.isArray(a)||(a=[a]);const l="#"+("000000"+(t*d).toString(16)).slice(-6);for(let t=0,i=a.length;t<i;++t){const i=a[t],n=i.getGeometryFunction()(e);if(!n||!we(r,n.getExtent()))continue;const s=i.clone(),o=s.getFill();o&&o.setColor(l);const h=s.getStroke();h&&(h.setColor(l),h.setLineDash(null)),s.setText(void 0);const c=i.getImage();if(c&&0!==c.getOpacity()){const t=c.getImageSize();if(!t)continue;const e=Dr(t[0],t[1],void 0,{alpha:!1}),i=e.canvas;e.fillStyle=l,e.fillRect(0,0,i.width,i.height),s.setImage(new lg({img:i,imgSize:t,anchor:c.getAnchor(),anchorXUnits:"pixels",anchorYUnits:"pixels",offset:c.getOrigin(),opacity:1,size:c.getSize(),scale:c.getScale(),rotation:c.getRotation(),rotateWithView:c.getRotateWithView()}))}const u=s.getZIndex()||0;let d=g[u];d||(d={},g[u]=d,d.Polygon=[],d.Circle=[],d.LineString=[],d.Point=[]),d[n.getType().replace("Multi","")].push(n,s)}}const f=Object.keys(g).map(Number).sort(a);for(let t=0,i=f.length;t<i;++t){const i=g[f[t]];for(const t in i){const n=i[t];for(let t=0,i=n.length;t<i;t+=2){c.setStyle(n[t+1]);for(let i=0,r=e.length;i<r;++i)c.setTransform(e[i]),c.drawGeometry(n[t])}}}return l.getImageData(0,0,h.width,h.height)}function wp(t,e,i){const n=[];if(i){const r=Math.floor(Math.round(t[0])*vp),s=Math.floor(Math.round(t[1])*vp),o=4*(ii(r,0,i.width-1)+ii(s,0,i.height-1)*i.width),a=i.data[o],l=i.data[o+1],h=i.data[o+2]+256*(l+256*a),c=Math.floor(16777215/e.length);h&&h%c==0&&n.push(e[h/c-1])}return n}class Ep extends Pc{constructor(t){super(t),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.animatingOrInteracting_,this.hitDetectionImageData_=null,this.renderedFeatures_=null,this.renderedRevision_=-1,this.renderedResolution_=NaN,this.renderedExtent_=[1/0,1/0,-1/0,-1/0],this.wrappedRenderedExtent_=[1/0,1/0,-1/0,-1/0],this.renderedRotation_,this.renderedCenter_=null,this.renderedProjection_=null,this.renderedRenderOrder_=null,this.replayGroup_=null,this.replayGroupChanged=!0,this.declutterExecutorGroup=null,this.clipping=!0,this.compositionContext_=null,this.opacity_=1}renderWorlds(t,e,i){const n=e.extent,r=e.viewState,s=r.center,o=r.resolution,a=r.projection,l=r.rotation,h=a.getExtent(),c=this.getLayer().getSource(),u=e.pixelRatio,d=e.viewHints,g=!(d[Ro]||d[Po]),f=this.compositionContext_,p=Math.round(e.size[0]*u),m=Math.round(e.size[1]*u),_=c.getWrapX()&&a.canWrapX(),y=_?Se(h):null,x=_?Math.ceil((n[2]-h[2])/y)+1:1;let v=_?Math.floor((n[0]-h[0])/y):0;do{const e=this.getRenderTransform(s,o,l,u,p,m,v*y);t.execute(f,1,e,l,g,void 0,i)}while(++v<x)}setupCompositionContext_(){if(1!==this.opacity_){const t=Dr(this.context.canvas.width,this.context.canvas.height,bc);this.compositionContext_=t}else this.compositionContext_=this.context}releaseCompositionContext_(){if(1!==this.opacity_){const t=this.context.globalAlpha;this.context.globalAlpha=this.opacity_,this.context.drawImage(this.compositionContext_.canvas,0,0),this.context.globalAlpha=t,kr(this.compositionContext_),bc.push(this.compositionContext_.canvas),this.compositionContext_=null}}renderDeclutter(t){this.declutterExecutorGroup&&(this.setupCompositionContext_(),this.renderWorlds(this.declutterExecutorGroup,t,t.declutterTree),this.releaseCompositionContext_())}renderFrame(t,e){const i=t.pixelRatio,n=t.layerStatesArray[t.layerIndex];It(this.pixelTransform,1/i,1/i),Ft(this.inversePixelTransform,this.pixelTransform);const r=Nt(this.pixelTransform);this.useContainer(e,r,this.getBackground(t));const s=this.context,o=s.canvas,a=this.replayGroup_,l=this.declutterExecutorGroup;if((!a||a.isEmpty())&&(!l||l.isEmpty()))return null;const h=Math.round(t.size[0]*i),c=Math.round(t.size[1]*i);o.width!=h||o.height!=c?(o.width=h,o.height=c,o.style.transform!==r&&(o.style.transform=r)):this.containerReused||s.clearRect(0,0,h,c),this.preRender(s,t);const u=t.viewState,d=u.projection;this.opacity_=n.opacity,this.setupCompositionContext_();let g=!1,f=!0;if(n.extent&&this.clipping){const e=on(n.extent,d);f=we(e,t.extent),g=f&&!Yt(e,t.extent),g&&this.clipUnrotated(this.compositionContext_,t,e)}return f&&this.renderWorlds(a,t),g&&this.compositionContext_.restore(),this.releaseCompositionContext_(),this.postRender(s,t),this.renderedRotation_!==u.rotation&&(this.renderedRotation_=u.rotation,this.hitDetectionImageData_=null),this.container}getFeatures(t){return new Promise(function(e){if(!this.hitDetectionImageData_&&!this.animatingOrInteracting_){const t=[this.context.canvas.width,this.context.canvas.height];bt(this.pixelTransform,t);const e=this.renderedCenter_,i=this.renderedResolution_,n=this.renderedRotation_,r=this.renderedProjection_,s=this.wrappedRenderedExtent_,o=this.getLayer(),a=[],l=t[0]*vp,h=t[1]*vp;a.push(this.getRenderTransform(e,i,n,vp,l,h,0).slice());const c=o.getSource(),u=r.getExtent();if(c.getWrapX()&&r.canWrapX()&&!Yt(u,s)){let t=s[0];const r=Se(u);let o,c=0;for(;t<u[0];)--c,o=r*c,a.push(this.getRenderTransform(e,i,n,vp,l,h,o).slice()),t+=r;for(c=0,t=s[2];t>u[2];)++c,o=r*c,a.push(this.getRenderTransform(e,i,n,vp,l,h,o).slice()),t-=r}this.hitDetectionImageData_=Sp(t,a,this.renderedFeatures_,o.getStyleFunction(),s,i,n)}e(wp(t,this.renderedFeatures_,this.hitDetectionImageData_))}.bind(this))}forEachFeatureAtCoordinate(t,e,i,n,r){if(!this.replayGroup_)return;const s=e.viewState.resolution,o=e.viewState.rotation,a=this.getLayer(),l={},h=function(t,e,i){const s=z(t),o=l[s];if(o){if(!0!==o&&i<o.distanceSq){if(0===i)return l[s]=!0,r.splice(r.lastIndexOf(o),1),n(t,a,e);o.geometry=e,o.distanceSq=i}}else{if(0===i)return l[s]=!0,n(t,a,e);r.push(l[s]={feature:t,layer:a,geometry:e,distanceSq:i,callback:n})}};let c;const u=[this.replayGroup_];return this.declutterExecutorGroup&&u.push(this.declutterExecutorGroup),u.some((n=>c=n.forEachFeatureAtCoordinate(t,s,o,i,h,n===this.declutterExecutorGroup&&e.declutterTree?e.declutterTree.all().map((t=>t.value)):null))),c}handleFontsChanged(){const t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()}handleStyleImageChange_(t){this.renderIfReadyAndVisible()}prepareFrame(t){const e=this.getLayer(),i=e.getSource();if(!i)return!1;const n=t.viewHints[Ro],r=t.viewHints[Po],s=e.getUpdateWhileAnimating(),o=e.getUpdateWhileInteracting();if(this.ready&&!s&&n||!o&&r)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;const a=t.extent,l=t.viewState,h=l.projection,c=l.resolution,d=t.pixelRatio,g=e.getRevision(),f=e.getRenderBuffer();let p=e.getRenderOrder();void 0===p&&(p=Pl);const m=l.center.slice(),_=Xt(a,f*c),y=_.slice(),x=[_.slice()],v=h.getExtent();if(i.getWrapX()&&h.canWrapX()&&!Yt(v,t.extent)){const t=Se(v),e=Math.max(Se(_)/2,t);_[0]=v[0]-e,_[2]=v[2]+e,Pi(m,h);const i=Pe(x[0],h);i[0]<v[0]&&i[2]<v[2]?x.push([i[0]+t,i[1],i[2]+t,i[3]]):i[0]>v[0]&&i[2]>v[2]&&x.push([i[0]-t,i[1],i[2]-t,i[3]])}if(this.ready&&this.renderedResolution_==c&&this.renderedRevision_==g&&this.renderedRenderOrder_==p&&Yt(this.wrappedRenderedExtent_,_))return u(this.renderedExtent_,y)||(this.hitDetectionImageData_=null,this.renderedExtent_=y),this.renderedCenter_=m,this.replayGroupChanged=!1,!0;this.replayGroup_=null;const S=new np(Ll(c,d),_,c,d);let w;this.getLayer().getDeclutter()&&(w=new np(Ll(c,d),_,c,d));const E=en();let T;if(E){for(let t=0,e=x.length;t<e;++t){const e=sn(x[t],h);i.loadFeatures(e,an(c,h),E)}T=qi(E,h)}else for(let t=0,e=x.length;t<e;++t)i.loadFeatures(x[t],c,h);const C=Il(c,d);let b=!0;const R=function(t){let i;const n=t.getStyleFunction()||e.getStyleFunction();if(n&&(i=n(t,c)),i){const e=this.renderFeature(t,C,i,S,T,w);b=b&&!e}}.bind(this),P=sn(_,h),I=i.getFeaturesInExtent(P);p&&I.sort(p);for(let t=0,e=I.length;t<e;++t)R(I[t]);this.renderedFeatures_=I,this.ready=b;const L=S.finish(),M=new _p(_,c,d,i.getOverlaps(),L,e.getRenderBuffer());return w&&(this.declutterExecutorGroup=new _p(_,c,d,i.getOverlaps(),w.finish(),e.getRenderBuffer())),this.renderedResolution_=c,this.renderedRevision_=g,this.renderedRenderOrder_=p,this.renderedExtent_=y,this.wrappedRenderedExtent_=_,this.renderedCenter_=m,this.renderedProjection_=h,this.replayGroup_=M,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0}renderFeature(t,e,i,n,r,s){if(!i)return!1;let o=!1;if(Array.isArray(i))for(let a=0,l=i.length;a<l;++a)o=Ml(n,t,i[a],e,this.boundHandleStyleImageChange_,r,s)||o;else o=Ml(n,t,i,e,this.boundHandleStyleImageChange_,r,s);return o}}class Tp extends Ic{constructor(t){super(t),this.vectorRenderer_=new Ep(t),this.layerImageRatio_=t.getImageRatio(),this.coordinateToVectorPixelTransform_=[1,0,0,1,0,0],this.renderedPixelToCoordinateTransform_=null}disposeInternal(){this.vectorRenderer_.dispose(),super.disposeInternal()}getFeatures(t){if(!this.vectorRenderer_)return new Promise((t=>t([])));const e=bt(this.coordinateToVectorPixelTransform_,bt(this.renderedPixelToCoordinateTransform_,t.slice()));return this.vectorRenderer_.getFeatures(e)}handleFontsChanged(){this.vectorRenderer_.handleFontsChanged()}prepareFrame(t){const e=t.pixelRatio,i=t.viewState,n=i.resolution,r=t.viewHints,s=this.vectorRenderer_;let o=t.extent;1!==this.layerImageRatio_&&(o=o.slice(0),Ce(o,this.layerImageRatio_));const a=Se(o)/n,l=_e(o)/n;if(!r[Ro]&&!r[Po]&&!Ee(o)){s.useContainer(null,null);const r=s.context,h=t.layerStatesArray[t.layerIndex];r.globalAlpha=h.opacity;const c=Object.assign({},h,{opacity:1}),u=Object.assign({},t,{declutterTree:new xh(9),extent:o,size:[a,l],viewState:Object.assign({},t.viewState,{rotation:0}),layerStatesArray:[c],layerIndex:0});let d=!0;const g=new Nr(o,n,e,r.canvas,(function(t){s.prepareFrame(u)&&s.replayGroupChanged&&(s.clipping=!1,s.renderFrame(u,null)&&(s.renderDeclutter(u),d=!1),t())}));g.addEventListener(S,function(){if(g.getState()!==Lr)return;this.image_=d?null:g;const t=g.getResolution(),n=g.getPixelRatio(),r=t*e/n;this.renderedResolution=r,this.coordinateToVectorPixelTransform_=Mt(this.coordinateToVectorPixelTransform_,a/2,l/2,1/r,-1/r,0,-i.center[0],-i.center[1])}.bind(this)),g.load()}return this.image_&&(this.renderedPixelToCoordinateTransform_=t.pixelToCoordinateTransform.slice()),!!this.image_}preRender(){}postRender(){}renderDeclutter(){}forEachFeatureAtCoordinate(t,e,i,n,r){return this.vectorRenderer_?this.vectorRenderer_.forEachFeatureAtCoordinate(t,e,i,n,r):super.forEachFeatureAtCoordinate(t,e,i,n,r)}}const Cp={image:["Polygon","Circle","LineString","Image","Text"],hybrid:["Polygon","LineString"],vector:[]},bp={hybrid:["Image","Text","Default"],vector:["Polygon","Circle","LineString","Image","Text","Default"]};class Rp extends Oc{constructor(t){super(t),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.renderedLayerRevision_,this.renderedPixelToCoordinateTransform_=null,this.renderedRotation_,this.tmpTransform_=[1,0,0,1,0,0]}prepareTile(t,e,i){let n;const r=t.getState();return r!==J&&r!==Q||(this.updateExecutorGroup_(t,e,i),this.tileImageNeedsRender_(t)&&(n=!0)),n}getTile(t,e,i,n){const r=n.pixelRatio,s=n.viewState,o=s.resolution,a=s.projection,l=this.getLayer(),h=l.getSource().getTile(t,e,i,r,a),c=n.viewHints,u=!(c[Ro]||c[Po]);!u&&h.wantedResolution||(h.wantedResolution=o);return this.prepareTile(h,r,a)&&(u||Date.now()-n.time<8)&&"vector"!==l.getRenderMode()&&this.renderTileImage_(h,n),super.getTile(t,e,i,n)}isDrawableTile(t){const e=this.getLayer();return super.isDrawableTile(t)&&("vector"===e.getRenderMode()?z(e)in t.executorGroups:t.hasContext(e))}getTileImage(t){return t.getImage(this.getLayer())}prepareFrame(t){const e=this.getLayer().getRevision();return this.renderedLayerRevision_!==e&&(this.renderedLayerRevision_=e,this.renderedTiles.length=0),super.prepareFrame(t)}updateExecutorGroup_(t,e,i){const n=this.getLayer(),r=n.getRevision(),s=n.getRenderOrder()||null,o=t.wantedResolution,a=t.getReplayState(n);if(!a.dirty&&a.renderedResolution===o&&a.renderedRevision==r&&a.renderedRenderOrder==s)return;const l=n.getSource(),h=n.getDeclutter(),c=l.getTileGrid(),u=l.getTileGridForProjection(i).getTileCoordExtent(t.wrappedTileCoord),d=l.getSourceTiles(e,i,t),g=z(n);delete t.hitDetectionImageData[g],t.executorGroups[g]=[],h&&(t.declutterExecutorGroups[g]=[]),a.dirty=!1;for(let i=0,r=d.length;i<r;++i){const r=d[i];if(r.getState()!=J)continue;const f=r.tileCoord,p=c.getTileCoordExtent(f),m=ye(u,p),_=Xt(m,n.getRenderBuffer()*o,this.tmpExtent),y=ee(p,m)?null:_,x=new np(0,_,o,e),v=h?new np(0,m,o,e):void 0,S=Il(o,e),w=function(t){let e;const i=t.getStyleFunction()||n.getStyleFunction();if(i&&(e=i(t,o)),e){const i=this.renderFeature(t,S,e,x,v);a.dirty=a.dirty||i}},E=r.getFeatures();s&&s!==a.renderedRenderOrder&&E.sort(s);for(let t=0,e=E.length;t<e;++t){const e=E[t];y&&!we(y,e.getGeometry().getExtent())||w.call(this,e)}const T=x.finish(),C="vector"!==n.getRenderMode()&&h&&1===d.length?null:m,b=new _p(C,o,e,l.getOverlaps(),T,n.getRenderBuffer());if(t.executorGroups[g].push(b),v){const i=new _p(null,o,e,l.getOverlaps(),v.finish(),n.getRenderBuffer());t.declutterExecutorGroups[g].push(i)}}a.renderedRevision=r,a.renderedRenderOrder=s,a.renderedResolution=o}forEachFeatureAtCoordinate(t,e,i,n,r){const s=e.viewState.resolution,o=e.viewState.rotation;i=null==i?0:i;const a=this.getLayer(),l=a.getSource().getTileGridForProjection(e.viewState.projection),h=zt([t]);Xt(h,s*i,h);const c={},u=function(t,e,i){let s=t.getId();void 0===s&&(s=z(t));const o=c[s];if(o){if(!0!==o&&i<o.distanceSq){if(0===i)return c[s]=!0,r.splice(r.lastIndexOf(o),1),n(t,a,e);o.geometry=e,o.distanceSq=i}}else{if(0===i)return c[s]=!0,n(t,a,e);r.push(c[s]={feature:t,layer:a,geometry:e,distanceSq:i,callback:n})}},d=this.renderedTiles;let g;for(let n=0,r=d.length;!g&&n<r;++n){const r=d[n];if(!we(l.getTileCoordExtent(r.wrappedTileCoord),h))continue;const c=z(a),f=[r.executorGroups[c]],p=r.declutterExecutorGroups[c];p&&f.push(p),f.some((n=>{const r=n===p?e.declutterTree.all().map((t=>t.value)):null;for(let e=0,a=n.length;e<a;++e){const a=n[e];if(g=a.forEachFeatureAtCoordinate(t,s,o,i,u,r),g)return!0}}))}return g}getFeatures(t){return new Promise(function(e,i){const n=this.getLayer(),r=z(n),s=n.getSource(),o=this.renderedProjection,a=o.getExtent(),l=this.renderedResolution,h=s.getTileGridForProjection(o),c=bt(this.renderedPixelToCoordinateTransform_,t.slice()),u=h.getTileCoordForCoordAndResolution(c,l);let d;for(let t=0,e=this.renderedTiles.length;t<e;++t)if(u.toString()===this.renderedTiles[t].tileCoord.toString()){if(d=this.renderedTiles[t],d.getState()===J){const t=h.getTileCoordExtent(d.tileCoord);s.getWrapX()&&o.canWrapX()&&!Yt(a,t)&&Pi(c,o);break}d=void 0}if(!d||d.loadingSourceTiles>0)return void e([]);const g=xe(h.getTileCoordExtent(d.wrappedTileCoord)),f=[(c[0]-g[0])/l,(g[1]-c[1])/l],p=d.getSourceTiles().reduce((function(t,e){return t.concat(e.getFeatures())}),[]);let m=d.hitDetectionImageData[r];if(!m&&!this.animatingOrInteracting_){const t=Va(h.getTileSize(h.getZForResolution(l,s.zDirection))),e=this.renderedRotation_;m=Sp(t,[this.getRenderTransform(h.getTileCoordCenter(d.wrappedTileCoord),l,0,vp,t[0]*vp,t[1]*vp,0)],p,n.getStyleFunction(),h.getTileCoordExtent(d.wrappedTileCoord),d.getReplayState(n).renderedResolution,e),d.hitDetectionImageData[r]=m}e(wp(f,p,m))}.bind(this))}handleFontsChanged(){const t=this.getLayer();t.getVisible()&&void 0!==this.renderedLayerRevision_&&t.changed()}handleStyleImageChange_(t){this.renderIfReadyAndVisible()}renderDeclutter(t){const e=this.context,i=e.globalAlpha;e.globalAlpha=this.getLayer().getOpacity();const n=t.viewHints,r=!(n[Ro]||n[Po]),s=this.renderedTiles;for(let e=0,i=s.length;e<i;++e){const i=s[e],n=i.declutterExecutorGroups[z(this.getLayer())];if(n)for(let e=n.length-1;e>=0;--e)n[e].execute(this.context,1,this.getTileRenderTransform(i,t),t.viewState.rotation,r,void 0,t.declutterTree)}e.globalAlpha=i}getTileRenderTransform(t,e){const i=e.pixelRatio,n=e.viewState,r=n.center,s=n.resolution,o=n.rotation,a=e.size,l=Math.round(a[0]*i),h=Math.round(a[1]*i),c=this.getLayer().getSource().getTileGridForProjection(e.viewState.projection),u=t.tileCoord,d=c.getTileCoordExtent(t.wrappedTileCoord),g=c.getTileCoordExtent(u,this.tmpExtent)[0]-d[0];return Et(Pt(this.inversePixelTransform.slice(),1/i,1/i),this.getRenderTransform(r,s,o,i,l,h,g))}postRender(t,e){const i=e.viewHints,n=!(i[Ro]||i[Po]);this.renderedPixelToCoordinateTransform_=e.pixelToCoordinateTransform.slice(),this.renderedRotation_=e.viewState.rotation;const r=this.getLayer(),s=r.getRenderMode(),o=t.globalAlpha;t.globalAlpha=r.getOpacity();const a=bp[s],l=e.viewState,h=l.rotation,c=r.getSource(),u=c.getTileGridForProjection(l.projection).getZForResolution(l.resolution,c.zDirection),d=this.renderedTiles,g=[],f=[];let p=!0;for(let i=d.length-1;i>=0;--i){const s=d[i];p=p&&!s.getReplayState(r).dirty;const o=s.executorGroups[z(r)].filter((t=>t.hasExecutors(a)));if(0===o.length)continue;const l=this.getTileRenderTransform(s,e),c=s.tileCoord[0];let m=!1;const _=o[0].getClipCoords(l);if(_){for(let e=0,i=g.length;e<i;++e)if(u!==c&&c<f[e]){const i=g[e];we([_[0],_[3],_[4],_[7]],[i[0],i[3],i[4],i[7]])&&(m||(t.save(),m=!0),t.beginPath(),t.moveTo(_[0],_[1]),t.lineTo(_[2],_[3]),t.lineTo(_[4],_[5]),t.lineTo(_[6],_[7]),t.moveTo(i[6],i[7]),t.lineTo(i[4],i[5]),t.lineTo(i[2],i[3]),t.lineTo(i[0],i[1]),t.clip())}g.push(_),f.push(c)}for(let e=0,i=o.length;e<i;++e){o[e].execute(t,1,l,h,n,a)}m&&t.restore()}t.globalAlpha=o,this.ready=p,super.postRender(t,e)}renderFeature(t,e,i,n,r){if(!i)return!1;let s=!1;if(Array.isArray(i))for(let o=0,a=i.length;o<a;++o)s=Ml(n,t,i[o],e,this.boundHandleStyleImageChange_,void 0,r)||s;else s=Ml(n,t,i,e,this.boundHandleStyleImageChange_,void 0,r);return s}tileImageNeedsRender_(t){const e=this.getLayer();if("vector"===e.getRenderMode())return!1;const i=t.getReplayState(e),n=e.getRevision(),r=t.wantedResolution;return i.renderedTileResolution!==r||i.renderedTileRevision!==n}renderTileImage_(t,e){const i=this.getLayer(),n=t.getReplayState(i),r=i.getRevision(),s=t.executorGroups[z(i)];n.renderedTileRevision=r;const o=t.wrappedTileCoord,a=o[0],l=i.getSource();let h=e.pixelRatio;const c=e.viewState.projection,u=l.getTileGridForProjection(c),d=u.getResolution(t.tileCoord[0]),g=e.pixelRatio/t.wantedResolution*d,f=u.getResolution(a),p=t.getContext(i);h=Math.round(Math.max(h,g/h));const m=l.getTilePixelSize(a,h,c);p.canvas.width=m[0],p.canvas.height=m[1];const _=h/g;if(1!==_){const t=wt(this.tmpTransform_);Pt(t,_,_),p.setTransform.apply(p,t)}const y=u.getTileCoordExtent(o,this.tmpExtent),x=g/f,v=wt(this.tmpTransform_);Pt(v,x,-x),Lt(v,-y[0],-y[3]);for(let t=0,e=s.length;t<e;++t){s[t].execute(p,_,v,0,!0,Cp[i.getRenderMode()])}n.renderedTileResolution=t.wantedResolution}}class Pp extends _n{constructor(t,e,i){super(),void 0!==i&&void 0===e?this.setFlatCoordinates(i,t):(e=e||0,this.setCenterAndRadius(t,e,i))}clone(){const t=new Pp(this.flatCoordinates.slice(),void 0,this.layout);return t.applyProperties(this),t}closestPointXY(t,e,i,n){const r=this.flatCoordinates,s=t-r[0],o=e-r[1],a=s*s+o*o;if(a<n){if(0===a)for(let t=0;t<this.stride;++t)i[t]=r[t];else{const t=this.getRadius()/Math.sqrt(a);i[0]=r[0]+t*s,i[1]=r[1]+t*o;for(let t=2;t<this.stride;++t)i[t]=r[t]}return i.length=this.stride,a}return n}containsXY(t,e){const i=this.flatCoordinates,n=t-i[0],r=e-i[1];return n*n+r*r<=this.getRadiusSquared_()}getCenter(){return this.flatCoordinates.slice(0,this.stride)}computeExtent(t){const e=this.flatCoordinates,i=e[this.stride]-e[0];return $t(e[0]-i,e[1]-i,e[0]+i,e[1]+i,t)}getRadius(){return Math.sqrt(this.getRadiusSquared_())}getRadiusSquared_(){const t=this.flatCoordinates[this.stride]-this.flatCoordinates[0],e=this.flatCoordinates[this.stride+1]-this.flatCoordinates[1];return t*t+e*e}getType(){return"Circle"}intersectsExtent(t){if(we(t,this.getExtent())){const e=this.getCenter();return t[0]<=e[0]&&t[2]>=e[0]||(t[1]<=e[1]&&t[3]>=e[1]||he(t,this.intersectsCoordinate.bind(this)))}return!1}setCenter(t){const e=this.stride,i=this.flatCoordinates[e]-this.flatCoordinates[0],n=t.slice();n[e]=n[0]+i;for(let i=1;i<e;++i)n[e+i]=t[i];this.setFlatCoordinates(this.layout,n),this.changed()}setCenterAndRadius(t,e,i){this.setLayout(i,t,0),this.flatCoordinates||(this.flatCoordinates=[]);const n=this.flatCoordinates;let r=Rn(n,0,t,this.stride);n[r++]=n[0]+e;for(let t=1,e=this.stride;t<e;++t)n[r++]=n[t];n.length=r,this.changed()}getCoordinates(){return null}setCoordinates(t,e){}setRadius(t){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+t,this.changed()}rotate(t,e){const i=this.getCenter(),n=this.getStride();this.setCenter(dn(i,0,i.length,n,t,e,i)),this.changed()}translate(t,e){const i=this.getCenter(),n=this.getStride();this.setCenter(fn(i,0,i.length,n,t,e,i)),this.changed()}}Pp.prototype.transform;class Ip extends mn{constructor(t){super(),this.geometries_=t||null,this.changeEventsKeys_=[],this.listenGeometriesChange_()}unlistenGeometriesChange_(){this.changeEventsKeys_.forEach(k),this.changeEventsKeys_.length=0}listenGeometriesChange_(){if(this.geometries_)for(let t=0,e=this.geometries_.length;t<e;++t)this.changeEventsKeys_.push(N(this.geometries_[t],S,this.changed,this))}clone(){const t=new Ip(null);return t.setGeometries(this.geometries_),t.applyProperties(this),t}closestPointXY(t,e,i,n){if(n<Wt(this.getExtent(),t,e))return n;const r=this.geometries_;for(let s=0,o=r.length;s<o;++s)n=r[s].closestPointXY(t,e,i,n);return n}containsXY(t,e){const i=this.geometries_;for(let n=0,r=i.length;n<r;++n)if(i[n].containsXY(t,e))return!0;return!1}computeExtent(t){Jt(t);const e=this.geometries_;for(let i=0,n=e.length;i<n;++i)ne(t,e[i].getExtent());return t}getGeometries(){return Lp(this.geometries_)}getGeometriesArray(){return this.geometries_}getGeometriesArrayRecursive(){let t=[];const e=this.geometries_;for(let i=0,n=e.length;i<n;++i)e[i].getType()===this.getType()?t=t.concat(e[i].getGeometriesArrayRecursive()):t.push(e[i]);return t}getSimplifiedGeometry(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<this.simplifiedGeometryMaxMinSquaredTolerance)return this;const e=[],i=this.geometries_;let n=!1;for(let r=0,s=i.length;r<s;++r){const s=i[r],o=s.getSimplifiedGeometry(t);e.push(o),o!==s&&(n=!0)}if(n){const t=new Ip(null);return t.setGeometriesArray(e),t}return this.simplifiedGeometryMaxMinSquaredTolerance=t,this}getType(){return"GeometryCollection"}intersectsExtent(t){const e=this.geometries_;for(let i=0,n=e.length;i<n;++i)if(e[i].intersectsExtent(t))return!0;return!1}isEmpty(){return 0===this.geometries_.length}rotate(t,e){const i=this.geometries_;for(let n=0,r=i.length;n<r;++n)i[n].rotate(t,e);this.changed()}scale(t,e,i){i||(i=ge(this.getExtent()));const n=this.geometries_;for(let r=0,s=n.length;r<s;++r)n[r].scale(t,e,i);this.changed()}setGeometries(t){this.setGeometriesArray(Lp(t))}setGeometriesArray(t){this.unlistenGeometriesChange_(),this.geometries_=t,this.listenGeometriesChange_(),this.changed()}applyTransform(t){const e=this.geometries_;for(let i=0,n=e.length;i<n;++i)e[i].applyTransform(t);this.changed()}translate(t,e){const i=this.geometries_;for(let n=0,r=i.length;n<r;++n)i[n].translate(t,e);this.changed()}disposeInternal(){this.unlistenGeometriesChange_(),super.disposeInternal()}}function Lp(t){const e=[];for(let i=0,n=t.length;i<n;++i)e.push(t[i].clone());return e}function Mp(t,e,i,n,r,s,a){let l,h;const c=(i-e)/n;if(1===c)l=e;else if(2===c)l=e,h=r;else if(0!==c){let s=t[e],a=t[e+1],c=0;const u=[0];for(let r=e+n;r<i;r+=n){const e=t[r],i=t[r+1];c+=Math.sqrt((e-s)*(e-s)+(i-a)*(i-a)),u.push(c),s=e,a=i}const d=r*c,g=o(u,d);g<0?(h=(d-u[-g-2])/(u[-g-1]-u[-g-2]),l=e+(-g-2)*n):l=e+g*n}a=a>1?a:2,s=s||new Array(a);for(let e=0;e<a;++e)s[e]=void 0===l?NaN:void 0===h?t[l+e]:hi(t[l+e],t[l+n+e],h);return s}function Fp(t,e,i,n,r,s){if(i==e)return null;let o;if(r<t[e+n-1])return s?(o=t.slice(e,e+n),o[n-1]=r,o):null;if(t[i-1]<r)return s?(o=t.slice(i-n,i),o[n-1]=r,o):null;if(r==t[e+n-1])return t.slice(e,e+n);let a=e/n,l=i/n;for(;a<l;){const e=a+l>>1;r<t[(e+1)*n-1]?l=e:a=e+1}const h=t[a*n-1];if(r==h)return t.slice((a-1)*n,(a-1)*n+n);const c=(r-h)/(t[(a+1)*n-1]-h);o=[];for(let e=0;e<n-1;++e)o.push(hi(t[(a-1)*n+e],t[a*n+e],c));return o.push(r),o}function Ap(t,e,i,n,r,s,o){if(o)return Fp(t,e,i[i.length-1],n,r,s);let a;if(r<t[n-1])return s?(a=t.slice(0,n),a[n-1]=r,a):null;if(t[t.length-1]<r)return s?(a=t.slice(t.length-n),a[n-1]=r,a):null;for(let s=0,o=i.length;s<o;++s){const o=i[s];if(e!=o){if(r<t[e+n-1])return null;if(r<=t[o-1])return Fp(t,e,o,n,r,!1);e=o}}return null}class Op extends _n{constructor(t,e){super(),this.flatMidpoint_=null,this.flatMidpointRevision_=-1,this.maxDelta_=-1,this.maxDeltaRevision_=-1,void 0===e||Array.isArray(t[0])?this.setCoordinates(t,e):this.setFlatCoordinates(e,t)}appendCoordinate(t){this.flatCoordinates?c(this.flatCoordinates,t):this.flatCoordinates=t.slice(),this.changed()}clone(){const t=new Op(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,i,n){return n<Wt(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Sn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Tn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,i,n))}forEachSegment(t){return Jn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinateAtM(t,e){return"XYM"!=this.layout&&"XYZM"!=this.layout?null:(e=void 0!==e&&e,Fp(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e))}getCoordinates(){return Gn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinateAt(t,e){return Mp(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,this.stride)}getLength(){return sp(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getFlatMidpoint(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_}getSimplifiedGeometryInternal(t){const e=[];return e.length=Mn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,0),new Op(e,"XY")}getType(){return"LineString"}intersectsExtent(t){return Qn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Pn(this.flatCoordinates,0,t,this.stride),this.changed()}}class Np extends _n{constructor(t,e,i){if(super(),this.ends_=[],this.maxDelta_=-1,this.maxDeltaRevision_=-1,Array.isArray(t[0]))this.setCoordinates(t,e);else if(void 0!==e&&i)this.setFlatCoordinates(e,t),this.ends_=i;else{let e=this.getLayout();const i=t,n=[],r=[];for(let t=0,s=i.length;t<s;++t){const s=i[t];0===t&&(e=s.getLayout()),c(n,s.getFlatCoordinates()),r.push(n.length)}this.setFlatCoordinates(e,n),this.ends_=r}}appendLineString(t){this.flatCoordinates?c(this.flatCoordinates,t.getFlatCoordinates().slice()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const t=new Np(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(t,e,i,n){return n<Wt(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(wn(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Cn(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,t,e,i,n))}getCoordinateAtM(t,e,i){return"XYM"!=this.layout&&"XYZM"!=this.layout||0===this.flatCoordinates.length?null:(e=void 0!==e&&e,i=void 0!==i&&i,Ap(this.flatCoordinates,0,this.ends_,this.stride,t,e,i))}getCoordinates(){return jn(this.flatCoordinates,0,this.ends_,this.stride)}getEnds(){return this.ends_}getLineString(t){return t<0||this.ends_.length<=t?null:new Op(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)}getLineStrings(){const t=this.flatCoordinates,e=this.ends_,i=this.layout,n=[];let r=0;for(let s=0,o=e.length;s<o;++s){const o=e[s],a=new Op(t.slice(r,o),i);n.push(a),r=o}return n}getFlatMidpoints(){const t=[],e=this.flatCoordinates;let i=0;const n=this.ends_,r=this.stride;for(let s=0,o=n.length;s<o;++s){const o=n[s];c(t,Mp(e,i,o,r,.5)),i=o}return t}getSimplifiedGeometryInternal(t){const e=[],i=[];return e.length=Fn(this.flatCoordinates,0,this.ends_,this.stride,t,e,0,i),new Np(e,"XY",i)}getType(){return"MultiLineString"}intersectsExtent(t){return tr(this.flatCoordinates,0,this.ends_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);const i=In(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()}}class Dp extends _n{constructor(t,e){super(),e&&!Array.isArray(t[0])?this.setFlatCoordinates(e,t):this.setCoordinates(t,e)}appendPoint(t){this.flatCoordinates?c(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.changed()}clone(){const t=new Dp(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,i,n){if(n<Wt(this.getExtent(),t,e))return n;const r=this.flatCoordinates,s=this.stride;for(let o=0,a=r.length;o<a;o+=s){const a=ri(t,e,r[o],r[o+1]);if(a<n){n=a;for(let t=0;t<s;++t)i[t]=r[o+t];i.length=s}}return n}getCoordinates(){return Gn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getPoint(t){const e=this.flatCoordinates?this.flatCoordinates.length/this.stride:0;return t<0||e<=t?null:new Wn(this.flatCoordinates.slice(t*this.stride,(t+1)*this.stride),this.layout)}getPoints(){const t=this.flatCoordinates,e=this.layout,i=this.stride,n=[];for(let r=0,s=t.length;r<s;r+=i){const s=new Wn(t.slice(r,r+i),e);n.push(s)}return n}getType(){return"MultiPoint"}intersectsExtent(t){const e=this.flatCoordinates,i=this.stride;for(let n=0,r=e.length;n<r;n+=i){if(Kt(t,e[n],e[n+1]))return!0}return!1}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Pn(this.flatCoordinates,0,t,this.stride),this.changed()}}function kp(t,e,i,n){const r=[];let s=[1/0,1/0,-1/0,-1/0];for(let o=0,a=i.length;o<a;++o){const a=i[o];s=te(t,e,a[0],n),r.push((s[0]+s[2])/2,(s[1]+s[3])/2),e=a[a.length-1]}return r}class Gp extends _n{constructor(t,e,i){if(super(),this.endss_=[],this.flatInteriorPointsRevision_=-1,this.flatInteriorPoints_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,!i&&!Array.isArray(t[0])){let n=this.getLayout();const r=t,s=[],o=[];for(let t=0,e=r.length;t<e;++t){const e=r[t];0===t&&(n=e.getLayout());const i=s.length,a=e.getEnds();for(let t=0,e=a.length;t<e;++t)a[t]+=i;c(s,e.getFlatCoordinates()),o.push(a)}e=n,t=s,i=o}void 0!==e&&i?(this.setFlatCoordinates(e,t),this.endss_=i):this.setCoordinates(t,e)}appendPolygon(t){let e;if(this.flatCoordinates){const i=this.flatCoordinates.length;c(this.flatCoordinates,t.getFlatCoordinates()),e=t.getEnds().slice();for(let t=0,n=e.length;t<n;++t)e[t]+=i}else this.flatCoordinates=t.getFlatCoordinates().slice(),e=t.getEnds().slice(),this.endss_.push();this.endss_.push(e),this.changed()}clone(){const t=this.endss_.length,e=new Array(t);for(let i=0;i<t;++i)e[i]=this.endss_[i].slice();const i=new Gp(this.flatCoordinates.slice(),this.layout,e);return i.applyProperties(this),i}closestPointXY(t,e,i,n){return n<Wt(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(En(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),bn(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,t,e,i,n))}containsXY(t,e){return qn(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t,e)}getArea(){return Xn(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)}getCoordinates(t){let e;return void 0!==t?(e=this.getOrientedFlatCoordinates().slice(),hr(e,0,this.endss_,this.stride,t)):e=this.flatCoordinates,Bn(e,0,this.endss_,this.stride)}getEndss(){return this.endss_}getFlatInteriorPoints(){if(this.flatInteriorPointsRevision_!=this.getRevision()){const t=kp(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=$n(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_}getInteriorPoints(){return new Dp(this.getFlatInteriorPoints().slice(),"XYM")}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const t=this.flatCoordinates;ar(t,0,this.endss_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=hr(this.orientedFlatCoordinates_,0,this.endss_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){const e=[],i=[];return e.length=kn(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),e,0,i),new Gp(e,"XY",i)}getPolygon(t){if(t<0||this.endss_.length<=t)return null;let e;if(0===t)e=0;else{const i=this.endss_[t-1];e=i[i.length-1]}const i=this.endss_[t].slice(),n=i[i.length-1];if(0!==e)for(let t=0,n=i.length;t<n;++t)i[t]-=e;return new ur(this.flatCoordinates.slice(e,n),this.layout,i)}getPolygons(){const t=this.layout,e=this.flatCoordinates,i=this.endss_,n=[];let r=0;for(let s=0,o=i.length;s<o;++s){const o=i[s].slice(),a=o[o.length-1];if(0!==r)for(let t=0,e=o.length;t<e;++t)o[t]-=r;const l=new ur(e.slice(r,a),t,o);n.push(l),r=a}return n}getType(){return"MultiPolygon"}intersectsExtent(t){return nr(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,3),this.flatCoordinates||(this.flatCoordinates=[]);const i=Ln(this.flatCoordinates,0,t,this.stride,this.endss_);if(0===i.length)this.flatCoordinates.length=0;else{const t=i[i.length-1];this.flatCoordinates.length=0===t.length?0:t[t.length-1]}this.changed()}}const jp=[1,0,0,1,0,0];class Bp{constructor(t,e,i,n,r){this.styleFunction,this.extent_,this.id_=r,this.type_=t,this.flatCoordinates_=e,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=i,this.properties_=n}get(t){return this.properties_[t]}getExtent(){return this.extent_||(this.extent_="Point"===this.type_?Qt(this.flatCoordinates_):te(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_}getFlatInteriorPoint(){if(!this.flatInteriorPoints_){const t=ge(this.getExtent());this.flatInteriorPoints_=Hn(this.flatCoordinates_,0,this.ends_,2,t,0)}return this.flatInteriorPoints_}getFlatInteriorPoints(){if(!this.flatInteriorPoints_){const t=kp(this.flatCoordinates_,0,this.ends_,2);this.flatInteriorPoints_=$n(this.flatCoordinates_,0,this.ends_,2,t)}return this.flatInteriorPoints_}getFlatMidpoint(){return this.flatMidpoints_||(this.flatMidpoints_=Mp(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_}getFlatMidpoints(){if(!this.flatMidpoints_){this.flatMidpoints_=[];const t=this.flatCoordinates_;let e=0;const i=this.ends_;for(let n=0,r=i.length;n<r;++n){const r=i[n],s=Mp(t,e,r,2,.5);c(this.flatMidpoints_,s),e=r}}return this.flatMidpoints_}getId(){return this.id_}getOrientedFlatCoordinates(){return this.flatCoordinates_}getGeometry(){return this}getSimplifiedGeometry(t){return this}simplifyTransformed(t,e){return this}getProperties(){return this.properties_}getStride(){return 2}getStyleFunction(){return this.styleFunction}getType(){return this.type_}transform(t){const e=(t=Ui(t)).getExtent(),i=t.getWorldExtent();if(e&&i){const t=_e(i)/_e(e);Mt(jp,i[0],i[3],t,-t,0,0,0),un(this.flatCoordinates_,0,this.flatCoordinates_.length,2,jp,this.flatCoordinates_)}}getEnds(){return this.ends_}}function Up(t){const e=t.getType();switch(e){case"Point":return new Wn(t.getFlatCoordinates());case"MultiPoint":return new Dp(t.getFlatCoordinates(),"XY");case"LineString":return new Op(t.getFlatCoordinates(),"XY");case"MultiLineString":return new Np(t.getFlatCoordinates(),"XY",t.getEnds());case"Polygon":const i=t.getFlatCoordinates(),n=t.getEnds(),r=cr(i,n);return r.length>1?new Gp(i,"XY",r):new ur(i,"XY",n);default:throw new Error("Invalid geometry type:"+e)}}Bp.prototype.getEndss=Bp.prototype.getEnds,Bp.prototype.getFlatCoordinates=Bp.prototype.getOrientedFlatCoordinates;class zp extends Ig{constructor(t){super(t)}createRenderer(){return new Ep(this)}}function Xp(t,e,i){const n=[];let r=t(0),s=t(1),o=e(r),a=e(s);const l=[s,r],h=[a,o],c=[1,0],u={};let d,g,f,p,m,_,y=1e5;for(;--y>0&&c.length>0;)f=c.pop(),r=l.pop(),o=h.pop(),_=f.toString(),_ in u||(n.push(o[0],o[1]),u[_]=!0),p=c.pop(),s=l.pop(),a=h.pop(),m=(f+p)/2,d=t(m),g=e(d),ni(g[0],g[1],o[0],o[1],a[0],a[1])<i?(n.push(a[0],a[1]),_=p.toString(),u[_]=!0):(c.push(p,m,m,f),h.push(a,g,g,o),l.push(s,d,d,r));return n}function Vp(t,e,i,n,r){return Xp((function(n){return[t,e+(i-e)*n]}),Hi(Ui("EPSG:4326"),n),r)}function Wp(t,e,i,n,r){return Xp((function(n){return[e+(i-e)*n,t]}),Hi(Ui("EPSG:4326"),n),r)}const Zp=new hg({color:"rgba(0,0,0,0.2)"}),Yp=[90,45,30,20,10,5,2,1,.5,20/60,10/60,5/60,2/60,1/60,30/3600,20/3600,10/3600,5/3600,2/3600,1/3600];const Kp="blur",qp="gradient",Hp="radius",$p=["#00f","#0ff","#0f0","#ff0","#f00"];class Jp{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.supportedMediaTypes=null}getReadOptions(t,e){if(e){let i=e.dataProjection?Ui(e.dataProjection):this.readProjection(t);e.extent&&i&&"tile-pixels"===i.getUnits()&&(i=Ui(i),i.setWorldExtent(e.extent)),e={dataProjection:i,featureProjection:e.featureProjection}}return this.adaptOptions(e)}adaptOptions(t){return Object.assign({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection},t)}getType(){return B()}readFeature(t,e){return B()}readFeatures(t,e){return B()}readGeometry(t,e){return B()}readProjection(t){return B()}writeFeature(t,e){return B()}writeFeatures(t,e){return B()}writeGeometry(t,e){return B()}}function Qp(t,e,i){const n=i?Ui(i.featureProjection):null,r=i?Ui(i.dataProjection):null;let s;if(s=n&&r&&!Ki(n,r)?(e?t.clone():t).transform(e?n:r,e?r:n):t,e&&i&&void 0!==i.decimals){const e=Math.pow(10,i.decimals),n=function(t){for(let i=0,n=t.length;i<n;++i)t[i]=Math.round(t[i]*e)/e;return t};s===t&&(s=t.clone()),s.applyTransform(n)}return s}function tm(t,e){const i=e?Ui(e.featureProjection):null,n=e?Ui(e.dataProjection):null;return i&&n&&!Ki(i,n)?Ji(t,n,i):t}var em={
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */read:function(t,e,i,n,r){var s,o,a=8*r-n-1,l=(1<<a)-1,h=l>>1,c=-7,u=i?r-1:0,d=i?-1:1,g=t[e+u];for(u+=d,s=g&(1<<-c)-1,g>>=-c,c+=a;c>0;s=256*s+t[e+u],u+=d,c-=8);for(o=s&(1<<-c)-1,s>>=-c,c+=n;c>0;o=256*o+t[e+u],u+=d,c-=8);if(0===s)s=1-h;else{if(s===l)return o?NaN:1/0*(g?-1:1);o+=Math.pow(2,n),s-=h}return(g?-1:1)*o*Math.pow(2,s-n)},write:function(t,e,i,n,r,s){var o,a,l,h=8*s-r-1,c=(1<<h)-1,u=c>>1,d=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,g=n?0:s-1,f=n?1:-1,p=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,o=c):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+u>=1?d/l:d*Math.pow(2,1-u))*l>=2&&(o++,l/=2),o+u>=c?(a=0,o=c):o+u>=1?(a=(e*l-1)*Math.pow(2,r),o+=u):(a=e*Math.pow(2,u-1)*Math.pow(2,r),o=0));r>=8;t[i+g]=255&a,g+=f,a/=256,r-=8);for(o=o<<r|a,h+=r;h>0;t[i+g]=255&o,g+=f,o/=256,h-=8);t[i+g-f]|=128*p}},im=rm,nm=em;function rm(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}rm.Varint=0,rm.Fixed64=1,rm.Bytes=2,rm.Fixed32=5;var sm=4294967296,om=1/sm,am="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function lm(t){return t.type===rm.Bytes?t.readVarint()+t.pos:t.pos+1}function hm(t,e,i){return i?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function cm(t,e,i){var n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));i.realloc(n);for(var r=i.pos-1;r>=t;r--)i.buf[r+n]=i.buf[r]}function um(t,e){for(var i=0;i<t.length;i++)e.writeVarint(t[i])}function dm(t,e){for(var i=0;i<t.length;i++)e.writeSVarint(t[i])}function gm(t,e){for(var i=0;i<t.length;i++)e.writeFloat(t[i])}function fm(t,e){for(var i=0;i<t.length;i++)e.writeDouble(t[i])}function pm(t,e){for(var i=0;i<t.length;i++)e.writeBoolean(t[i])}function mm(t,e){for(var i=0;i<t.length;i++)e.writeFixed32(t[i])}function _m(t,e){for(var i=0;i<t.length;i++)e.writeSFixed32(t[i])}function ym(t,e){for(var i=0;i<t.length;i++)e.writeFixed64(t[i])}function xm(t,e){for(var i=0;i<t.length;i++)e.writeSFixed64(t[i])}function vm(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function Sm(t,e,i){t[i]=e,t[i+1]=e>>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function wm(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}rm.prototype={destroy:function(){this.buf=null},readFields:function(t,e,i){for(i=i||this.length;this.pos<i;){var n=this.readVarint(),r=n>>3,s=this.pos;this.type=7&n,t(r,e,this),this.pos===s&&this.skip(n)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=vm(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=wm(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=vm(this.buf,this.pos)+vm(this.buf,this.pos+4)*sm;return this.pos+=8,t},readSFixed64:function(){var t=vm(this.buf,this.pos)+wm(this.buf,this.pos+4)*sm;return this.pos+=8,t},readFloat:function(){var t=nm.read(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=nm.read(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,i,n=this.buf;return e=127&(i=n[this.pos++]),i<128?e:(e|=(127&(i=n[this.pos++]))<<7,i<128?e:(e|=(127&(i=n[this.pos++]))<<14,i<128?e:(e|=(127&(i=n[this.pos++]))<<21,i<128?e:function(t,e,i){var n,r,s=i.buf;if(r=s[i.pos++],n=(112&r)>>4,r<128)return hm(t,n,e);if(r=s[i.pos++],n|=(127&r)<<3,r<128)return hm(t,n,e);if(r=s[i.pos++],n|=(127&r)<<10,r<128)return hm(t,n,e);if(r=s[i.pos++],n|=(127&r)<<17,r<128)return hm(t,n,e);if(r=s[i.pos++],n|=(127&r)<<24,r<128)return hm(t,n,e);if(r=s[i.pos++],n|=(1&r)<<31,r<128)return hm(t,n,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(i=n[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&am?function(t,e,i){return am.decode(t.subarray(e,i))}(this.buf,e,t):function(t,e,i){var n="",r=e;for(;r<i;){var s,o,a,l=t[r],h=null,c=l>239?4:l>223?3:l>191?2:1;if(r+c>i)break;1===c?l<128&&(h=l):2===c?128==(192&(s=t[r+1]))&&(h=(31&l)<<6|63&s)<=127&&(h=null):3===c?(s=t[r+1],o=t[r+2],128==(192&s)&&128==(192&o)&&((h=(15&l)<<12|(63&s)<<6|63&o)<=2047||h>=55296&&h<=57343)&&(h=null)):4===c&&(s=t[r+1],o=t[r+2],a=t[r+3],128==(192&s)&&128==(192&o)&&128==(192&a)&&((h=(15&l)<<18|(63&s)<<12|(63&o)<<6|63&a)<=65535||h>=1114112)&&(h=null)),null===h?(h=65533,c=1):h>65535&&(h-=65536,n+=String.fromCharCode(h>>>10&1023|55296),h=56320|1023&h),n+=String.fromCharCode(h),r+=c}return n}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==rm.Bytes)return t.push(this.readVarint(e));var i=lm(this);for(t=t||[];this.pos<i;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==rm.Bytes)return t.push(this.readSVarint());var e=lm(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==rm.Bytes)return t.push(this.readBoolean());var e=lm(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==rm.Bytes)return t.push(this.readFloat());var e=lm(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==rm.Bytes)return t.push(this.readDouble());var e=lm(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==rm.Bytes)return t.push(this.readFixed32());var e=lm(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==rm.Bytes)return t.push(this.readSFixed32());var e=lm(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==rm.Bytes)return t.push(this.readFixed64());var e=lm(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==rm.Bytes)return t.push(this.readSFixed64());var e=lm(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===rm.Varint)for(;this.buf[this.pos++]>127;);else if(e===rm.Bytes)this.pos=this.readVarint()+this.pos;else if(e===rm.Fixed32)this.pos+=4;else{if(e!==rm.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var i=new Uint8Array(e);i.set(this.buf),this.buf=i,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),Sm(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),Sm(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),Sm(this.buf,-1&t,this.pos),Sm(this.buf,Math.floor(t*om),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),Sm(this.buf,-1&t,this.pos),Sm(this.buf,Math.floor(t*om),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var i,n;t>=0?(i=t%4294967296|0,n=t/4294967296|0):(n=~(-t/4294967296),4294967295^(i=~(-t%4294967296))?i=i+1|0:(i=0,n=n+1|0));if(t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,i){i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos++]=127&t|128,t>>>=7,i.buf[i.pos]=127&t}(i,0,e),function(t,e){var i=(7&t)<<4;if(e.buf[e.pos++]|=i|((t>>>=3)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;if(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),!t)return;e.buf[e.pos++]=127&t}(n,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,i){for(var n,r,s=0;s<e.length;s++){if((n=e.charCodeAt(s))>55295&&n<57344){if(!r){n>56319||s+1===e.length?(t[i++]=239,t[i++]=191,t[i++]=189):r=n;continue}if(n<56320){t[i++]=239,t[i++]=191,t[i++]=189,r=n;continue}n=r-55296<<10|n-56320|65536,r=null}else r&&(t[i++]=239,t[i++]=191,t[i++]=189,r=null);n<128?t[i++]=n:(n<2048?t[i++]=n>>6|192:(n<65536?t[i++]=n>>12|224:(t[i++]=n>>18|240,t[i++]=n>>12&63|128),t[i++]=n>>6&63|128),t[i++]=63&n|128)}return i}(this.buf,t,this.pos);var i=this.pos-e;i>=128&&cm(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),nm.write(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),nm.write(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var i=0;i<e;i++)this.buf[this.pos++]=t[i]},writeRawMessage:function(t,e){this.pos++;var i=this.pos;t(e,this);var n=this.pos-i;n>=128&&cm(i,n,this),this.pos=i-1,this.writeVarint(n),this.pos+=n},writeMessage:function(t,e,i){this.writeTag(t,rm.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,um,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,dm,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,pm,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,gm,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,fm,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,mm,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,_m,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,ym,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,xm,e)},writeBytesField:function(t,e){this.writeTag(t,rm.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,rm.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,rm.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,rm.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,rm.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,rm.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,rm.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,rm.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,rm.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,rm.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};class Em extends Jp{constructor(t){super(),t=t||{},this.dataProjection=new Ae({code:"",units:"tile-pixels"}),this.featureClass_=t.featureClass?t.featureClass:Bp,this.geometryName_=t.geometryName,this.layerName_=t.layerName?t.layerName:"layer",this.layers_=t.layers?t.layers:null,this.idProperty_=t.idProperty,this.supportedMediaTypes=["application/vnd.mapbox-vector-tile","application/x-protobuf"]}readRawGeometry_(t,e,i,n){t.pos=e.geometry;const r=t.readVarint()+t.pos;let s=1,o=0,a=0,l=0,h=0,c=0;for(;t.pos<r;){if(!o){const e=t.readVarint();s=7&e,o=e>>3}o--,1===s||2===s?(a+=t.readSVarint(),l+=t.readSVarint(),1===s&&h>c&&(n.push(h),c=h),i.push(a,l),h+=2):7===s?h>c&&(i.push(i[c],i[c+1]),h+=2):at(!1,59)}h>c&&(n.push(h),c=h)}createFeature_(t,e,i){const n=e.type;if(0===n)return null;let r;const s=e.properties;let o;this.idProperty_?(o=s[this.idProperty_],delete s[this.idProperty_]):o=e.id,s[this.layerName_]=e.layer.name;const a=[],l=[];this.readRawGeometry_(t,e,a,l);const h=function(t,e){let i;1===t?i=1===e?"Point":"MultiPoint":2===t?i=1===e?"LineString":"MultiLineString":3===t&&(i="Polygon");return i}(n,l.length);if(this.featureClass_===Bp)r=new this.featureClass_(h,a,l,s,o),r.transform(i.dataProjection);else{let t;if("Polygon"==h){const e=cr(a,l);t=e.length>1?new Gp(a,"XY",e):new ur(a,"XY",l)}else t="Point"===h?new Wn(a,"XY"):"LineString"===h?new Op(a,"XY"):"MultiPoint"===h?new Dp(a,"XY"):"MultiLineString"===h?new Np(a,"XY",l):null;r=new(0,this.featureClass_),this.geometryName_&&r.setGeometryName(this.geometryName_);const e=Qp(t,!1,i);r.setGeometry(e),void 0!==o&&r.setId(o),r.setProperties(s,!0)}return r}getType(){return"arraybuffer"}readFeatures(t,e){const i=this.layers_,n=Ui((e=this.adaptOptions(e)).dataProjection);n.setWorldExtent(e.extent),e.dataProjection=n;const r=new im(t),s=r.readFields(Tm,{}),o=[];for(const t in s){if(i&&!i.includes(t))continue;const a=s[t],l=a?[0,0,a.extent,a.extent]:null;n.setExtent(l);for(let t=0,i=a.length;t<i;++t){const i=Rm(r,a,t),n=this.createFeature_(r,i,e);null!==n&&o.push(n)}}return o}readProjection(t){return this.dataProjection}setLayers(t){this.layers_=t}}function Tm(t,e,i){if(3===t){const t={keys:[],values:[],features:[]},n=i.readVarint()+i.pos;i.readFields(Cm,t,n),t.length=t.features.length,t.length&&(e[t.name]=t)}}function Cm(t,e,i){if(15===t)e.version=i.readVarint();else if(1===t)e.name=i.readString();else if(5===t)e.extent=i.readVarint();else if(2===t)e.features.push(i.pos);else if(3===t)e.keys.push(i.readString());else if(4===t){let n=null;const r=i.readVarint()+i.pos;for(;i.pos<r;)n=1===(t=i.readVarint()>>3)?i.readString():2===t?i.readFloat():3===t?i.readDouble():4===t?i.readVarint64():5===t?i.readVarint():6===t?i.readSVarint():7===t?i.readBoolean():null;e.values.push(n)}}function bm(t,e,i){if(1==t)e.id=i.readVarint();else if(2==t){const t=i.readVarint()+i.pos;for(;i.pos<t;){const t=e.layer.keys[i.readVarint()],n=e.layer.values[i.readVarint()];e.properties[t]=n}}else 3==t?e.type=i.readVarint():4==t&&(e.geometry=i.pos)}function Rm(t,e,i){t.pos=e.features[i];const n=t.readVarint()+t.pos,r={layer:e,type:0,properties:{}};return t.readFields(bm,r,n),r}class Pm extends Ig{constructor(t){t=t||{};const e=Object.assign({},t);delete e.preload,delete e.useInterimTilesOnError,super(e),this.on,this.once,this.un;const i=t.renderMode||"hybrid";at("hybrid"==i||"vector"==i,28),this.renderMode_=i,this.setPreload(t.preload?t.preload:0),this.setUseInterimTilesOnError(void 0===t.useInterimTilesOnError||t.useInterimTilesOnError),this.getBackground,this.setBackground}createRenderer(){return new Rp(this)}getFeatures(t){return super.getFeatures(t)}getRenderMode(){return this.renderMode_}getPreload(){return this.get(Mc)}getUseInterimTilesOnError(){return this.get(Fc)}setPreload(t){this.set(Mc,t)}setUseInterimTilesOnError(t){this.set(Fc,t)}}class Im extends i{constructor(t){super(w),this.error=t}}function Lm(t,e){const i=`\n attribute vec2 ${pd.TEXTURE_COORD};\n uniform mat4 ${fd.TILE_TRANSFORM};\n uniform float ${fd.TEXTURE_PIXEL_WIDTH};\n uniform float ${fd.TEXTURE_PIXEL_HEIGHT};\n uniform float ${fd.TEXTURE_RESOLUTION};\n uniform float ${fd.TEXTURE_ORIGIN_X};\n uniform float ${fd.TEXTURE_ORIGIN_Y};\n uniform float ${fd.DEPTH};\n\n varying vec2 v_textureCoord;\n varying vec2 v_mapCoord;\n\n void main() {\n v_textureCoord = ${pd.TEXTURE_COORD};\n v_mapCoord = vec2(\n ${fd.TEXTURE_ORIGIN_X} + ${fd.TEXTURE_RESOLUTION} * ${fd.TEXTURE_PIXEL_WIDTH} * v_textureCoord[0],\n ${fd.TEXTURE_ORIGIN_Y} - ${fd.TEXTURE_RESOLUTION} * ${fd.TEXTURE_PIXEL_HEIGHT} * v_textureCoord[1]\n );\n gl_Position = ${fd.TILE_TRANSFORM} * vec4(${pd.TEXTURE_COORD}, ${fd.DEPTH}, 1.0);\n }\n `,n={inFragmentShader:!0,variables:[],attributes:[],stringLiteralsMap:{},functions:{},bandCount:e},r=[];if(void 0!==t.color){const e=Gd(n,t.color,Cd);r.push(`color = ${e};`)}if(void 0!==t.contrast){const e=Gd(n,t.contrast,Ed);r.push(`color.rgb = clamp((${e} + 1.0) * color.rgb - (${e} / 2.0), vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0));`)}if(void 0!==t.exposure){const e=Gd(n,t.exposure,Ed);r.push(`color.rgb = clamp((${e} + 1.0) * color.rgb, vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0));`)}if(void 0!==t.saturation){const e=Gd(n,t.saturation,Ed);r.push(`\n float saturation = ${e} + 1.0;\n float sr = (1.0 - saturation) * 0.2126;\n float sg = (1.0 - saturation) * 0.7152;\n float sb = (1.0 - saturation) * 0.0722;\n mat3 saturationMatrix = mat3(\n sr + saturation, sr, sr,\n sg, sg + saturation, sg,\n sb, sb, sb + saturation\n );\n color.rgb = clamp(saturationMatrix * color.rgb, vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0));\n `)}if(void 0!==t.gamma){const e=Gd(n,t.gamma,Ed);r.push(`color.rgb = pow(color.rgb, vec3(1.0 / ${e}));`)}if(void 0!==t.brightness){const e=Gd(n,t.brightness,Ed);r.push(`color.rgb = clamp(color.rgb + ${e}, vec3(0.0, 0.0, 0.0), vec3(1.0, 1.0, 1.0));`)}const s={},o=n.variables.length;if(o>1&&!t.variables)throw new Error(`Missing variables in style (expected ${n.variables})`);for(let e=0;e<o;++e){const i=n.variables[e];if(!(i in t.variables))throw new Error(`Missing '${i}' in style variables`);s[Kd(i)]=function(){let e=t.variables[i];return"string"==typeof e&&(e=Dd(n,e)),void 0!==e?e:-9999999}}const a=Object.keys(s).map((function(t){return`uniform float ${t};`})),l=Math.ceil(e/4);a.push(`uniform sampler2D ${fd.TILE_TEXTURE_ARRAY}[${l}];`),n.paletteTextures&&a.push(`uniform sampler2D u_paletteTextures[${n.paletteTextures.length}];`);const h=Object.keys(n.functions).map((function(t){return n.functions[t]}));return{vertexShader:i,fragmentShader:`\n #ifdef GL_FRAGMENT_PRECISION_HIGH\n precision highp float;\n #else\n precision mediump float;\n #endif\n\n varying vec2 v_textureCoord;\n varying vec2 v_mapCoord;\n uniform vec4 ${fd.RENDER_EXTENT};\n uniform float ${fd.TRANSITION_ALPHA};\n uniform float ${fd.TEXTURE_PIXEL_WIDTH};\n uniform float ${fd.TEXTURE_PIXEL_HEIGHT};\n uniform float ${fd.RESOLUTION};\n uniform float ${fd.ZOOM};\n\n ${a.join("\n")}\n\n ${h.join("\n")}\n\n void main() {\n if (\n v_mapCoord[0] < ${fd.RENDER_EXTENT}[0] ||\n v_mapCoord[1] < ${fd.RENDER_EXTENT}[1] ||\n v_mapCoord[0] > ${fd.RENDER_EXTENT}[2] ||\n v_mapCoord[1] > ${fd.RENDER_EXTENT}[3]\n ) {\n discard;\n }\n\n vec4 color = texture2D(${fd.TILE_TEXTURE_ARRAY}[0], v_textureCoord);\n\n ${r.join("\n")}\n\n if (color.a == 0.0) {\n discard;\n }\n\n gl_FragColor = color;\n gl_FragColor.rgb *= gl_FragColor.a;\n gl_FragColor *= ${fd.TRANSITION_ALPHA};\n }`,uniforms:s,paletteTextures:n.paletteTextures}}class Mm extends Ac{constructor(t){const e=(t=t?Object.assign({},t):{}).style||{};delete t.style;const i=t.cacheSize;delete t.cacheSize,super(t),this.sources_=t.sources,this.renderedSource_=null,this.renderedResolution_=NaN,this.style_=e,this.cacheSize_=i,this.styleVariables_=this.style_.variables||{},this.addChangeListener(ds,this.handleSourceUpdate_)}getSources(t,e){const i=this.getSource();return this.sources_?"function"==typeof this.sources_?this.sources_(t,e):this.sources_:i?[i]:[]}getRenderSource(){return this.renderedSource_||this.getSource()}getSourceState(){const t=this.getRenderSource();return t?t.getState():"undefined"}handleSourceUpdate_(){this.hasRenderer()&&this.getRenderer().clearCache(),this.getSource()&&this.setStyle(this.style_)}getSourceBandCount_(){const t=Number.MAX_SAFE_INTEGER,e=this.getSources([-t,-t,t,t],t);return e&&e.length&&"bandCount"in e[0]?e[0].bandCount:4}createRenderer(){const t=Lm(this.style_,this.getSourceBandCount_());return new wd(this,{vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,uniforms:t.uniforms,cacheSize:this.cacheSize_,paletteTextures:t.paletteTextures})}renderSources(t,e){const i=this.getRenderer();let n;for(let r=0,s=e.length;r<s;++r)this.renderedSource_=e[r],i.prepareFrame(t)&&(n=i.renderFrame(t));return n}render(t,e){this.rendered=!0;const i=t.viewState,n=this.getSources(t.extent,i.resolution);let r=!0;for(let t=0,e=n.length;t<e;++t){const e=n[t],i=e.getState();if("loading"==i){const t=()=>{"ready"==e.getState()&&(e.removeEventListener("change",t),this.changed())};e.addEventListener("change",t)}r=r&&"ready"==i}const s=this.renderSources(t,n);if(this.getRenderer().renderComplete&&r)return this.renderedResolution_=i.resolution,s;if(this.renderedResolution_>.5*i.resolution){const e=this.getSources(t.extent,this.renderedResolution_).filter((t=>!n.includes(t)));if(e.length>0)return this.renderSources(t,e)}return s}setStyle(t){this.styleVariables_=t.variables||{},this.style_=t;const e=Lm(this.style_,this.getSourceBandCount_());this.getRenderer().reset({vertexShader:e.vertexShader,fragmentShader:e.fragmentShader,uniforms:e.uniforms,paletteTextures:e.paletteTextures}),this.changed()}updateStyleVariables(t){Object.assign(this.styleVariables_,t),this.changed()}}Mm.prototype.dispose;const Fm="addfeatures";class Am extends i{constructor(t,e,i,n){super(t),this.features=i,this.file=e,this.projection=n}}const Om="drawstart",Nm="drawend",Dm="drawabort";class km extends i{constructor(t,e){super(t),this.feature=e}}function Gm(t,e){return ri(t[0],t[1],e[0],e[1])}function jm(t,e){const i=t.length;return e<0?t[e+i]:e>=i?t[e-i]:t[e]}function Bm(t,e,i){let n,r;e<i?(n=e,r=i):(n=i,r=e);const s=Math.ceil(n),o=Math.floor(r);if(s>o){return Gm(Zm(t,n),Zm(t,r))}let a=0;if(n<s){a+=Gm(Zm(t,n),jm(t,s))}if(o<r){a+=Gm(jm(t,o),Zm(t,r))}for(let e=s;e<o-1;++e){a+=Gm(jm(t,e),jm(t,e+1))}return a}function Um(t,e,i){if(e instanceof Op)Xm(t,e.getCoordinates(),!1,i);else if(e instanceof Np){const n=e.getCoordinates();for(let e=0,r=n.length;e<r;++e)Xm(t,n[e],!1,i)}else if(e instanceof ur){const n=e.getCoordinates();for(let e=0,r=n.length;e<r;++e)Xm(t,n[e],!0,i)}else if(e instanceof Gp){const n=e.getCoordinates();for(let e=0,r=n.length;e<r;++e){const r=n[e];for(let e=0,n=r.length;e<n;++e)Xm(t,r[e],!0,i)}}else if(e instanceof Ip){const n=e.getGeometries();for(let e=0;e<n.length;++e)Um(t,n[e],i)}}const zm={index:-1,endIndex:NaN};function Xm(t,e,i,n){const r=t[0],s=t[1];for(let t=0,o=e.length-1;t<o;++t){const o=Wm(r,s,e[t],e[t+1]);if(0===o.squaredDistance){const r=t+o.along;return void n.push({coordinates:e,ring:i,startIndex:r,endIndex:r})}}}const Vm={along:0,squaredDistance:0};function Wm(t,e,i,n){const r=i[0],s=i[1],o=n[0]-r,a=n[1]-s;let l=0,h=r,c=s;return 0===o&&0===a||(l=ii(((t-r)*o+(e-s)*a)/(o*o+a*a),0,1),h+=o*l,c+=a*l),Vm.along=l,Vm.squaredDistance=ci(ri(t,e,h,c),10),Vm}function Zm(t,e){const i=t.length;let n=Math.floor(e);const r=e-n;n>=i?n-=i:n<0&&(n+=i);let s=n+1;s>=i&&(s-=i);const o=t[n],a=o[0],l=o[1],h=t[s];return[a+(h[0]-a)*r,l+(h[1]-l)*r]}function Ym(){const t=fg();return function(e,i){return t[e.getGeometry().getType()]}}const Km="extentchanged";class qm extends i{constructor(t){super(Km),this.extent=t}}function Hm(){const t=fg();return function(e,i){return t.Polygon}}function $m(){const t=fg();return function(e,i){return t.Point}}function Jm(t){return function(e){return zt([t,e])}}function Qm(t,e){return t[0]==e[0]?function(i){return zt([t,[i[0],e[1]]])}:t[1]==e[1]?function(i){return zt([t,[e[0],i[1]]])}:null}function t_(t){return parseFloat(t)}function e_(t){return function(t){return ci(t,5)}(t).toString()}function i_(t,e){return!isNaN(t)&&t!==t_(e_(e))}const n_=[0,0,0,0],r_=[],s_="modifystart",o_="modifyend";class a_ extends i{constructor(t,e,i){super(t),this.features=e,this.mapBrowserEvent=i}}function l_(t,e){return t.index-e.index}function h_(t,e,i){const n=e.geometry;if("Circle"===n.getType()){let r=n;if(1===e.index){const e=en();e&&(r=r.clone().transform(e,i));const n=Ti(r.getCenter(),rn(t,i)),s=Math.sqrt(n)-r.getRadius();return s*s}}const r=rn(t,i);return r_[0]=rn(e.segment[0],i),r_[1]=rn(e.segment[1],i),bi(r,r_)}function c_(t,e,i){const n=e.geometry;if("Circle"===n.getType()&&1===e.index){let e=n;const r=en();return r&&(e=e.clone().transform(r,i)),nn(e.getClosestPoint(rn(t,i)),i)}const r=rn(t,i);return r_[0]=rn(e.segment[0],i),r_[1]=rn(e.segment[1],i),nn(yi(r,r_),i)}function u_(){const t=fg();return function(e,i){return t.Point}}const d_="select";class g_ extends i{constructor(t,e,i,n){super(t),this.selected=e,this.deselected=i,this.mapBrowserEvent=n}}const f_={};class p_ extends ea{constructor(t){let e;if(super(),this.on,this.once,this.un,t=t||{},this.boundAddFeature_=this.addFeature_.bind(this),this.boundRemoveFeature_=this.removeFeature_.bind(this),this.condition_=t.condition?t.condition:pa,this.addCondition_=t.addCondition?t.addCondition:fa,this.removeCondition_=t.removeCondition?t.removeCondition:fa,this.toggleCondition_=t.toggleCondition?t.toggleCondition:_a,this.multi_=!!t.multi&&t.multi,this.filter_=t.filter?t.filter:g,this.hitTolerance_=t.hitTolerance?t.hitTolerance:0,this.style_=void 0!==t.style?t.style:function(){const t=fg();return c(t.Polygon,t.LineString),c(t.GeometryCollection,t.LineString),function(e){return e.getGeometry()?t[e.getGeometry().getType()]:null}}(),this.features_=t.features||new q,t.layers)if("function"==typeof t.layers)e=t.layers;else{const i=t.layers;e=function(t){return i.includes(t)}}else e=g;this.layerFilter_=e,this.featureLayerAssociation_={}}addFeatureLayerAssociation_(t,e){this.featureLayerAssociation_[z(t)]=e}getFeatures(){return this.features_}getHitTolerance(){return this.hitTolerance_}getLayer(t){return this.featureLayerAssociation_[z(t)]}setHitTolerance(t){this.hitTolerance_=t}setMap(t){this.getMap()&&this.style_&&this.features_.forEach(this.restorePreviousStyle_.bind(this)),super.setMap(t),t?(this.features_.addEventListener(W,this.boundAddFeature_),this.features_.addEventListener(Z,this.boundRemoveFeature_),this.style_&&this.features_.forEach(this.applySelectedStyle_.bind(this))):(this.features_.removeEventListener(W,this.boundAddFeature_),this.features_.removeEventListener(Z,this.boundRemoveFeature_))}addFeature_(t){const e=t.element;if(this.style_&&this.applySelectedStyle_(e),!this.getLayer(e)){const t=this.getMap().getAllLayers().find((function(t){if(t instanceof zp&&t.getSource()&&t.getSource().hasFeature(e))return t}));t&&this.addFeatureLayerAssociation_(e,t)}}removeFeature_(t){this.style_&&this.restorePreviousStyle_(t.element)}getStyle(){return this.style_}applySelectedStyle_(t){const e=z(t);e in f_||(f_[e]=t.getStyle()),t.setStyle(this.style_)}restorePreviousStyle_(t){const e=this.getMap().getInteractions().getArray();for(let i=e.length-1;i>=0;--i){const n=e[i];if(n!==this&&n instanceof p_&&n.getStyle()&&-1!==n.getFeatures().getArray().lastIndexOf(t))return void t.setStyle(n.getStyle())}const i=z(t);t.setStyle(f_[i]),delete f_[i]}removeFeatureLayerAssociation_(t){delete this.featureLayerAssociation_[z(t)]}handleEvent(t){if(!this.condition_(t))return!0;const e=this.addCondition_(t),i=this.removeCondition_(t),n=this.toggleCondition_(t),r=!e&&!i&&!n,s=t.map,o=this.getFeatures(),a=[],l=[];if(r){y(this.featureLayerAssociation_),s.forEachFeatureAtPixel(t.pixel,function(t,e){if(t instanceof lt&&this.filter_(t,e))return this.addFeatureLayerAssociation_(t,e),l.push(t),!this.multi_}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(let t=o.getLength()-1;t>=0;--t){const e=o.item(t),i=l.indexOf(e);i>-1?l.splice(i,1):(o.remove(e),a.push(e))}0!==l.length&&o.extend(l)}else{s.forEachFeatureAtPixel(t.pixel,function(t,r){if(t instanceof lt&&this.filter_(t,r))return!e&&!n||o.getArray().includes(t)?(i||n)&&o.getArray().includes(t)&&(a.push(t),this.removeFeatureLayerAssociation_(t)):(this.addFeatureLayerAssociation_(t,r),l.push(t)),!this.multi_}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_});for(let t=a.length-1;t>=0;--t)o.remove(a[t]);o.extend(l)}return(l.length>0||a.length>0)&&this.dispatchEvent(new g_(d_,l,a,t)),!0}}function m_(t){return t.feature?t.feature:t.element?t.element:void 0}const __=[];const y_="translatestart",x_="translating",v_="translateend";class S_ extends i{constructor(t,e,i,n,r){super(t),this.features=e,this.coordinate=i,this.startCoordinate=n,this.mapBrowserEvent=r}}function w_(t,e,i,n,r,s){void 0!==r?s=void 0!==s?s:0:(r=[],s=0);let o=e;for(;o<i;){const e=t[o++];r[s++]=t[o++],r[s++]=e;for(let e=2;e<n;++e)r[s++]=t[o++]}return r.length=s,r}class E_ extends Jp{constructor(){super()}getType(){return"json"}readFeature(t,e){return this.readFeatureFromObject(T_(t),this.getReadOptions(t,e))}readFeatures(t,e){return this.readFeaturesFromObject(T_(t),this.getReadOptions(t,e))}readFeatureFromObject(t,e){return B()}readFeaturesFromObject(t,e){return B()}readGeometry(t,e){return this.readGeometryFromObject(T_(t),this.getReadOptions(t,e))}readGeometryFromObject(t,e){return B()}readProjection(t){return this.readProjectionFromObject(T_(t))}readProjectionFromObject(t){return B()}writeFeature(t,e){return JSON.stringify(this.writeFeatureObject(t,e))}writeFeatureObject(t,e){return B()}writeFeatures(t,e){return JSON.stringify(this.writeFeaturesObject(t,e))}writeFeaturesObject(t,e){return B()}writeGeometry(t,e){return JSON.stringify(this.writeGeometryObject(t,e))}writeGeometryObject(t,e){return B()}}function T_(t){if("string"==typeof t){const e=JSON.parse(t);return e||null}return null!==t?t:null}const C_={Point:function(t){let e;e=void 0!==t.m&&void 0!==t.z?new Wn([t.x,t.y,t.z,t.m],"XYZM"):void 0!==t.z?new Wn([t.x,t.y,t.z],"XYZ"):void 0!==t.m?new Wn([t.x,t.y,t.m],"XYM"):new Wn([t.x,t.y]);return e},LineString:function(t){const e=P_(t);return new Op(t.paths[0],e)},Polygon:function(t){const e=P_(t);return new ur(t.rings,e)},MultiPoint:function(t){const e=P_(t);return new Dp(t.points,e)},MultiLineString:function(t){const e=P_(t);return new Np(t.paths,e)},MultiPolygon:function(t){const e=P_(t);return new Gp(t.rings,e)}},b_={Point:function(t,e){const i=t.getCoordinates();let n;const r=t.getLayout();"XYZ"===r?n={x:i[0],y:i[1],z:i[2]}:"XYM"===r?n={x:i[0],y:i[1],m:i[2]}:"XYZM"===r?n={x:i[0],y:i[1],z:i[2],m:i[3]}:"XY"===r?n={x:i[0],y:i[1]}:at(!1,34);return n},LineString:function(t,e){const i=I_(t);return{hasZ:i.hasZ,hasM:i.hasM,paths:[t.getCoordinates()]}},Polygon:function(t,e){const i=I_(t);return{hasZ:i.hasZ,hasM:i.hasM,rings:t.getCoordinates(!1)}},MultiPoint:function(t,e){const i=I_(t);return{hasZ:i.hasZ,hasM:i.hasM,points:t.getCoordinates()}},MultiLineString:function(t,e){const i=I_(t);return{hasZ:i.hasZ,hasM:i.hasM,paths:t.getCoordinates()}},MultiPolygon:function(t,e){const i=I_(t),n=t.getCoordinates(!1),r=[];for(let t=0;t<n.length;t++)for(let e=n[t].length-1;e>=0;e--)r.push(n[t][e]);return{hasZ:i.hasZ,hasM:i.hasM,rings:r}}};function R_(t,e){if(!t)return null;let i;if("number"==typeof t.x&&"number"==typeof t.y)i="Point";else if(t.points)i="MultiPoint";else if(t.paths){i=1===t.paths.length?"LineString":"MultiLineString"}else if(t.rings){const e=t,n=P_(e),r=function(t,e){const i=[],n=[],r=[];let s,o;for(s=0,o=t.length;s<o;++s){i.length=0,Pn(i,0,t[s],e.length);sr(i,0,i.length,e.length)?n.push([t[s]]):r.push(t[s])}for(;r.length;){const t=r.shift();let e=!1;for(s=n.length-1;s>=0;s--){const i=n[s][0];if(Yt(new Vn(i).getExtent(),new Vn(t).getExtent())){n[s].push(t),e=!0;break}}e||n.push([t.reverse()])}return n}(e.rings,n);1===r.length?(i="Polygon",t=Object.assign({},t,{rings:r[0]})):(i="MultiPolygon",t=Object.assign({},t,{rings:r}))}return Qp((0,C_[i])(t),!1,e)}function P_(t){let e="XY";return!0===t.hasZ&&!0===t.hasM?e="XYZM":!0===t.hasZ?e="XYZ":!0===t.hasM&&(e="XYM"),e}function I_(t){const e=t.getLayout();return{hasZ:"XYZ"===e||"XYZM"===e,hasM:"XYM"===e||"XYZM"===e}}function L_(t,e){return(0,b_[t.getType()])(Qp(t,!0,e),e)}class M_ extends Jp{constructor(){super(),this.xmlSerializer_=Nu()}getType(){return"xml"}readFeature(t,e){if(t){if("string"==typeof t){const i=_u(t);return this.readFeatureFromDocument(i,e)}return pu(t)?this.readFeatureFromDocument(t,e):this.readFeatureFromNode(t,e)}return null}readFeatureFromDocument(t,e){const i=this.readFeaturesFromDocument(t,e);return i.length>0?i[0]:null}readFeatureFromNode(t,e){return null}readFeatures(t,e){if(t){if("string"==typeof t){const i=_u(t);return this.readFeaturesFromDocument(i,e)}return pu(t)?this.readFeaturesFromDocument(t,e):this.readFeaturesFromNode(t,e)}return[]}readFeaturesFromDocument(t,e){const i=[];for(let n=t.firstChild;n;n=n.nextSibling)n.nodeType==Node.ELEMENT_NODE&&c(i,this.readFeaturesFromNode(n,e));return i}readFeaturesFromNode(t,e){return B()}readGeometry(t,e){if(t){if("string"==typeof t){const i=_u(t);return this.readGeometryFromDocument(i,e)}return pu(t)?this.readGeometryFromDocument(t,e):this.readGeometryFromNode(t,e)}return null}readGeometryFromDocument(t,e){return null}readGeometryFromNode(t,e){return null}readProjection(t){if(t){if("string"==typeof t){const e=_u(t);return this.readProjectionFromDocument(e)}return pu(t)?this.readProjectionFromDocument(t):this.readProjectionFromNode(t)}return null}readProjectionFromDocument(t){return this.dataProjection}readProjectionFromNode(t){return this.dataProjection}writeFeature(t,e){const i=this.writeFeatureNode(t,e);return this.xmlSerializer_.serializeToString(i)}writeFeatureNode(t,e){return null}writeFeatures(t,e){const i=this.writeFeaturesNode(t,e);return this.xmlSerializer_.serializeToString(i)}writeFeaturesNode(t,e){return null}writeGeometry(t,e){const i=this.writeGeometryNode(t,e);return this.xmlSerializer_.serializeToString(i)}writeGeometryNode(t,e){return null}}const F_="http://www.opengis.net/gml",A_=/^\s*$/;class O_ extends M_{constructor(t){super(),t=t||{},this.featureType=t.featureType,this.featureNS=t.featureNS,this.srsName=t.srsName,this.schemaLocation="",this.FEATURE_COLLECTION_PARSERS={},this.FEATURE_COLLECTION_PARSERS[this.namespace]={featureMember:xu(this.readFeaturesInternal),featureMembers:vu(this.readFeaturesInternal)},this.supportedMediaTypes=["application/gml+xml"]}readFeaturesInternal(t,e){const i=t.localName;let n=null;if("FeatureCollection"==i)n=Lu([],this.FEATURE_COLLECTION_PARSERS,t,e,this);else if("featureMembers"==i||"featureMember"==i||"member"==i){const r=e[0];let s=r.featureType,o=r.featureNS;const a="p",l="p0";if(!s&&t.childNodes){s=[],o={};for(let e=0,i=t.childNodes.length;e<i;++e){const i=t.childNodes[e];if(1===i.nodeType){const t=i.nodeName.split(":").pop();if(!s.includes(t)){let e="",n=0;const r=i.namespaceURI;for(const t in o){if(o[t]===r){e=t;break}++n}e||(e=a+n,o[e]=r),s.push(e+":"+t)}}}"featureMember"!=i&&(r.featureType=s,r.featureNS=o)}if("string"==typeof o){const t=o;o={},o[l]=t}const h={},c=Array.isArray(s)?s:[s];for(const t in o){const e={};for(let n=0,r=c.length;n<r;++n){(c[n].includes(":")?c[n].split(":")[0]:l)===t&&(e[c[n].split(":").pop()]="featureMembers"==i?xu(this.readFeatureElement,this):vu(this.readFeatureElement,this))}h[o[t]]=e}n=Lu("featureMember"==i||"member"==i?void 0:[],h,t,e)}return null===n&&(n=[]),n}readGeometryOrExtent(t,e){const i=e[0];return i.srsName=t.firstElementChild.getAttribute("srsName"),i.srsDimension=t.firstElementChild.getAttribute("srsDimension"),Lu(null,this.GEOMETRY_PARSERS,t,e,this)}readExtentElement(t,e){const i=e[0],n=this.readGeometryOrExtent(t,e);return n?tm(n,i):void 0}readGeometryElement(t,e){const i=e[0],n=this.readGeometryOrExtent(t,e);return n?Qp(n,!1,i):void 0}readFeatureElementInternal(t,e,i){let n;const r={};for(let s=t.firstElementChild;s;s=s.nextElementSibling){let t;const o=s.localName;0===s.childNodes.length||1===s.childNodes.length&&(3===s.firstChild.nodeType||4===s.firstChild.nodeType)?(t=gu(s,!1),A_.test(t)&&(t=void 0)):(i&&(t="boundedBy"===o?this.readExtentElement(s,e):this.readGeometryElement(s,e)),t?"boundedBy"!==o&&(n=o):t=this.readFeatureElementInternal(s,e,!1));const a=s.attributes.length;if(a>0){t={_content_:t};for(let e=0;e<a;e++){t[s.attributes[e].name]=s.attributes[e].value}}r[o]?(r[o]instanceof Array||(r[o]=[r[o]]),r[o].push(t)):r[o]=t}if(i){const e=new lt(r);n&&e.setGeometryName(n);const i=t.getAttribute("fid")||mu(t,this.namespace,"id");return i&&e.setId(i),e}return r}readFeatureElement(t,e){return this.readFeatureElementInternal(t,e,!0)}readPoint(t,e){const i=this.readFlatCoordinatesFromNode(t,e);if(i)return new Wn(i,"XYZ")}readMultiPoint(t,e){const i=Lu([],this.MULTIPOINT_PARSERS,t,e,this);return i?new Dp(i):void 0}readMultiLineString(t,e){const i=Lu([],this.MULTILINESTRING_PARSERS,t,e,this);if(i)return new Np(i)}readMultiPolygon(t,e){const i=Lu([],this.MULTIPOLYGON_PARSERS,t,e,this);if(i)return new Gp(i)}pointMemberParser(t,e){Iu(this.POINTMEMBER_PARSERS,t,e,this)}lineStringMemberParser(t,e){Iu(this.LINESTRINGMEMBER_PARSERS,t,e,this)}polygonMemberParser(t,e){Iu(this.POLYGONMEMBER_PARSERS,t,e,this)}readLineString(t,e){const i=this.readFlatCoordinatesFromNode(t,e);if(i){return new Op(i,"XYZ")}}readFlatLinearRing(t,e){const i=Lu(null,this.GEOMETRY_FLAT_COORDINATES_PARSERS,t,e,this);return i||void 0}readLinearRing(t,e){const i=this.readFlatCoordinatesFromNode(t,e);if(i)return new Vn(i,"XYZ")}readPolygon(t,e){const i=Lu([null],this.FLAT_LINEAR_RINGS_PARSERS,t,e,this);if(i&&i[0]){const t=i[0],e=[t.length];let n,r;for(n=1,r=i.length;n<r;++n)c(t,i[n]),e.push(t.length);return new ur(t,"XYZ",e)}}readFlatCoordinatesFromNode(t,e){return Lu(null,this.GEOMETRY_FLAT_COORDINATES_PARSERS,t,e,this)}readGeometryFromNode(t,e){const i=this.readGeometryElement(t,[this.getReadOptions(t,e||{})]);return i||null}readFeaturesFromNode(t,e){const i={featureType:this.featureType,featureNS:this.featureNS};i&&Object.assign(i,this.getReadOptions(t,e));return this.readFeaturesInternal(t,[i])||[]}readProjectionFromNode(t){return Ui(this.srsName?this.srsName:t.firstElementChild.getAttribute("srsName"))}}function N_(t){return D_(gu(t,!1))}function D_(t){const e=/^\s*(true|1)|(false|0)\s*$/.exec(t);return e?void 0!==e[1]||!1:void 0}function k_(t){const e=gu(t,!1),i=Date.parse(e);return isNaN(i)?void 0:i/1e3}function G_(t){return j_(gu(t,!1))}function j_(t){const e=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(t);return e?parseFloat(e[1]):void 0}function B_(t){return U_(gu(t,!1))}function U_(t){const e=/^\s*(\d+)\s*$/.exec(t);return e?parseInt(e[1],10):void 0}function z_(t){return gu(t,!1).trim()}function X_(t,e){K_(t,e?"1":"0")}function V_(t,e){t.appendChild(Du().createCDATASection(e))}function W_(t,e){const i=new Date(1e3*e),n=i.getUTCFullYear()+"-"+fi(i.getUTCMonth()+1,2)+"-"+fi(i.getUTCDate(),2)+"T"+fi(i.getUTCHours(),2)+":"+fi(i.getUTCMinutes(),2)+":"+fi(i.getUTCSeconds(),2)+"Z";t.appendChild(Du().createTextNode(n))}function Z_(t,e){const i=e.toPrecision();t.appendChild(Du().createTextNode(i))}function Y_(t,e){const i=e.toString();t.appendChild(Du().createTextNode(i))}function K_(t,e){t.appendChild(Du().createTextNode(e))}O_.prototype.namespace=F_,O_.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml":{}},O_.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml":{}},O_.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml":{}},O_.prototype.MULTIPOINT_PARSERS={"http://www.opengis.net/gml":{pointMember:xu(O_.prototype.pointMemberParser),pointMembers:xu(O_.prototype.pointMemberParser)}},O_.prototype.MULTILINESTRING_PARSERS={"http://www.opengis.net/gml":{lineStringMember:xu(O_.prototype.lineStringMemberParser),lineStringMembers:xu(O_.prototype.lineStringMemberParser)}},O_.prototype.MULTIPOLYGON_PARSERS={"http://www.opengis.net/gml":{polygonMember:xu(O_.prototype.polygonMemberParser),polygonMembers:xu(O_.prototype.polygonMemberParser)}},O_.prototype.POINTMEMBER_PARSERS={"http://www.opengis.net/gml":{Point:xu(O_.prototype.readFlatCoordinatesFromNode)}},O_.prototype.LINESTRINGMEMBER_PARSERS={"http://www.opengis.net/gml":{LineString:xu(O_.prototype.readLineString)}},O_.prototype.POLYGONMEMBER_PARSERS={"http://www.opengis.net/gml":{Polygon:xu(O_.prototype.readPolygon)}},O_.prototype.RING_PARSERS={"http://www.opengis.net/gml":{LinearRing:vu(O_.prototype.readFlatLinearRing)}};const q_={MultiLineString:"lineStringMember",MultiCurve:"curveMember",MultiPolygon:"polygonMember",MultiSurface:"surfaceMember"};class H_ extends O_{constructor(t){super(t=t||{}),this.FEATURE_COLLECTION_PARSERS[F_].featureMember=xu(this.readFeaturesInternal),this.schemaLocation=t.schemaLocation?t.schemaLocation:"http://www.opengis.net/gml http://schemas.opengis.net/gml/2.1.2/feature.xsd"}readFlatCoordinates(t,e){const i=gu(t,!1).replace(/^\s*|\s*$/g,""),n=e[0].srsName;let r="enu";if(n){const t=Ui(n);t&&(r=t.getAxisOrientation())}const s=i.trim().split(/\s+/),o=[];for(let t=0,e=s.length;t<e;t++){const e=s[t].split(/,+/),i=parseFloat(e[0]),n=parseFloat(e[1]),a=3===e.length?parseFloat(e[2]):0;"en"===r.substr(0,2)?o.push(i,n,a):o.push(n,i,a)}return o}readBox(t,e){const i=Lu([null],this.BOX_PARSERS_,t,e,this);return $t(i[1][0],i[1][1],i[1][3],i[1][4])}innerBoundaryIsParser(t,e){const i=Lu(void 0,this.RING_PARSERS,t,e,this);if(i){e[e.length-1].push(i)}}outerBoundaryIsParser(t,e){const i=Lu(void 0,this.RING_PARSERS,t,e,this);if(i){e[e.length-1][0]=i}}GEOMETRY_NODE_FACTORY_(t,e,i){const n=e[e.length-1],r=n.multiSurface,s=n.surface,o=n.multiCurve;return Array.isArray(t)?i="Envelope":"MultiPolygon"===(i=t.getType())&&!0===r?i="MultiSurface":"Polygon"===i&&!0===s?i="Surface":"MultiLineString"===i&&!0===o&&(i="MultiCurve"),du("http://www.opengis.net/gml",i)}writeFeatureElement(t,e,i){const n=e.getId();n&&t.setAttribute("fid",n);const r=i[i.length-1],s=r.featureNS,o=e.getGeometryName();r.serializers||(r.serializers={},r.serializers[s]={});const a=[],l=[];if(e.hasProperties()){const t=e.getProperties();for(const e in t){const i=t[e];null!==i&&(a.push(e),l.push(i),e==o||"function"==typeof i.getSimplifiedGeometry?e in r.serializers[s]||(r.serializers[s][e]=Eu(this.writeGeometryElement,this)):e in r.serializers[s]||(r.serializers[s][e]=Eu(K_)))}}const h=Object.assign({},r);h.node=t,Fu(h,r.serializers,Cu(void 0,s),l,i,a)}writeCurveOrLineString(t,e,i){const n=i[i.length-1].srsName;if("LineStringSegment"!==t.nodeName&&n&&t.setAttribute("srsName",n),"LineString"===t.nodeName||"LineStringSegment"===t.nodeName){const n=this.createCoordinatesNode_(t.namespaceURI);t.appendChild(n),this.writeCoordinates_(n,e,i)}else if("Curve"===t.nodeName){const n=du(t.namespaceURI,"segments");t.appendChild(n),this.writeCurveSegments_(n,e,i)}}writeLineStringOrCurveMember(t,e,i){const n=this.GEOMETRY_NODE_FACTORY_(e,i);n&&(t.appendChild(n),this.writeCurveOrLineString(n,e,i))}writeMultiCurveOrLineString(t,e,i){const n=i[i.length-1],r=n.hasZ,s=n.srsName,o=n.curve;s&&t.setAttribute("srsName",s);const a=e.getLineStrings();Fu({node:t,hasZ:r,srsName:s,curve:o},this.LINESTRINGORCURVEMEMBER_SERIALIZERS,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,a,i,void 0,this)}writeGeometryElement(t,e,i){const n=i[i.length-1],r=Object.assign({},n);let s;r.node=t,s=Array.isArray(e)?tm(e,n):Qp(e,!0,n),Fu(r,this.GEOMETRY_SERIALIZERS,this.GEOMETRY_NODE_FACTORY_,[s],i,void 0,this)}createCoordinatesNode_(t){const e=du(t,"coordinates");return e.setAttribute("decimal","."),e.setAttribute("cs",","),e.setAttribute("ts"," "),e}writeCoordinates_(t,e,i){const n=i[i.length-1],r=n.hasZ,s=n.srsName,o=e.getCoordinates(),a=o.length,l=new Array(a);for(let t=0;t<a;++t){const e=o[t];l[t]=this.getCoords_(e,s,r)}K_(t,l.join(" "))}writeCurveSegments_(t,e,i){const n=du(t.namespaceURI,"LineStringSegment");t.appendChild(n),this.writeCurveOrLineString(n,e,i)}writeSurfaceOrPolygon(t,e,i){const n=i[i.length-1],r=n.hasZ,s=n.srsName;if("PolygonPatch"!==t.nodeName&&s&&t.setAttribute("srsName",s),"Polygon"===t.nodeName||"PolygonPatch"===t.nodeName){const n=e.getLinearRings();Fu({node:t,hasZ:r,srsName:s},this.RING_SERIALIZERS,this.RING_NODE_FACTORY_,n,i,void 0,this)}else if("Surface"===t.nodeName){const n=du(t.namespaceURI,"patches");t.appendChild(n),this.writeSurfacePatches_(n,e,i)}}RING_NODE_FACTORY_(t,e,i){const n=e[e.length-1],r=n.node,s=n.exteriorWritten;return void 0===s&&(n.exteriorWritten=!0),du(r.namespaceURI,void 0!==s?"innerBoundaryIs":"outerBoundaryIs")}writeSurfacePatches_(t,e,i){const n=du(t.namespaceURI,"PolygonPatch");t.appendChild(n),this.writeSurfaceOrPolygon(n,e,i)}writeRing(t,e,i){const n=du(t.namespaceURI,"LinearRing");t.appendChild(n),this.writeLinearRing(n,e,i)}getCoords_(t,e,i){let n="enu";e&&(n=Ui(e).getAxisOrientation());let r="en"===n.substr(0,2)?t[0]+","+t[1]:t[1]+","+t[0];if(i){r+=","+(t[2]||0)}return r}writePoint(t,e,i){const n=i[i.length-1],r=n.hasZ,s=n.srsName;s&&t.setAttribute("srsName",s);const o=this.createCoordinatesNode_(t.namespaceURI);t.appendChild(o);const a=e.getCoordinates();K_(o,this.getCoords_(a,s,r))}writeMultiPoint(t,e,i){const n=i[i.length-1],r=n.hasZ,s=n.srsName;s&&t.setAttribute("srsName",s);const o=e.getPoints();Fu({node:t,hasZ:r,srsName:s},this.POINTMEMBER_SERIALIZERS,Cu("pointMember"),o,i,void 0,this)}writePointMember(t,e,i){const n=du(t.namespaceURI,"Point");t.appendChild(n),this.writePoint(n,e,i)}writeLinearRing(t,e,i){const n=i[i.length-1].srsName;n&&t.setAttribute("srsName",n);const r=this.createCoordinatesNode_(t.namespaceURI);t.appendChild(r),this.writeCoordinates_(r,e,i)}writeMultiSurfaceOrPolygon(t,e,i){const n=i[i.length-1],r=n.hasZ,s=n.srsName,o=n.surface;s&&t.setAttribute("srsName",s);const a=e.getPolygons();Fu({node:t,hasZ:r,srsName:s,surface:o},this.SURFACEORPOLYGONMEMBER_SERIALIZERS,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,a,i,void 0,this)}writeSurfaceOrPolygonMember(t,e,i){const n=this.GEOMETRY_NODE_FACTORY_(e,i);n&&(t.appendChild(n),this.writeSurfaceOrPolygon(n,e,i))}writeEnvelope(t,e,i){const n=i[i.length-1].srsName;n&&t.setAttribute("srsName",n);const r=[e[0]+" "+e[1],e[2]+" "+e[3]];Fu({node:t},this.ENVELOPE_SERIALIZERS,bu,r,i,["lowerCorner","upperCorner"],this)}MULTIGEOMETRY_MEMBER_NODE_FACTORY_(t,e,i){const n=e[e.length-1].node;return du("http://www.opengis.net/gml",q_[n.nodeName])}}H_.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml":{coordinates:vu(H_.prototype.readFlatCoordinates)}},H_.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml":{innerBoundaryIs:H_.prototype.innerBoundaryIsParser,outerBoundaryIs:H_.prototype.outerBoundaryIsParser}},H_.prototype.BOX_PARSERS_={"http://www.opengis.net/gml":{coordinates:xu(H_.prototype.readFlatCoordinates)}},H_.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml":{Point:vu(O_.prototype.readPoint),MultiPoint:vu(O_.prototype.readMultiPoint),LineString:vu(O_.prototype.readLineString),MultiLineString:vu(O_.prototype.readMultiLineString),LinearRing:vu(O_.prototype.readLinearRing),Polygon:vu(O_.prototype.readPolygon),MultiPolygon:vu(O_.prototype.readMultiPolygon),Box:vu(H_.prototype.readBox)}},H_.prototype.GEOMETRY_SERIALIZERS={"http://www.opengis.net/gml":{Curve:Eu(H_.prototype.writeCurveOrLineString),MultiCurve:Eu(H_.prototype.writeMultiCurveOrLineString),Point:Eu(H_.prototype.writePoint),MultiPoint:Eu(H_.prototype.writeMultiPoint),LineString:Eu(H_.prototype.writeCurveOrLineString),MultiLineString:Eu(H_.prototype.writeMultiCurveOrLineString),LinearRing:Eu(H_.prototype.writeLinearRing),Polygon:Eu(H_.prototype.writeSurfaceOrPolygon),MultiPolygon:Eu(H_.prototype.writeMultiSurfaceOrPolygon),Surface:Eu(H_.prototype.writeSurfaceOrPolygon),MultiSurface:Eu(H_.prototype.writeMultiSurfaceOrPolygon),Envelope:Eu(H_.prototype.writeEnvelope)}},H_.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{lineStringMember:Eu(H_.prototype.writeLineStringOrCurveMember),curveMember:Eu(H_.prototype.writeLineStringOrCurveMember)}},H_.prototype.RING_SERIALIZERS={"http://www.opengis.net/gml":{outerBoundaryIs:Eu(H_.prototype.writeRing),innerBoundaryIs:Eu(H_.prototype.writeRing)}},H_.prototype.POINTMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{pointMember:Eu(H_.prototype.writePointMember)}},H_.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{surfaceMember:Eu(H_.prototype.writeSurfaceOrPolygonMember),polygonMember:Eu(H_.prototype.writeSurfaceOrPolygonMember)}},H_.prototype.ENVELOPE_SERIALIZERS={"http://www.opengis.net/gml":{lowerCorner:Eu(K_),upperCorner:Eu(K_)}};const $_={MultiLineString:"lineStringMember",MultiCurve:"curveMember",MultiPolygon:"polygonMember",MultiSurface:"surfaceMember"};class J_ extends O_{constructor(t){super(t=t||{}),this.surface_=void 0!==t.surface&&t.surface,this.curve_=void 0!==t.curve&&t.curve,this.multiCurve_=void 0===t.multiCurve||t.multiCurve,this.multiSurface_=void 0===t.multiSurface||t.multiSurface,this.schemaLocation=t.schemaLocation?t.schemaLocation:"http://www.opengis.net/gml http://schemas.opengis.net/gml/3.1.1/profiles/gmlsfProfile/1.0.0/gmlsf.xsd",this.hasZ=void 0!==t.hasZ&&t.hasZ}readMultiCurve(t,e){const i=Lu([],this.MULTICURVE_PARSERS,t,e,this);if(i){return new Np(i)}}readFlatCurveRing(t,e){const i=Lu([],this.MULTICURVE_PARSERS,t,e,this),n=[];for(let t=0,e=i.length;t<e;++t)c(n,i[t].getFlatCoordinates());return n}readMultiSurface(t,e){const i=Lu([],this.MULTISURFACE_PARSERS,t,e,this);if(i)return new Gp(i)}curveMemberParser(t,e){Iu(this.CURVEMEMBER_PARSERS,t,e,this)}surfaceMemberParser(t,e){Iu(this.SURFACEMEMBER_PARSERS,t,e,this)}readPatch(t,e){return Lu([null],this.PATCHES_PARSERS,t,e,this)}readSegment(t,e){return Lu([],this.SEGMENTS_PARSERS,t,e,this)}readPolygonPatch(t,e){return Lu([null],this.FLAT_LINEAR_RINGS_PARSERS,t,e,this)}readLineStringSegment(t,e){return Lu([null],this.GEOMETRY_FLAT_COORDINATES_PARSERS,t,e,this)}interiorParser(t,e){const i=Lu(void 0,this.RING_PARSERS,t,e,this);if(i){e[e.length-1].push(i)}}exteriorParser(t,e){const i=Lu(void 0,this.RING_PARSERS,t,e,this);if(i){e[e.length-1][0]=i}}readSurface(t,e){const i=Lu([null],this.SURFACE_PARSERS,t,e,this);if(i&&i[0]){const t=i[0],e=[t.length];let n,r;for(n=1,r=i.length;n<r;++n)c(t,i[n]),e.push(t.length);return new ur(t,"XYZ",e)}}readCurve(t,e){const i=Lu([null],this.CURVE_PARSERS,t,e,this);if(i){return new Op(i,"XYZ")}}readEnvelope(t,e){const i=Lu([null],this.ENVELOPE_PARSERS,t,e,this);return $t(i[1][0],i[1][1],i[2][0],i[2][1])}readFlatPos(t,e){let i=gu(t,!1);const n=/^\s*([+\-]?\d*\.?\d+(?:[eE][+\-]?\d+)?)\s*/,r=[];let s;for(;s=n.exec(i);)r.push(parseFloat(s[1])),i=i.substr(s[0].length);if(""!==i)return;const o=e[0].srsName;let a="enu";if(o){a=Ui(o).getAxisOrientation()}if("neu"===a){let t,e;for(t=0,e=r.length;t<e;t+=3){const e=r[t],i=r[t+1];r[t]=i,r[t+1]=e}}const l=r.length;return 2==l&&r.push(0),0!==l?r:void 0}readFlatPosList(t,e){const i=gu(t,!1).replace(/^\s*|\s*$/g,""),n=e[0],r=n.srsName,s=n.srsDimension;let o="enu";if(r){o=Ui(r).getAxisOrientation()}const a=i.split(/\s+/);let l,h,c,u=2;t.getAttribute("srsDimension")?u=U_(t.getAttribute("srsDimension")):t.getAttribute("dimension")?u=U_(t.getAttribute("dimension")):t.parentNode.getAttribute("srsDimension")?u=U_(t.parentNode.getAttribute("srsDimension")):s&&(u=U_(s));const d=[];for(let t=0,e=a.length;t<e;t+=u)l=parseFloat(a[t]),h=parseFloat(a[t+1]),c=3===u?parseFloat(a[t+2]):0,"en"===o.substr(0,2)?d.push(l,h,c):d.push(h,l,c);return d}writePos_(t,e,i){const n=i[i.length-1],r=n.hasZ,s=r?"3":"2";t.setAttribute("srsDimension",s);const o=n.srsName;let a="enu";o&&(a=Ui(o).getAxisOrientation());const l=e.getCoordinates();let h;if(h="en"===a.substr(0,2)?l[0]+" "+l[1]:l[1]+" "+l[0],r){h+=" "+(l[2]||0)}K_(t,h)}getCoords_(t,e,i){let n="enu";e&&(n=Ui(e).getAxisOrientation());let r="en"===n.substr(0,2)?t[0]+" "+t[1]:t[1]+" "+t[0];if(i){r+=" "+(t[2]||0)}return r}writePosList_(t,e,i){const n=i[i.length-1],r=n.hasZ,s=r?"3":"2";t.setAttribute("srsDimension",s);const o=n.srsName,a=e.getCoordinates(),l=a.length,h=new Array(l);let c;for(let t=0;t<l;++t)c=a[t],h[t]=this.getCoords_(c,o,r);K_(t,h.join(" "))}writePoint(t,e,i){const n=i[i.length-1].srsName;n&&t.setAttribute("srsName",n);const r=du(t.namespaceURI,"pos");t.appendChild(r),this.writePos_(r,e,i)}writeEnvelope(t,e,i){const n=i[i.length-1].srsName;n&&t.setAttribute("srsName",n);const r=[e[0]+" "+e[1],e[2]+" "+e[3]];Fu({node:t},this.ENVELOPE_SERIALIZERS,bu,r,i,["lowerCorner","upperCorner"],this)}writeLinearRing(t,e,i){const n=i[i.length-1].srsName;n&&t.setAttribute("srsName",n);const r=du(t.namespaceURI,"posList");t.appendChild(r),this.writePosList_(r,e,i)}RING_NODE_FACTORY_(t,e,i){const n=e[e.length-1],r=n.node,s=n.exteriorWritten;return void 0===s&&(n.exteriorWritten=!0),du(r.namespaceURI,void 0!==s?"interior":"exterior")}writeSurfaceOrPolygon(t,e,i){const n=i[i.length-1],r=n.hasZ,s=n.srsName;if("PolygonPatch"!==t.nodeName&&s&&t.setAttribute("srsName",s),"Polygon"===t.nodeName||"PolygonPatch"===t.nodeName){const n=e.getLinearRings();Fu({node:t,hasZ:r,srsName:s},this.RING_SERIALIZERS,this.RING_NODE_FACTORY_,n,i,void 0,this)}else if("Surface"===t.nodeName){const n=du(t.namespaceURI,"patches");t.appendChild(n),this.writeSurfacePatches_(n,e,i)}}writeCurveOrLineString(t,e,i){const n=i[i.length-1].srsName;if("LineStringSegment"!==t.nodeName&&n&&t.setAttribute("srsName",n),"LineString"===t.nodeName||"LineStringSegment"===t.nodeName){const n=du(t.namespaceURI,"posList");t.appendChild(n),this.writePosList_(n,e,i)}else if("Curve"===t.nodeName){const n=du(t.namespaceURI,"segments");t.appendChild(n),this.writeCurveSegments_(n,e,i)}}writeMultiSurfaceOrPolygon(t,e,i){const n=i[i.length-1],r=n.hasZ,s=n.srsName,o=n.surface;s&&t.setAttribute("srsName",s);const a=e.getPolygons();Fu({node:t,hasZ:r,srsName:s,surface:o},this.SURFACEORPOLYGONMEMBER_SERIALIZERS,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,a,i,void 0,this)}writeMultiPoint(t,e,i){const n=i[i.length-1],r=n.srsName,s=n.hasZ;r&&t.setAttribute("srsName",r);const o=e.getPoints();Fu({node:t,hasZ:s,srsName:r},this.POINTMEMBER_SERIALIZERS,Cu("pointMember"),o,i,void 0,this)}writeMultiCurveOrLineString(t,e,i){const n=i[i.length-1],r=n.hasZ,s=n.srsName,o=n.curve;s&&t.setAttribute("srsName",s);const a=e.getLineStrings();Fu({node:t,hasZ:r,srsName:s,curve:o},this.LINESTRINGORCURVEMEMBER_SERIALIZERS,this.MULTIGEOMETRY_MEMBER_NODE_FACTORY_,a,i,void 0,this)}writeRing(t,e,i){const n=du(t.namespaceURI,"LinearRing");t.appendChild(n),this.writeLinearRing(n,e,i)}writeSurfaceOrPolygonMember(t,e,i){const n=this.GEOMETRY_NODE_FACTORY_(e,i);n&&(t.appendChild(n),this.writeSurfaceOrPolygon(n,e,i))}writePointMember(t,e,i){const n=du(t.namespaceURI,"Point");t.appendChild(n),this.writePoint(n,e,i)}writeLineStringOrCurveMember(t,e,i){const n=this.GEOMETRY_NODE_FACTORY_(e,i);n&&(t.appendChild(n),this.writeCurveOrLineString(n,e,i))}writeSurfacePatches_(t,e,i){const n=du(t.namespaceURI,"PolygonPatch");t.appendChild(n),this.writeSurfaceOrPolygon(n,e,i)}writeCurveSegments_(t,e,i){const n=du(t.namespaceURI,"LineStringSegment");t.appendChild(n),this.writeCurveOrLineString(n,e,i)}writeGeometryElement(t,e,i){const n=i[i.length-1],r=Object.assign({},n);let s;r.node=t,s=Array.isArray(e)?tm(e,n):Qp(e,!0,n),Fu(r,this.GEOMETRY_SERIALIZERS,this.GEOMETRY_NODE_FACTORY_,[s],i,void 0,this)}writeFeatureElement(t,e,i){const n=e.getId();n&&t.setAttribute("fid",n);const r=i[i.length-1],s=r.featureNS,o=e.getGeometryName();r.serializers||(r.serializers={},r.serializers[s]={});const a=[],l=[];if(e.hasProperties()){const t=e.getProperties();for(const e in t){const i=t[e];null!==i&&(a.push(e),l.push(i),e==o||"function"==typeof i.getSimplifiedGeometry?e in r.serializers[s]||(r.serializers[s][e]=Eu(this.writeGeometryElement,this)):e in r.serializers[s]||(r.serializers[s][e]=Eu(K_)))}}const h=Object.assign({},r);h.node=t,Fu(h,r.serializers,Cu(void 0,s),l,i,a)}writeFeatureMembers_(t,e,i){const n=i[i.length-1],r=n.featureType,s=n.featureNS,o={};o[s]={},o[s][r]=Eu(this.writeFeatureElement,this);const a=Object.assign({},n);a.node=t,Fu(a,o,Cu(r,s),e,i)}MULTIGEOMETRY_MEMBER_NODE_FACTORY_(t,e,i){const n=e[e.length-1].node;return du(this.namespace,$_[n.nodeName])}GEOMETRY_NODE_FACTORY_(t,e,i){const n=e[e.length-1],r=n.multiSurface,s=n.surface,o=n.curve,a=n.multiCurve;return Array.isArray(t)?i="Envelope":"MultiPolygon"===(i=t.getType())&&!0===r?i="MultiSurface":"Polygon"===i&&!0===s?i="Surface":"LineString"===i&&!0===o?i="Curve":"MultiLineString"===i&&!0===a&&(i="MultiCurve"),du(this.namespace,i)}writeGeometryNode(t,e){e=this.adaptOptions(e);const i=du(this.namespace,"geom"),n={node:i,hasZ:this.hasZ,srsName:this.srsName,curve:this.curve_,surface:this.surface_,multiSurface:this.multiSurface_,multiCurve:this.multiCurve_};return e&&Object.assign(n,e),this.writeGeometryElement(i,t,[n]),i}writeFeaturesNode(t,e){e=this.adaptOptions(e);const i=du(this.namespace,"featureMembers");i.setAttributeNS(uu,"xsi:schemaLocation",this.schemaLocation);const n={srsName:this.srsName,hasZ:this.hasZ,curve:this.curve_,surface:this.surface_,multiSurface:this.multiSurface_,multiCurve:this.multiCurve_,featureNS:this.featureNS,featureType:this.featureType};return e&&Object.assign(n,e),this.writeFeatureMembers_(i,t,[n]),i}}J_.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml":{pos:vu(J_.prototype.readFlatPos),posList:vu(J_.prototype.readFlatPosList),coordinates:vu(H_.prototype.readFlatCoordinates)}},J_.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml":{interior:J_.prototype.interiorParser,exterior:J_.prototype.exteriorParser}},J_.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml":{Point:vu(O_.prototype.readPoint),MultiPoint:vu(O_.prototype.readMultiPoint),LineString:vu(O_.prototype.readLineString),MultiLineString:vu(O_.prototype.readMultiLineString),LinearRing:vu(O_.prototype.readLinearRing),Polygon:vu(O_.prototype.readPolygon),MultiPolygon:vu(O_.prototype.readMultiPolygon),Surface:vu(J_.prototype.readSurface),MultiSurface:vu(J_.prototype.readMultiSurface),Curve:vu(J_.prototype.readCurve),MultiCurve:vu(J_.prototype.readMultiCurve),Envelope:vu(J_.prototype.readEnvelope)}},J_.prototype.MULTICURVE_PARSERS={"http://www.opengis.net/gml":{curveMember:xu(J_.prototype.curveMemberParser),curveMembers:xu(J_.prototype.curveMemberParser)}},J_.prototype.MULTISURFACE_PARSERS={"http://www.opengis.net/gml":{surfaceMember:xu(J_.prototype.surfaceMemberParser),surfaceMembers:xu(J_.prototype.surfaceMemberParser)}},J_.prototype.CURVEMEMBER_PARSERS={"http://www.opengis.net/gml":{LineString:xu(O_.prototype.readLineString),Curve:xu(J_.prototype.readCurve)}},J_.prototype.SURFACEMEMBER_PARSERS={"http://www.opengis.net/gml":{Polygon:xu(O_.prototype.readPolygon),Surface:xu(J_.prototype.readSurface)}},J_.prototype.SURFACE_PARSERS={"http://www.opengis.net/gml":{patches:vu(J_.prototype.readPatch)}},J_.prototype.CURVE_PARSERS={"http://www.opengis.net/gml":{segments:vu(J_.prototype.readSegment)}},J_.prototype.ENVELOPE_PARSERS={"http://www.opengis.net/gml":{lowerCorner:xu(J_.prototype.readFlatPosList),upperCorner:xu(J_.prototype.readFlatPosList)}},J_.prototype.PATCHES_PARSERS={"http://www.opengis.net/gml":{PolygonPatch:vu(J_.prototype.readPolygonPatch)}},J_.prototype.SEGMENTS_PARSERS={"http://www.opengis.net/gml":{LineStringSegment:yu(J_.prototype.readLineStringSegment)}},O_.prototype.RING_PARSERS={"http://www.opengis.net/gml":{LinearRing:vu(O_.prototype.readFlatLinearRing),Ring:vu(J_.prototype.readFlatCurveRing)}},J_.prototype.writeFeatures,J_.prototype.RING_SERIALIZERS={"http://www.opengis.net/gml":{exterior:Eu(J_.prototype.writeRing),interior:Eu(J_.prototype.writeRing)}},J_.prototype.ENVELOPE_SERIALIZERS={"http://www.opengis.net/gml":{lowerCorner:Eu(K_),upperCorner:Eu(K_)}},J_.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{surfaceMember:Eu(J_.prototype.writeSurfaceOrPolygonMember),polygonMember:Eu(J_.prototype.writeSurfaceOrPolygonMember)}},J_.prototype.POINTMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{pointMember:Eu(J_.prototype.writePointMember)}},J_.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{lineStringMember:Eu(J_.prototype.writeLineStringOrCurveMember),curveMember:Eu(J_.prototype.writeLineStringOrCurveMember)}},J_.prototype.GEOMETRY_SERIALIZERS={"http://www.opengis.net/gml":{Curve:Eu(J_.prototype.writeCurveOrLineString),MultiCurve:Eu(J_.prototype.writeMultiCurveOrLineString),Point:Eu(J_.prototype.writePoint),MultiPoint:Eu(J_.prototype.writeMultiPoint),LineString:Eu(J_.prototype.writeCurveOrLineString),MultiLineString:Eu(J_.prototype.writeMultiCurveOrLineString),LinearRing:Eu(J_.prototype.writeLinearRing),Polygon:Eu(J_.prototype.writeSurfaceOrPolygon),MultiPolygon:Eu(J_.prototype.writeMultiSurfaceOrPolygon),Surface:Eu(J_.prototype.writeSurfaceOrPolygon),MultiSurface:Eu(J_.prototype.writeMultiSurfaceOrPolygon),Envelope:Eu(J_.prototype.writeEnvelope)}};const Q_=J_;Q_.prototype.writeFeatures,Q_.prototype.writeFeaturesNode;class ty extends J_{constructor(t){super(t=t||{}),this.schemaLocation=t.schemaLocation?t.schemaLocation:this.namespace+" http://schemas.opengis.net/gml/3.2.1/gml.xsd"}}ty.prototype.namespace="http://www.opengis.net/gml/3.2",ty.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml/3.2":{pos:vu(J_.prototype.readFlatPos),posList:vu(J_.prototype.readFlatPosList),coordinates:vu(H_.prototype.readFlatCoordinates)}},ty.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml/3.2":{interior:J_.prototype.interiorParser,exterior:J_.prototype.exteriorParser}},ty.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml/3.2":{Point:vu(O_.prototype.readPoint),MultiPoint:vu(O_.prototype.readMultiPoint),LineString:vu(O_.prototype.readLineString),MultiLineString:vu(O_.prototype.readMultiLineString),LinearRing:vu(O_.prototype.readLinearRing),Polygon:vu(O_.prototype.readPolygon),MultiPolygon:vu(O_.prototype.readMultiPolygon),Surface:vu(ty.prototype.readSurface),MultiSurface:vu(J_.prototype.readMultiSurface),Curve:vu(ty.prototype.readCurve),MultiCurve:vu(J_.prototype.readMultiCurve),Envelope:vu(ty.prototype.readEnvelope)}},ty.prototype.MULTICURVE_PARSERS={"http://www.opengis.net/gml/3.2":{curveMember:xu(J_.prototype.curveMemberParser),curveMembers:xu(J_.prototype.curveMemberParser)}},ty.prototype.MULTISURFACE_PARSERS={"http://www.opengis.net/gml/3.2":{surfaceMember:xu(J_.prototype.surfaceMemberParser),surfaceMembers:xu(J_.prototype.surfaceMemberParser)}},ty.prototype.CURVEMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{LineString:xu(O_.prototype.readLineString),Curve:xu(J_.prototype.readCurve)}},ty.prototype.SURFACEMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{Polygon:xu(O_.prototype.readPolygon),Surface:xu(J_.prototype.readSurface)}},ty.prototype.SURFACE_PARSERS={"http://www.opengis.net/gml/3.2":{patches:vu(J_.prototype.readPatch)}},ty.prototype.CURVE_PARSERS={"http://www.opengis.net/gml/3.2":{segments:vu(J_.prototype.readSegment)}},ty.prototype.ENVELOPE_PARSERS={"http://www.opengis.net/gml/3.2":{lowerCorner:xu(J_.prototype.readFlatPosList),upperCorner:xu(J_.prototype.readFlatPosList)}},ty.prototype.PATCHES_PARSERS={"http://www.opengis.net/gml/3.2":{PolygonPatch:vu(J_.prototype.readPolygonPatch)}},ty.prototype.SEGMENTS_PARSERS={"http://www.opengis.net/gml/3.2":{LineStringSegment:yu(J_.prototype.readLineStringSegment)}},ty.prototype.MULTIPOINT_PARSERS={"http://www.opengis.net/gml/3.2":{pointMember:xu(O_.prototype.pointMemberParser),pointMembers:xu(O_.prototype.pointMemberParser)}},ty.prototype.MULTILINESTRING_PARSERS={"http://www.opengis.net/gml/3.2":{lineStringMember:xu(O_.prototype.lineStringMemberParser),lineStringMembers:xu(O_.prototype.lineStringMemberParser)}},ty.prototype.MULTIPOLYGON_PARSERS={"http://www.opengis.net/gml/3.2":{polygonMember:xu(O_.prototype.polygonMemberParser),polygonMembers:xu(O_.prototype.polygonMemberParser)}},ty.prototype.POINTMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{Point:xu(O_.prototype.readFlatCoordinatesFromNode)}},ty.prototype.LINESTRINGMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{LineString:xu(O_.prototype.readLineString)}},ty.prototype.POLYGONMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{Polygon:xu(O_.prototype.readPolygon)}},ty.prototype.RING_PARSERS={"http://www.opengis.net/gml/3.2":{LinearRing:vu(O_.prototype.readFlatLinearRing),Ring:vu(ty.prototype.readFlatCurveRing)}},ty.prototype.RING_SERIALIZERS={"http://www.opengis.net/gml/3.2":{exterior:Eu(J_.prototype.writeRing),interior:Eu(J_.prototype.writeRing)}},ty.prototype.ENVELOPE_SERIALIZERS={"http://www.opengis.net/gml/3.2":{lowerCorner:Eu(K_),upperCorner:Eu(K_)}},ty.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS={"http://www.opengis.net/gml/3.2":{surfaceMember:Eu(J_.prototype.writeSurfaceOrPolygonMember),polygonMember:Eu(J_.prototype.writeSurfaceOrPolygonMember)}},ty.prototype.POINTMEMBER_SERIALIZERS={"http://www.opengis.net/gml/3.2":{pointMember:Eu(J_.prototype.writePointMember)}},ty.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS={"http://www.opengis.net/gml/3.2":{lineStringMember:Eu(J_.prototype.writeLineStringOrCurveMember),curveMember:Eu(J_.prototype.writeLineStringOrCurveMember)}},ty.prototype.GEOMETRY_SERIALIZERS={"http://www.opengis.net/gml/3.2":{Curve:Eu(J_.prototype.writeCurveOrLineString),MultiCurve:Eu(J_.prototype.writeMultiCurveOrLineString),Point:Eu(ty.prototype.writePoint),MultiPoint:Eu(J_.prototype.writeMultiPoint),LineString:Eu(J_.prototype.writeCurveOrLineString),MultiLineString:Eu(J_.prototype.writeMultiCurveOrLineString),LinearRing:Eu(J_.prototype.writeLinearRing),Polygon:Eu(J_.prototype.writeSurfaceOrPolygon),MultiPolygon:Eu(J_.prototype.writeMultiSurfaceOrPolygon),Surface:Eu(J_.prototype.writeSurfaceOrPolygon),MultiSurface:Eu(J_.prototype.writeMultiSurfaceOrPolygon),Envelope:Eu(J_.prototype.writeEnvelope)}};const ey=[null,"http://www.topografix.com/GPX/1/0","http://www.topografix.com/GPX/1/1"],iy={rte:Iy,trk:Ly,wpt:My},ny=Pu(ey,{rte:xu(Iy),trk:xu(Ly),wpt:xu(My)}),ry=Pu(ey,{text:wu(z_,"linkText"),type:wu(z_,"linkType")}),sy=Pu(ey,{rte:Eu((function(t,e,i){const n=i[0],r=e.getProperties(),s={node:t};s.properties=r;const o=e.getGeometry();if("LineString"==o.getType()){const t=Qp(o,!0,n);s.geometryLayout=t.getLayout(),r.rtept=t.getCoordinates()}const a=i[i.length-1].node,l=fy[a.namespaceURI],h=Ru(r,l);Fu(s,py,bu,h,i,l)})),trk:Eu((function(t,e,i){const n=i[0],r=e.getProperties(),s={node:t};s.properties=r;const o=e.getGeometry();if("MultiLineString"==o.getType()){const t=Qp(o,!0,n);r.trkseg=t.getLineStrings()}const a=i[i.length-1].node,l=_y[a.namespaceURI],h=Ru(r,l);Fu(s,yy,bu,h,i,l)})),wpt:Eu((function(t,e,i){const n=i[0],r=i[i.length-1];r.properties=e.getProperties();const s=e.getGeometry();if("Point"==s.getType()){const e=Qp(s,!0,n);r.geometryLayout=e.getLayout(),Ay(t,e.getCoordinates(),i)}}))});const oy=Pu(ey,{name:wu(z_),cmt:wu(z_),desc:wu(z_),src:wu(z_),link:Ry,number:wu(B_),extensions:Py,type:wu(z_),rtept:function(t,e){const i=Lu({},ay,t,e);if(i){const n=e[e.length-1],r=n.flatCoordinates,s=n.layoutOptions;Cy(r,s,t,i)}}}),ay=Pu(ey,{ele:wu(G_),time:wu(k_)}),ly=Pu(ey,{name:wu(z_),cmt:wu(z_),desc:wu(z_),src:wu(z_),link:Ry,number:wu(B_),type:wu(z_),extensions:Py,trkseg:function(t,e){const i=e[e.length-1];Iu(hy,t,e);const n=i.flatCoordinates;i.ends.push(n.length)}}),hy=Pu(ey,{trkpt:function(t,e){const i=Lu({},cy,t,e);if(i){const n=e[e.length-1],r=n.flatCoordinates,s=n.layoutOptions;Cy(r,s,t,i)}}}),cy=Pu(ey,{ele:wu(G_),time:wu(k_)}),uy=Pu(ey,{ele:wu(G_),time:wu(k_),magvar:wu(G_),geoidheight:wu(G_),name:wu(z_),cmt:wu(z_),desc:wu(z_),src:wu(z_),link:Ry,sym:wu(z_),type:wu(z_),fix:wu(z_),sat:wu(B_),hdop:wu(G_),vdop:wu(G_),pdop:wu(G_),ageofdgpsdata:wu(G_),dgpsid:wu(B_),extensions:Py}),dy=["text","type"],gy=Pu(ey,{text:Eu(K_),type:Eu(K_)}),fy=Pu(ey,["name","cmt","desc","src","link","number","type","rtept"]),py=Pu(ey,{name:Eu(K_),cmt:Eu(K_),desc:Eu(K_),src:Eu(K_),link:Eu(Fy),number:Eu(Y_),type:Eu(K_),rtept:Tu(Eu(Ay))}),my=Pu(ey,["ele","time"]),_y=Pu(ey,["name","cmt","desc","src","link","number","type","trkseg"]),yy=Pu(ey,{name:Eu(K_),cmt:Eu(K_),desc:Eu(K_),src:Eu(K_),link:Eu(Fy),number:Eu(Y_),type:Eu(K_),trkseg:Tu(Eu((function(t,e,i){const n={node:t};n.geometryLayout=e.getLayout(),n.properties={},Fu(n,vy,xy,e.getCoordinates(),i)})))}),xy=Cu("trkpt"),vy=Pu(ey,{trkpt:Eu(Ay)}),Sy=Pu(ey,["ele","time","magvar","geoidheight","name","cmt","desc","src","link","sym","type","fix","sat","hdop","vdop","pdop","ageofdgpsdata","dgpsid"]),wy=Pu(ey,{ele:Eu(Z_),time:Eu(W_),magvar:Eu(Z_),geoidheight:Eu(Z_),name:Eu(K_),cmt:Eu(K_),desc:Eu(K_),src:Eu(K_),link:Eu(Fy),sym:Eu(K_),type:Eu(K_),fix:Eu(K_),sat:Eu(Y_),hdop:Eu(Z_),vdop:Eu(Z_),pdop:Eu(Z_),ageofdgpsdata:Eu(Z_),dgpsid:Eu(Y_)}),Ey={Point:"wpt",LineString:"rte",MultiLineString:"trk"};function Ty(t,e,i){const n=t.getGeometry();if(n){const t=Ey[n.getType()];if(t){return du(e[e.length-1].node.namespaceURI,t)}}}function Cy(t,e,i,n){return t.push(parseFloat(i.getAttribute("lon")),parseFloat(i.getAttribute("lat"))),"ele"in n?(t.push(n.ele),delete n.ele,e.hasZ=!0):t.push(0),"time"in n?(t.push(n.time),delete n.time,e.hasM=!0):t.push(0),t}function by(t,e,i){let n="XY",r=2;if(t.hasZ&&t.hasM?(n="XYZM",r=4):t.hasZ?(n="XYZ",r=3):t.hasM&&(n="XYM",r=3),4!==r){for(let i=0,n=e.length/4;i<n;i++)e[i*r]=e[4*i],e[i*r+1]=e[4*i+1],t.hasZ&&(e[i*r+2]=e[4*i+2]),t.hasM&&(e[i*r+2]=e[4*i+3]);if(e.length=e.length/4*r,i)for(let t=0,e=i.length;t<e;t++)i[t]=i[t]/4*r}return n}function Ry(t,e){const i=e[e.length-1],n=t.getAttribute("href");null!==n&&(i.link=n),Iu(ry,t,e)}function Py(t,e){e[e.length-1].extensionsNode_=t}function Iy(t,e){const i=e[0],n=Lu({flatCoordinates:[],layoutOptions:{}},oy,t,e);if(!n)return;const r=n.flatCoordinates;delete n.flatCoordinates;const s=n.layoutOptions;delete n.layoutOptions;const o=by(s,r),a=new Op(r,o);Qp(a,!1,i);const l=new lt(a);return l.setProperties(n,!0),l}function Ly(t,e){const i=e[0],n=Lu({flatCoordinates:[],ends:[],layoutOptions:{}},ly,t,e);if(!n)return;const r=n.flatCoordinates;delete n.flatCoordinates;const s=n.ends;delete n.ends;const o=n.layoutOptions;delete n.layoutOptions;const a=by(o,r,s),l=new Np(r,a,s);Qp(l,!1,i);const h=new lt(l);return h.setProperties(n,!0),h}function My(t,e){const i=e[0],n=Lu({},uy,t,e);if(!n)return;const r={},s=Cy([],r,t,n),o=by(r,s),a=new Wn(s,o);Qp(a,!1,i);const l=new lt(a);return l.setProperties(n,!0),l}function Fy(t,e,i){t.setAttribute("href",e);const n=i[i.length-1].properties,r=[n.linkText,n.linkType];Fu({node:t},gy,bu,r,i,dy)}function Ay(t,e,i){const n=i[i.length-1],r=n.node.namespaceURI,s=n.properties;t.setAttributeNS(null,"lat",String(e[1])),t.setAttributeNS(null,"lon",String(e[0]));switch(n.geometryLayout){case"XYZM":0!==e[3]&&(s.time=e[3]);case"XYZ":0!==e[2]&&(s.ele=e[2]);break;case"XYM":0!==e[2]&&(s.time=e[2])}const o="rtept"==t.nodeName?my[r]:Sy[r],a=Ru(s,o);Fu({node:t,properties:s},wy,bu,a,i,o)}function Oy(t,e){if(!t)return null;let i;switch(t.type){case"Point":i=function(t){return new Wn(t.coordinates)}(t);break;case"LineString":i=function(t){return new Op(t.coordinates)}(t);break;case"Polygon":i=function(t){return new ur(t.coordinates)}(t);break;case"MultiPoint":i=function(t){return new Dp(t.coordinates)}(t);break;case"MultiLineString":i=function(t){return new Np(t.coordinates)}(t);break;case"MultiPolygon":i=function(t){return new Gp(t.coordinates)}(t);break;case"GeometryCollection":i=function(t,e){const i=t.geometries.map((function(t){return Oy(t,e)}));return new Ip(i)}(t);break;default:throw new Error("Unsupported GeoJSON type: "+t.type)}return Qp(i,!1,e)}function Ny(t,e){const i=(t=Qp(t,!0,e)).getType();let n;switch(i){case"Point":n=function(t,e){return{type:"Point",coordinates:t.getCoordinates()}}(t);break;case"LineString":n=function(t,e){return{type:"LineString",coordinates:t.getCoordinates()}}(t);break;case"Polygon":n=function(t,e){let i;e&&(i=e.rightHanded);return{type:"Polygon",coordinates:t.getCoordinates(i)}}(t,e);break;case"MultiPoint":n=function(t,e){return{type:"MultiPoint",coordinates:t.getCoordinates()}}(t);break;case"MultiLineString":n=function(t,e){return{type:"MultiLineString",coordinates:t.getCoordinates()}}(t);break;case"MultiPolygon":n=function(t,e){let i;e&&(i=e.rightHanded);return{type:"MultiPolygon",coordinates:t.getCoordinates(i)}}(t,e);break;case"GeometryCollection":n=function(t,e){delete(e=Object.assign({},e)).featureProjection;return{type:"GeometryCollection",geometries:t.getGeometriesArray().map((function(t){return Ny(t,e)}))}}(t,e);break;case"Circle":n={type:"GeometryCollection",geometries:[]};break;default:throw new Error("Unsupported geometry type: "+i)}return n}class Dy extends Jp{constructor(){super()}getType(){return"text"}readFeature(t,e){return this.readFeatureFromText(ky(t),this.adaptOptions(e))}readFeatureFromText(t,e){return B()}readFeatures(t,e){return this.readFeaturesFromText(ky(t),this.adaptOptions(e))}readFeaturesFromText(t,e){return B()}readGeometry(t,e){return this.readGeometryFromText(ky(t),this.adaptOptions(e))}readGeometryFromText(t,e){return B()}readProjection(t){return this.readProjectionFromText(ky(t))}readProjectionFromText(t){return this.dataProjection}writeFeature(t,e){return this.writeFeatureText(t,this.adaptOptions(e))}writeFeatureText(t,e){return B()}writeFeatures(t,e){return this.writeFeaturesText(t,this.adaptOptions(e))}writeFeaturesText(t,e){return B()}writeGeometry(t,e){return this.writeGeometryText(t,this.adaptOptions(e))}writeGeometryText(t,e){return B()}}function ky(t){return"string"==typeof t?t:""}const Gy=/^B(\d{2})(\d{2})(\d{2})(\d{2})(\d{5})([NS])(\d{3})(\d{5})([EW])([AV])(\d{5})(\d{5})/,jy=/^H.([A-Z]{3}).*?:(.*)/,By=/^HFDTE(\d{2})(\d{2})(\d{2})/,Uy=/\r\n|\r|\n/;const zy=["http://www.google.com/kml/ext/2.2"],Xy=[null,"http://earth.google.com/kml/2.0","http://earth.google.com/kml/2.1","http://earth.google.com/kml/2.2","http://www.opengis.net/kml/2.2"],Vy={fraction:"fraction",pixels:"pixels",insetPixels:"pixels"},Wy=Pu(Xy,{ExtendedData:Yx,Region:Kx,MultiGeometry:wu(Gx,"geometry"),LineString:wu(Nx,"geometry"),LinearRing:wu(Dx,"geometry"),Point:wu(jx,"geometry"),Polygon:wu(Ux,"geometry"),Style:wu(Xx),StyleMap:function(t,e){const i=Sx.call(this,t,e);if(!i)return;const n=e[e.length-1];Array.isArray(i)?n.Style=i:"string"==typeof i?n.styleUrl=i:at(!1,38)},address:wu(z_),description:wu(z_),name:wu(z_),open:wu(N_),phoneNumber:wu(z_),styleUrl:wu(yx),visibility:wu(N_)},Pu(zy,{MultiTrack:wu((function(t,e){const i=Lu([],Px,t,e);if(!i)return;return new Np(i)}),"geometry"),Track:wu(Lx,"geometry")})),Zy=Pu(Xy,{ExtendedData:Yx,Region:Kx,Link:function(t,e){Iu(Yy,t,e)},address:wu(z_),description:wu(z_),name:wu(z_),open:wu(N_),phoneNumber:wu(z_),visibility:wu(N_)}),Yy=Pu(Xy,{href:wu(_x)}),Ky=Pu(Xy,{LatLonAltBox:function(t,e){const i=Lu({},$x,t,e);if(!i)return;const n=e[e.length-1],r=[parseFloat(i.west),parseFloat(i.south),parseFloat(i.east),parseFloat(i.north)];n.extent=r,n.altitudeMode=i.altitudeMode,n.minAltitude=parseFloat(i.minAltitude),n.maxAltitude=parseFloat(i.maxAltitude)},Lod:function(t,e){const i=Lu({},Jx,t,e);if(!i)return;const n=e[e.length-1];n.minLodPixels=parseFloat(i.minLodPixels),n.maxLodPixels=parseFloat(i.maxLodPixels),n.minFadeExtent=parseFloat(i.minFadeExtent),n.maxFadeExtent=parseFloat(i.maxFadeExtent)}}),qy=Pu(Xy,["Document","Placemark"]),Hy=Pu(Xy,{Document:Eu((function(t,e,i){Fu({node:t},nv,rv,e,i,void 0,this)})),Placemark:Eu(Pv)});let $y,Jy,Qy,tx,ex,ix,nx=null;let rx,sx=null;let ox,ax=null;let lx=null;let hx=null;let cx,ux=null;function dx(t){return 32/Math.min(t[0],t[1])}function gx(t){return t}function fx(t,e,i){return Array.isArray(t)?t:"string"==typeof t?fx(i[t],e,i):e}function px(t){const e=gu(t,!1),i=/^\s*#?\s*([0-9A-Fa-f]{8})\s*$/.exec(e);if(i){const t=i[1];return[parseInt(t.substr(6,2),16),parseInt(t.substr(4,2),16),parseInt(t.substr(2,2),16),parseInt(t.substr(0,2),16)/255]}}function mx(t){let e=gu(t,!1);const i=[];e=e.replace(/\s*,\s*/g,",");const n=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?),([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s+|,|$)(?:([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s+|$))?\s*/i;let r;for(;r=n.exec(e);){const t=parseFloat(r[1]),n=parseFloat(r[2]),s=r[3]?parseFloat(r[3]):0;i.push(t,n,s),e=e.substr(r[0].length)}if(""===e)return i}function _x(t){const e=gu(t,!1).trim();let i=t.baseURI;if(i&&"about:blank"!=i||(i=window.location.href),i){return new URL(e,i).href}return e}function yx(t){const e=gu(t,!1).trim().replace(/^(?!.*#)/,"#");let i=t.baseURI;if(i&&"about:blank"!=i||(i=window.location.href),i){return new URL(e,i).href}return e}function xx(t){return G_(t)}const vx=Pu(Xy,{Pair:function(t,e){const i=Lu({},qx,t,e,this);if(!i)return;const n=i.key;if(n&&"normal"==n){const t=i.styleUrl;t&&(e[e.length-1]=t);const n=i.Style;n&&(e[e.length-1]=n)}}});function Sx(t,e){return Lu(void 0,vx,t,e,this)}const wx=Pu(Xy,{Icon:wu((function(t,e){const i=Lu({},Mx,t,e);return i||null})),color:wu(px),heading:wu(G_),hotSpot:wu((function(t){const e=t.getAttribute("xunits"),i=t.getAttribute("yunits");let n;return n="insetPixels"!==e?"insetPixels"!==i?"bottom-left":"top-left":"insetPixels"!==i?"bottom-right":"top-right",{x:parseFloat(t.getAttribute("x")),xunits:Vy[e],y:parseFloat(t.getAttribute("y")),yunits:Vy[i],origin:n}})),scale:wu(xx)});const Ex=Pu(Xy,{color:wu(px),scale:wu(xx)});const Tx=Pu(Xy,{color:wu(px),width:wu(G_)});const Cx=Pu(Xy,{color:wu(px),fill:wu(N_),outline:wu(N_)});const bx=Pu(Xy,{coordinates:vu(mx)});function Rx(t,e){return Lu(null,bx,t,e)}const Px=Pu(zy,{Track:xu(Lx)});const Ix=Pu(Xy,{when:function(t,e){const i=e[e.length-1].whens,n=gu(t,!1),r=Date.parse(n);i.push(isNaN(r)?0:r)}},Pu(zy,{coord:function(t,e){const i=e[e.length-1].coordinates,n=gu(t,!1),r=/^\s*([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s*$/i.exec(n);if(r){const t=parseFloat(r[1]),e=parseFloat(r[2]),n=parseFloat(r[3]);i.push([t,e,n])}else i.push([])}}));function Lx(t,e){const i=Lu({coordinates:[],whens:[]},Ix,t,e);if(!i)return;const n=[],r=i.coordinates,s=i.whens;for(let t=0,e=Math.min(r.length,s.length);t<e;++t)3==r[t].length&&n.push(r[t][0],r[t][1],r[t][2],s[t]);return new Op(n,"XYZM")}const Mx=Pu(Xy,{href:wu(_x)},Pu(zy,{x:wu(G_),y:wu(G_),w:wu(G_),h:wu(G_)}));const Fx=Pu(Xy,{coordinates:vu(mx)});function Ax(t,e){return Lu(null,Fx,t,e)}const Ox=Pu(Xy,{extrude:wu(N_),tessellate:wu(N_),altitudeMode:wu(z_)});function Nx(t,e){const i=Lu({},Ox,t,e),n=Ax(t,e);if(n){const t=new Op(n,"XYZ");return t.setProperties(i,!0),t}}function Dx(t,e){const i=Lu({},Ox,t,e),n=Ax(t,e);if(n){const t=new ur(n,"XYZ",[n.length]);return t.setProperties(i,!0),t}}const kx=Pu(Xy,{LineString:xu(Nx),LinearRing:xu(Dx),MultiGeometry:xu(Gx),Point:xu(jx),Polygon:xu(Ux)});function Gx(t,e){const i=Lu([],kx,t,e);if(!i)return null;if(0===i.length)return new Ip(i);let n,r=!0;const s=i[0].getType();let o;for(let t=1,e=i.length;t<e;++t)if(o=i[t],o.getType()!=s){r=!1;break}if(r){let t,e;if("Point"==s){const r=i[0];t=r.getLayout(),e=r.getFlatCoordinates();for(let t=1,n=i.length;t<n;++t)o=i[t],c(e,o.getFlatCoordinates());n=new Dp(e,t),Vx(n,i)}else"LineString"==s?(n=new Np(i),Vx(n,i)):"Polygon"==s?(n=new Gp(i),Vx(n,i)):"GeometryCollection"==s?n=new Ip(i):at(!1,37)}else n=new Ip(i);return n}function jx(t,e){const i=Lu({},Ox,t,e),n=Ax(t,e);if(n){const t=new Wn(n,"XYZ");return t.setProperties(i,!0),t}}const Bx=Pu(Xy,{innerBoundaryIs:function(t,e){const i=Lu([],Qx,t,e);if(i.length>0){e[e.length-1].push(...i)}},outerBoundaryIs:function(t,e){const i=Lu(void 0,tv,t,e);if(i){e[e.length-1][0]=i}}});function Ux(t,e){const i=Lu({},Ox,t,e),n=Lu([null],Bx,t,e);if(n&&n[0]){const t=n[0],e=[t.length];for(let i=1,r=n.length;i<r;++i)c(t,n[i]),e.push(t.length);const r=new ur(t,"XYZ",e);return r.setProperties(i,!0),r}}const zx=Pu(Xy,{IconStyle:function(t,e){const i=Lu({},wx,t,e);if(!i)return;const n=e[e.length-1],r="Icon"in i?i.Icon:{},s=!("Icon"in i)||Object.keys(r).length>0;let o;const a=r.href;let l,h,c;a?o=a:s&&(o=ix);let u="bottom-left";const d=i.hotSpot;let g;d?(l=[d.x,d.y],h=d.xunits,c=d.yunits,u=d.origin):/^https?:\/\/maps\.(?:google|gstatic)\.com\//.test(o)&&(o.includes("pushpin")?(l=Jy,h=Qy,c=tx):o.includes("arrow-reverse")?(l=[54,42],h=Qy,c=tx):o.includes("paddle")&&(l=[32,1],h=Qy,c=tx));const f=r.x,p=r.y;let m;void 0!==f&&void 0!==p&&(g=[f,p]);const _=r.w,y=r.h;let x;void 0!==_&&void 0!==y&&(m=[_,y]);const v=i.heading;void 0!==v&&(x=ai(v));const S=i.scale,w=i.color;if(s){o==ix&&(m=ex);const t=new lg({anchor:l,anchorOrigin:u,anchorXUnits:h,anchorYUnits:c,crossOrigin:this.crossOrigin_,offset:g,offsetOrigin:"bottom-left",rotation:x,scale:S,size:m,src:this.iconUrlFunction_(o),color:w}),e=t.getScaleArray()[0],i=t.getSize();if(null===i){const i=t.getImageState();if(i===Pr||i===Ir){const n=function(){const i=t.getImageState();if(i!==Pr&&i!==Ir){const i=t.getSize();if(i&&2==i.length){const n=dx(i);t.setScale(e*n)}t.unlistenImageChange(n)}};t.listenImageChange(n),i===Pr&&t.load()}}else if(2==i.length){const n=dx(i);t.setScale(e*n)}n.imageStyle=t}else n.imageStyle=rx},LabelStyle:function(t,e){const i=Lu({},Ex,t,e);if(!i)return;const n=e[e.length-1],r=new mg({fill:new rg({color:"color"in i?i.color:$y}),scale:i.scale});n.textStyle=r},LineStyle:function(t,e){const i=Lu({},Tx,t,e);if(!i)return;const n=e[e.length-1],r=new hg({color:"color"in i?i.color:$y,width:"width"in i?i.width:1});n.strokeStyle=r},PolyStyle:function(t,e){const i=Lu({},Cx,t,e);if(!i)return;const n=e[e.length-1],r=new rg({color:"color"in i?i.color:$y});n.fillStyle=r;const s=i.fill;void 0!==s&&(n.fill=s);const o=i.outline;void 0!==o&&(n.outline=o)}});function Xx(t,e){const i=Lu({},zx,t,e,this);if(!i)return null;let n="fillStyle"in i?i.fillStyle:nx;const r=i.fill;let s;void 0===r||r||(n=null),"imageStyle"in i?i.imageStyle!=rx&&(s=i.imageStyle):s=sx;const o="textStyle"in i?i.textStyle:lx,a="strokeStyle"in i?i.strokeStyle:ax,l=i.outline;return void 0===l||l?[new cg({fill:n,image:s,stroke:a,text:o,zIndex:void 0})]:[new cg({geometry:function(t){const e=t.getGeometry(),i=e.getType();if("GeometryCollection"===i){return new Ip(e.getGeometriesArrayRecursive().filter((function(t){const e=t.getType();return"Polygon"!==e&&"MultiPolygon"!==e})))}if("Polygon"!==i&&"MultiPolygon"!==i)return e},fill:n,image:s,stroke:a,text:o,zIndex:void 0}),new cg({geometry:function(t){const e=t.getGeometry(),i=e.getType();if("GeometryCollection"===i){return new Ip(e.getGeometriesArrayRecursive().filter((function(t){const e=t.getType();return"Polygon"===e||"MultiPolygon"===e})))}if("Polygon"===i||"MultiPolygon"===i)return e},fill:n,stroke:null,zIndex:void 0})]}function Vx(t,e){const i=e.length,n=new Array(e.length),r=new Array(e.length),s=new Array(e.length);let o,a,l;o=!1,a=!1,l=!1;for(let t=0;t<i;++t){const i=e[t];n[t]=i.get("extrude"),r[t]=i.get("tessellate"),s[t]=i.get("altitudeMode"),o=o||void 0!==n[t],a=a||void 0!==r[t],l=l||s[t]}o&&t.set("extrude",n),a&&t.set("tessellate",r),l&&t.set("altitudeMode",s)}const Wx=Pu(Xy,{displayName:wu(z_),value:wu(z_)});const Zx=Pu(Xy,{Data:function(t,e){const i=t.getAttribute("name");Iu(Wx,t,e);const n=e[e.length-1];i&&n.displayName?n[i]={value:n.value,displayName:n.displayName,toString:function(){return n.value}}:null!==i?n[i]=n.value:null!==n.displayName&&(n[n.displayName]=n.value),delete n.value},SchemaData:function(t,e){Iu(Hx,t,e)}});function Yx(t,e){Iu(Zx,t,e)}function Kx(t,e){Iu(Ky,t,e)}const qx=Pu(Xy,{Style:wu(Xx),key:wu(z_),styleUrl:wu(yx)});const Hx=Pu(Xy,{SimpleData:function(t,e){const i=t.getAttribute("name");if(null!==i){const n=z_(t);e[e.length-1][i]=n}}});const $x=Pu(Xy,{altitudeMode:wu(z_),minAltitude:wu(G_),maxAltitude:wu(G_),north:wu(G_),south:wu(G_),east:wu(G_),west:wu(G_)});const Jx=Pu(Xy,{minLodPixels:wu(G_),maxLodPixels:wu(G_),minFadeExtent:wu(G_),maxFadeExtent:wu(G_)});const Qx=Pu(Xy,{LinearRing:xu(Rx)});const tv=Pu(Xy,{LinearRing:vu(Rx)});function ev(t,e){const i=$r(e),n=[255*(4==i.length?i[3]:1),i[2],i[1],i[0]];for(let t=0;t<4;++t){const e=Math.floor(n[t]).toString(16);n[t]=1==e.length?"0"+e:e}K_(t,n.join(""))}const iv=Pu(Xy,{Data:Eu((function(t,e,i){t.setAttribute("name",e.name);const n={node:t},r=e.value;"object"==typeof r?(null!==r&&r.displayName&&Fu(n,iv,bu,[r.displayName],i,["displayName"]),null!==r&&r.value&&Fu(n,iv,bu,[r.value],i,["value"])):Fu(n,iv,bu,[r],i,["value"])})),value:Eu((function(t,e){K_(t,e)})),displayName:Eu((function(t,e){V_(t,e)}))});const nv=Pu(Xy,{Placemark:Eu(Pv)}),rv=function(t,e,i){return du(e[e.length-1].node.namespaceURI,"Placemark")};const sv=Cu("Data");const ov=Pu(Xy,["href"],Pu(zy,["x","y","w","h"])),av=Pu(Xy,{href:Eu(K_)},Pu(zy,{x:Eu(Z_),y:Eu(Z_),w:Eu(Z_),h:Eu(Z_)})),lv=function(t,e,i){return du(zy[0],"gx:"+i)};const hv=Pu(Xy,["scale","heading","Icon","color","hotSpot"]),cv=Pu(Xy,{Icon:Eu((function(t,e,i){const n={node:t},r=i[i.length-1].node;let s=ov[r.namespaceURI],o=Ru(e,s);Fu(n,av,bu,o,i,s),s=ov[zy[0]],o=Ru(e,s),Fu(n,av,lv,o,i,s)})),color:Eu(ev),heading:Eu(Z_),hotSpot:Eu((function(t,e){t.setAttribute("x",String(e.x)),t.setAttribute("y",String(e.y)),t.setAttribute("xunits",e.xunits),t.setAttribute("yunits",e.yunits)})),scale:Eu(Gv)});const uv=Pu(Xy,["color","scale"]),dv=Pu(Xy,{color:Eu(ev),scale:Eu(Gv)});const gv=Pu(Xy,["color","width"]),fv=Pu(Xy,{color:Eu(ev),width:Eu(Z_)});const pv={Point:"Point",LineString:"LineString",LinearRing:"LinearRing",Polygon:"Polygon",MultiPoint:"MultiGeometry",MultiLineString:"MultiGeometry",MultiPolygon:"MultiGeometry",GeometryCollection:"MultiGeometry"},mv=function(t,e,i){if(t){return du(e[e.length-1].node.namespaceURI,pv[t.getType()])}},_v=Cu("Point"),yv=Cu("LineString"),xv=Cu("LinearRing"),vv=Cu("Polygon"),Sv=Pu(Xy,{LineString:Eu(Mv),Point:Eu(Mv),Polygon:Eu(Dv),GeometryCollection:Eu(wv)});function wv(t,e,i){const n={node:t},r=e.getType();let s,o=[];"GeometryCollection"===r?(e.getGeometriesArrayRecursive().forEach((function(t){const e=t.getType();"MultiPoint"===e?o=o.concat(t.getPoints()):"MultiLineString"===e?o=o.concat(t.getLineStrings()):"MultiPolygon"===e?o=o.concat(t.getPolygons()):"Point"===e||"LineString"===e||"Polygon"===e?o.push(t):at(!1,39)})),s=mv):"MultiPoint"===r?(o=e.getPoints(),s=_v):"MultiLineString"===r?(o=e.getLineStrings(),s=yv):"MultiPolygon"===r?(o=e.getPolygons(),s=vv):at(!1,39),Fu(n,Sv,s,o,i)}const Ev=Pu(Xy,{LinearRing:Eu(Mv)});function Tv(t,e,i){Fu({node:t},Ev,xv,[e],i)}const Cv=Pu(Xy,{ExtendedData:Eu((function(t,e,i){const n={node:t},r=e.names,s=e.values,o=r.length;for(let t=0;t<o;t++)Fu(n,iv,sv,[{name:r[t],value:s[t]}],i)})),MultiGeometry:Eu(wv),LineString:Eu(Mv),LinearRing:Eu(Mv),Point:Eu(Mv),Polygon:Eu(Dv),Style:Eu((function(t,e,i){const n={node:t},r={};if(e.pointStyles.length){const t=e.pointStyles[0].getText();t&&(r.LabelStyle=t);const i=e.pointStyles[0].getImage();i&&"function"==typeof i.getSrc&&(r.IconStyle=i)}if(e.lineStyles.length){const t=e.lineStyles[0].getStroke();t&&(r.LineStyle=t)}if(e.polyStyles.length){const t=e.polyStyles[0].getStroke();t&&!r.LineStyle&&(r.LineStyle=t),r.PolyStyle=e.polyStyles[0]}const s=i[i.length-1].node,o=jv[s.namespaceURI],a=Ru(r,o);Fu(n,Bv,bu,a,i,o)})),address:Eu(K_),description:Eu(K_),name:Eu(K_),open:Eu(X_),phoneNumber:Eu(K_),styleUrl:Eu(K_),visibility:Eu(X_)}),bv=Pu(Xy,["name","open","visibility","address","phoneNumber","description","styleUrl","Style"]),Rv=Cu("ExtendedData");function Pv(t,e,i){const n={node:t};e.getId()&&t.setAttribute("id",e.getId());const r=e.getProperties(),s={address:1,description:1,name:1,open:1,phoneNumber:1,styleUrl:1,visibility:1};s[e.getGeometryName()]=1;const o=Object.keys(r||{}).sort().filter((function(t){return!s[t]})),a=e.getStyleFunction();if(a){const t=a(e,0);if(t){const i=Array.isArray(t)?t:[t];let n=i;if(e.getGeometry()&&(n=i.filter((function(t){const i=t.getGeometryFunction()(e);if(i){const t=i.getType();return"GeometryCollection"===t?i.getGeometriesArrayRecursive().filter((function(t){const e=t.getType();return"Point"===e||"MultiPoint"===e})).length:"Point"===t||"MultiPoint"===t}}))),this.writeStyles_){let t=i,s=i;e.getGeometry()&&(t=i.filter((function(t){const i=t.getGeometryFunction()(e);if(i){const t=i.getType();return"GeometryCollection"===t?i.getGeometriesArrayRecursive().filter((function(t){const e=t.getType();return"LineString"===e||"MultiLineString"===e})).length:"LineString"===t||"MultiLineString"===t}})),s=i.filter((function(t){const i=t.getGeometryFunction()(e);if(i){const t=i.getType();return"GeometryCollection"===t?i.getGeometriesArrayRecursive().filter((function(t){const e=t.getType();return"Polygon"===e||"MultiPolygon"===e})).length:"Polygon"===t||"MultiPolygon"===t}}))),r.Style={pointStyles:n,lineStyles:t,polyStyles:s}}if(n.length&&void 0===r.name){const t=n[0].getText();t&&(r.name=t.getText())}}}const l=i[i.length-1].node,h=bv[l.namespaceURI],c=Ru(r,h);if(Fu(n,Cv,bu,c,i,h),o.length>0){const t=Ru(r,o);Fu(n,Cv,Rv,[{names:o,values:t}],i)}const u=i[0];let d=e.getGeometry();d&&(d=Qp(d,!0,u)),Fu(n,Cv,mv,[d],i)}const Iv=Pu(Xy,["extrude","tessellate","altitudeMode","coordinates"]),Lv=Pu(Xy,{extrude:Eu(X_),tessellate:Eu(X_),altitudeMode:Eu(K_),coordinates:Eu((function(t,e,i){const n=i[i.length-1],r=n.layout,s=n.stride;let o;"XY"==r||"XYM"==r?o=2:"XYZ"==r||"XYZM"==r?o=3:at(!1,34);const a=e.length;let l="";if(a>0){l+=e[0];for(let t=1;t<o;++t)l+=","+e[t];for(let t=s;t<a;t+=s){l+=" "+e[t];for(let i=1;i<o;++i)l+=","+e[t+i]}}K_(t,l)}))});function Mv(t,e,i){const n=e.getFlatCoordinates(),r={node:t};r.layout=e.getLayout(),r.stride=e.getStride();const s=e.getProperties();s.coordinates=n;const o=i[i.length-1].node,a=Iv[o.namespaceURI],l=Ru(s,a);Fu(r,Lv,bu,l,i,a)}const Fv=Pu(Xy,["color","fill","outline"]),Av=Pu(Xy,{outerBoundaryIs:Eu(Tv),innerBoundaryIs:Eu(Tv)}),Ov=Cu("innerBoundaryIs"),Nv=Cu("outerBoundaryIs");function Dv(t,e,i){const n=e.getLinearRings(),r=n.shift(),s={node:t};Fu(s,Av,Ov,n,i),Fu(s,Av,Nv,[r],i)}const kv=Pu(Xy,{color:Eu(ev),fill:Eu(X_),outline:Eu(X_)});function Gv(t,e){Z_(t,Math.round(1e6*e)/1e6)}const jv=Pu(Xy,["IconStyle","LabelStyle","LineStyle","PolyStyle"]),Bv=Pu(Xy,{IconStyle:Eu((function(t,e,i){const n={node:t},r={},s=e.getSrc(),o=e.getSize(),a=e.getImageSize(),l={href:s};if(o){l.w=o[0],l.h=o[1];const t=e.getAnchor(),i=e.getOrigin();if(i&&a&&0!==i[0]&&i[1]!==o[1]&&(l.x=i[0],l.y=a[1]-(i[1]+o[1])),t&&(t[0]!==o[0]/2||t[1]!==o[1]/2)){const e={x:t[0],xunits:"pixels",y:o[1]-t[1],yunits:"pixels"};r.hotSpot=e}}r.Icon=l;let h=e.getScaleArray()[0],c=o;if(null===c&&(c=ex),2==c.length){h/=dx(c)}1!==h&&(r.scale=h);const u=e.getRotation();0!==u&&(r.heading=u);const d=e.getColor();d&&(r.color=d);const g=i[i.length-1].node,f=hv[g.namespaceURI],p=Ru(r,f);Fu(n,cv,bu,p,i,f)})),LabelStyle:Eu((function(t,e,i){const n={node:t},r={},s=e.getFill();s&&(r.color=s.getColor());const o=e.getScale();o&&1!==o&&(r.scale=o);const a=i[i.length-1].node,l=uv[a.namespaceURI],h=Ru(r,l);Fu(n,dv,bu,h,i,l)})),LineStyle:Eu((function(t,e,i){const n={node:t},r={color:e.getColor(),width:Number(e.getWidth())||1},s=i[i.length-1].node,o=gv[s.namespaceURI],a=Ru(r,o);Fu(n,fv,bu,a,i,o)})),PolyStyle:Eu((function(t,e,i){const n={node:t},r=e.getFill(),s=e.getStroke(),o={color:r?r.getColor():void 0,fill:!!r&&void 0,outline:!!s&&void 0},a=i[i.length-1].node,l=Fv[a.namespaceURI],h=Ru(o,l);Fu(n,kv,bu,h,i,l)}))});const Uv=[null],zv=Pu(Uv,{nd:function(t,e){e[e.length-1].ndrefs.push(t.getAttribute("ref"))},tag:Wv}),Xv=Pu(Uv,{node:function(t,e){const i=e[0],n=e[e.length-1],r=t.getAttribute("id"),s=[parseFloat(t.getAttribute("lon")),parseFloat(t.getAttribute("lat"))];n.nodes[r]=s;const o=Lu({tags:{}},Vv,t,e);if(!x(o.tags)){const t=new Wn(s);Qp(t,!1,i);const e=new lt(t);void 0!==r&&e.setId(r),e.setProperties(o.tags,!0),n.features.push(e)}},way:function(t,e){const i=Lu({id:t.getAttribute("id"),ndrefs:[],tags:{}},zv,t,e);e[e.length-1].ways.push(i)}});const Vv=Pu(Uv,{tag:Wv});function Wv(t,e){e[e.length-1].tags[t.getAttribute("k")]=t.getAttribute("v")}class Zv{read(t){if(t){if("string"==typeof t){const e=_u(t);return this.readFromDocument(e)}return pu(t)?this.readFromDocument(t):this.readFromNode(t)}return null}readFromDocument(t){for(let e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readFromNode(e);return null}readFromNode(t){}}function Yv(t){return t.getAttributeNS("http://www.w3.org/1999/xlink","href")}const Kv=[null,"http://www.opengis.net/ows/1.1"],qv=Pu(Kv,{ServiceIdentification:wu((function(t,e){return Lu({},lS,t,e)})),ServiceProvider:wu((function(t,e){return Lu({},hS,t,e)})),OperationsMetadata:wu((function(t,e){return Lu({},rS,t,e)}))});class Hv extends Zv{constructor(){super()}readFromNode(t){const e=Lu({},qv,t,[]);return e||null}}const $v=Pu(Kv,{DeliveryPoint:wu(z_),City:wu(z_),AdministrativeArea:wu(z_),PostalCode:wu(z_),Country:wu(z_),ElectronicMailAddress:wu(z_)}),Jv=Pu(Kv,{Value:Su((function(t,e){return z_(t)}))}),Qv=Pu(Kv,{AllowedValues:wu((function(t,e){return Lu({},Jv,t,e)}))}),tS=Pu(Kv,{Phone:wu((function(t,e){return Lu({},sS,t,e)})),Address:wu((function(t,e){return Lu({},$v,t,e)}))}),eS=Pu(Kv,{HTTP:wu((function(t,e){return Lu({},iS,t,e)}))}),iS=Pu(Kv,{Get:Su((function(t,e){const i=Yv(t);if(!i)return;return Lu({href:i},oS,t,e)})),Post:void 0}),nS=Pu(Kv,{DCP:wu((function(t,e){return Lu({},eS,t,e)}))}),rS=Pu(Kv,{Operation:function(t,e){const i=t.getAttribute("name"),n=Lu({},nS,t,e);if(!n)return;e[e.length-1][i]=n}}),sS=Pu(Kv,{Voice:wu(z_),Facsimile:wu(z_)}),oS=Pu(Kv,{Constraint:Su((function(t,e){const i=t.getAttribute("name");if(!i)return;return Lu({name:i},Qv,t,e)}))}),aS=Pu(Kv,{IndividualName:wu(z_),PositionName:wu(z_),ContactInfo:wu((function(t,e){return Lu({},tS,t,e)}))}),lS=Pu(Kv,{Abstract:wu(z_),AccessConstraints:wu(z_),Fees:wu(z_),Title:wu(z_),ServiceTypeVersion:wu(z_),ServiceType:wu(z_)}),hS=Pu(Kv,{ProviderName:wu(z_),ProviderSite:wu(Yv),ServiceContact:wu((function(t,e){return Lu({},aS,t,e)}))});function cS(t,e,i){let n;i=i||1e5;const r=new Array(e);for(n=0;n<e;++n)r[n]=0;for(let i=0,s=t.length;i<s;)for(n=0;n<e;++n,++i){const e=t[i],s=e-r[n];r[n]=e,t[i]=s}return dS(t,i)}function uS(t,e,i){let n;i=i||1e5;const r=new Array(e);for(n=0;n<e;++n)r[n]=0;const s=gS(t,i);for(let t=0,i=s.length;t<i;)for(n=0;n<e;++n,++t)r[n]+=s[t],s[t]=r[n];return s}function dS(t,e){e=e||1e5;for(let i=0,n=t.length;i<n;++i)t[i]=Math.round(t[i]*e);return fS(t)}function gS(t,e){e=e||1e5;const i=pS(t);for(let t=0,n=i.length;t<n;++t)i[t]/=e;return i}function fS(t){for(let e=0,i=t.length;e<i;++e){const i=t[e];t[e]=i<0?~(i<<1):i<<1}return mS(t)}function pS(t){const e=_S(t);for(let t=0,i=e.length;t<i;++t){const i=e[t];e[t]=1&i?~(i>>1):i>>1}return e}function mS(t){let e="";for(let i=0,n=t.length;i<n;++i)e+=yS(t[i]);return e}function _S(t){const e=[];let i=0,n=0;for(let r=0,s=t.length;r<s;++r){const s=t.charCodeAt(r)-63;i|=(31&s)<<n,s<32?(e.push(i),i=0,n=0):n+=5}return e}function yS(t){let e,i="";for(;t>=32;)e=63+(32|31&t),i+=String.fromCharCode(e),t>>=5;return e=t+63,i+=String.fromCharCode(e),i}const xS={Point:function(t,e,i){const n=t.coordinates;e&&i&&TS(n,e,i);return new Wn(n)},LineString:function(t,e){const i=vS(t.arcs,e);return new Op(i)},Polygon:function(t,e){const i=[];for(let n=0,r=t.arcs.length;n<r;++n)i[n]=vS(t.arcs[n],e);return new ur(i)},MultiPoint:function(t,e,i){const n=t.coordinates;if(e&&i)for(let t=0,r=n.length;t<r;++t)TS(n[t],e,i);return new Dp(n)},MultiLineString:function(t,e){const i=[];for(let n=0,r=t.arcs.length;n<r;++n)i[n]=vS(t.arcs[n],e);return new Np(i)},MultiPolygon:function(t,e){const i=[];for(let n=0,r=t.arcs.length;n<r;++n){const r=t.arcs[n],s=[];for(let t=0,i=r.length;t<i;++t)s[t]=vS(r[t],e);i[n]=s}return new Gp(i)}};function vS(t,e){const i=[];let n;for(let r=0,s=t.length;r<s;++r)if(n=t[r],r>0&&i.pop(),n>=0){const t=e[n];for(let e=0,n=t.length;e<n;++e)i.push(t[e].slice(0))}else{const t=e[~n];for(let e=t.length-1;e>=0;--e)i.push(t[e].slice(0))}return i}function SS(t,e,i,n,r,s,o){const a=t.geometries,l=[];for(let t=0,h=a.length;t<h;++t)l[t]=wS(a[t],e,i,n,r,s,o);return l}function wS(t,e,i,n,r,s,o){let a=null;const l=t.type;if(l){const r=xS[l];a="Point"===l||"MultiPoint"===l?r(t,i,n):r(t,e),a=Qp(a,!1,o)}const h=new lt({geometry:a});void 0!==t.id&&h.setId(t.id);let c=t.properties;return r&&(c||(c={}),c[r]=s),c&&h.setProperties(c,!0),h}function ES(t,e,i){let n=0,r=0;for(let s=0,o=t.length;s<o;++s){const o=t[s];n+=o[0],r+=o[1],o[0]=n,o[1]=r,TS(o,e,i)}}function TS(t,e,i){t[0]=t[0]*e[0]+i[0],t[1]=t[1]*e[1]+i[1]}class CS{constructor(t){this.tagName_=t}getTagName(){return this.tagName_}}class bS extends CS{constructor(t,e){super(t),this.conditions=e,at(this.conditions.length>=2,57)}}class RS extends bS{constructor(t){super("And",Array.prototype.slice.call(arguments))}}class PS extends CS{constructor(t,e,i){if(super("BBOX"),this.geometryName=t,this.extent=e,4!==e.length)throw new Error("Expected an extent with four values ([minX, minY, maxX, maxY])");this.srsName=i}}class IS extends CS{constructor(t,e,i,n){super(t),this.geometryName=e||"the_geom",this.geometry=i,this.srsName=n}}class LS extends IS{constructor(t,e,i){super("Contains",t,e,i)}}class MS extends IS{constructor(t,e,i,n,r){super("DWithin",t,e,r),this.distance=i,this.unit=n}}class FS extends IS{constructor(t,e,i){super("Disjoint",t,e,i)}}class AS extends CS{constructor(t,e){super(t),this.propertyName=e}}class OS extends AS{constructor(t,e,i){super("During",t),this.begin=e,this.end=i}}class NS extends AS{constructor(t,e,i,n){super(t,e),this.expression=i,this.matchCase=n}}class DS extends NS{constructor(t,e,i){super("PropertyIsEqualTo",t,e,i)}}class kS extends NS{constructor(t,e){super("PropertyIsGreaterThan",t,e)}}class GS extends NS{constructor(t,e){super("PropertyIsGreaterThanOrEqualTo",t,e)}}class jS extends IS{constructor(t,e,i){super("Intersects",t,e,i)}}class BS extends AS{constructor(t,e,i){super("PropertyIsBetween",t),this.lowerBoundary=e,this.upperBoundary=i}}class US extends AS{constructor(t,e,i,n,r,s){super("PropertyIsLike",t),this.pattern=e,this.wildCard=void 0!==i?i:"*",this.singleChar=void 0!==n?n:".",this.escapeChar=void 0!==r?r:"!",this.matchCase=s}}class zS extends AS{constructor(t){super("PropertyIsNull",t)}}class XS extends NS{constructor(t,e){super("PropertyIsLessThan",t,e)}}class VS extends NS{constructor(t,e){super("PropertyIsLessThanOrEqualTo",t,e)}}class WS extends CS{constructor(t){super("Not"),this.condition=t}}class ZS extends NS{constructor(t,e,i){super("PropertyIsNotEqualTo",t,e,i)}}class YS extends bS{constructor(t){super("Or",Array.prototype.slice.call(arguments))}}class KS extends CS{constructor(t){super("ResourceId"),this.rid=t}}class qS extends IS{constructor(t,e,i){super("Within",t,e,i)}}function HS(t){const e=[null].concat(Array.prototype.slice.call(arguments));return new(Function.prototype.bind.apply(RS,e))}function $S(t,e,i){return new PS(t,e,i)}const JS={"http://www.opengis.net/gml":{boundedBy:wu(O_.prototype.readExtentElement,"bounds")},"http://www.opengis.net/wfs/2.0":{member:xu(O_.prototype.readFeaturesInternal)}},QS={"http://www.opengis.net/wfs":{totalInserted:wu(B_),totalUpdated:wu(B_),totalDeleted:wu(B_)},"http://www.opengis.net/wfs/2.0":{totalInserted:wu(B_),totalUpdated:wu(B_),totalDeleted:wu(B_)}},tw={"http://www.opengis.net/wfs":{TransactionSummary:wu(uw,"transactionSummary"),InsertResults:wu(pw,"insertIds")},"http://www.opengis.net/wfs/2.0":{TransactionSummary:wu(uw,"transactionSummary"),InsertResults:wu(pw,"insertIds")}},ew={"http://www.opengis.net/wfs":{PropertyName:Eu(K_)},"http://www.opengis.net/wfs/2.0":{PropertyName:Eu(K_)}},iw={"http://www.opengis.net/wfs":{Insert:Eu(mw),Update:Eu(vw),Delete:Eu(xw),Property:Eu(Sw),Native:Eu(ww)},"http://www.opengis.net/wfs/2.0":{Insert:Eu(mw),Update:Eu(vw),Delete:Eu(xw),Property:Eu(Sw),Native:Eu(ww)}},nw="feature",rw="http://www.w3.org/2000/xmlns/",sw={"2.0.0":"http://www.opengis.net/ogc/1.1","1.1.0":"http://www.opengis.net/ogc","1.0.0":"http://www.opengis.net/ogc"},ow={"2.0.0":"http://www.opengis.net/wfs/2.0","1.1.0":"http://www.opengis.net/wfs","1.0.0":"http://www.opengis.net/wfs"},aw={"2.0.0":"http://www.opengis.net/fes/2.0","1.1.0":"http://www.opengis.net/fes","1.0.0":"http://www.opengis.net/fes"},lw={"2.0.0":"http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd","1.1.0":"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd","1.0.0":"http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/wfs.xsd"},hw={"2.0.0":ty,"1.1.0":J_,"1.0.0":H_};function cw(t,e,i,n){Fu(n,iw,Cu(t),e,i)}function uw(t,e){return Lu({},QS,t,e)}const dw={"http://www.opengis.net/ogc":{FeatureId:xu((function(t,e){return t.getAttribute("fid")}))},"http://www.opengis.net/ogc/1.1":{FeatureId:xu((function(t,e){return t.getAttribute("fid")}))}};function gw(t,e){Iu(dw,t,e)}const fw={"http://www.opengis.net/wfs":{Feature:gw},"http://www.opengis.net/wfs/2.0":{Feature:gw}};function pw(t,e){return Lu([],fw,t,e)}function mw(t,e,i){const n=i[i.length-1],r=n.featureType,s=n.featureNS,o=n.gmlVersion,a=du(s,r);t.appendChild(a),2===o?H_.prototype.writeFeatureElement(a,e,i):3===o?J_.prototype.writeFeatureElement(a,e,i):ty.prototype.writeFeatureElement(a,e,i)}function _w(t,e,i){const n=i[i.length-1].version,r=sw[n],s=du(r,"Filter"),o=du(r,"FeatureId");s.appendChild(o),o.setAttribute("fid",e),t.appendChild(s)}function yw(t,e){const i=(t=t||nw)+":";return e.startsWith(i)?e:i+e}function xw(t,e,i){const n=i[i.length-1];at(void 0!==e.getId(),26);const r=n.featureType,s=n.featurePrefix,o=n.featureNS,a=yw(s,r);t.setAttribute("typeName",a),t.setAttributeNS(rw,"xmlns:"+s,o);const l=e.getId();void 0!==l&&_w(t,l,i)}function vw(t,e,i){const n=i[i.length-1];at(void 0!==e.getId(),27);const r=n.version,s=n.featureType,o=n.featurePrefix,a=n.featureNS,l=yw(o,s),h=e.getGeometryName();t.setAttribute("typeName",l),t.setAttributeNS(rw,"xmlns:"+o,a);const c=e.getId();if(void 0!==c){const s=e.getKeys(),o=[];for(let t=0,i=s.length;t<i;t++){const i=e.get(s[t]);if(void 0!==i){let e=s[t];i&&"function"==typeof i.getSimplifiedGeometry&&(e=h),o.push({name:e,value:i})}}Fu({version:r,gmlVersion:n.gmlVersion,node:t,hasZ:n.hasZ,srsName:n.srsName},iw,Cu("Property"),o,i),_w(t,c,i)}}function Sw(t,e,i){const n=i[i.length-1],r=n.version,s=ow[r],o=du(s,"Name"),a=n.gmlVersion;if(t.appendChild(o),K_(o,e.name),void 0!==e.value&&null!==e.value){const n=du(s,"Value");t.appendChild(n),e.value&&"function"==typeof e.value.getSimplifiedGeometry?2===a?H_.prototype.writeGeometryElement(n,e.value,i):3===a?J_.prototype.writeGeometryElement(n,e.value,i):ty.prototype.writeGeometryElement(n,e.value,i):K_(n,e.value)}}function ww(t,e,i){e.vendorId&&t.setAttribute("vendorId",e.vendorId),void 0!==e.safeToIgnore&&t.setAttribute("safeToIgnore",String(e.safeToIgnore)),void 0!==e.value&&K_(t,e.value)}const Ew={"http://www.opengis.net/wfs":{Query:Eu(Tw)},"http://www.opengis.net/wfs/2.0":{Query:Eu(Tw)},"http://www.opengis.net/ogc":{During:Eu(Iw),And:Eu(Lw),Or:Eu(Lw),Not:Eu(Mw),BBOX:Eu(bw),Contains:Eu(Rw),Intersects:Eu(Rw),Within:Eu(Rw),DWithin:Eu(Pw),PropertyIsEqualTo:Eu(Fw),PropertyIsNotEqualTo:Eu(Fw),PropertyIsLessThan:Eu(Fw),PropertyIsLessThanOrEqualTo:Eu(Fw),PropertyIsGreaterThan:Eu(Fw),PropertyIsGreaterThanOrEqualTo:Eu(Fw),PropertyIsNull:Eu(Aw),PropertyIsBetween:Eu(Ow),PropertyIsLike:Eu(Nw)},"http://www.opengis.net/fes/2.0":{During:Eu(Iw),And:Eu(Lw),Or:Eu(Lw),Not:Eu(Mw),BBOX:Eu(bw),Contains:Eu(Rw),Disjoint:Eu(Rw),Intersects:Eu(Rw),ResourceId:Eu((function(t,e,i){t.setAttribute("rid",e.rid)})),Within:Eu(Rw),DWithin:Eu(Pw),PropertyIsEqualTo:Eu(Fw),PropertyIsNotEqualTo:Eu(Fw),PropertyIsLessThan:Eu(Fw),PropertyIsLessThanOrEqualTo:Eu(Fw),PropertyIsGreaterThan:Eu(Fw),PropertyIsGreaterThanOrEqualTo:Eu(Fw),PropertyIsNull:Eu(Aw),PropertyIsBetween:Eu(Ow),PropertyIsLike:Eu(Nw)}};function Tw(t,e,i){const n=i[i.length-1],r=n.version,s=n.featurePrefix,o=n.featureNS,a=n.propertyNames,l=n.srsName;let h,c;h=s?yw(s,e):e,c="2.0.0"===r?"typeNames":"typeName",t.setAttribute(c,h),l&&t.setAttribute("srsName",l),o&&t.setAttributeNS(rw,"xmlns:"+s,o);const u=Object.assign({},n);u.node=t,Fu(u,ew,Cu("PropertyName"),a,i);const d=n.filter;if(d){const e=du(Uw(r),"Filter");t.appendChild(e),Cw(e,d,i)}}function Cw(t,e,i){const n=i[i.length-1],r={node:t};Object.assign(r,{context:n}),Fu(r,Ew,Cu(e.getTagName()),[e],i)}function bw(t,e,i){const n=i[i.length-1],r=n.context.version;n.srsName=e.srsName;const s=hw[r];Gw(r,t,e.geometryName),s.prototype.writeGeometryElement(t,e.extent,i)}function Rw(t,e,i){const n=i[i.length-1],r=n.context.version;n.srsName=e.srsName;const s=hw[r];Gw(r,t,e.geometryName),s.prototype.writeGeometryElement(t,e.geometry,i)}function Pw(t,e,i){const n=i[i.length-1].context.version;Rw(t,e,i);const r=du(Uw(n),"Distance");K_(r,e.distance.toString()),"2.0.0"===n?r.setAttribute("uom",e.unit):r.setAttribute("units",e.unit),t.appendChild(r)}function Iw(t,e,i){const n=i[i.length-1].context.version;Dw(aw[n],"ValueReference",t,e.propertyName);const r=du(F_,"TimePeriod");t.appendChild(r);const s=du(F_,"begin");r.appendChild(s),jw(s,e.begin);const o=du(F_,"end");r.appendChild(o),jw(o,e.end)}function Lw(t,e,i){const n=i[i.length-1].context,r={node:t};Object.assign(r,{context:n});const s=e.conditions;for(let t=0,e=s.length;t<e;++t){const e=s[t];Fu(r,Ew,Cu(e.getTagName()),[e],i)}}function Mw(t,e,i){const n=i[i.length-1].context,r={node:t};Object.assign(r,{context:n});const s=e.condition;Fu(r,Ew,Cu(s.getTagName()),[s],i)}function Fw(t,e,i){const n=i[i.length-1].context.version;void 0!==e.matchCase&&t.setAttribute("matchCase",e.matchCase.toString()),Gw(n,t,e.propertyName),kw(n,t,""+e.expression)}function Aw(t,e,i){Gw(i[i.length-1].context.version,t,e.propertyName)}function Ow(t,e,i){const n=i[i.length-1].context.version,r=Uw(n);Gw(n,t,e.propertyName);const s=du(r,"LowerBoundary");t.appendChild(s),kw(n,s,""+e.lowerBoundary);const o=du(r,"UpperBoundary");t.appendChild(o),kw(n,o,""+e.upperBoundary)}function Nw(t,e,i){const n=i[i.length-1].context.version;t.setAttribute("wildCard",e.wildCard),t.setAttribute("singleChar",e.singleChar),t.setAttribute("escapeChar",e.escapeChar),void 0!==e.matchCase&&t.setAttribute("matchCase",e.matchCase.toString()),Gw(n,t,e.propertyName),kw(n,t,""+e.pattern)}function Dw(t,e,i,n){const r=du(t,e);K_(r,n),i.appendChild(r)}function kw(t,e,i){Dw(Uw(t),"Literal",e,i)}function Gw(t,e,i){"2.0.0"===t?Dw(aw[t],"ValueReference",e,i):Dw(sw[t],"PropertyName",e,i)}function jw(t,e){const i=du(F_,"TimeInstant");t.appendChild(i);const n=du(F_,"timePosition");i.appendChild(n),K_(n,e)}function Bw(t,e,i){const n=i[i.length-1],r=Object.assign({},n);r.node=t,Fu(r,Ew,Cu("Query"),e,i)}function Uw(t){let e;return e="2.0.0"===t?aw[t]:sw[t],e}const zw=1,Xw=2,Vw=3,Ww=4,Zw=5,Yw=6,Kw=7,qw=15,Hw=16,$w=17;class Jw{constructor(t){this.view_=t,this.pos_=0,this.initialized_=!1,this.isLittleEndian_=!1,this.hasZ_=!1,this.hasM_=!1,this.srid_=null,this.layout_="XY"}readUint8(){return this.view_.getUint8(this.pos_++)}readUint32(t){return this.view_.getUint32((this.pos_+=4)-4,void 0!==t?t:this.isLittleEndian_)}readDouble(t){return this.view_.getFloat64((this.pos_+=8)-8,void 0!==t?t:this.isLittleEndian_)}readPoint(){const t=[];return t.push(this.readDouble()),t.push(this.readDouble()),this.hasZ_&&t.push(this.readDouble()),this.hasM_&&t.push(this.readDouble()),t}readLineString(){const t=this.readUint32(),e=[];for(let i=0;i<t;i++)e.push(this.readPoint());return e}readPolygon(){const t=this.readUint32(),e=[];for(let i=0;i<t;i++)e.push(this.readLineString());return e}readWkbHeader(t){const e=this.readUint8()>0,i=this.readUint32(e),n=Math.floor((268435455&i)/1e3),r=Boolean(2147483648&i)||1===n||3===n,s=Boolean(1073741824&i)||2===n||3===n,o=Boolean(536870912&i),a=(268435455&i)%1e3,l=["XY",r?"Z":"",s?"M":""].join(""),h=o?this.readUint32(e):null;if(void 0!==t&&t!==a)throw new Error("Unexpected WKB geometry type "+a);if(this.initialized_){if(this.isLittleEndian_!==e)throw new Error("Inconsistent endian");if(this.layout_!==l)throw new Error("Inconsistent geometry layout");if(h&&this.srid_!==h)throw new Error("Inconsistent coordinate system (SRID)")}else this.isLittleEndian_=e,this.hasZ_=r,this.hasM_=s,this.layout_=l,this.srid_=h,this.initialized_=!0;return a}readWkbPayload(t){switch(t){case zw:return this.readPoint();case Xw:return this.readLineString();case Vw:case $w:return this.readPolygon();case Ww:return this.readMultiPoint();case Zw:return this.readMultiLineString();case Yw:case qw:case Hw:return this.readMultiPolygon();case Kw:return this.readGeometryCollection();default:throw new Error("Unsupported WKB geometry type "+t+" is found")}}readWkbBlock(t){return this.readWkbPayload(this.readWkbHeader(t))}readWkbCollection(t,e){const i=this.readUint32(),n=[];for(let r=0;r<i;r++){const i=t.call(this,e);i&&n.push(i)}return n}readMultiPoint(){return this.readWkbCollection(this.readWkbBlock,zw)}readMultiLineString(){return this.readWkbCollection(this.readWkbBlock,Xw)}readMultiPolygon(){return this.readWkbCollection(this.readWkbBlock,Vw)}readGeometryCollection(){return this.readWkbCollection(this.readGeometry)}readGeometry(){const t=this.readWkbHeader(),e=this.readWkbPayload(t);switch(t){case zw:return new Wn(e,this.layout_);case Xw:return new Op(e,this.layout_);case Vw:case $w:return new ur(e,this.layout_);case Ww:return new Dp(e,this.layout_);case Zw:return new Np(e,this.layout_);case Yw:case qw:case Hw:return new Gp(e,this.layout_);case Kw:return new Ip(e);default:return null}}getSrid(){return this.srid_}}class Qw{constructor(t){t=t||{},this.layout_=t.layout,this.isLittleEndian_=!1!==t.littleEndian,this.isEWKB_=!1!==t.ewkb,this.writeQueue_=[],this.nodata_=Object.assign({X:0,Y:0,Z:0,M:0},t.nodata)}writeUint8(t){this.writeQueue_.push([1,t])}writeUint32(t){this.writeQueue_.push([4,t])}writeDouble(t){this.writeQueue_.push([8,t])}writePoint(t,e){const i=Object.assign.apply(null,e.split("").map(((e,i)=>({[e]:t[i]}))));for(const t of this.layout_)this.writeDouble(t in i?i[t]:this.nodata_[t])}writeLineString(t,e){this.writeUint32(t.length);for(let i=0;i<t.length;i++)this.writePoint(t[i],e)}writePolygon(t,e){this.writeUint32(t.length);for(let i=0;i<t.length;i++)this.writeLineString(t[i],e)}writeWkbHeader(t,e){t%=1e3,this.layout_.includes("Z")&&(t+=this.isEWKB_?2147483648:1e3),this.layout_.includes("M")&&(t+=this.isEWKB_?1073741824:2e3),this.isEWKB_&&Number.isInteger(e)&&(t|=536870912),this.writeUint8(this.isLittleEndian_?1:0),this.writeUint32(t),this.isEWKB_&&Number.isInteger(e)&&this.writeUint32(e)}writeMultiPoint(t,e){this.writeUint32(t.length);for(let i=0;i<t.length;i++)this.writeWkbHeader(1),this.writePoint(t[i],e)}writeMultiLineString(t,e){this.writeUint32(t.length);for(let i=0;i<t.length;i++)this.writeWkbHeader(2),this.writeLineString(t[i],e)}writeMultiPolygon(t,e){this.writeUint32(t.length);for(let i=0;i<t.length;i++)this.writeWkbHeader(3),this.writePolygon(t[i],e)}writeGeometryCollection(t){this.writeUint32(t.length);for(let e=0;e<t.length;e++)this.writeGeometry(t[e])}findMinimumLayout(t,e="XYZM"){if(t instanceof _n)return(i=t.getLayout())===(n=e)?i:"XYZM"===i?n:"XYZM"===n?i:"XY";var i,n;if(t instanceof Ip){const i=t.getGeometriesArray();for(let t=0;t<i.length&&"XY"!==e;t++)e=this.findMinimumLayout(i[t],e)}return e}writeGeometry(t,e){const i={Point:zw,LineString:Xw,Polygon:Vw,MultiPoint:Ww,MultiLineString:Zw,MultiPolygon:Yw,GeometryCollection:Kw},n=t.getType(),r=i[n];if(!r)throw new Error("GeometryType "+n+" is not supported");if(this.layout_||(this.layout_=this.findMinimumLayout(t)),this.writeWkbHeader(r,e),t instanceof _n){({Point:this.writePoint,LineString:this.writeLineString,Polygon:this.writePolygon,MultiPoint:this.writeMultiPoint,MultiLineString:this.writeMultiLineString,MultiPolygon:this.writeMultiPolygon})[n].call(this,t.getCoordinates(),t.getLayout())}else t instanceof Ip&&this.writeGeometryCollection(t.getGeometriesArray())}getBuffer(){const t=this.writeQueue_.reduce(((t,e)=>t+e[0]),0),e=new ArrayBuffer(t),i=new DataView(e);let n=0;return this.writeQueue_.forEach((t=>{switch(t[0]){case 1:i.setUint8(n,t[1]);break;case 4:i.setUint32(n,t[1],this.isLittleEndian_);break;case 8:i.setFloat64(n,t[1],this.isLittleEndian_)}n+=t[0]})),e}}function tE(t){return"string"==typeof t?function(t){const e=new Uint8Array(t.length/2);for(let i=0;i<t.length/2;i++)e[i]=parseInt(t.substr(2*i,2),16);return new DataView(e.buffer)}(t):ArrayBuffer.isView(t)?t instanceof DataView?t:new DataView(t.buffer,t.byteOffset,t.byteLength):t instanceof ArrayBuffer?new DataView(t):null}const eE={POINT:Wn,LINESTRING:Op,POLYGON:ur,MULTIPOINT:Dp,MULTILINESTRING:Np,MULTIPOLYGON:Gp},iE="EMPTY",nE=0,rE=1,sE=2,oE=3,aE=4,lE=5,hE=6,cE={Point:"POINT",LineString:"LINESTRING",Polygon:"POLYGON",MultiPoint:"MULTIPOINT",MultiLineString:"MULTILINESTRING",MultiPolygon:"MULTIPOLYGON",GeometryCollection:"GEOMETRYCOLLECTION",Circle:"CIRCLE"};class uE{constructor(t){this.wkt=t,this.index_=-1}isAlpha_(t){return t>="a"&&t<="z"||t>="A"&&t<="Z"}isNumeric_(t,e){return e=void 0!==e&&e,t>="0"&&t<="9"||"."==t&&!e}isWhiteSpace_(t){return" "==t||"\t"==t||"\r"==t||"\n"==t}nextChar_(){return this.wkt.charAt(++this.index_)}nextToken(){const t=this.nextChar_(),e=this.index_;let i,n=t;if("("==t)i=sE;else if(","==t)i=lE;else if(")"==t)i=oE;else if(this.isNumeric_(t)||"-"==t)i=aE,n=this.readNumber_();else if(this.isAlpha_(t))i=rE,n=this.readText_();else{if(this.isWhiteSpace_(t))return this.nextToken();if(""!==t)throw new Error("Unexpected character: "+t);i=hE}return{position:e,value:n,type:i}}readNumber_(){let t;const e=this.index_;let i=!1,n=!1;do{"."==t?i=!0:"e"!=t&&"E"!=t||(n=!0),t=this.nextChar_()}while(this.isNumeric_(t,i)||!n&&("e"==t||"E"==t)||n&&("-"==t||"+"==t));return parseFloat(this.wkt.substring(e,this.index_--))}readText_(){let t;const e=this.index_;do{t=this.nextChar_()}while(this.isAlpha_(t));return this.wkt.substring(e,this.index_--).toUpperCase()}}class dE{constructor(t){this.lexer_=t,this.token_={position:0,type:nE},this.layout_="XY"}consume_(){this.token_=this.lexer_.nextToken()}isTokenType(t){return this.token_.type==t}match(t){const e=this.isTokenType(t);return e&&this.consume_(),e}parse(){return this.consume_(),this.parseGeometry_()}parseGeometryLayout_(){let t="XY";const e=this.token_;if(this.isTokenType(rE)){const i=e.value;"Z"===i?t="XYZ":"M"===i?t="XYM":"ZM"===i&&(t="XYZM"),"XY"!==t&&this.consume_()}return t}parseGeometryCollectionText_(){if(this.match(sE)){const t=[];do{t.push(this.parseGeometry_())}while(this.match(lE));if(this.match(oE))return t}throw new Error(this.formatErrorMessage_())}parsePointText_(){if(this.match(sE)){const t=this.parsePoint_();if(this.match(oE))return t}throw new Error(this.formatErrorMessage_())}parseLineStringText_(){if(this.match(sE)){const t=this.parsePointList_();if(this.match(oE))return t}throw new Error(this.formatErrorMessage_())}parsePolygonText_(){if(this.match(sE)){const t=this.parseLineStringTextList_();if(this.match(oE))return t}throw new Error(this.formatErrorMessage_())}parseMultiPointText_(){if(this.match(sE)){let t;if(t=this.token_.type==sE?this.parsePointTextList_():this.parsePointList_(),this.match(oE))return t}throw new Error(this.formatErrorMessage_())}parseMultiLineStringText_(){if(this.match(sE)){const t=this.parseLineStringTextList_();if(this.match(oE))return t}throw new Error(this.formatErrorMessage_())}parseMultiPolygonText_(){if(this.match(sE)){const t=this.parsePolygonTextList_();if(this.match(oE))return t}throw new Error(this.formatErrorMessage_())}parsePoint_(){const t=[],e=this.layout_.length;for(let i=0;i<e;++i){const e=this.token_;if(!this.match(aE))break;t.push(e.value)}if(t.length==e)return t;throw new Error(this.formatErrorMessage_())}parsePointList_(){const t=[this.parsePoint_()];for(;this.match(lE);)t.push(this.parsePoint_());return t}parsePointTextList_(){const t=[this.parsePointText_()];for(;this.match(lE);)t.push(this.parsePointText_());return t}parseLineStringTextList_(){const t=[this.parseLineStringText_()];for(;this.match(lE);)t.push(this.parseLineStringText_());return t}parsePolygonTextList_(){const t=[this.parsePolygonText_()];for(;this.match(lE);)t.push(this.parsePolygonText_());return t}isEmptyGeometry_(){const t=this.isTokenType(rE)&&this.token_.value==iE;return t&&this.consume_(),t}formatErrorMessage_(){return"Unexpected `"+this.token_.value+"` at position "+this.token_.position+" in `"+this.lexer_.wkt+"`"}parseGeometry_(){const t=this.token_;if(this.match(rE)){const e=t.value;this.layout_=this.parseGeometryLayout_();const i=this.isEmptyGeometry_();if("GEOMETRYCOLLECTION"==e){if(i)return new Ip([]);const t=this.parseGeometryCollectionText_();return new Ip(t)}{const t=eE[e];if(!t)throw new Error("Invalid geometry type: "+e);let n;if(i)n="POINT"==e?[NaN,NaN]:[];else switch(e){case"POINT":n=this.parsePointText_();break;case"LINESTRING":n=this.parseLineStringText_();break;case"POLYGON":n=this.parsePolygonText_();break;case"MULTIPOINT":n=this.parseMultiPointText_();break;case"MULTILINESTRING":n=this.parseMultiLineStringText_();break;case"MULTIPOLYGON":n=this.parseMultiPolygonText_()}return new t(n,this.layout_)}}throw new Error(this.formatErrorMessage_())}}function gE(t){const e=t.getCoordinates();return 0===e.length?"":e.join(" ")}function fE(t){const e=t.getCoordinates(),i=[];for(let t=0,n=e.length;t<n;++t)i.push(e[t].join(" "));return i.join(",")}function pE(t){const e=[],i=t.getLinearRings();for(let t=0,n=i.length;t<n;++t)e.push("("+fE(i[t])+")");return e.join(",")}const mE={Point:gE,LineString:fE,Polygon:pE,MultiPoint:function(t){const e=[],i=t.getPoints();for(let t=0,n=i.length;t<n;++t)e.push("("+gE(i[t])+")");return e.join(",")},MultiLineString:function(t){const e=[],i=t.getLineStrings();for(let t=0,n=i.length;t<n;++t)e.push("("+fE(i[t])+")");return e.join(",")},MultiPolygon:function(t){const e=[],i=t.getPolygons();for(let t=0,n=i.length;t<n;++t)e.push("("+pE(i[t])+")");return e.join(",")},GeometryCollection:function(t){const e=[],i=t.getGeometries();for(let t=0,n=i.length;t<n;++t)e.push(_E(i[t]));return e.join(",")}};function _E(t){const e=t.getType(),i=(0,mE[e])(t);let n=cE[e];if("function"==typeof t.getFlatCoordinates){const e=function(t){const e=t.getLayout();let i="";return"XYZ"!==e&&"XYZM"!==e||(i+="Z"),"XYM"!==e&&"XYZM"!==e||(i+="M"),i}(t);e.length>0&&(n+=" "+e)}return 0===i.length?n+" "+iE:n+"("+i+")"}const yE=[null,"http://www.opengis.net/wms"],xE=Pu(yE,{Service:wu((function(t,e){return Lu({},SE,t,e)})),Capability:wu((function(t,e){return Lu({},vE,t,e)}))}),vE=Pu(yE,{Request:wu((function(t,e){return Lu({},IE,t,e)})),Exception:wu((function(t,e){return Lu([],CE,t,e)})),Layer:wu((function(t,e){const i=Lu({},bE,t,e);if(void 0===i.Layer)return Object.assign(i,DE(t,e));return i}))});const SE=Pu(yE,{Name:wu(z_),Title:wu(z_),Abstract:wu(z_),KeywordList:wu(BE),OnlineResource:wu(Yv),ContactInformation:wu((function(t,e){return Lu({},wE,t,e)})),Fees:wu(z_),AccessConstraints:wu(z_),LayerLimit:wu(B_),MaxWidth:wu(B_),MaxHeight:wu(B_)}),wE=Pu(yE,{ContactPersonPrimary:wu((function(t,e){return Lu({},EE,t,e)})),ContactPosition:wu(z_),ContactAddress:wu((function(t,e){return Lu({},TE,t,e)})),ContactVoiceTelephone:wu(z_),ContactFacsimileTelephone:wu(z_),ContactElectronicMailAddress:wu(z_)}),EE=Pu(yE,{ContactPerson:wu(z_),ContactOrganization:wu(z_)}),TE=Pu(yE,{AddressType:wu(z_),Address:wu(z_),City:wu(z_),StateOrProvince:wu(z_),PostCode:wu(z_),Country:wu(z_)}),CE=Pu(yE,{Format:xu(z_)}),bE=Pu(yE,{Name:wu(z_),Title:wu(z_),Abstract:wu(z_),KeywordList:wu(BE),CRS:Su(z_),EX_GeographicBoundingBox:wu((function(t,e){const i=Lu({},PE,t,e);if(!i)return;const n=i.westBoundLongitude,r=i.southBoundLatitude,s=i.eastBoundLongitude,o=i.northBoundLatitude;if(void 0===n||void 0===r||void 0===s||void 0===o)return;return[n,r,s,o]})),BoundingBox:Su((function(t,e){const i=[j_(t.getAttribute("minx")),j_(t.getAttribute("miny")),j_(t.getAttribute("maxx")),j_(t.getAttribute("maxy"))],n=[j_(t.getAttribute("resx")),j_(t.getAttribute("resy"))];return{crs:t.getAttribute("CRS"),extent:i,res:n}})),Dimension:Su((function(t,e){return{name:t.getAttribute("name"),units:t.getAttribute("units"),unitSymbol:t.getAttribute("unitSymbol"),default:t.getAttribute("default"),multipleValues:D_(t.getAttribute("multipleValues")),nearestValue:D_(t.getAttribute("nearestValue")),current:D_(t.getAttribute("current")),values:z_(t)}})),Attribution:wu((function(t,e){return Lu({},RE,t,e)})),AuthorityURL:Su((function(t,e){const i=kE(t,e);if(i)return i.name=t.getAttribute("name"),i;return})),Identifier:Su(z_),MetadataURL:Su((function(t,e){const i=kE(t,e);if(i)return i.type=t.getAttribute("type"),i;return})),DataURL:Su(kE),FeatureListURL:Su(kE),Style:Su((function(t,e){return Lu({},AE,t,e)})),MinScaleDenominator:wu(G_),MaxScaleDenominator:wu(G_),Layer:Su(DE)}),RE=Pu(yE,{Title:wu(z_),OnlineResource:wu(Yv),LogoURL:wu(jE)}),PE=Pu(yE,{westBoundLongitude:wu(G_),eastBoundLongitude:wu(G_),southBoundLatitude:wu(G_),northBoundLatitude:wu(G_)}),IE=Pu(yE,{GetCapabilities:wu(GE),GetMap:wu(GE),GetFeatureInfo:wu(GE)}),LE=Pu(yE,{Format:Su(z_),DCPType:Su((function(t,e){return Lu({},ME,t,e)}))}),ME=Pu(yE,{HTTP:wu((function(t,e){return Lu({},FE,t,e)}))}),FE=Pu(yE,{Get:wu(kE),Post:wu(kE)}),AE=Pu(yE,{Name:wu(z_),Title:wu(z_),Abstract:wu(z_),LegendURL:Su(jE),StyleSheetURL:wu(kE),StyleURL:wu(kE)}),OE=Pu(yE,{Format:wu(z_),OnlineResource:wu(Yv)}),NE=Pu(yE,{Keyword:xu(z_)});function DE(t,e){const i=e[e.length-1],n=Lu({},bE,t,e);if(!n)return;let r=D_(t.getAttribute("queryable"));void 0===r&&(r=i.queryable),n.queryable=void 0!==r&&r;let s=U_(t.getAttribute("cascaded"));void 0===s&&(s=i.cascaded),n.cascaded=s;let o=D_(t.getAttribute("opaque"));void 0===o&&(o=i.opaque),n.opaque=void 0!==o&&o;let a=D_(t.getAttribute("noSubsets"));void 0===a&&(a=i.noSubsets),n.noSubsets=void 0!==a&&a;let l=j_(t.getAttribute("fixedWidth"));l||(l=i.fixedWidth),n.fixedWidth=l;let h=j_(t.getAttribute("fixedHeight"));h||(h=i.fixedHeight),n.fixedHeight=h;["Style","CRS","AuthorityURL"].forEach((function(t){if(t in i){const e=n[t]||[];n[t]=e.concat(i[t])}}));return["EX_GeographicBoundingBox","BoundingBox","Dimension","Attribution","MinScaleDenominator","MaxScaleDenominator"].forEach((function(t){if(!(t in n)){const e=i[t];n[t]=e}})),n}function kE(t,e){return Lu({},OE,t,e)}function GE(t,e){return Lu({},LE,t,e)}function jE(t,e){const i=kE(t,e);if(i){const e=[U_(t.getAttribute("width")),U_(t.getAttribute("height"))];return i.size=e,i}}function BE(t,e){return Lu([],NE,t,e)}const UE=[null,"http://www.opengis.net/wmts/1.0"],zE=[null,"http://www.opengis.net/ows/1.1"],XE=Pu(UE,{Contents:wu((function(t,e){return Lu({},VE,t,e)}))});const VE=Pu(UE,{Layer:Su((function(t,e){return Lu({},WE,t,e)})),TileMatrixSet:Su((function(t,e){return Lu({},JE,t,e)}))}),WE=Pu(UE,{Style:Su((function(t,e){const i=Lu({},ZE,t,e);if(!i)return;const n="true"===t.getAttribute("isDefault");return i.isDefault=n,i})),Format:Su(z_),TileMatrixSetLink:Su((function(t,e){return Lu({},YE,t,e)})),Dimension:Su((function(t,e){return Lu({},HE,t,e)})),ResourceURL:Su((function(t,e){const i=t.getAttribute("format"),n=t.getAttribute("template"),r=t.getAttribute("resourceType"),s={};i&&(s.format=i);n&&(s.template=n);r&&(s.resourceType=r);return s}))},Pu(zE,{Title:wu(z_),Abstract:wu(z_),WGS84BoundingBox:wu(tT),Identifier:wu(z_)})),ZE=Pu(UE,{LegendURL:Su((function(t,e){const i={};return i.format=t.getAttribute("format"),i.href=Yv(t),i}))},Pu(zE,{Title:wu(z_),Identifier:wu(z_)})),YE=Pu(UE,{TileMatrixSet:wu(z_),TileMatrixSetLimits:wu((function(t,e){return Lu([],KE,t,e)}))}),KE=Pu(UE,{TileMatrixLimits:xu((function(t,e){return Lu({},qE,t,e)}))}),qE=Pu(UE,{TileMatrix:wu(z_),MinTileRow:wu(B_),MaxTileRow:wu(B_),MinTileCol:wu(B_),MaxTileCol:wu(B_)}),HE=Pu(UE,{Default:wu(z_),Value:Su(z_)},Pu(zE,{Identifier:wu(z_)})),$E=Pu(zE,{LowerCorner:xu(eT),UpperCorner:xu(eT)}),JE=Pu(UE,{WellKnownScaleSet:wu(z_),TileMatrix:Su((function(t,e){return Lu({},QE,t,e)}))},Pu(zE,{SupportedCRS:wu(z_),Identifier:wu(z_),BoundingBox:wu(tT)})),QE=Pu(UE,{TopLeftCorner:wu(eT),ScaleDenominator:wu(G_),TileWidth:wu(B_),TileHeight:wu(B_),MatrixWidth:wu(B_),MatrixHeight:wu(B_)},Pu(zE,{Identifier:wu(z_)}));function tT(t,e){const i=Lu([],$E,t,e);if(2==i.length)return zt(i)}function eT(t,e){const i=z_(t).split(/\s+/);if(!i||2!=i.length)return;const n=+i[0],r=+i[1];return isNaN(n)||isNaN(r)?void 0:[n,r]}const iT=["fullscreenchange","webkitfullscreenchange","MSFullscreenChange"],nT="enterfullscreen",rT="leavefullscreen";function sT(t){const e=t.body;return!!(e.webkitRequestFullscreen||e.requestFullscreen&&t.fullscreenEnabled)}function oT(t){return!(!t.webkitIsFullScreen&&!t.fullscreenElement)}function aT(t){t.requestFullscreen?t.requestFullscreen():t.webkitRequestFullscreen&&t.webkitRequestFullscreen()}const lT="projection",hT="coordinateFormat";const cT=.75,uT=.1;const dT="units",gT=[1,2,5],fT=25.4/.28;const pT=0,mT=1;var _T={};return _T.AssertionError=e,_T.Collection=q,_T.Collection.CollectionEvent=K,_T.DataTile=ot,_T.Disposable=s,_T.Feature=lt,_T.Feature.createStyleFunction=ht,_T.Geolocation=class extends V{constructor(t){super(),this.on,this.once,this.un,t=t||{},this.position_=null,this.transform_=Gi,this.watchId_=void 0,this.addChangeListener(wr,this.handleProjectionChanged_),this.addChangeListener(Tr,this.handleTrackingChanged_),void 0!==t.projection&&this.setProjection(t.projection),void 0!==t.trackingOptions&&this.setTrackingOptions(t.trackingOptions),this.setTracking(void 0!==t.tracking&&t.tracking)}disposeInternal(){this.setTracking(!1),super.disposeInternal()}handleProjectionChanged_(){const t=this.getProjection();t&&(this.transform_=qi(Ui("EPSG:4326"),t),this.position_&&this.set(Sr,this.transform_(this.position_)))}handleTrackingChanged_(){if("geolocation"in navigator){const t=this.getTracking();t&&void 0===this.watchId_?this.watchId_=navigator.geolocation.watchPosition(this.positionChange_.bind(this),this.positionError_.bind(this),this.getTrackingOptions()):t||void 0===this.watchId_||(navigator.geolocation.clearWatch(this.watchId_),this.watchId_=void 0)}}positionChange_(t){const e=t.coords;this.set(mr,e.accuracy),this.set(yr,null===e.altitude?void 0:e.altitude),this.set(xr,null===e.altitudeAccuracy?void 0:e.altitudeAccuracy),this.set(vr,null===e.heading?void 0:ai(e.heading)),this.position_?(this.position_[0]=e.longitude,this.position_[1]=e.latitude):this.position_=[e.longitude,e.latitude];const i=this.transform_(this.position_);this.set(Sr,i),this.set(Er,null===e.speed?void 0:e.speed);const n=dr(this.position_,e.accuracy);n.applyTransform(this.transform_),this.set(_r,n),this.changed()}positionError_(t){this.dispatchEvent(new br(t))}getAccuracy(){return this.get(mr)}getAccuracyGeometry(){return this.get(_r)||null}getAltitude(){return this.get(yr)}getAltitudeAccuracy(){return this.get(xr)}getHeading(){return this.get(vr)}getPosition(){return this.get(Sr)}getProjection(){return this.get(wr)}getSpeed(){return this.get(Er)}getTracking(){return this.get(Tr)}getTrackingOptions(){return this.get(Cr)}setProjection(t){this.set(wr,Ui(t))}setTracking(t){this.set(Tr,t)}setTrackingOptions(t){this.set(Cr,t)}},_T.Image=Ar,_T.Image.listenImage=Or,_T.ImageBase=Rr,_T.ImageCanvas=Nr,_T.ImageTile=Vr,_T.Kinetic=Wr,_T.Map=Ya,_T.MapBrowserEvent=oo,_T.MapBrowserEventHandler=go,_T.MapEvent=so,_T.Object=V,_T.Object.ObjectEvent=X,_T.Observable=G,_T.Observable.unByKey=j,_T.Overlay=Qa,_T.Tile=st,_T.TileCache=ll,_T.TileQueue=Co,_T.TileQueue.getTilePriority=bo,_T.TileRange=hl,_T.TileRange.createOrUpdate=cl,_T.VectorRenderTile=dl,_T.VectorTile=gl,_T.View=zo,_T.View.createCenterConstraint=Vo,_T.View.createResolutionConstraint=Wo,_T.View.createRotationConstraint=Zo,_T.View.isNoopAnimation=Yo,_T.array={},_T.array.binarySearch=o,_T.array.equals=u,_T.array.extend=c,_T.array.isSorted=d,_T.array.linearFindNearest=l,_T.array.numberSafeCompareFunction=a,_T.array.remove=function(t,e){const i=t.indexOf(e),n=i>-1;return n&&t.splice(i,1),n},_T.array.reverseSubArray=h,_T.array.stableSort=function(t,e){const i=t.length,n=Array(t.length);let r;for(r=0;r<i;r++)n[r]={index:r,value:t[r]};for(n.sort((function(t,i){return e(t.value,i.value)||t.index-i.index})),r=0;r<t.length;r++)t[r]=n[r].value},_T.asserts={},_T.asserts.assert=at,_T.centerconstraint={},_T.centerconstraint.createExtent=Mo,_T.centerconstraint.none=Fo,_T.color={},_T.color.asArray=$r,_T.color.asString=Kr,_T.color.fromString=Hr,_T.color.isStringColor=ts,_T.color.normalize=Jr,_T.color.toString=Qr,_T.colorlike={},_T.colorlike.asColorLike=fl,_T.control={},_T.control.Attribution=Ho,_T.control.Control=qo,_T.control.FullScreen=class extends qo{constructor(t){t=t||{},super({element:document.createElement("div"),target:t.target}),this.on,this.once,this.un,this.keys_=void 0!==t.keys&&t.keys,this.source_=t.source,this.isInFullscreen_=!1,this.boundHandleMapTargetChange_=this.handleMapTargetChange_.bind(this),this.cssClassName_=void 0!==t.className?t.className:"ol-full-screen",this.documentListeners_=[],this.activeClassName_=void 0!==t.activeClassName?t.activeClassName.split(" "):[this.cssClassName_+"-true"],this.inactiveClassName_=void 0!==t.inactiveClassName?t.inactiveClassName.split(" "):[this.cssClassName_+"-false"];const e=void 0!==t.label?t.label:"⤢";this.labelNode_="string"==typeof e?document.createTextNode(e):e;const i=void 0!==t.labelActive?t.labelActive:"×";this.labelActiveNode_="string"==typeof i?document.createTextNode(i):i;const n=t.tipLabel?t.tipLabel:"Toggle full-screen";this.button_=document.createElement("button"),this.button_.title=n,this.button_.setAttribute("type","button"),this.button_.appendChild(this.labelNode_),this.button_.addEventListener(T,this.handleClick_.bind(this),!1),this.setClassName_(this.button_,this.isInFullscreen_),this.element.className=`${this.cssClassName_} ol-unselectable ol-control`,this.element.appendChild(this.button_)}handleClick_(t){t.preventDefault(),this.handleFullScreen_()}handleFullScreen_(){const t=this.getMap();if(!t)return;const e=t.getOwnerDocument();if(sT(e))if(oT(e))!function(t){t.exitFullscreen?t.exitFullscreen():t.webkitExitFullscreen&&t.webkitExitFullscreen()}(e);else{let i;i=this.source_?"string"==typeof this.source_?e.getElementById(this.source_):this.source_:t.getTargetElement(),this.keys_?function(t){t.webkitRequestFullscreen?t.webkitRequestFullscreen():aT(t)}(i):aT(i)}}handleFullScreenChange_(){const t=this.getMap();if(!t)return;const e=this.isInFullscreen_;this.isInFullscreen_=oT(t.getOwnerDocument()),e!==this.isInFullscreen_&&(this.setClassName_(this.button_,this.isInFullscreen_),this.isInFullscreen_?(Br(this.labelActiveNode_,this.labelNode_),this.dispatchEvent(nT)):(Br(this.labelNode_,this.labelActiveNode_),this.dispatchEvent(rT)),t.updateSize())}setClassName_(t,e){e?(t.classList.remove(...this.inactiveClassName_),t.classList.add(...this.activeClassName_)):(t.classList.remove(...this.activeClassName_),t.classList.add(...this.inactiveClassName_))}setMap(t){const e=this.getMap();e&&e.removeChangeListener(So,this.boundHandleMapTargetChange_),super.setMap(t),this.handleMapTargetChange_(),t&&t.addChangeListener(So,this.boundHandleMapTargetChange_)}handleMapTargetChange_(){const t=this.documentListeners_;for(let e=0,i=t.length;e<i;++e)k(t[e]);t.length=0;const e=this.getMap();if(e){const i=e.getOwnerDocument();sT(i)?this.element.classList.remove(Ps):this.element.classList.add(Ps);for(let e=0,n=iT.length;e<n;++e)t.push(N(i,iT[e],this.handleFullScreenChange_,this));this.handleFullScreenChange_()}}},_T.control.MousePosition=class extends qo{constructor(t){t=t||{};const e=document.createElement("div");e.className=void 0!==t.className?t.className:"ol-mouse-position",super({element:e,render:t.render,target:t.target}),this.on,this.once,this.un,this.addChangeListener(lT,this.handleProjectionChanged_),t.coordinateFormat&&this.setCoordinateFormat(t.coordinateFormat),t.projection&&this.setProjection(t.projection),this.renderOnMouseOut_=void 0!==t.placeholder,this.placeholder_=this.renderOnMouseOut_?t.placeholder:" ",this.renderedHTML_=e.innerHTML,this.mapProjection_=null,this.transform_=null}handleProjectionChanged_(){this.transform_=null}getCoordinateFormat(){return this.get(hT)}getProjection(){return this.get(lT)}handleMouseMove(t){const e=this.getMap();this.updateHTML_(e.getEventPixel(t))}handleMouseOut(t){this.updateHTML_(null)}setMap(t){if(super.setMap(t),t){const e=t.getViewport();this.listenerKeys.push(N(e,lo,this.handleMouseMove,this)),this.renderOnMouseOut_&&this.listenerKeys.push(N(e,uo,this.handleMouseOut,this)),this.updateHTML_(null)}}setCoordinateFormat(t){this.set(hT,t)}setProjection(t){this.set(lT,Ui(t))}updateHTML_(t){let e=this.placeholder_;if(t&&this.mapProjection_){if(!this.transform_){const t=this.getProjection();this.transform_=t?qi(this.mapProjection_,t):Gi}const i=this.getMap().getCoordinateFromPixelInternal(t);if(i){const t=en();t&&(this.transform_=qi(this.mapProjection_,t)),this.transform_(i,i);const n=this.getCoordinateFormat();e=n?n(i):i.toString()}}this.renderedHTML_&&e===this.renderedHTML_||(this.element.innerHTML=e,this.renderedHTML_=e)}render(t){const e=t.frameState;e?this.mapProjection_!=e.viewState.projection&&(this.mapProjection_=e.viewState.projection,this.transform_=null):this.mapProjection_=null}},_T.control.OverviewMap=class extends qo{constructor(t){t=t||{},super({element:document.createElement("div"),render:t.render,target:t.target}),this.boundHandleRotationChanged_=this.handleRotationChanged_.bind(this),this.collapsed_=void 0===t.collapsed||t.collapsed,this.collapsible_=void 0===t.collapsible||t.collapsible,this.collapsible_||(this.collapsed_=!1),this.rotateWithView_=void 0!==t.rotateWithView&&t.rotateWithView,this.viewExtent_=void 0;const e=void 0!==t.className?t.className:"ol-overviewmap",i=void 0!==t.tipLabel?t.tipLabel:"Overview map",n=void 0!==t.collapseLabel?t.collapseLabel:"‹";"string"==typeof n?(this.collapseLabel_=document.createElement("span"),this.collapseLabel_.textContent=n):this.collapseLabel_=n;const r=void 0!==t.label?t.label:"›";"string"==typeof r?(this.label_=document.createElement("span"),this.label_.textContent=r):this.label_=r;const s=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_,o=document.createElement("button");o.setAttribute("type","button"),o.title=i,o.appendChild(s),o.addEventListener(T,this.handleClick_.bind(this),!1),this.ovmapDiv_=document.createElement("div"),this.ovmapDiv_.className="ol-overviewmap-map",this.view_=t.view;const a=new Ya({view:t.view,controls:new q,interactions:new q});this.ovmap_=a,t.layers&&t.layers.forEach((function(t){a.addLayer(t)}));const l=document.createElement("div");l.className="ol-overviewmap-box",l.style.boxSizing="border-box",this.boxOverlay_=new Qa({position:[0,0],positioning:"center-center",element:l}),this.ovmap_.addOverlay(this.boxOverlay_);const h=e+" "+"ol-unselectable "+Is+(this.collapsed_&&this.collapsible_?" ol-collapsed":"")+(this.collapsible_?"":" ol-uncollapsible"),c=this.element;c.className=h,c.appendChild(this.ovmapDiv_),c.appendChild(o);const u=this,d=this.boxOverlay_,g=this.boxOverlay_.getElement(),f=function(t){const e={clientX:(i=t).clientX,clientY:i.clientY};var i;const n=a.getEventCoordinateInternal(e);d.setPosition(n)},p=function(t){const e=a.getEventCoordinateInternal(t);u.getMap().getView().setCenterInternal(e),window.removeEventListener("mousemove",f),window.removeEventListener("mouseup",p)};g.addEventListener("mousedown",(function(){window.addEventListener("mousemove",f),window.addEventListener("mouseup",p)}))}setMap(t){const e=this.getMap();if(t!==e){if(e){const t=e.getView();t&&this.unbindView_(t),this.ovmap_.setTarget(null)}if(super.setMap(t),t){this.ovmap_.setTarget(this.ovmapDiv_),this.listenerKeys.push(N(t,r,this.handleMapPropertyChange_,this));const e=t.getView();e&&(this.bindView_(e),e.isDef()&&(this.ovmap_.updateSize(),this.resetExtent_())),this.ovmap_.isRendered()||this.updateBoxAfterOvmapIsRendered_()}}}handleMapPropertyChange_(t){if(t.key===wo){const e=t.oldValue;e&&this.unbindView_(e);const i=this.getMap().getView();this.bindView_(i)}else this.ovmap_.isRendered()||t.key!==So&&t.key!==vo||this.ovmap_.updateSize()}bindView_(t){if(!this.view_){const e=new zo({projection:t.getProjection()});this.ovmap_.setView(e)}t.addChangeListener(Io.ROTATION,this.boundHandleRotationChanged_),this.handleRotationChanged_()}unbindView_(t){t.removeChangeListener(Io.ROTATION,this.boundHandleRotationChanged_)}handleRotationChanged_(){this.rotateWithView_&&this.ovmap_.getView().setRotation(this.getMap().getView().getRotation())}validateExtent_(){const t=this.getMap(),e=this.ovmap_;if(!t.isRendered()||!e.isRendered())return;const i=t.getSize(),n=t.getView().calculateExtentInternal(i);if(this.viewExtent_&&ee(n,this.viewExtent_))return;this.viewExtent_=n;const r=e.getSize(),s=e.getView().calculateExtentInternal(r),o=e.getPixelFromCoordinateInternal(xe(n)),a=e.getPixelFromCoordinateInternal(de(n)),l=Math.abs(o[0]-a[0]),h=Math.abs(o[1]-a[1]),c=r[0],u=r[1];l<c*uT||h<u*uT||l>c*cT||h>u*cT?this.resetExtent_():Yt(s,n)||this.recenter_()}resetExtent_(){const t=this.getMap(),e=this.ovmap_,i=t.getSize(),n=t.getView().calculateExtentInternal(i),r=e.getView(),s=Math.log(7.5)/Math.LN2;Ce(n,1/(Math.pow(2,s/2)*uT)),r.fitInternal(gr(n))}recenter_(){const t=this.getMap(),e=this.ovmap_,i=t.getView();e.getView().setCenterInternal(i.getCenterInternal())}updateBox_(){const t=this.getMap(),e=this.ovmap_;if(!t.isRendered()||!e.isRendered())return;const i=t.getSize(),n=t.getView(),r=e.getView(),s=this.rotateWithView_?0:-n.getRotation(),o=this.boxOverlay_,a=this.boxOverlay_.getElement(),l=n.getCenterInternal(),h=n.getResolution(),c=r.getResolution(),u=i[0]*h/c,d=i[1]*h/c;if(o.setPosition(l),a){a.style.width=u+"px",a.style.height=d+"px";const t="rotate("+s+"rad)";a.style.transform=t}}updateBoxAfterOvmapIsRendered_(){this.ovmapPostrenderKey_||(this.ovmapPostrenderKey_=D(this.ovmap_,fo,(function(t){delete this.ovmapPostrenderKey_,this.updateBox_()}),this))}handleClick_(t){t.preventDefault(),this.handleToggle_()}handleToggle_(){this.element.classList.toggle(Ls),this.collapsed_?Br(this.collapseLabel_,this.label_):Br(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_;const t=this.ovmap_;if(!this.collapsed_){if(t.isRendered())return this.viewExtent_=void 0,void t.render();t.updateSize(),this.resetExtent_(),this.updateBoxAfterOvmapIsRendered_()}}getCollapsible(){return this.collapsible_}setCollapsible(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),!t&&this.collapsed_&&this.handleToggle_())}setCollapsed(t){this.collapsible_&&this.collapsed_!==t&&this.handleToggle_()}getCollapsed(){return this.collapsed_}getRotateWithView(){return this.rotateWithView_}setRotateWithView(t){this.rotateWithView_!==t&&(this.rotateWithView_=t,0!==this.getMap().getView().getRotation()&&(this.rotateWithView_?this.handleRotationChanged_():this.ovmap_.getView().setRotation(0),this.viewExtent_=void 0,this.validateExtent_(),this.updateBox_()))}getOverviewMap(){return this.ovmap_}render(t){this.validateExtent_(),this.updateBox_()}},_T.control.Rotate=$o,_T.control.ScaleLine=class extends qo{constructor(t){t=t||{};const e=document.createElement("div");e.style.pointerEvents="none",super({element:e,render:t.render,target:t.target}),this.on,this.once,this.un;const i=void 0!==t.className?t.className:t.bar?"ol-scale-bar":"ol-scale-line";this.innerElement_=document.createElement("div"),this.innerElement_.className=i+"-inner",this.element.className=i+" "+Rs,this.element.appendChild(this.innerElement_),this.viewState_=null,this.minWidth_=void 0!==t.minWidth?t.minWidth:64,this.maxWidth_=t.maxWidth,this.renderedVisible_=!1,this.renderedWidth_=void 0,this.renderedHTML_="",this.addChangeListener(dT,this.handleUnitsChanged_),this.setUnits(t.units||"metric"),this.scaleBar_=t.bar||!1,this.scaleBarSteps_=t.steps||4,this.scaleBarText_=t.text||!1,this.dpi_=t.dpi||void 0}getUnits(){return this.get(dT)}handleUnitsChanged_(){this.updateElement_()}setUnits(t){this.set(dT,t)}setDpi(t){this.dpi_=t}updateElement_(){const t=this.viewState_;if(!t)return void(this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1));const e=t.center,i=t.projection,n=this.getUnits(),r="degrees"==n?"degrees":"m";let s=zi(i,t.resolution,e,r);const o=this.minWidth_*(this.dpi_||fT)/fT,a=void 0!==this.maxWidth_?this.maxWidth_*(this.dpi_||fT)/fT:void 0;let l=o*s,h="";if("degrees"==n){const t=Fe.degrees;l*=t,l<t/60?(h="″",s*=3600):l<t?(h="′",s*=60):h="°"}else"imperial"==n?l<.9144?(h="in",s/=.0254):l<1609.344?(h="ft",s/=.3048):(h="mi",s/=1609.344):"nautical"==n?(s/=1852,h="NM"):"metric"==n?l<.001?(h="μm",s*=1e6):l<1?(h="mm",s*=1e3):l<1e3?h="m":(h="km",s/=1e3):"us"==n?l<.9144?(h="in",s*=39.37):l<1609.344?(h="ft",s/=.30480061):(h="mi",s/=1609.3472):at(!1,33);let c,u,d,g,f,p,m=3*Math.floor(Math.log(o*s)/Math.log(10));while(!0){d=Math.floor(m/3);const t=Math.pow(10,d);if(c=gT[(m%3+3)%3]*t,u=Math.round(c/s),isNaN(u))return this.element.style.display="none",void(this.renderedVisible_=!1);if(void 0!==a&&u>=a){c=g,u=f,d=p;break}if(u>=o)break;g=c,f=u,p=d,++m}const _=this.scaleBar_?this.createScaleBar(u,c,h):c.toFixed(d<0?-d:0)+" "+h;this.renderedHTML_!=_&&(this.innerElement_.innerHTML=_,this.renderedHTML_=_),this.renderedWidth_!=u&&(this.innerElement_.style.width=u+"px",this.renderedWidth_=u),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}createScaleBar(t,e,i){const n=this.getScaleForResolution(),r=n<1?Math.round(1/n).toLocaleString()+" : 1":"1 : "+Math.round(n).toLocaleString(),s=this.scaleBarSteps_,o=t/s,a=[this.createMarker("absolute")];for(let n=0;n<s;++n){const r=n%2==0?"ol-scale-singlebar-odd":"ol-scale-singlebar-even";a.push(`<div><div class="ol-scale-singlebar ${r}" style="width: ${o}px;"></div>`+this.createMarker("relative")+(n%2==0||2===s?this.createStepText(n,t,!1,e,i):"")+"</div>")}a.push(this.createStepText(s,t,!0,e,i));return(this.scaleBarText_?`<div class="ol-scale-text" style="width: ${t}px;">`+r+"</div>":"")+a.join("")}createMarker(t){return`<div class="ol-scale-step-marker" style="position: ${t}; top: ${"absolute"===t?3:-10}px;"></div>`}createStepText(t,e,i,n,r){const s=(0===t?0:Math.round(n/this.scaleBarSteps_*t*100)/100)+(0===t?"":" "+r);return`<div class="ol-scale-step-text" style="margin-left: ${0===t?-3:e/this.scaleBarSteps_*-1}px;text-align: ${0===t?"left":"center"};min-width: ${0===t?0:e/this.scaleBarSteps_*2}px;left: ${i?e+"px":"unset"};">`+s+"</div>"}getScaleForResolution(){return zi(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,"m")*(1e3/25.4)*(this.dpi_||fT)}render(t){const e=t.frameState;this.viewState_=e?e.viewState:null,this.updateElement_()}},_T.control.Zoom=Jo,_T.control.ZoomSlider=class extends qo{constructor(t){t=t||{},super({element:document.createElement("div"),render:t.render}),this.dragListenerKeys_=[],this.currentResolution_=void 0,this.direction_=pT,this.dragging_,this.heightLimit_=0,this.widthLimit_=0,this.startX_,this.startY_,this.thumbSize_=null,this.sliderInitialized_=!1,this.duration_=void 0!==t.duration?t.duration:200;const e=void 0!==t.className?t.className:"ol-zoomslider",i=document.createElement("button");i.setAttribute("type","button"),i.className=e+"-thumb "+Rs;const r=this.element;r.className=e+" "+"ol-unselectable "+Is,r.appendChild(i),r.addEventListener(ho,this.handleDraggerStart_.bind(this),!1),r.addEventListener(lo,this.handleDraggerDrag_.bind(this),!1),r.addEventListener(co,this.handleDraggerEnd_.bind(this),!1),r.addEventListener(T,this.handleContainerClick_.bind(this),!1),i.addEventListener(T,n,!1)}setMap(t){super.setMap(t),t&&t.render()}initSlider_(){const t=this.element;let e=t.offsetWidth,i=t.offsetHeight;if(0===e&&0===i)return this.sliderInitialized_=!1;const n=getComputedStyle(t);e-=parseFloat(n.paddingRight)+parseFloat(n.paddingLeft),i-=parseFloat(n.paddingTop)+parseFloat(n.paddingBottom);const r=t.firstElementChild,s=getComputedStyle(r),o=r.offsetWidth+parseFloat(s.marginRight)+parseFloat(s.marginLeft),a=r.offsetHeight+parseFloat(s.marginTop)+parseFloat(s.marginBottom);return this.thumbSize_=[o,a],e>i?(this.direction_=mT,this.widthLimit_=e-o):(this.direction_=pT,this.heightLimit_=i-a),this.sliderInitialized_=!0}handleContainerClick_(t){const e=this.getMap().getView(),i=this.getRelativePosition_(t.offsetX-this.thumbSize_[0]/2,t.offsetY-this.thumbSize_[1]/2),n=this.getResolutionForPosition_(i),r=e.getConstrainedZoom(e.getZoomForResolution(n));e.animateInternal({zoom:r,duration:this.duration_,easing:it})}handleDraggerStart_(t){if(!this.dragging_&&t.target===this.element.firstElementChild){const e=this.element.firstElementChild;if(this.getMap().getView().beginInteraction(),this.startX_=t.clientX-parseFloat(e.style.left),this.startY_=t.clientY-parseFloat(e.style.top),this.dragging_=!0,0===this.dragListenerKeys_.length){const t=this.handleDraggerDrag_,e=this.handleDraggerEnd_,i=this.getMap().getOwnerDocument();this.dragListenerKeys_.push(N(i,lo,t,this),N(i,co,e,this))}}}handleDraggerDrag_(t){if(this.dragging_){const e=t.clientX-this.startX_,i=t.clientY-this.startY_,n=this.getRelativePosition_(e,i);this.currentResolution_=this.getResolutionForPosition_(n),this.getMap().getView().setResolution(this.currentResolution_)}}handleDraggerEnd_(t){if(this.dragging_){this.getMap().getView().endInteraction(),this.dragging_=!1,this.startX_=void 0,this.startY_=void 0,this.dragListenerKeys_.forEach(k),this.dragListenerKeys_.length=0}}setThumbPosition_(t){const e=this.getPositionForResolution_(t),i=this.element.firstElementChild;this.direction_==mT?i.style.left=this.widthLimit_*e+"px":i.style.top=this.heightLimit_*e+"px"}getRelativePosition_(t,e){let i;return i=this.direction_===mT?t/this.widthLimit_:e/this.heightLimit_,ii(i,0,1)}getResolutionForPosition_(t){return this.getMap().getView().getResolutionForValueFunction()(1-t)}getPositionForResolution_(t){return ii(1-this.getMap().getView().getValueForResolutionFunction()(t),0,1)}render(t){if(!t.frameState)return;if(!this.sliderInitialized_&&!this.initSlider_())return;const e=t.frameState.viewState.resolution;this.currentResolution_=e,this.setThumbPosition_(e)}},_T.control.ZoomToExtent=class extends qo{constructor(t){t=t||{},super({element:document.createElement("div"),target:t.target}),this.extent=t.extent?t.extent:null;const e=void 0!==t.className?t.className:"ol-zoom-extent",i=void 0!==t.label?t.label:"E",n=void 0!==t.tipLabel?t.tipLabel:"Fit to extent",r=document.createElement("button");r.setAttribute("type","button"),r.title=n,r.appendChild("string"==typeof i?document.createTextNode(i):i),r.addEventListener(T,this.handleClick_.bind(this),!1);const s=e+" "+"ol-unselectable "+Is,o=this.element;o.className=s,o.appendChild(r)}handleClick_(t){t.preventDefault(),this.handleZoomToExtent()}handleZoomToExtent(){const t=this.getMap().getView(),e=this.extent?this.extent:t.getProjection().getExtent();t.fitInternal(gr(e))}},_T.control.defaults={},_T.control.defaults.defaults=Qo,_T.coordinate={},_T.coordinate.add=mi,_T.coordinate.closestOnCircle=_i,_T.coordinate.closestOnSegment=yi,_T.coordinate.createStringXY=function(t){return function(e){return Ri(e,t)}},_T.coordinate.degreesToStringHDMS=xi,_T.coordinate.distance=Ci,_T.coordinate.equals=Si,_T.coordinate.format=vi,_T.coordinate.getWorldsAway=Ii,_T.coordinate.rotate=wi,_T.coordinate.scale=Ei,_T.coordinate.squaredDistance=Ti,_T.coordinate.squaredDistanceToSegment=bi,_T.coordinate.toStringHDMS=function(t,e){return t?xi("NS",t[1],e)+" "+xi("EW",t[0],e):""},_T.coordinate.toStringXY=Ri,_T.coordinate.wrapX=Pi,_T.css={},_T.css.CLASS_COLLAPSED=Ls,_T.css.CLASS_CONTROL=Is,_T.css.CLASS_HIDDEN=Cs,_T.css.CLASS_SELECTABLE=bs,_T.css.CLASS_UNSELECTABLE=Rs,_T.css.CLASS_UNSUPPORTED=Ps,_T.css.getFontParameters=As,_T.dom={},_T.dom.createCanvasContext2D=Dr,_T.dom.outerHeight=jr,_T.dom.outerWidth=Gr,_T.dom.releaseCanvas=kr,_T.dom.removeChildren=zr,_T.dom.removeNode=Ur,_T.dom.replaceChildren=Xr,_T.dom.replaceNode=Br,_T.easing={},_T.easing.easeIn=et,_T.easing.easeOut=it,_T.easing.inAndOut=nt,_T.easing.linear=rt,_T.easing.upAndDown=function(t){return t<.5?nt(2*t):1-nt(2*(t-.5))},_T.events={},_T.events.Event=i,_T.events.Event.preventDefault=function(t){t.preventDefault()},_T.events.Event.stopPropagation=n,_T.events.Target=v,_T.events.condition={},_T.events.condition.all=aa,_T.events.condition.altKeyOnly=la,_T.events.condition.altShiftKeysOnly=ha,_T.events.condition.always=da,_T.events.condition.click=function(t){return t.type==ao.CLICK},_T.events.condition.doubleClick=function(t){return t.type==ao.DBLCLICK},_T.events.condition.focus=ca,_T.events.condition.focusWithTabindex=ua,_T.events.condition.mouseActionButton=ga,_T.events.condition.mouseOnly=xa,_T.events.condition.never=fa,_T.events.condition.noModifierKeys=ma,_T.events.condition.penOnly=function(t){const e=t.originalEvent;return at(void 0!==e,56),"pen"===e.pointerType},_T.events.condition.platformModifierKeyOnly=function(t){const e=t.originalEvent;return!e.altKey&&(pt?e.metaKey:e.ctrlKey)&&!e.shiftKey},_T.events.condition.pointerMove=function(t){return"pointermove"==t.type},_T.events.condition.primaryAction=va,_T.events.condition.shiftKeyOnly=_a,_T.events.condition.singleClick=pa,_T.events.condition.targetNotEditable=ya,_T.events.condition.touchOnly=function(t){const e=t.originalEvent;return at(void 0!==e,56),"touch"===e.pointerType},_T.events.listen=N,_T.events.listenOnce=D,_T.events.unlistenByKey=k,_T.extent={},_T.extent.applyTransform=Re,_T.extent.approximatelyEquals=ie,_T.extent.boundingExtent=zt,_T.extent.buffer=Xt,_T.extent.clone=Vt,_T.extent.closestSquaredDistanceXY=Wt,_T.extent.containsCoordinate=Zt,_T.extent.containsExtent=Yt,_T.extent.containsXY=Kt,_T.extent.coordinateRelationship=qt,_T.extent.createEmpty=Ht,_T.extent.createOrUpdate=$t,_T.extent.createOrUpdateEmpty=Jt,_T.extent.createOrUpdateFromCoordinate=Qt,_T.extent.createOrUpdateFromCoordinates=function(t,e){return se(Jt(e),t)},_T.extent.createOrUpdateFromFlatCoordinates=te,_T.extent.createOrUpdateFromRings=function(t,e){return ae(Jt(e),t)},_T.extent.equals=ee,_T.extent.extend=ne,_T.extent.extendCoordinate=re,_T.extent.extendCoordinates=se,_T.extent.extendFlatCoordinates=oe,_T.extent.extendRings=ae,_T.extent.extendXY=le,_T.extent.forEachCorner=he,_T.extent.getArea=ce,_T.extent.getBottomLeft=ue,_T.extent.getBottomRight=de,_T.extent.getCenter=ge,_T.extent.getCorner=fe,_T.extent.getEnlargedArea=function(t,e){const i=Math.min(t[0],e[0]),n=Math.min(t[1],e[1]);return(Math.max(t[2],e[2])-i)*(Math.max(t[3],e[3])-n)},_T.extent.getForViewAndSize=pe,_T.extent.getHeight=_e,_T.extent.getIntersection=ye,_T.extent.getIntersectionArea=function(t,e){return ce(ye(t,e))},_T.extent.getMargin=function(t){return Se(t)+_e(t)},_T.extent.getRotatedViewport=me,_T.extent.getSize=function(t){return[t[2]-t[0],t[3]-t[1]]},_T.extent.getTopLeft=xe,_T.extent.getTopRight=ve,_T.extent.getWidth=Se,_T.extent.intersects=we,_T.extent.intersectsSegment=be,_T.extent.isEmpty=Ee,_T.extent.returnOrUpdate=Te,_T.extent.scaleFromCenter=Ce,_T.extent.wrapAndSliceX=Ie,_T.extent.wrapX=Pe,_T.featureloader={},_T.featureloader.loadFeaturesXhr=_l,_T.featureloader.setWithCredentials=function(t){ml=t},_T.featureloader.xhr=yl,_T.format={},_T.format.EsriJSON=class extends E_{constructor(t){t=t||{},super(),this.geometryName_=t.geometryName}readFeatureFromObject(t,e,i){const n=t,r=R_(n.geometry,e),s=new lt;if(this.geometryName_&&s.setGeometryName(this.geometryName_),s.setGeometry(r),n.attributes){s.setProperties(n.attributes,!0);const t=n.attributes[i];void 0!==t&&s.setId(t)}return s}readFeaturesFromObject(t,e){if(e=e||{},t.features){const i=[],n=t.features;for(let r=0,s=n.length;r<s;++r)i.push(this.readFeatureFromObject(n[r],e,t.objectIdFieldName));return i}return[this.readFeatureFromObject(t,e)]}readGeometryFromObject(t,e){return R_(t,e)}readProjectionFromObject(t){if(t.spatialReference&&void 0!==t.spatialReference.wkid){return Ui("EPSG:"+t.spatialReference.wkid)}return null}writeGeometryObject(t,e){return L_(t,this.adaptOptions(e))}writeFeatureObject(t,e){e=this.adaptOptions(e);const i={};if(!t.hasProperties())return i.attributes={},i;const n=t.getProperties(),r=t.getGeometry();if(r){i.geometry=L_(r,e);const s=e&&(e.dataProjection||e.featureProjection);s&&(i.geometry.spatialReference={wkid:Number(Ui(s).getCode().split(":").pop())}),delete n[t.getGeometryName()]}return x(n)?i.attributes={}:i.attributes=n,i}writeFeaturesObject(t,e){e=this.adaptOptions(e);const i=[];for(let n=0,r=t.length;n<r;++n)i.push(this.writeFeatureObject(t[n],e));return{features:i}}},_T.format.Feature=Jp,_T.format.Feature.transformExtentWithOptions=tm,_T.format.Feature.transformGeometryWithOptions=Qp,_T.format.GML=Q_,_T.format.GML2=H_,_T.format.GML3=J_,_T.format.GML32=ty,_T.format.GMLBase=O_,_T.format.GMLBase.GMLNS=F_,_T.format.GPX=class extends M_{constructor(t){super(),t=t||{},this.dataProjection=Ui("EPSG:4326"),this.readExtensions_=t.readExtensions}handleReadExtensions_(t){t||(t=[]);for(let e=0,i=t.length;e<i;++e){const i=t[e];if(this.readExtensions_){const t=i.get("extensionsNode_")||null;this.readExtensions_(i,t)}i.set("extensionsNode_",void 0)}}readFeatureFromNode(t,e){if(!ey.includes(t.namespaceURI))return null;const i=iy[t.localName];if(!i)return null;const n=i(t,[this.getReadOptions(t,e)]);return n?(this.handleReadExtensions_([n]),n):null}readFeaturesFromNode(t,e){if(!ey.includes(t.namespaceURI))return[];if("gpx"==t.localName){const i=Lu([],ny,t,[this.getReadOptions(t,e)]);return i?(this.handleReadExtensions_(i),i):[]}return[]}writeFeaturesNode(t,e){e=this.adaptOptions(e);const i=du("http://www.topografix.com/GPX/1/1","gpx");return i.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xsi",uu),i.setAttributeNS(uu,"xsi:schemaLocation","http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd"),i.setAttribute("version","1.1"),i.setAttribute("creator","OpenLayers"),Fu({node:i},sy,Ty,t,[e]),i}},_T.format.GeoJSON=class extends E_{constructor(t){t=t||{},super(),this.dataProjection=Ui(t.dataProjection?t.dataProjection:"EPSG:4326"),t.featureProjection&&(this.defaultFeatureProjection=Ui(t.featureProjection)),this.geometryName_=t.geometryName,this.extractGeometryName_=t.extractGeometryName,this.supportedMediaTypes=["application/geo+json","application/vnd.geo+json"]}readFeatureFromObject(t,e){let i=null;i="Feature"===t.type?t:{type:"Feature",geometry:t,properties:null};const n=Oy(i.geometry,e),r=new lt;return this.geometryName_?r.setGeometryName(this.geometryName_):this.extractGeometryName_&&"geometry_name"in i!==void 0&&r.setGeometryName(i.geometry_name),r.setGeometry(n),"id"in i&&r.setId(i.id),i.properties&&r.setProperties(i.properties,!0),r}readFeaturesFromObject(t,e){let i=null;if("FeatureCollection"===t.type){i=[];const n=t.features;for(let t=0,r=n.length;t<r;++t)i.push(this.readFeatureFromObject(n[t],e))}else i=[this.readFeatureFromObject(t,e)];return i}readGeometryFromObject(t,e){return Oy(t,e)}readProjectionFromObject(t){const e=t.crs;let i;return e?"name"==e.type?i=Ui(e.properties.name):"EPSG"===e.type?i=Ui("EPSG:"+e.properties.code):at(!1,36):i=this.dataProjection,i}writeFeatureObject(t,e){e=this.adaptOptions(e);const i={type:"Feature",geometry:null,properties:null},n=t.getId();if(void 0!==n&&(i.id=n),!t.hasProperties())return i;const r=t.getProperties(),s=t.getGeometry();return s&&(i.geometry=Ny(s,e),delete r[t.getGeometryName()]),x(r)||(i.properties=r),i}writeFeaturesObject(t,e){e=this.adaptOptions(e);const i=[];for(let n=0,r=t.length;n<r;++n)i.push(this.writeFeatureObject(t[n],e));return{type:"FeatureCollection",features:i}}writeGeometryObject(t,e){return Ny(t,this.adaptOptions(e))}},_T.format.IGC=class extends Dy{constructor(t){super(),t=t||{},this.dataProjection=Ui("EPSG:4326"),this.altitudeMode_=t.altitudeMode?t.altitudeMode:"none"}readFeatureFromText(t,e){const i=this.altitudeMode_,n=t.split(Uy),r={},s=[];let o,a,l=2e3,h=0,c=1,u=-1;for(o=0,a=n.length;o<a;++o){const t=n[o];let e;if("B"==t.charAt(0)){if(e=Gy.exec(t),e){const t=parseInt(e[1],10),n=parseInt(e[2],10),r=parseInt(e[3],10);let o=parseInt(e[4],10)+parseInt(e[5],10)/6e4;"S"==e[6]&&(o=-o);let a=parseInt(e[7],10)+parseInt(e[8],10)/6e4;if("W"==e[9]&&(a=-a),s.push(a,o),"none"!=i){let t;t="gps"==i?parseInt(e[11],10):"barometric"==i?parseInt(e[12],10):0,s.push(t)}let d=Date.UTC(l,h,c,t,n,r);d<u&&(d=Date.UTC(l,h,c+1,t,n,r)),s.push(d/1e3),u=d}}else"H"==t.charAt(0)&&(e=By.exec(t),e?(c=parseInt(e[1],10),h=parseInt(e[2],10)-1,l=2e3+parseInt(e[3],10)):(e=jy.exec(t),e&&(r[e[1]]=e[2].trim())))}if(0===s.length)return null;const d=new Op(s,"none"==i?"XYM":"XYZM"),g=new lt(Qp(d,!1,e));return g.setProperties(r,!0),g}readFeaturesFromText(t,e){const i=this.readFeatureFromText(t,e);return i?[i]:[]}},_T.format.IIIFInfo=class{constructor(t){this.setImageInfo(t)}setImageInfo(t){this.imageInfo="string"==typeof t?JSON.parse(t):t}getImageApiVersion(){if(void 0===this.imageInfo)return;let t=this.imageInfo["@context"]||"ol-no-context";"string"==typeof t&&(t=[t]);for(let e=0;e<t.length;e++)switch(t[e]){case"http://library.stanford.edu/iiif/image-api/1.1/context.json":case"http://iiif.io/api/image/1/context.json":return rc;case"http://iiif.io/api/image/2/context.json":return sc;case"http://iiif.io/api/image/3/context.json":return oc;case"ol-no-context":if(this.getComplianceLevelEntryFromProfile(rc)&&this.imageInfo.identifier)return rc}at(!1,61)}getComplianceLevelEntryFromProfile(t){if(void 0!==this.imageInfo&&void 0!==this.imageInfo.profile)switch(void 0===t&&(t=this.getImageApiVersion()),t){case rc:if(lc.test(this.imageInfo.profile))return this.imageInfo.profile;break;case oc:if(cc.test(this.imageInfo.profile))return this.imageInfo.profile;break;case sc:if("string"==typeof this.imageInfo.profile&&hc.test(this.imageInfo.profile))return this.imageInfo.profile;if(Array.isArray(this.imageInfo.profile)&&this.imageInfo.profile.length>0&&"string"==typeof this.imageInfo.profile[0]&&hc.test(this.imageInfo.profile[0]))return this.imageInfo.profile[0]}}getComplianceLevelFromProfile(t){const e=this.getComplianceLevelEntryFromProfile(t);if(void 0===e)return;const i=e.match(/level[0-2](?:\.json)?$/g);return Array.isArray(i)?i[0].replace(".json",""):void 0}getComplianceLevelSupportedFeatures(){if(void 0===this.imageInfo)return;const t=this.getImageApiVersion(),e=this.getComplianceLevelFromProfile(t);return void 0===e?ac.none.none:ac[t][e]}getTileSourceOptions(t){const e=t||{},i=this.getImageApiVersion();if(void 0===i)return;const n=void 0===i?void 0:uc[i](this);return void 0!==n?{url:n.url,version:i,size:[this.imageInfo.width,this.imageInfo.height],sizes:n.sizes,format:void 0!==e.format&&n.formats.includes(e.format)?e.format:void 0!==n.preferredFormat?n.preferredFormat:"jpg",supports:n.supports,quality:e.quality&&n.qualities.includes(e.quality)?e.quality:n.qualities.includes("native")?"native":"default",resolutions:Array.isArray(n.resolutions)?n.resolutions.sort((function(t,e){return e-t})):void 0,tileSize:n.tileSize}:void 0}},_T.format.JSONFeature=E_,_T.format.KML=class extends M_{constructor(t){super(),t=t||{},ux||($y=[255,255,255,1],nx=new rg({color:$y}),Jy=[20,2],Qy="pixels",tx="pixels",ex=[64,64],ix="https://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png",sx=new lg({anchor:Jy,anchorOrigin:"bottom-left",anchorXUnits:Qy,anchorYUnits:tx,crossOrigin:"anonymous",rotation:0,scale:dx(ex),size:ex,src:ix}),rx="NO_IMAGE",ax=new hg({color:$y,width:1}),ox=new hg({color:[51,51,51,1],width:2}),lx=new mg({font:"bold 16px Helvetica",fill:nx,stroke:ox,scale:.8}),hx=new cg({fill:nx,image:sx,text:lx,stroke:ax,zIndex:0}),ux=[hx]),this.dataProjection=Ui("EPSG:4326"),this.defaultStyle_=t.defaultStyle?t.defaultStyle:ux,this.extractStyles_=void 0===t.extractStyles||t.extractStyles,this.writeStyles_=void 0===t.writeStyles||t.writeStyles,this.sharedStyles_={},this.showPointNames_=void 0===t.showPointNames||t.showPointNames,this.crossOrigin_=void 0!==t.crossOrigin?t.crossOrigin:"anonymous",this.iconUrlFunction_=t.iconUrlFunction?t.iconUrlFunction:gx,this.supportedMediaTypes=["application/vnd.google-earth.kml+xml"]}readDocumentOrFolder_(t,e){const i=Lu([],Pu(Xy,{Document:yu(this.readDocumentOrFolder_,this),Folder:yu(this.readDocumentOrFolder_,this),Placemark:xu(this.readPlacemark_,this),Style:this.readSharedStyle_.bind(this),StyleMap:this.readSharedStyleMap_.bind(this)}),t,e,this);return i||void 0}readPlacemark_(t,e){const i=Lu({geometry:null},Wy,t,e,this);if(!i)return;const n=new lt,r=t.getAttribute("id");null!==r&&n.setId(r);const s=e[0],o=i.geometry;if(o&&Qp(o,!1,s),n.setGeometry(o),delete i.geometry,this.extractStyles_){const t=function(t,e,i,n,r){return function(s,o){let a=r,l="",h=[];if(a){const t=s.getGeometry();if(t)if(t instanceof Ip)h=t.getGeometriesArrayRecursive().filter((function(t){const e=t.getType();return"Point"===e||"MultiPoint"===e})),a=h.length>0;else{const e=t.getType();a="Point"===e||"MultiPoint"===e}}a&&(l=s.get("name"),a=a&&!!l,a&&/&[^&]+;/.test(l)&&(cx||(cx=document.createElement("textarea")),cx.innerHTML=l,l=cx.value));let c=i;if(t?c=t:e&&(c=fx(e,i,n)),a){const t=function(t,e){const i=[0,0];let n="start";const r=t.getImage();if(r){const t=r.getSize();if(t&&2==t.length){const e=r.getScaleArray(),s=r.getAnchor();i[0]=e[0]*(t[0]-s[0]),i[1]=e[1]*(t[1]/2-s[1]),n="left"}}let s=t.getText();s?(s=s.clone(),s.setFont(s.getFont()||lx.getFont()),s.setScale(s.getScale()||lx.getScale()),s.setFill(s.getFill()||lx.getFill()),s.setStroke(s.getStroke()||ox)):s=lx.clone();s.setText(e),s.setOffsetX(i[0]),s.setOffsetY(i[1]),s.setTextAlign(n);return new cg({image:r,text:s})}(c[0],l);if(h.length>0){t.setGeometry(new Ip(h));return[t,new cg({geometry:c[0].getGeometry(),image:null,fill:c[0].getFill(),stroke:c[0].getStroke(),text:null})].concat(c.slice(1))}return t}return c}}(i.Style,i.styleUrl,this.defaultStyle_,this.sharedStyles_,this.showPointNames_);n.setStyle(t)}return delete i.Style,n.setProperties(i,!0),n}readSharedStyle_(t,e){const i=t.getAttribute("id");if(null!==i){const n=Xx.call(this,t,e);if(n){let e,r=t.baseURI;if(r&&"about:blank"!=r||(r=window.location.href),r){e=new URL("#"+i,r).href}else e="#"+i;this.sharedStyles_[e]=n}}}readSharedStyleMap_(t,e){const i=t.getAttribute("id");if(null===i)return;const n=Sx.call(this,t,e);if(!n)return;let r,s=t.baseURI;if(s&&"about:blank"!=s||(s=window.location.href),s){r=new URL("#"+i,s).href}else r="#"+i;this.sharedStyles_[r]=n}readFeatureFromNode(t,e){if(!Xy.includes(t.namespaceURI))return null;const i=this.readPlacemark_(t,[this.getReadOptions(t,e)]);return i||null}readFeaturesFromNode(t,e){if(!Xy.includes(t.namespaceURI))return[];let i;const n=t.localName;if("Document"==n||"Folder"==n)return i=this.readDocumentOrFolder_(t,[this.getReadOptions(t,e)]),i||[];if("Placemark"==n){const i=this.readPlacemark_(t,[this.getReadOptions(t,e)]);return i?[i]:[]}if("kml"==n){i=[];for(let n=t.firstElementChild;n;n=n.nextElementSibling){const t=this.readFeaturesFromNode(n,e);t&&c(i,t)}return i}return[]}readName(t){if(t){if("string"==typeof t){const e=_u(t);return this.readNameFromDocument(e)}return pu(t)?this.readNameFromDocument(t):this.readNameFromNode(t)}}readNameFromDocument(t){for(let e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE){const t=this.readNameFromNode(e);if(t)return t}}readNameFromNode(t){for(let e=t.firstElementChild;e;e=e.nextElementSibling)if(Xy.includes(e.namespaceURI)&&"name"==e.localName)return z_(e);for(let e=t.firstElementChild;e;e=e.nextElementSibling){const t=e.localName;if(Xy.includes(e.namespaceURI)&&("Document"==t||"Folder"==t||"Placemark"==t||"kml"==t)){const t=this.readNameFromNode(e);if(t)return t}}}readNetworkLinks(t){const e=[];if("string"==typeof t){const i=_u(t);c(e,this.readNetworkLinksFromDocument(i))}else pu(t)?c(e,this.readNetworkLinksFromDocument(t)):c(e,this.readNetworkLinksFromNode(t));return e}readNetworkLinksFromDocument(t){const e=[];for(let i=t.firstChild;i;i=i.nextSibling)i.nodeType==Node.ELEMENT_NODE&&c(e,this.readNetworkLinksFromNode(i));return e}readNetworkLinksFromNode(t){const e=[];for(let i=t.firstElementChild;i;i=i.nextElementSibling)if(Xy.includes(i.namespaceURI)&&"NetworkLink"==i.localName){const t=Lu({},Zy,i,[]);e.push(t)}for(let i=t.firstElementChild;i;i=i.nextElementSibling){const t=i.localName;!Xy.includes(i.namespaceURI)||"Document"!=t&&"Folder"!=t&&"kml"!=t||c(e,this.readNetworkLinksFromNode(i))}return e}readRegion(t){const e=[];if("string"==typeof t){const i=_u(t);c(e,this.readRegionFromDocument(i))}else pu(t)?c(e,this.readRegionFromDocument(t)):c(e,this.readRegionFromNode(t));return e}readRegionFromDocument(t){const e=[];for(let i=t.firstChild;i;i=i.nextSibling)i.nodeType==Node.ELEMENT_NODE&&c(e,this.readRegionFromNode(i));return e}readRegionFromNode(t){const e=[];for(let i=t.firstElementChild;i;i=i.nextElementSibling)if(Xy.includes(i.namespaceURI)&&"Region"==i.localName){const t=Lu({},Ky,i,[]);e.push(t)}for(let i=t.firstElementChild;i;i=i.nextElementSibling){const t=i.localName;!Xy.includes(i.namespaceURI)||"Document"!=t&&"Folder"!=t&&"kml"!=t||c(e,this.readRegionFromNode(i))}return e}writeFeaturesNode(t,e){e=this.adaptOptions(e);const i=du(Xy[4],"kml"),n="http://www.w3.org/2000/xmlns/";i.setAttributeNS(n,"xmlns:gx",zy[0]),i.setAttributeNS(n,"xmlns:xsi",uu),i.setAttributeNS(uu,"xsi:schemaLocation","http://www.opengis.net/kml/2.2 https://developers.google.com/kml/schema/kml22gx.xsd");const r={node:i},s={};t.length>1?s.Document=t:1==t.length&&(s.Placemark=t[0]);const o=qy[i.namespaceURI],a=Ru(s,o);return Fu(r,Hy,bu,a,[e],o,this),i}},_T.format.KML.getDefaultFillStyle=function(){return nx},_T.format.KML.getDefaultImageStyle=function(){return sx},_T.format.KML.getDefaultStrokeStyle=function(){return ax},_T.format.KML.getDefaultStyle=function(){return hx},_T.format.KML.getDefaultStyleArray=function(){return ux},_T.format.KML.getDefaultTextStyle=function(){return lx},_T.format.KML.readFlatCoordinates=mx,_T.format.MVT=Em,_T.format.OSMXML=class extends M_{constructor(){super(),this.dataProjection=Ui("EPSG:4326")}readFeaturesFromNode(t,e){if(e=this.getReadOptions(t,e),"osm"==t.localName){const i=Lu({nodes:{},ways:[],features:[]},Xv,t,[e]);for(let t=0;t<i.ways.length;t++){const n=i.ways[t],r=[];for(let t=0,e=n.ndrefs.length;t<e;t++){c(r,i.nodes[n.ndrefs[t]])}let s;s=n.ndrefs[0]==n.ndrefs[n.ndrefs.length-1]?new ur(r,"XY",[r.length]):new Op(r,"XY"),Qp(s,!1,e);const o=new lt(s);void 0!==n.id&&o.setId(n.id),o.setProperties(n.tags,!0),i.features.push(o)}if(i.features)return i.features}return[]}},_T.format.OWS=Hv,_T.format.Polyline=class extends Dy{constructor(t){super(),t=t||{},this.dataProjection=Ui("EPSG:4326"),this.factor_=t.factor?t.factor:1e5,this.geometryLayout_=t.geometryLayout?t.geometryLayout:"XY"}readFeatureFromText(t,e){const i=this.readGeometryFromText(t,e);return new lt(i)}readFeaturesFromText(t,e){return[this.readFeatureFromText(t,e)]}readGeometryFromText(t,e){const i=yn(this.geometryLayout_),n=uS(t,i,this.factor_);w_(n,0,n.length,i,n);const r=Gn(n,0,n.length,i);return Qp(new Op(r,this.geometryLayout_),!1,this.adaptOptions(e))}writeFeatureText(t,e){const i=t.getGeometry();return i?this.writeGeometryText(i,e):(at(!1,40),"")}writeFeaturesText(t,e){return this.writeFeatureText(t[0],e)}writeGeometryText(t,e){const i=(t=Qp(t,!0,this.adaptOptions(e))).getFlatCoordinates(),n=t.getStride();return w_(i,0,i.length,n,i),cS(i,n,this.factor_)}},_T.format.Polyline.decodeDeltas=uS,_T.format.Polyline.decodeFloats=gS,_T.format.Polyline.decodeSignedIntegers=pS,_T.format.Polyline.decodeUnsignedIntegers=_S,_T.format.Polyline.encodeDeltas=cS,_T.format.Polyline.encodeFloats=dS,_T.format.Polyline.encodeSignedIntegers=fS,_T.format.Polyline.encodeUnsignedInteger=yS,_T.format.Polyline.encodeUnsignedIntegers=mS,_T.format.TextFeature=Dy,_T.format.TopoJSON=class extends E_{constructor(t){super(),t=t||{},this.layerName_=t.layerName,this.layers_=t.layers?t.layers:null,this.dataProjection=Ui(t.dataProjection?t.dataProjection:"EPSG:4326")}readFeaturesFromObject(t,e){if("Topology"==t.type){const i=t;let n,r=null,s=null;i.transform&&(n=i.transform,r=n.scale,s=n.translate);const o=i.arcs;n&&function(t,e,i){for(let n=0,r=t.length;n<r;++n)ES(t[n],e,i)}(o,r,s);const a=[],l=i.objects,h=this.layerName_;let c;for(const t in l)this.layers_&&!this.layers_.includes(t)||("GeometryCollection"===l[t].type?(c=l[t],a.push.apply(a,SS(c,o,r,s,h,t,e))):(c=l[t],a.push(wS(c,o,r,s,h,t,e))));return a}return[]}readProjectionFromObject(t){return this.dataProjection}},_T.format.WFS=class extends M_{constructor(t){super(),t=t||{},this.version_=t.version?t.version:"1.1.0",this.featureType_=t.featureType,this.featureNS_=t.featureNS,this.gmlFormat_=t.gmlFormat?t.gmlFormat:new hw[this.version_],this.schemaLocation_=t.schemaLocation?t.schemaLocation:lw[this.version_]}getFeatureType(){return this.featureType_}setFeatureType(t){this.featureType_=t}readFeaturesFromNode(t,e){const i={node:t};Object.assign(i,{featureType:this.featureType_,featureNS:this.featureNS_}),Object.assign(i,this.getReadOptions(t,e||{}));const n=[i];let r;r="2.0.0"===this.version_?JS:this.gmlFormat_.FEATURE_COLLECTION_PARSERS;let s=Lu([],r,t,n,this.gmlFormat_);return s||(s=[]),s}readTransactionResponse(t){if(t){if("string"==typeof t){const e=_u(t);return this.readTransactionResponseFromDocument(e)}return pu(t)?this.readTransactionResponseFromDocument(t):this.readTransactionResponseFromNode(t)}}readFeatureCollectionMetadata(t){if(t){if("string"==typeof t){const e=_u(t);return this.readFeatureCollectionMetadataFromDocument(e)}return pu(t)?this.readFeatureCollectionMetadataFromDocument(t):this.readFeatureCollectionMetadataFromNode(t)}}readFeatureCollectionMetadataFromDocument(t){for(let e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readFeatureCollectionMetadataFromNode(e)}readFeatureCollectionMetadataFromNode(t){const e={},i=U_(t.getAttribute("numberOfFeatures"));return e.numberOfFeatures=i,Lu(e,JS,t,[],this.gmlFormat_)}readTransactionResponseFromDocument(t){for(let e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readTransactionResponseFromNode(e)}readTransactionResponseFromNode(t){return Lu({},tw,t,[])}writeGetFeature(t){const e=du(ow[this.version_],"GetFeature");e.setAttribute("service","WFS"),e.setAttribute("version",this.version_),t.handle&&e.setAttribute("handle",t.handle),t.outputFormat&&e.setAttribute("outputFormat",t.outputFormat),void 0!==t.maxFeatures&&e.setAttribute("maxFeatures",String(t.maxFeatures)),t.resultType&&e.setAttribute("resultType",t.resultType),void 0!==t.startIndex&&e.setAttribute("startIndex",String(t.startIndex)),void 0!==t.count&&e.setAttribute("count",String(t.count)),void 0!==t.viewParams&&e.setAttribute("viewParams",t.viewParams),e.setAttributeNS(uu,"xsi:schemaLocation",this.schemaLocation_);const i={node:e};if(Object.assign(i,{version:this.version_,srsName:t.srsName,featureNS:t.featureNS?t.featureNS:this.featureNS_,featurePrefix:t.featurePrefix,propertyNames:t.propertyNames?t.propertyNames:[]}),at(Array.isArray(t.featureTypes),11),"string"==typeof t.featureTypes[0]){let n=t.filter;t.bbox&&(at(t.geometryName,12),n=this.combineBboxAndFilter(t.geometryName,t.bbox,t.srsName,n)),Object.assign(i,{geometryName:t.geometryName,filter:n}),Bw(e,t.featureTypes,[i])}else t.featureTypes.forEach((n=>{const r=this.combineBboxAndFilter(n.geometryName,n.bbox,t.srsName,t.filter);Object.assign(i,{geometryName:n.geometryName,filter:r}),Bw(e,[n.name],[i])}));return e}combineBboxAndFilter(t,e,i,n){const r=$S(t,e,i);return n?HS(n,r):r}writeTransaction(t,e,i,n){const r=[],s=n.version?n.version:this.version_,o=du(ow[s],"Transaction");let a;o.setAttribute("service","WFS"),o.setAttribute("version",s),n&&(a=n.gmlOptions?n.gmlOptions:{},n.handle&&o.setAttribute("handle",n.handle)),o.setAttributeNS(uu,"xsi:schemaLocation",lw[s]);const l=function(t,e,i,n){const r=n.featurePrefix?n.featurePrefix:nw;let s;"1.0.0"===i?s=2:"1.1.0"===i?s=3:"2.0.0"===i&&(s=3.2);return Object.assign({node:t},{version:i,featureNS:n.featureNS,featureType:n.featureType,featurePrefix:r,gmlVersion:s,hasZ:n.hasZ,srsName:n.srsName},e)}(o,a,s,n);return t&&cw("Insert",t,r,l),e&&cw("Update",e,r,l),i&&cw("Delete",i,r,l),n.nativeElements&&cw("Native",n.nativeElements,r,l),o}readProjectionFromDocument(t){for(let e=t.firstChild;e;e=e.nextSibling)if(e.nodeType==Node.ELEMENT_NODE)return this.readProjectionFromNode(e);return null}readProjectionFromNode(t){if(t.firstElementChild&&t.firstElementChild.firstElementChild)for(let e=(t=t.firstElementChild.firstElementChild).firstElementChild;e;e=e.nextElementSibling)if(0!==e.childNodes.length&&(1!==e.childNodes.length||3!==e.firstChild.nodeType)){const t=[{}];return this.gmlFormat_.readGeometryElement(e,t),Ui(t.pop().srsName)}return null}},_T.format.WFS.writeFilter=function(t,e){const i=du(Uw(e=e||"1.1.0"),"Filter"),n={node:i};return Object.assign(n,{version:e,filter:t}),Cw(i,t,[n]),i},_T.format.WKB=class extends Jp{constructor(t){super(),t=t||{},this.splitCollection=Boolean(t.splitCollection),this.viewCache_=null,this.hex_=!1!==t.hex,this.littleEndian_=!1!==t.littleEndian,this.ewkb_=!1!==t.ewkb,this.layout_=t.geometryLayout,this.nodataZ_=t.nodataZ||0,this.nodataM_=t.nodataM||0,this.srid_=t.srid}getType(){return this.hex_?"text":"arraybuffer"}readFeature(t,e){return new lt({geometry:this.readGeometry(t,e)})}readFeatures(t,e){let i=[];const n=this.readGeometry(t,e);return i=this.splitCollection&&n instanceof Ip?n.getGeometriesArray():[n],i.map((t=>new lt({geometry:t})))}readGeometry(t,e){const i=tE(t);if(!i)return null;const n=new Jw(i).readGeometry();return this.viewCache_=i,e=this.getReadOptions(t,e),this.viewCache_=null,Qp(n,!1,e)}readProjection(t){const e=this.viewCache_||tE(t);if(!e)return;const i=new Jw(e);return i.readWkbHeader(),i.getSrid()&&Ui("EPSG:"+i.getSrid())||void 0}writeFeature(t,e){return this.writeGeometry(t.getGeometry(),e)}writeFeatures(t,e){return this.writeGeometry(new Ip(t.map((t=>t.getGeometry()))),e)}writeGeometry(t,e){e=this.adaptOptions(e);const i=new Qw({layout:this.layout_,littleEndian:this.littleEndian_,ewkb:this.ewkb_,nodata:{Z:this.nodataZ_,M:this.nodataM_}});let n=Number.isInteger(this.srid_)?Number(this.srid_):null;if(!1!==this.srid_&&!Number.isInteger(this.srid_)){const t=e.dataProjection&&Ui(e.dataProjection);if(t){const e=t.getCode();e.startsWith("EPSG:")&&(n=Number(e.substring(5)))}}i.writeGeometry(Qp(t,!0,e),n);const r=i.getBuffer();return this.hex_?function(t){const e=new Uint8Array(t);return Array.from(e.values()).map((t=>(t<16?"0":"")+Number(t).toString(16).toUpperCase())).join("")}(r):r}},_T.format.WKT=class extends Dy{constructor(t){super(),t=t||{},this.splitCollection_=void 0!==t.splitCollection&&t.splitCollection}parse_(t){const e=new uE(t);return new dE(e).parse()}readFeatureFromText(t,e){const i=this.readGeometryFromText(t,e),n=new lt;return n.setGeometry(i),n}readFeaturesFromText(t,e){let i=[];const n=this.readGeometryFromText(t,e);i=this.splitCollection_&&"GeometryCollection"==n.getType()?n.getGeometriesArray():[n];const r=[];for(let t=0,e=i.length;t<e;++t){const e=new lt;e.setGeometry(i[t]),r.push(e)}return r}readGeometryFromText(t,e){return Qp(this.parse_(t),!1,e)}writeFeatureText(t,e){const i=t.getGeometry();return i?this.writeGeometryText(i,e):""}writeFeaturesText(t,e){if(1==t.length)return this.writeFeatureText(t[0],e);const i=[];for(let e=0,n=t.length;e<n;++e)i.push(t[e].getGeometry());const n=new Ip(i);return this.writeGeometryText(n,e)}writeGeometryText(t,e){return _E(Qp(t,!0,e))}},_T.format.WMSCapabilities=class extends Zv{constructor(){super(),this.version=void 0}readFromNode(t){this.version=t.getAttribute("version").trim();const e=Lu({version:this.version},xE,t,[]);return e||null}},_T.format.WMSGetFeatureInfo=class extends M_{constructor(t){super(),t=t||{},this.featureNS_="http://mapserver.gis.umn.edu/mapserver",this.gmlFormat_=new H_,this.layers_=t.layers?t.layers:null}getLayers(){return this.layers_}setLayers(t){this.layers_=t}readFeatures_(t,e){t.setAttribute("namespaceURI",this.featureNS_);const i=t.localName;let n=[];if(0===t.childNodes.length)return n;if("msGMLOutput"==i)for(let i=0,r=t.childNodes.length;i<r;i++){const r=t.childNodes[i];if(r.nodeType!==Node.ELEMENT_NODE)continue;const s=r,o=e[0],a="_layer",l=s.localName.replace(a,"");if(this.layers_&&!this.layers_.includes(l))continue;const h=l+"_feature";o.featureType=h,o.featureNS=this.featureNS_;const u={};u[h]=xu(this.gmlFormat_.readFeatureElement,this.gmlFormat_);const d=Pu([o.featureNS,null],u);s.setAttribute("namespaceURI",this.featureNS_);const g=Lu([],d,s,e,this.gmlFormat_);g&&c(n,g)}if("FeatureCollection"==i){const e=Lu([],this.gmlFormat_.FEATURE_COLLECTION_PARSERS,t,[{}],this.gmlFormat_);e&&(n=e)}return n}readFeaturesFromNode(t,e){const i={};return e&&Object.assign(i,this.getReadOptions(t,e)),this.readFeatures_(t,[i])}},_T.format.WMTSCapabilities=class extends Zv{constructor(){super(),this.owsParser_=new Hv}readFromNode(t){let e=t.getAttribute("version");e&&(e=e.trim());let i=this.owsParser_.readFromNode(t);return i?(i.version=e,i=Lu(i,XE,t,[]),i||null):null}},_T.format.XML=Zv,_T.format.XMLFeature=M_,_T.format.filter={},_T.format.filter.And=RS,_T.format.filter.Bbox=PS,_T.format.filter.Comparison=AS,_T.format.filter.ComparisonBinary=NS,_T.format.filter.Contains=LS,_T.format.filter.DWithin=MS,_T.format.filter.Disjoint=FS,_T.format.filter.During=OS,_T.format.filter.EqualTo=DS,_T.format.filter.Filter=CS,_T.format.filter.GreaterThan=kS,_T.format.filter.GreaterThanOrEqualTo=GS,_T.format.filter.Intersects=jS,_T.format.filter.IsBetween=BS,_T.format.filter.IsLike=US,_T.format.filter.IsNull=zS,_T.format.filter.LessThan=XS,_T.format.filter.LessThanOrEqualTo=VS,_T.format.filter.LogicalNary=bS,_T.format.filter.Not=WS,_T.format.filter.NotEqualTo=ZS,_T.format.filter.Or=YS,_T.format.filter.ResourceId=KS,_T.format.filter.Spatial=IS,_T.format.filter.Within=qS,_T.format.filter.and=HS,_T.format.filter.bbox=$S,_T.format.filter.between=function(t,e,i){return new BS(t,e,i)},_T.format.filter.contains=function(t,e,i){return new LS(t,e,i)},_T.format.filter.disjoint=function(t,e,i){return new FS(t,e,i)},_T.format.filter.during=function(t,e,i){return new OS(t,e,i)},_T.format.filter.dwithin=function(t,e,i,n,r){return new MS(t,e,i,n,r)},_T.format.filter.equalTo=function(t,e,i){return new DS(t,e,i)},_T.format.filter.greaterThan=function(t,e){return new kS(t,e)},_T.format.filter.greaterThanOrEqualTo=function(t,e){return new GS(t,e)},_T.format.filter.intersects=function(t,e,i){return new jS(t,e,i)},_T.format.filter.isNull=function(t){return new zS(t)},_T.format.filter.lessThan=function(t,e){return new XS(t,e)},_T.format.filter.lessThanOrEqualTo=function(t,e){return new VS(t,e)},_T.format.filter.like=function(t,e,i,n,r,s){return new US(t,e,i,n,r,s)},_T.format.filter.not=function(t){return new WS(t)},_T.format.filter.notEqualTo=function(t,e,i){return new ZS(t,e,i)},_T.format.filter.or=function(t){const e=[null].concat(Array.prototype.slice.call(arguments));return new(Function.prototype.bind.apply(YS,e))},_T.format.filter.resourceId=function(t){return new KS(t)},_T.format.filter.within=function(t,e,i){return new qS(t,e,i)},_T.format.xlink={},_T.format.xlink.readHref=Yv,_T.format.xsd={},_T.format.xsd.readBoolean=N_,_T.format.xsd.readBooleanString=D_,_T.format.xsd.readDateTime=k_,_T.format.xsd.readDecimal=G_,_T.format.xsd.readDecimalString=j_,_T.format.xsd.readNonNegativeIntegerString=U_,_T.format.xsd.readPositiveInteger=B_,_T.format.xsd.readString=z_,_T.format.xsd.writeBooleanTextNode=X_,_T.format.xsd.writeCDATASection=V_,_T.format.xsd.writeDateTimeTextNode=W_,_T.format.xsd.writeDecimalTextNode=Z_,_T.format.xsd.writeNonNegativeIntegerTextNode=Y_,_T.format.xsd.writeStringTextNode=K_,_T.functions={},_T.functions.FALSE=f,_T.functions.TRUE=g,_T.functions.VOID=p,_T.functions.memoizeOne=m,_T.functions.toPromise=_,_T.geom={},_T.geom.Circle=Pp,_T.geom.Geometry=mn,_T.geom.GeometryCollection=Ip,_T.geom.LineString=Op,_T.geom.LinearRing=Vn,_T.geom.MultiLineString=Np,_T.geom.MultiPoint=Dp,_T.geom.MultiPolygon=Gp,_T.geom.Point=Wn,_T.geom.Polygon=ur,_T.geom.Polygon.circular=dr,_T.geom.Polygon.fromCircle=fr,_T.geom.Polygon.fromExtent=gr,_T.geom.Polygon.makeRegular=pr,_T.geom.SimpleGeometry=_n,_T.geom.SimpleGeometry.getStrideForLayout=yn,_T.geom.SimpleGeometry.transformGeom2D=xn,_T.geom.flat={},_T.geom.flat.area={},_T.geom.flat.area.linearRing=Un,_T.geom.flat.area.linearRings=zn,_T.geom.flat.area.linearRingss=Xn,_T.geom.flat.center={},_T.geom.flat.center.linearRingss=kp,_T.geom.flat.closest={},_T.geom.flat.closest.arrayMaxSquaredDelta=wn,_T.geom.flat.closest.assignClosestArrayPoint=Cn,_T.geom.flat.closest.assignClosestMultiArrayPoint=bn,_T.geom.flat.closest.assignClosestPoint=Tn,_T.geom.flat.closest.maxSquaredDelta=Sn,_T.geom.flat.closest.multiArrayMaxSquaredDelta=En,_T.geom.flat.contains={},_T.geom.flat.contains.linearRingContainsExtent=Zn,_T.geom.flat.contains.linearRingContainsXY=Yn,_T.geom.flat.contains.linearRingsContainsXY=Kn,_T.geom.flat.contains.linearRingssContainsXY=qn,_T.geom.flat.deflate={},_T.geom.flat.deflate.deflateCoordinate=Rn,_T.geom.flat.deflate.deflateCoordinates=Pn,_T.geom.flat.deflate.deflateCoordinatesArray=In,_T.geom.flat.deflate.deflateMultiCoordinatesArray=Ln,_T.geom.flat.flip={},_T.geom.flat.flip.flipXY=w_,_T.geom.flat.geodesic={},_T.geom.flat.geodesic.greatCircleArc=function(t,e,i,n,r,s){const o=Ui("EPSG:4326"),a=Math.cos(ai(e)),l=Math.sin(ai(e)),h=Math.cos(ai(n)),c=Math.sin(ai(n)),u=Math.cos(ai(i-t)),d=Math.sin(ai(i-t)),g=l*c+a*h*u;return Xp((function(e){if(1<=g)return[i,n];const r=e*Math.acos(g),s=Math.cos(r),o=Math.sin(r),f=d*h,p=a*c-l*h*u,m=Math.atan2(f,p),_=Math.asin(l*s+a*o*Math.cos(m));return[oi(ai(t)+Math.atan2(Math.sin(m)*o*a,s-l*Math.sin(_))),oi(_)]}),Hi(o,r),s)},_T.geom.flat.geodesic.meridian=Vp,_T.geom.flat.geodesic.parallel=Wp,_T.geom.flat.inflate={},_T.geom.flat.inflate.inflateCoordinates=Gn,_T.geom.flat.inflate.inflateCoordinatesArray=jn,_T.geom.flat.inflate.inflateMultiCoordinatesArray=Bn,_T.geom.flat.interiorpoint={},_T.geom.flat.interiorpoint.getInteriorPointOfArray=Hn,_T.geom.flat.interiorpoint.getInteriorPointsOfMultiArray=$n,_T.geom.flat.interpolate={},_T.geom.flat.interpolate.interpolatePoint=Mp,_T.geom.flat.interpolate.lineStringCoordinateAtM=Fp,_T.geom.flat.interpolate.lineStringsCoordinateAtM=Ap,_T.geom.flat.intersectsextent={},_T.geom.flat.intersectsextent.intersectsLineString=Qn,_T.geom.flat.intersectsextent.intersectsLineStringArray=tr,_T.geom.flat.intersectsextent.intersectsLinearRing=er,_T.geom.flat.intersectsextent.intersectsLinearRingArray=ir,_T.geom.flat.intersectsextent.intersectsLinearRingMultiArray=nr,_T.geom.flat.length={},_T.geom.flat.length.lineStringLength=sp,_T.geom.flat.length.linearRingLength=function(t,e,i,n){let r=sp(t,e,i,n);const s=t[i-n]-t[e],o=t[i-n+1]-t[e+1];return r+=Math.sqrt(s*s+o*o),r},_T.geom.flat.orient={},_T.geom.flat.orient.inflateEnds=cr,_T.geom.flat.orient.linearRingIsClockwise=sr,_T.geom.flat.orient.linearRingsAreOriented=or,_T.geom.flat.orient.linearRingssAreOriented=ar,_T.geom.flat.orient.orientLinearRings=lr,_T.geom.flat.orient.orientLinearRingsArray=hr,_T.geom.flat.reverse={},_T.geom.flat.reverse.coordinates=rr,_T.geom.flat.segments={},_T.geom.flat.segments.forEach=Jn,_T.geom.flat.simplify={},_T.geom.flat.simplify.douglasPeucker=Mn,_T.geom.flat.simplify.douglasPeuckerArray=Fn,_T.geom.flat.simplify.douglasPeuckerMultiArray=function(t,e,i,n,r,s,o,a){for(let l=0,h=i.length;l<h;++l){const h=i[l],c=[];o=Fn(t,e,h,n,r,s,o,c),a.push(c),e=h[h.length-1]}return o},_T.geom.flat.simplify.quantize=Nn,_T.geom.flat.simplify.quantizeArray=Dn,_T.geom.flat.simplify.quantizeMultiArray=kn,_T.geom.flat.simplify.radialDistance=An,_T.geom.flat.simplify.simplifyLineString=function(t,e,i,n,r,s,o){return o=void 0!==o?o:[],s||(i=An(t,e,i,n,r,o,0),t=o,e=0,n=2),o.length=Mn(t,e,i,n,r,o,0),o},_T.geom.flat.simplify.snap=On,_T.geom.flat.straightchunk={},_T.geom.flat.straightchunk.matchingChunk=Qf,_T.geom.flat.textpath={},_T.geom.flat.textpath.drawTextOnPath=rp,_T.geom.flat.topology={},_T.geom.flat.topology.lineStringIsClosed=function(t,e,i,n){const r=i-n;return t[e]===t[r]&&t[e+1]===t[r+1]&&(i-e)/n>3&&!!Un(t,e,i,n)},_T.geom.flat.transform={},_T.geom.flat.transform.rotate=dn,_T.geom.flat.transform.scale=gn,_T.geom.flat.transform.transform2D=un,_T.geom.flat.transform.translate=fn,_T.has={},_T.has.DEVICE_PIXEL_RATIO=mt,_T.has.FIREFOX=ut,_T.has.IMAGE_DECODE=yt,_T.has.MAC=pt,_T.has.PASSIVE_EVENT_LISTENERS=xt,_T.has.SAFARI=dt,_T.has.SAFARI_BUG_237906=gt,_T.has.WEBKIT=ft,_T.has.WORKER_OFFSCREEN_CANVAS=_t,_T.interaction={},_T.interaction.DoubleClickZoom=ra,_T.interaction.DragAndDrop=class extends ea{constructor(t){t=t||{},super({handleEvent:g}),this.on,this.once,this.un,this.readAsBuffer_=!1,this.formats_=[];const e=t.formatConstructors?t.formatConstructors:[];for(let t=0,i=e.length;t<i;++t){let i=e[t];"function"==typeof i&&(i=new i),this.formats_.push(i),this.readAsBuffer_=this.readAsBuffer_||"arraybuffer"===i.getType()}this.projection_=t.projection?Ui(t.projection):null,this.dropListenKeys_=null,this.source_=t.source||null,this.target=t.target?t.target:null}handleResult_(t,e){const i=e.target.result,n=this.getMap();let r,s=this.projection_;if(!s&&(s=en(),!s)){s=n.getView().getProjection()}const o=this.formats_;for(let e=0,n=o.length;e<n;++e){const n=o[e];let a=i;this.readAsBuffer_&&"arraybuffer"!==n.getType()&&(void 0===r&&(r=(new TextDecoder).decode(i)),a=r);const l=this.tryReadFeatures_(n,a,{featureProjection:s});if(l&&l.length>0){this.source_&&(this.source_.clear(),this.source_.addFeatures(l)),this.dispatchEvent(new Am(Fm,t,l,s));break}}}registerListeners_(){const t=this.getMap();if(t){const e=this.target?this.target:t.getViewport();this.dropListenKeys_=[N(e,P,this.handleDrop,this),N(e,b,this.handleStop,this),N(e,R,this.handleStop,this),N(e,P,this.handleStop,this)]}}setActive(t){!this.getActive()&&t&&this.registerListeners_(),this.getActive()&&!t&&this.unregisterListeners_(),super.setActive(t)}setMap(t){this.unregisterListeners_(),super.setMap(t),this.getActive()&&this.registerListeners_()}tryReadFeatures_(t,e,i){try{return t.readFeatures(e,i)}catch(t){return null}}unregisterListeners_(){this.dropListenKeys_&&(this.dropListenKeys_.forEach(k),this.dropListenKeys_=null)}handleDrop(t){const e=t.dataTransfer.files;for(let t=0,i=e.length;t<i;++t){const i=e.item(t),n=new FileReader;n.addEventListener(M,this.handleResult_.bind(this,i)),this.readAsBuffer_?n.readAsArrayBuffer(i):n.readAsText(i)}}handleStop(t){t.stopPropagation(),t.preventDefault(),t.dataTransfer.dropEffect="copy"}},_T.interaction.DragAndDrop.DragAndDropEvent=Am,_T.interaction.DragBox=Ia,_T.interaction.DragBox.DragBoxEvent=Pa,_T.interaction.DragPan=Sa,_T.interaction.DragRotate=wa,_T.interaction.DragRotateAndZoom=class extends sa{constructor(t){super(t=t||{}),this.condition_=t.condition?t.condition:_a,this.lastAngle_=void 0,this.lastMagnitude_=void 0,this.lastScaleDelta_=0,this.duration_=void 0!==t.duration?t.duration:400}handleDragEvent(t){if(!xa(t))return;const e=t.map,i=e.getSize(),n=t.pixel,r=n[0]-i[0]/2,s=i[1]/2-n[1],o=Math.atan2(s,r),a=Math.sqrt(r*r+s*s),l=e.getView();if(void 0!==this.lastAngle_){const t=this.lastAngle_-o;l.adjustRotationInternal(t)}this.lastAngle_=o,void 0!==this.lastMagnitude_&&l.adjustResolutionInternal(this.lastMagnitude_/a),void 0!==this.lastMagnitude_&&(this.lastScaleDelta_=this.lastMagnitude_/a),this.lastMagnitude_=a}handleUpEvent(t){if(!xa(t))return!0;const e=t.map.getView(),i=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,i),this.lastScaleDelta_=0,!1}handleDownEvent(t){return!!xa(t)&&(!!this.condition_(t)&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,this.lastMagnitude_=void 0,!0))}},_T.interaction.DragZoom=La,_T.interaction.Draw=class extends sa{constructor(t){const e=t;e.stopDown||(e.stopDown=f),super(e),this.on,this.once,this.un,this.shouldHandle_=!1,this.downPx_=null,this.downTimeout_,this.lastDragTime_,this.pointerType_,this.freehand_=!1,this.source_=t.source?t.source:null,this.features_=t.features?t.features:null,this.snapTolerance_=t.snapTolerance?t.snapTolerance:12,this.type_=t.type,this.mode_=function(t){switch(t){case"Point":case"MultiPoint":return"Point";case"LineString":case"MultiLineString":return"LineString";case"Polygon":case"MultiPolygon":return"Polygon";case"Circle":return"Circle";default:throw new Error("Invalid type: "+t)}}(this.type_),this.stopClick_=!!t.stopClick,this.minPoints_=t.minPoints?t.minPoints:"Polygon"===this.mode_?3:2,this.maxPoints_="Circle"===this.mode_?2:t.maxPoints?t.maxPoints:1/0,this.finishCondition_=t.finishCondition?t.finishCondition:g,this.geometryLayout_=t.geometryLayout?t.geometryLayout:"XY";let i=t.geometryFunction;if(!i){const t=this.mode_;if("Circle"===t)i=function(t,e,i){const n=e||new Pp([NaN,NaN]),r=rn(t[0],i),s=Ti(r,rn(t[t.length-1],i));n.setCenterAndRadius(r,Math.sqrt(s),this.geometryLayout_);const o=en();return o&&n.transform(i,o),n};else{let e;"Point"===t?e=Wn:"LineString"===t?e=Op:"Polygon"===t&&(e=ur),i=function(i,n,r){return n?"Polygon"===t?i[0].length?n.setCoordinates([i[0].concat([i[0][0]])],this.geometryLayout_):n.setCoordinates([],this.geometryLayout_):n.setCoordinates(i,this.geometryLayout_):n=new e(i,this.geometryLayout_),n}}}this.geometryFunction_=i,this.dragVertexDelay_=void 0!==t.dragVertexDelay?t.dragVertexDelay:500,this.finishCoordinate_=null,this.sketchFeature_=null,this.sketchPoint_=null,this.sketchCoords_=null,this.sketchLine_=null,this.sketchLineCoords_=null,this.squaredClickTolerance_=t.clickTolerance?t.clickTolerance*t.clickTolerance:36,this.overlay_=new zp({source:new zh({useSpatialIndex:!1,wrapX:!!t.wrapX&&t.wrapX}),style:t.style?t.style:Ym(),updateWhileInteracting:!0}),this.geometryName_=t.geometryName,this.condition_=t.condition?t.condition:ma,this.freehandCondition_,t.freehand?this.freehandCondition_=da:this.freehandCondition_=t.freehandCondition?t.freehandCondition:_a,this.traceCondition_,this.setTrace(t.trace||!1),this.traceState_={active:!1},this.traceSource_=t.traceSource||t.source||null,this.addChangeListener(ta,this.updateState_)}setTrace(t){let e;e=t?!0===t?da:t:fa,this.traceCondition_=e}setMap(t){super.setMap(t),this.updateState_()}getOverlay(){return this.overlay_}handleEvent(t){t.originalEvent.type===E&&t.originalEvent.preventDefault(),this.freehand_="Point"!==this.mode_&&this.freehandCondition_(t);let e=t.type===ao.POINTERMOVE,i=!0;if(!this.freehand_&&this.lastDragTime_&&t.type===ao.POINTERDRAG){Date.now()-this.lastDragTime_>=this.dragVertexDelay_?(this.downPx_=t.pixel,this.shouldHandle_=!this.freehand_,e=!0):this.lastDragTime_=void 0,this.shouldHandle_&&void 0!==this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0)}return this.freehand_&&t.type===ao.POINTERDRAG&&null!==this.sketchFeature_?(this.addToDrawing_(t.coordinate),i=!1):this.freehand_&&t.type===ao.POINTERDOWN?i=!1:e&&this.getPointerCount()<2?(i=t.type===ao.POINTERMOVE,i&&this.freehand_?(this.handlePointerMove_(t),this.shouldHandle_&&t.originalEvent.preventDefault()):("mouse"===t.originalEvent.pointerType||t.type===ao.POINTERDRAG&&void 0===this.downTimeout_)&&this.handlePointerMove_(t)):t.type===ao.DBLCLICK&&(i=!1),super.handleEvent(t)&&i}handleDownEvent(t){return this.shouldHandle_=!this.freehand_,this.freehand_?(this.downPx_=t.pixel,this.finishCoordinate_||this.startDrawing_(t.coordinate),!0):this.condition_(t)?(this.lastDragTime_=Date.now(),this.downTimeout_=setTimeout(function(){this.handlePointerMove_(new oo(ao.POINTERMOVE,t.map,t.originalEvent,!1,t.frameState))}.bind(this),this.dragVertexDelay_),this.downPx_=t.pixel,!0):(this.lastDragTime_=void 0,!1)}deactivateTrace_(){this.traceState_={active:!1}}toggleTraceState_(t){if(!this.traceSource_||!this.traceCondition_(t))return;if(this.traceState_.active)return void this.deactivateTrace_();const e=this.getMap(),i=zt([e.getCoordinateFromPixel([t.pixel[0]-this.snapTolerance_,t.pixel[1]+this.snapTolerance_]),e.getCoordinateFromPixel([t.pixel[0]+this.snapTolerance_,t.pixel[1]-this.snapTolerance_])]),n=this.traceSource_.getFeaturesInExtent(i);if(0===n.length)return;const r=function(t,e){const i=[];for(let n=0;n<e.length;++n)Um(t,e[n].getGeometry(),i);return i}(t.coordinate,n);r.length&&(this.traceState_={active:!0,startPx:t.pixel.slice(),targets:r,targetIndex:-1})}addOrRemoveTracedCoordinates_(t,e){const i=t.startIndex<=t.endIndex;i===t.startIndex<=e?i&&e>t.endIndex||!i&&e<t.endIndex?this.addTracedCoordinates_(t,t.endIndex,e):(i&&e<t.endIndex||!i&&e>t.endIndex)&&this.removeTracedCoordinates_(e,t.endIndex):(this.removeTracedCoordinates_(t.startIndex,t.endIndex),this.addTracedCoordinates_(t,t.startIndex,e))}removeTracedCoordinates_(t,e){if(t===e)return;let i=0;if(t<e){const n=Math.ceil(t);let r=Math.floor(e);r===e&&(r-=1),i=r-n+1}else{const n=Math.floor(t);let r=Math.ceil(e);r===e&&(r+=1),i=n-r+1}i>0&&this.removeLastPoints_(i)}addTracedCoordinates_(t,e,i){if(e===i)return;const n=[];if(e<i){const r=Math.ceil(e);let s=Math.floor(i);s===i&&(s-=1);for(let e=r;e<=s;++e)n.push(jm(t.coordinates,e))}else{const r=Math.floor(e);let s=Math.ceil(i);s===i&&(s+=1);for(let e=r;e>=s;--e)n.push(jm(t.coordinates,e))}n.length&&this.appendCoordinates(n)}updateTrace_(t){const e=this.traceState_;if(!e.active)return;if(-1===e.targetIndex&&Ci(e.startPx,t.pixel)<this.snapTolerance_)return;const i=function(t,e,i,n){const r=t[0],s=t[1];let o=1/0,a=-1,l=NaN;for(let t=0;t<e.targets.length;++t){const i=e.targets[t],n=i.coordinates;let h,c=1/0;for(let t=0;t<n.length-1;++t){const e=Wm(r,s,n[t],n[t+1]);e.squaredDistance<c&&(c=e.squaredDistance,h=t+e.along)}c<o&&(o=c,i.ring&&e.targetIndex===t&&(i.endIndex>i.startIndex?h<i.startIndex&&(h+=n.length):i.endIndex<i.startIndex&&h>i.startIndex&&(h-=n.length)),l=h,a=t)}const h=e.targets[a];let c=h.ring;if(e.targetIndex===a&&c){const t=Zm(h.coordinates,l);Ci(i.getPixelFromCoordinate(t),e.startPx)>n&&(c=!1)}if(c){const t=h.coordinates,e=t.length,i=h.startIndex,n=l;if(i<n){const r=Bm(t,i,n);Bm(t,i,n-e)<r&&(l-=e)}else{const r=Bm(t,i,n);Bm(t,i,n+e)<r&&(l+=e)}}return zm.index=a,zm.endIndex=l,zm}(t.coordinate,e,this.getMap(),this.snapTolerance_);if(e.targetIndex!==i.index){if(-1!==e.targetIndex){const t=e.targets[e.targetIndex];this.removeTracedCoordinates_(t.startIndex,t.endIndex)}const t=e.targets[i.index];this.addTracedCoordinates_(t,t.startIndex,i.endIndex)}else{const t=e.targets[e.targetIndex];this.addOrRemoveTracedCoordinates_(t,i.endIndex)}e.targetIndex=i.index;const n=e.targets[e.targetIndex];n.endIndex=i.endIndex;const r=Zm(n.coordinates,n.endIndex),s=this.getMap().getPixelFromCoordinate(r);t.coordinate=r,t.pixel=[Math.round(s[0]),Math.round(s[1])]}handleUpEvent(t){let e=!0;if(0===this.getPointerCount()){this.downTimeout_&&(clearTimeout(this.downTimeout_),this.downTimeout_=void 0),this.handlePointerMove_(t);const i=this.traceState_.active;if(this.toggleTraceState_(t),this.shouldHandle_){const n=!this.finishCoordinate_;n&&this.startDrawing_(t.coordinate),!n&&this.freehand_?this.finishDrawing():this.freehand_||n&&"Point"!==this.mode_||(this.atFinish_(t.pixel,i)?this.finishCondition_(t)&&this.finishDrawing():this.addToDrawing_(t.coordinate)),e=!1}else this.freehand_&&this.abortDrawing()}return!e&&this.stopClick_&&t.preventDefault(),e}handlePointerMove_(t){if(this.pointerType_=t.originalEvent.pointerType,this.downPx_&&(!this.freehand_&&this.shouldHandle_||this.freehand_&&!this.shouldHandle_)){const e=this.downPx_,i=t.pixel,n=e[0]-i[0],r=e[1]-i[1],s=n*n+r*r;if(this.shouldHandle_=this.freehand_?s>this.squaredClickTolerance_:s<=this.squaredClickTolerance_,!this.shouldHandle_)return}this.finishCoordinate_?(this.updateTrace_(t),this.modifyDrawing_(t.coordinate)):this.createOrUpdateSketchPoint_(t.coordinate.slice())}atFinish_(t,e){let i=!1;if(this.sketchFeature_){let n=!1,r=[this.finishCoordinate_];const s=this.mode_;if("Point"===s)i=!0;else if("Circle"===s)i=2===this.sketchCoords_.length;else if("LineString"===s)n=!e&&this.sketchCoords_.length>this.minPoints_;else if("Polygon"===s){const t=this.sketchCoords_;n=t[0].length>this.minPoints_,r=[t[0][0],t[0][t[0].length-2]],r=e?[t[0][0]]:[t[0][0],t[0][t[0].length-2]]}if(n){const e=this.getMap();for(let n=0,s=r.length;n<s;n++){const s=r[n],o=e.getPixelFromCoordinate(s),a=t[0]-o[0],l=t[1]-o[1],h=this.freehand_?1:this.snapTolerance_;if(i=Math.sqrt(a*a+l*l)<=h,i){this.finishCoordinate_=s;break}}}}return i}createOrUpdateSketchPoint_(t){if(this.sketchPoint_){this.sketchPoint_.getGeometry().setCoordinates(t)}else this.sketchPoint_=new lt(new Wn(t)),this.updateSketchFeatures_()}createOrUpdateCustomSketchLine_(t){this.sketchLine_||(this.sketchLine_=new lt);const e=t.getLinearRing(0);let i=this.sketchLine_.getGeometry();i?(i.setFlatCoordinates(e.getLayout(),e.getFlatCoordinates()),i.changed()):(i=new Op(e.getFlatCoordinates(),e.getLayout()),this.sketchLine_.setGeometry(i))}startDrawing_(t){const e=this.getMap().getView().getProjection(),i=yn(this.geometryLayout_);for(;t.length<i;)t.push(0);this.finishCoordinate_=t,"Point"===this.mode_?this.sketchCoords_=t.slice():"Polygon"===this.mode_?(this.sketchCoords_=[[t.slice(),t.slice()]],this.sketchLineCoords_=this.sketchCoords_[0]):this.sketchCoords_=[t.slice(),t.slice()],this.sketchLineCoords_&&(this.sketchLine_=new lt(new Op(this.sketchLineCoords_)));const n=this.geometryFunction_(this.sketchCoords_,void 0,e);this.sketchFeature_=new lt,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(n),this.updateSketchFeatures_(),this.dispatchEvent(new km(Om,this.sketchFeature_))}modifyDrawing_(t){const e=this.getMap(),i=this.sketchFeature_.getGeometry(),n=e.getView().getProjection(),r=yn(this.geometryLayout_);let s,o;for(;t.length<r;)t.push(0);if("Point"===this.mode_?o=this.sketchCoords_:"Polygon"===this.mode_?(s=this.sketchCoords_[0],o=s[s.length-1],this.atFinish_(e.getPixelFromCoordinate(t))&&(t=this.finishCoordinate_.slice())):(s=this.sketchCoords_,o=s[s.length-1]),o[0]=t[0],o[1]=t[1],this.geometryFunction_(this.sketchCoords_,i,n),this.sketchPoint_){this.sketchPoint_.getGeometry().setCoordinates(t)}if("Polygon"===i.getType()&&"Polygon"!==this.mode_)this.createOrUpdateCustomSketchLine_(i);else if(this.sketchLineCoords_){this.sketchLine_.getGeometry().setCoordinates(this.sketchLineCoords_)}this.updateSketchFeatures_()}addToDrawing_(t){const e=this.sketchFeature_.getGeometry(),i=this.getMap().getView().getProjection();let n,r;const s=this.mode_;"LineString"===s||"Circle"===s?(this.finishCoordinate_=t.slice(),r=this.sketchCoords_,r.length>=this.maxPoints_&&(this.freehand_?r.pop():n=!0),r.push(t.slice()),this.geometryFunction_(r,e,i)):"Polygon"===s&&(r=this.sketchCoords_[0],r.length>=this.maxPoints_&&(this.freehand_?r.pop():n=!0),r.push(t.slice()),n&&(this.finishCoordinate_=r[0]),this.geometryFunction_(this.sketchCoords_,e,i)),this.createOrUpdateSketchPoint_(t.slice()),this.updateSketchFeatures_(),n&&this.finishDrawing()}removeLastPoints_(t){if(!this.sketchFeature_)return;const e=this.sketchFeature_.getGeometry(),i=this.getMap().getView().getProjection(),n=this.mode_;for(let r=0;r<t;++r){let t;if("LineString"===n||"Circle"===n){if(t=this.sketchCoords_,t.splice(-2,1),t.length>=2){this.finishCoordinate_=t[t.length-2].slice();const e=this.finishCoordinate_.slice();t[t.length-1]=e,this.createOrUpdateSketchPoint_(e)}this.geometryFunction_(t,e,i),"Polygon"===e.getType()&&this.sketchLine_&&this.createOrUpdateCustomSketchLine_(e)}else if("Polygon"===n){t=this.sketchCoords_[0],t.splice(-2,1);const n=this.sketchLine_.getGeometry();if(t.length>=2){const e=t[t.length-2].slice();t[t.length-1]=e,this.createOrUpdateSketchPoint_(e)}n.setCoordinates(t),this.geometryFunction_(this.sketchCoords_,e,i)}if(1===t.length){this.abortDrawing();break}}this.updateSketchFeatures_()}removeLastPoint(){this.removeLastPoints_(1)}finishDrawing(){const t=this.abortDrawing_();if(!t)return;let e=this.sketchCoords_;const i=t.getGeometry(),n=this.getMap().getView().getProjection();"LineString"===this.mode_?(e.pop(),this.geometryFunction_(e,i,n)):"Polygon"===this.mode_&&(e[0].pop(),this.geometryFunction_(e,i,n),e=i.getCoordinates()),"MultiPoint"===this.type_?t.setGeometry(new Dp([e])):"MultiLineString"===this.type_?t.setGeometry(new Np([e])):"MultiPolygon"===this.type_&&t.setGeometry(new Gp([e])),this.dispatchEvent(new km(Nm,t)),this.features_&&this.features_.push(t),this.source_&&this.source_.addFeature(t)}abortDrawing_(){this.finishCoordinate_=null;const t=this.sketchFeature_;return this.sketchFeature_=null,this.sketchPoint_=null,this.sketchLine_=null,this.overlay_.getSource().clear(!0),this.deactivateTrace_(),t}abortDrawing(){const t=this.abortDrawing_();t&&this.dispatchEvent(new km(Dm,t))}appendCoordinates(t){const e=this.mode_,i=!this.sketchFeature_;let n;if(i&&this.startDrawing_(t[0]),"LineString"===e||"Circle"===e)n=this.sketchCoords_;else{if("Polygon"!==e)return;n=this.sketchCoords_&&this.sketchCoords_.length?this.sketchCoords_[0]:[]}i&&n.shift(),n.pop();for(let e=0;e<t.length;e++)this.addToDrawing_(t[e]);const r=t[t.length-1];this.addToDrawing_(r),this.modifyDrawing_(r)}extend(t){const e=t.getGeometry();this.sketchFeature_=t,this.sketchCoords_=e.getCoordinates();const i=this.sketchCoords_[this.sketchCoords_.length-1];this.finishCoordinate_=i.slice(),this.sketchCoords_.push(i.slice()),this.sketchPoint_=new lt(new Wn(i)),this.updateSketchFeatures_(),this.dispatchEvent(new km(Om,this.sketchFeature_))}updateSketchFeatures_(){const t=[];this.sketchFeature_&&t.push(this.sketchFeature_),this.sketchLine_&&t.push(this.sketchLine_),this.sketchPoint_&&t.push(this.sketchPoint_);const e=this.overlay_.getSource();e.clear(!0),e.addFeatures(t)}updateState_(){const t=this.getMap(),e=this.getActive();t&&e||this.abortDrawing(),this.overlay_.setMap(e?t:null)}},_T.interaction.Draw.DrawEvent=km,_T.interaction.Draw.createBox=function(){return function(t,e,i){const n=zt([t[0],t[t.length-1]].map((function(t){return rn(t,i)}))),r=[[ue(n),de(n),ve(n),xe(n),ue(n)]];e?e.setCoordinates(r):e=new ur(r);const s=en();return s&&e.transform(i,s),e}},_T.interaction.Draw.createRegularPolygon=function(t,e){return function(i,n,r){const s=rn(i[0],r),o=rn(i[i.length-1],r),a=Math.sqrt(Ti(s,o));n=n||fr(new Pp(s),t);let l=e;if(!e&&0!==e){const t=o[0]-s[0],e=o[1]-s[1];l=Math.atan2(e,t)}pr(n,s,a,l);const h=en();return h&&n.transform(r,h),n}},_T.interaction.Extent=class extends sa{constructor(t){super(t=t||{}),this.on,this.once,this.un,this.condition_=t.condition?t.condition:da,this.extent_=null,this.pointerHandler_=null,this.pixelTolerance_=void 0!==t.pixelTolerance?t.pixelTolerance:10,this.snappedToVertex_=!1,this.extentFeature_=null,this.vertexFeature_=null,t||(t={}),this.extentOverlay_=new zp({source:new zh({useSpatialIndex:!1,wrapX:!!t.wrapX}),style:t.boxStyle?t.boxStyle:Hm(),updateWhileAnimating:!0,updateWhileInteracting:!0}),this.vertexOverlay_=new zp({source:new zh({useSpatialIndex:!1,wrapX:!!t.wrapX}),style:t.pointerStyle?t.pointerStyle:$m(),updateWhileAnimating:!0,updateWhileInteracting:!0}),t.extent&&this.setExtent(t.extent)}snapToVertex_(t,e){const i=e.getCoordinateFromPixelInternal(t),n=function(t,e){return bi(i,t)-bi(i,e)},r=this.getExtentInternal();if(r){const s=function(t){return[[[t[0],t[1]],[t[0],t[3]]],[[t[0],t[3]],[t[2],t[3]]],[[t[2],t[3]],[t[2],t[1]]],[[t[2],t[1]],[t[0],t[1]]]]}(r);s.sort(n);const o=s[0];let a=yi(i,o);const l=e.getPixelFromCoordinateInternal(a);if(Ci(t,l)<=this.pixelTolerance_){const t=e.getPixelFromCoordinateInternal(o[0]),i=e.getPixelFromCoordinateInternal(o[1]),n=Ti(l,t),r=Ti(l,i),s=Math.sqrt(Math.min(n,r));return this.snappedToVertex_=s<=this.pixelTolerance_,this.snappedToVertex_&&(a=n>r?o[1]:o[0]),a}}return null}handlePointerMove_(t){const e=t.pixel,i=t.map;let n=this.snapToVertex_(e,i);n||(n=i.getCoordinateFromPixelInternal(e)),this.createOrUpdatePointerFeature_(n)}createOrUpdateExtentFeature_(t){let e=this.extentFeature_;return e?t?e.setGeometry(gr(t)):e.setGeometry(void 0):(e=new lt(t?gr(t):{}),this.extentFeature_=e,this.extentOverlay_.getSource().addFeature(e)),e}createOrUpdatePointerFeature_(t){let e=this.vertexFeature_;if(e){e.getGeometry().setCoordinates(t)}else e=new lt(new Wn(t)),this.vertexFeature_=e,this.vertexOverlay_.getSource().addFeature(e);return e}handleEvent(t){return!t.originalEvent||!this.condition_(t)||(t.type!=ao.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(t),super.handleEvent(t),!1)}handleDownEvent(t){const e=t.pixel,i=t.map,n=this.getExtentInternal();let r=this.snapToVertex_(e,i);const s=function(t){let e=null,i=null;return t[0]==n[0]?e=n[2]:t[0]==n[2]&&(e=n[0]),t[1]==n[1]?i=n[3]:t[1]==n[3]&&(i=n[1]),null!==e&&null!==i?[e,i]:null};if(r&&n){const t=r[0]==n[0]||r[0]==n[2]?r[0]:null,e=r[1]==n[1]||r[1]==n[3]?r[1]:null;null!==t&&null!==e?this.pointerHandler_=Jm(s(r)):null!==t?this.pointerHandler_=Qm(s([t,n[1]]),s([t,n[3]])):null!==e&&(this.pointerHandler_=Qm(s([n[0],e]),s([n[2],e])))}else r=i.getCoordinateFromPixelInternal(e),this.setExtent([r[0],r[1],r[0],r[1]]),this.pointerHandler_=Jm(r);return!0}handleDragEvent(t){if(this.pointerHandler_){const e=t.coordinate;this.setExtent(this.pointerHandler_(e)),this.createOrUpdatePointerFeature_(e)}}handleUpEvent(t){this.pointerHandler_=null;const e=this.getExtentInternal();return e&&0!==ce(e)||this.setExtent(null),!1}setMap(t){this.extentOverlay_.setMap(t),this.vertexOverlay_.setMap(t),super.setMap(t)}getExtent(){return sn(this.getExtentInternal(),this.getMap().getView().getProjection())}getExtentInternal(){return this.extent_}setExtent(t){this.extent_=t||null,this.createOrUpdateExtentFeature_(t),this.dispatchEvent(new qm(this.extent_))}},_T.interaction.Extent.ExtentEvent=qm,_T.interaction.Interaction=ea,_T.interaction.Interaction.pan=ia,_T.interaction.Interaction.zoomByDelta=na,_T.interaction.KeyboardPan=Na,_T.interaction.KeyboardZoom=Da,_T.interaction.Link=class extends ea{constructor(t){let e;super(),e=!0===(t=Object.assign({animate:!0,replace:!1,prefix:""},t||{})).animate?{duration:250}:t.animate?t.animate:null,this.animationOptions_=e,this.replace_=t.replace,this.prefix_=t.prefix,this.listenerKeys_=[],this.initial_=!0,this.updateState_=this.updateState_.bind(this)}getParamName_(t){return this.prefix_?this.prefix_+t:t}get_(t,e){return t.get(this.getParamName_(e))}set_(t,e,i){t.set(this.getParamName_(e),i)}delete_(t,e){t.delete(this.getParamName_(e))}setMap(t){const e=this.getMap();super.setMap(t),t!==e&&(e&&this.unregisterListeners_(e),t&&(this.initial_=!0,this.updateState_(),this.registerListeners_(t)))}registerListeners_(t){this.listenerKeys_.push(N(t,mo,this.updateUrl_,this),N(t.getLayerGroup(),S,this.updateUrl_,this),N(t,"change:layergroup",this.handleChangeLayerGroup_,this)),this.replace_||addEventListener("popstate",this.updateState_)}unregisterListeners_(t){for(let t=0,e=this.listenerKeys_.length;t<e;++t)k(this.listenerKeys_[t]);this.listenerKeys_.length=0,this.replace_||removeEventListener("popstate",this.updateState_);const e=new URL(window.location.href),i=e.searchParams;this.delete_(i,"x"),this.delete_(i,"y"),this.delete_(i,"z"),this.delete_(i,"r"),this.delete_(i,"l"),window.history.replaceState(null,"",e)}handleChangeLayerGroup_(){const t=this.getMap();t&&(this.unregisterListeners_(t),this.registerListeners_(t),this.initial_=!0,this.updateUrl_())}updateState_(){const t=this.getMap();if(!t)return;const e=t.getView();if(!e)return;const i=new URL(window.location.href).searchParams;let n=!1;const r={},s=t_(this.get_(i,"z"));i_(s,e.getZoom())&&(n=!0,r.zoom=s);const o=t_(this.get_(i,"r"));i_(o,e.getRotation())&&(n=!0,r.rotation=o);const a=[t_(this.get_(i,"x")),t_(this.get_(i,"y"))];var l,h;l=a,h=e.getCenter(),(i_(l[0],h[0])||i_(l[1],h[1]))&&(n=!0,r.center=a),n&&(!this.initial_&&this.animationOptions_?e.animate(Object.assign(r,this.animationOptions_)):(r.center&&e.setCenter(r.center),"zoom"in r&&e.setZoom(r.zoom),"rotation"in r&&e.setRotation(r.rotation)));const c=t.getAllLayers(),u=this.get_(i,"l");if(u&&u.length===c.length)for(let t=0,e=c.length;t<e;++t){const e=parseInt(u[t]);if(!isNaN(e)){const i=Boolean(e),n=c[t];n.getVisible()!==i&&n.setVisible(i)}}}updateUrl_(){const t=this.getMap();if(!t)return;const e=t.getView();if(!e)return;const i=this.initial_;this.initial_=!1;const n=e.getCenter(),r=e.getZoom(),s=e.getRotation(),o=t.getAllLayers(),a=new Array(o.length);for(let t=0,e=o.length;t<e;++t)a[t]=o[t].getVisible()?"1":"0";const l=new URL(window.location.href),h=l.searchParams;this.set_(h,"x",e_(n[0])),this.set_(h,"y",e_(n[1])),this.set_(h,"z",e_(r)),this.set_(h,"r",e_(s)),this.set_(h,"l",a.join("")),l.href!==window.location.href&&(i||this.replace_?window.history.replaceState(null,"",l):window.history.pushState(null,"",l))}},_T.interaction.Modify=class extends sa{constructor(t){let e;if(super(t),this.on,this.once,this.un,this.boundHandleFeatureChange_=this.handleFeatureChange_.bind(this),this.condition_=t.condition?t.condition:va,this.defaultDeleteCondition_=function(t){return la(t)&&pa(t)},this.deleteCondition_=t.deleteCondition?t.deleteCondition:this.defaultDeleteCondition_,this.insertVertexCondition_=t.insertVertexCondition?t.insertVertexCondition:da,this.vertexFeature_=null,this.vertexSegments_=null,this.lastPixel_=[0,0],this.ignoreNextSingleClick_=!1,this.featuresBeingModified_=null,this.rBush_=new Ah,this.pixelTolerance_=void 0!==t.pixelTolerance?t.pixelTolerance:10,this.snappedToVertex_=!1,this.changingFeature_=!1,this.dragSegments_=[],this.overlay_=new zp({source:new zh({useSpatialIndex:!1,wrapX:!!t.wrapX}),style:t.style?t.style:u_(),updateWhileAnimating:!0,updateWhileInteracting:!0}),this.SEGMENT_WRITERS_={Point:this.writePointGeometry_.bind(this),LineString:this.writeLineStringGeometry_.bind(this),LinearRing:this.writeLineStringGeometry_.bind(this),Polygon:this.writePolygonGeometry_.bind(this),MultiPoint:this.writeMultiPointGeometry_.bind(this),MultiLineString:this.writeMultiLineStringGeometry_.bind(this),MultiPolygon:this.writeMultiPolygonGeometry_.bind(this),Circle:this.writeCircleGeometry_.bind(this),GeometryCollection:this.writeGeometryCollectionGeometry_.bind(this)},this.source_=null,this.hitDetection_=null,t.features?e=t.features:t.source&&(this.source_=t.source,e=new q(this.source_.getFeatures()),this.source_.addEventListener(Oh,this.handleSourceAdd_.bind(this)),this.source_.addEventListener(kh,this.handleSourceRemove_.bind(this))),!e)throw new Error("The modify interaction requires features, a source or a layer");t.hitDetection&&(this.hitDetection_=t.hitDetection),this.features_=e,this.features_.forEach(this.addFeature_.bind(this)),this.features_.addEventListener(W,this.handleFeatureAdd_.bind(this)),this.features_.addEventListener(Z,this.handleFeatureRemove_.bind(this)),this.lastPointerEvent_=null,this.delta_=[0,0],this.snapToPointer_=void 0===t.snapToPointer?!this.hitDetection_:t.snapToPointer}addFeature_(t){const e=t.getGeometry();if(e){const i=this.SEGMENT_WRITERS_[e.getType()];i&&i(t,e)}const i=this.getMap();i&&i.isRendered()&&this.getActive()&&this.handlePointerAtPixel_(this.lastPixel_,i),t.addEventListener(S,this.boundHandleFeatureChange_)}willModifyFeatures_(t,e){if(!this.featuresBeingModified_){this.featuresBeingModified_=new q;const i=this.featuresBeingModified_.getArray();for(let t=0,n=e.length;t<n;++t){const n=e[t];for(let t=0,e=n.length;t<e;++t){const e=n[t].feature;e&&!i.includes(e)&&this.featuresBeingModified_.push(e)}}0===this.featuresBeingModified_.getLength()?this.featuresBeingModified_=null:this.dispatchEvent(new a_(s_,this.featuresBeingModified_,t))}}removeFeature_(t){this.removeFeatureSegmentData_(t),this.vertexFeature_&&0===this.features_.getLength()&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.removeEventListener(S,this.boundHandleFeatureChange_)}removeFeatureSegmentData_(t){const e=this.rBush_,i=[];e.forEach((function(e){t===e.feature&&i.push(e)}));for(let t=i.length-1;t>=0;--t){const n=i[t];for(let t=this.dragSegments_.length-1;t>=0;--t)this.dragSegments_[t][0]===n&&this.dragSegments_.splice(t,1);e.remove(n)}}setActive(t){this.vertexFeature_&&!t&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),super.setActive(t)}setMap(t){this.overlay_.setMap(t),super.setMap(t)}getOverlay(){return this.overlay_}handleSourceAdd_(t){t.feature&&this.features_.push(t.feature)}handleSourceRemove_(t){t.feature&&this.features_.remove(t.feature)}handleFeatureAdd_(t){this.addFeature_(t.element)}handleFeatureChange_(t){if(!this.changingFeature_){const e=t.target;this.removeFeature_(e),this.addFeature_(e)}}handleFeatureRemove_(t){this.removeFeature_(t.element)}writePointGeometry_(t,e){const i=e.getCoordinates(),n={feature:t,geometry:e,segment:[i,i]};this.rBush_.insert(e.getExtent(),n)}writeMultiPointGeometry_(t,e){const i=e.getCoordinates();for(let n=0,r=i.length;n<r;++n){const r=i[n],s={feature:t,geometry:e,depth:[n],index:n,segment:[r,r]};this.rBush_.insert(e.getExtent(),s)}}writeLineStringGeometry_(t,e){const i=e.getCoordinates();for(let n=0,r=i.length-1;n<r;++n){const r=i.slice(n,n+2),s={feature:t,geometry:e,index:n,segment:r};this.rBush_.insert(zt(r),s)}}writeMultiLineStringGeometry_(t,e){const i=e.getCoordinates();for(let n=0,r=i.length;n<r;++n){const r=i[n];for(let i=0,s=r.length-1;i<s;++i){const s=r.slice(i,i+2),o={feature:t,geometry:e,depth:[n],index:i,segment:s};this.rBush_.insert(zt(s),o)}}}writePolygonGeometry_(t,e){const i=e.getCoordinates();for(let n=0,r=i.length;n<r;++n){const r=i[n];for(let i=0,s=r.length-1;i<s;++i){const s=r.slice(i,i+2),o={feature:t,geometry:e,depth:[n],index:i,segment:s};this.rBush_.insert(zt(s),o)}}}writeMultiPolygonGeometry_(t,e){const i=e.getCoordinates();for(let n=0,r=i.length;n<r;++n){const r=i[n];for(let i=0,s=r.length;i<s;++i){const s=r[i];for(let r=0,o=s.length-1;r<o;++r){const o=s.slice(r,r+2),a={feature:t,geometry:e,depth:[i,n],index:r,segment:o};this.rBush_.insert(zt(o),a)}}}}writeCircleGeometry_(t,e){const i=e.getCenter(),n={feature:t,geometry:e,index:0,segment:[i,i]},r={feature:t,geometry:e,index:1,segment:[i,i]},s=[n,r];n.featureSegments=s,r.featureSegments=s,this.rBush_.insert(Qt(i),n);let o=e;const a=en();if(a&&this.getMap()){const t=this.getMap().getView().getProjection();o=o.clone().transform(a,t),o=fr(o).transform(t,a)}this.rBush_.insert(o.getExtent(),r)}writeGeometryCollectionGeometry_(t,e){const i=e.getGeometriesArray();for(let e=0;e<i.length;++e){const n=i[e];(0,this.SEGMENT_WRITERS_[n.getType()])(t,n)}}createOrUpdateVertexFeature_(t,e,i){let n=this.vertexFeature_;if(n){n.getGeometry().setCoordinates(t)}else n=new lt(new Wn(t)),this.vertexFeature_=n,this.overlay_.getSource().addFeature(n);return n.set("features",e),n.set("geometries",i),n}handleEvent(t){if(!t.originalEvent)return!0;let e;return this.lastPointerEvent_=t,t.map.getView().getInteracting()||t.type!=ao.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(t),this.vertexFeature_&&this.deleteCondition_(t)&&(e=!(t.type!=ao.SINGLECLICK||!this.ignoreNextSingleClick_)||this.removePoint()),t.type==ao.SINGLECLICK&&(this.ignoreNextSingleClick_=!1),super.handleEvent(t)&&!e}handleDragEvent(t){this.ignoreNextSingleClick_=!1,this.willModifyFeatures_(t,this.dragSegments_);const e=[t.coordinate[0]+this.delta_[0],t.coordinate[1]+this.delta_[1]],i=[],n=[];for(let r=0,s=this.dragSegments_.length;r<s;++r){const s=this.dragSegments_[r],o=s[0],a=o.feature;i.includes(a)||i.push(a);const l=o.geometry;n.includes(l)||n.push(l);const h=o.depth;let c;const u=o.segment,d=s[1];for(;e.length<l.getStride();)e.push(u[d][e.length]);switch(l.getType()){case"Point":c=e,u[0]=e,u[1]=e;break;case"MultiPoint":c=l.getCoordinates(),c[o.index]=e,u[0]=e,u[1]=e;break;case"LineString":c=l.getCoordinates(),c[o.index+d]=e,u[d]=e;break;case"MultiLineString":case"Polygon":c=l.getCoordinates(),c[h[0]][o.index+d]=e,u[d]=e;break;case"MultiPolygon":c=l.getCoordinates(),c[h[1]][h[0]][o.index+d]=e,u[d]=e;break;case"Circle":if(u[0]=e,u[1]=e,0===o.index)this.changingFeature_=!0,l.setCenter(e),this.changingFeature_=!1;else{this.changingFeature_=!0;const i=t.map.getView().getProjection();let n=Ci(rn(l.getCenter(),i),rn(e,i));const r=en();if(r){const t=l.clone().transform(r,i);t.setRadius(n),n=t.transform(i,r).getRadius()}l.setRadius(n),this.changingFeature_=!1}}c&&this.setGeometryCoordinates_(l,c)}this.createOrUpdateVertexFeature_(e,i,n)}handleDownEvent(t){if(!this.condition_(t))return!1;const e=t.coordinate;this.handlePointerAtPixel_(t.pixel,t.map,e),this.dragSegments_.length=0,this.featuresBeingModified_=null;const i=this.vertexFeature_;if(i){const n=t.map.getView().getProjection(),r=[],s=i.getGeometry().getCoordinates(),o=zt([s]),a=this.rBush_.getInExtent(o),l={};a.sort(l_);for(let i=0,o=a.length;i<o;++i){const o=a[i],h=o.segment;let c=z(o.geometry);const u=o.depth;if(u&&(c+="-"+u.join("-")),l[c]||(l[c]=new Array(2)),"Circle"!==o.geometry.getType()||1!==o.index)if(!Si(h[0],s)||l[c][0])if(!Si(h[1],s)||l[c][1])z(h)in this.vertexSegments_&&!l[c][0]&&!l[c][1]&&this.insertVertexCondition_(t)&&r.push(o);else{if(l[c][0]&&0===l[c][0].index){let t=o.geometry.getCoordinates();switch(o.geometry.getType()){case"LineString":case"MultiLineString":continue;case"MultiPolygon":t=t[u[1]];case"Polygon":if(o.index!==t[u[0]].length-2)continue}}this.dragSegments_.push([o,1]),l[c][1]=o}else this.dragSegments_.push([o,0]),l[c][0]=o;else{Si(c_(e,o,n),s)&&!l[c][0]&&(this.dragSegments_.push([o,0]),l[c][0]=o)}}r.length&&this.willModifyFeatures_(t,[r]);for(let t=r.length-1;t>=0;--t)this.insertVertex_(r[t],s)}return!!this.vertexFeature_}handleUpEvent(t){for(let e=this.dragSegments_.length-1;e>=0;--e){const i=this.dragSegments_[e][0],n=i.geometry;if("Circle"===n.getType()){const e=n.getCenter(),r=i.featureSegments[0],s=i.featureSegments[1];r.segment[0]=e,r.segment[1]=e,s.segment[0]=e,s.segment[1]=e,this.rBush_.update(Qt(e),r);let o=n;const a=en();if(a){const e=t.map.getView().getProjection();o=o.clone().transform(a,e),o=fr(o).transform(e,a)}this.rBush_.update(o.getExtent(),s)}else this.rBush_.update(zt(i.segment),i)}return this.featuresBeingModified_&&(this.dispatchEvent(new a_(o_,this.featuresBeingModified_,t)),this.featuresBeingModified_=null),!1}handlePointerMove_(t){this.lastPixel_=t.pixel,this.handlePointerAtPixel_(t.pixel,t.map,t.coordinate)}handlePointerAtPixel_(t,e,i){const n=i||e.getCoordinateFromPixel(t),r=e.getView().getProjection(),s=function(t,e){return h_(n,t,r)-h_(n,e,r)};let o,a;if(this.hitDetection_){const i="object"==typeof this.hitDetection_?t=>t===this.hitDetection_:void 0;e.forEachFeatureAtPixel(t,((t,e,i)=>{if("Point"===(i=i||t.getGeometry()).getType()&&this.features_.getArray().includes(t)){a=i;const e=i.getFlatCoordinates().slice(0,2);o=[{feature:t,geometry:i,segment:[e,e]}]}return!0}),{layerFilter:i})}if(!o){const t=sn(Xt(on(Qt(n,n_),r),e.getView().getResolution()*this.pixelTolerance_,n_),r);o=this.rBush_.getInExtent(t)}if(o&&o.length>0){const i=o.sort(s)[0],l=i.segment;let h=c_(n,i,r);const c=e.getPixelFromCoordinate(h);let u=Ci(t,c);if(a||u<=this.pixelTolerance_){const t={};if(t[z(l)]=!0,this.snapToPointer_||(this.delta_[0]=h[0]-n[0],this.delta_[1]=h[1]-n[1]),"Circle"===i.geometry.getType()&&1===i.index)this.snappedToVertex_=!0,this.createOrUpdateVertexFeature_(h,[i.feature],[i.geometry]);else{const n=e.getPixelFromCoordinate(l[0]),r=e.getPixelFromCoordinate(l[1]),s=Ti(c,n),a=Ti(c,r);u=Math.sqrt(Math.min(s,a)),this.snappedToVertex_=u<=this.pixelTolerance_,this.snappedToVertex_&&(h=s>a?l[1]:l[0]),this.createOrUpdateVertexFeature_(h,[i.feature],[i.geometry]);const d={};d[z(i.geometry)]=!0;for(let e=1,i=o.length;e<i;++e){const i=o[e].segment;if(!(Si(l[0],i[0])&&Si(l[1],i[1])||Si(l[0],i[1])&&Si(l[1],i[0])))break;{const n=z(o[e].geometry);n in d||(d[n]=!0,t[z(i)]=!0)}}}return void(this.vertexSegments_=t)}}this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null)}insertVertex_(t,e){const i=t.segment,n=t.feature,r=t.geometry,s=t.depth,o=t.index;let a;for(;e.length<r.getStride();)e.push(0);switch(r.getType()){case"MultiLineString":case"Polygon":a=r.getCoordinates(),a[s[0]].splice(o+1,0,e);break;case"MultiPolygon":a=r.getCoordinates(),a[s[1]][s[0]].splice(o+1,0,e);break;case"LineString":a=r.getCoordinates(),a.splice(o+1,0,e);break;default:return}this.setGeometryCoordinates_(r,a);const l=this.rBush_;l.remove(t),this.updateSegmentIndices_(r,o,s,1);const h={segment:[i[0],e],feature:n,geometry:r,depth:s,index:o};l.insert(zt(h.segment),h),this.dragSegments_.push([h,1]);const c={segment:[e,i[1]],feature:n,geometry:r,depth:s,index:o+1};l.insert(zt(c.segment),c),this.dragSegments_.push([c,0]),this.ignoreNextSingleClick_=!0}removePoint(){if(this.lastPointerEvent_&&this.lastPointerEvent_.type!=ao.POINTERDRAG){const t=this.lastPointerEvent_;this.willModifyFeatures_(t,this.dragSegments_);const e=this.removeVertex_();return this.featuresBeingModified_&&this.dispatchEvent(new a_(o_,this.featuresBeingModified_,t)),this.featuresBeingModified_=null,e}return!1}removeVertex_(){const t=this.dragSegments_,e={};let i,n,r,s,o,a,l,h,c,u,d,g=!1;for(o=t.length-1;o>=0;--o)r=t[o],u=r[0],d=z(u.feature),u.depth&&(d+="-"+u.depth.join("-")),d in e||(e[d]={}),0===r[1]?(e[d].right=u,e[d].index=u.index):1==r[1]&&(e[d].left=u,e[d].index=u.index+1);for(d in e){switch(c=e[d].right,l=e[d].left,a=e[d].index,h=a-1,u=void 0!==l?l:c,h<0&&(h=0),s=u.geometry,n=s.getCoordinates(),i=n,g=!1,s.getType()){case"MultiLineString":n[u.depth[0]].length>2&&(n[u.depth[0]].splice(a,1),g=!0);break;case"LineString":n.length>2&&(n.splice(a,1),g=!0);break;case"MultiPolygon":i=i[u.depth[1]];case"Polygon":i=i[u.depth[0]],i.length>4&&(a==i.length-1&&(a=0),i.splice(a,1),g=!0,0===a&&(i.pop(),i.push(i[0]),h=i.length-1))}if(g){this.setGeometryCoordinates_(s,n);const e=[];if(void 0!==l&&(this.rBush_.remove(l),e.push(l.segment[0])),void 0!==c&&(this.rBush_.remove(c),e.push(c.segment[1])),void 0!==l&&void 0!==c){const t={depth:u.depth,feature:u.feature,geometry:u.geometry,index:h,segment:e};this.rBush_.insert(zt(t.segment),t)}this.updateSegmentIndices_(s,a,u.depth,-1),this.vertexFeature_&&(this.overlay_.getSource().removeFeature(this.vertexFeature_),this.vertexFeature_=null),t.length=0}}return g}setGeometryCoordinates_(t,e){this.changingFeature_=!0,t.setCoordinates(e),this.changingFeature_=!1}updateSegmentIndices_(t,e,i,n){this.rBush_.forEachInExtent(t.getExtent(),(function(r){r.geometry===t&&(void 0===i||void 0===r.depth||u(r.depth,i))&&r.index>e&&(r.index+=n)}))}},_T.interaction.Modify.ModifyEvent=a_,_T.interaction.MouseWheelZoom=ka,_T.interaction.PinchRotate=Ga,_T.interaction.PinchZoom=ja,_T.interaction.Pointer=sa,_T.interaction.Pointer.centroid=oa,_T.interaction.Select=p_,_T.interaction.Select.SelectEvent=g_,_T.interaction.Snap=class extends sa{constructor(t){const e=t=t||{};e.handleDownEvent||(e.handleDownEvent=g),e.stopDown||(e.stopDown=f),super(e),this.source_=t.source?t.source:null,this.vertex_=void 0===t.vertex||t.vertex,this.edge_=void 0===t.edge||t.edge,this.features_=t.features?t.features:null,this.featuresListenerKeys_=[],this.featureChangeListenerKeys_={},this.indexedFeaturesExtents_={},this.pendingFeatures_={},this.pixelTolerance_=void 0!==t.pixelTolerance?t.pixelTolerance:10,this.rBush_=new Ah,this.GEOMETRY_SEGMENTERS_={Point:this.segmentPointGeometry_.bind(this),LineString:this.segmentLineStringGeometry_.bind(this),LinearRing:this.segmentLineStringGeometry_.bind(this),Polygon:this.segmentPolygonGeometry_.bind(this),MultiPoint:this.segmentMultiPointGeometry_.bind(this),MultiLineString:this.segmentMultiLineStringGeometry_.bind(this),MultiPolygon:this.segmentMultiPolygonGeometry_.bind(this),GeometryCollection:this.segmentGeometryCollectionGeometry_.bind(this),Circle:this.segmentCircleGeometry_.bind(this)}}addFeature(t,e){e=void 0===e||e;const i=z(t),n=t.getGeometry();if(n){const e=this.GEOMETRY_SEGMENTERS_[n.getType()];if(e){this.indexedFeaturesExtents_[i]=n.getExtent([1/0,1/0,-1/0,-1/0]);const r=[];if(e(r,n),1===r.length)this.rBush_.insert(zt(r[0]),{feature:t,segment:r[0]});else if(r.length>1){const e=r.map((t=>zt(t))),i=r.map((e=>({feature:t,segment:e})));this.rBush_.load(e,i)}}}e&&(this.featureChangeListenerKeys_[i]=N(t,S,this.handleFeatureChange_,this))}forEachFeatureAdd_(t){this.addFeature(t)}forEachFeatureRemove_(t){this.removeFeature(t)}getFeatures_(){let t;return this.features_?t=this.features_:this.source_&&(t=this.source_.getFeatures()),t}handleEvent(t){const e=this.snapTo(t.pixel,t.coordinate,t.map);return e&&(t.coordinate=e.vertex.slice(0,2),t.pixel=e.vertexPixel),super.handleEvent(t)}handleFeatureAdd_(t){const e=m_(t);this.addFeature(e)}handleFeatureRemove_(t){const e=m_(t);this.removeFeature(e)}handleFeatureChange_(t){const e=t.target;if(this.handlingDownUpSequence){const t=z(e);t in this.pendingFeatures_||(this.pendingFeatures_[t]=e)}else this.updateFeature_(e)}handleUpEvent(t){const e=Object.values(this.pendingFeatures_);return e.length&&(e.forEach(this.updateFeature_.bind(this)),this.pendingFeatures_={}),!1}removeFeature(t,e){const i=void 0===e||e,n=z(t),r=this.indexedFeaturesExtents_[n];if(r){const e=this.rBush_,i=[];e.forEachInExtent(r,(function(e){t===e.feature&&i.push(e)}));for(let t=i.length-1;t>=0;--t)e.remove(i[t])}i&&(k(this.featureChangeListenerKeys_[n]),delete this.featureChangeListenerKeys_[n])}setMap(t){const e=this.getMap(),i=this.featuresListenerKeys_,n=this.getFeatures_();e&&(i.forEach(k),i.length=0,n.forEach(this.forEachFeatureRemove_.bind(this))),super.setMap(t),t&&(this.features_?i.push(N(this.features_,W,this.handleFeatureAdd_,this),N(this.features_,Z,this.handleFeatureRemove_,this)):this.source_&&i.push(N(this.source_,Oh,this.handleFeatureAdd_,this),N(this.source_,kh,this.handleFeatureRemove_,this)),n.forEach(this.forEachFeatureAdd_.bind(this)))}snapTo(t,e,i){const n=zt([i.getCoordinateFromPixel([t[0]-this.pixelTolerance_,t[1]+this.pixelTolerance_]),i.getCoordinateFromPixel([t[0]+this.pixelTolerance_,t[1]-this.pixelTolerance_])]),r=this.rBush_.getInExtent(n),s=r.length;if(0===s)return null;const o=i.getView().getProjection(),a=rn(e,o);let l,h=1/0;const c=this.pixelTolerance_*this.pixelTolerance_,u=()=>{if(l){const e=i.getPixelFromCoordinate(l);if(Ti(t,e)<=c)return{vertex:l,vertexPixel:[Math.round(e[0]),Math.round(e[1])]}}return null};if(this.vertex_){for(let t=0;t<s;++t){const e=r[t];"Circle"!==e.feature.getGeometry().getType()&&e.segment.forEach((t=>{const e=rn(t,o),i=Ti(a,e);i<h&&(l=t,h=i)}))}const t=u();if(t)return t}if(this.edge_){for(let t=0;t<s;++t){let e=null;const i=r[t];if("Circle"===i.feature.getGeometry().getType()){let t=i.feature.getGeometry();const n=en();n&&(t=t.clone().transform(n,o)),e=nn(_i(a,t),o)}else{const[t,n]=i.segment;n&&(__[0]=rn(t,o),__[1]=rn(n,o),e=yi(a,__))}if(e){const t=Ti(a,e);t<h&&(l=e,h=t)}}const t=u();if(t)return t}return null}updateFeature_(t){this.removeFeature(t,!1),this.addFeature(t,!1)}segmentCircleGeometry_(t,e){const i=this.getMap().getView().getProjection();let n=e;const r=en();r&&(n=n.clone().transform(r,i));const s=fr(n);r&&s.transform(i,r);const o=s.getCoordinates()[0];for(let e=0,i=o.length-1;e<i;++e)t.push(o.slice(e,e+2))}segmentGeometryCollectionGeometry_(t,e){const i=e.getGeometriesArray();for(let e=0;e<i.length;++e){const n=this.GEOMETRY_SEGMENTERS_[i[e].getType()];n&&n(t,i[e])}}segmentLineStringGeometry_(t,e){const i=e.getCoordinates();for(let e=0,n=i.length-1;e<n;++e)t.push(i.slice(e,e+2))}segmentMultiLineStringGeometry_(t,e){const i=e.getCoordinates();for(let e=0,n=i.length;e<n;++e){const n=i[e];for(let e=0,i=n.length-1;e<i;++e)t.push(n.slice(e,e+2))}}segmentMultiPointGeometry_(t,e){e.getCoordinates().forEach((e=>{t.push([e])}))}segmentMultiPolygonGeometry_(t,e){const i=e.getCoordinates();for(let e=0,n=i.length;e<n;++e){const n=i[e];for(let e=0,i=n.length;e<i;++e){const i=n[e];for(let e=0,n=i.length-1;e<n;++e)t.push(i.slice(e,e+2))}}}segmentPointGeometry_(t,e){t.push([e.getCoordinates()])}segmentPolygonGeometry_(t,e){const i=e.getCoordinates();for(let e=0,n=i.length;e<n;++e){const n=i[e];for(let e=0,i=n.length-1;e<i;++e)t.push(n.slice(e,e+2))}}},_T.interaction.Translate=class extends sa{constructor(t){let e;if(super(t=t||{}),this.on,this.once,this.un,this.lastCoordinate_=null,this.startCoordinate_=null,this.features_=void 0!==t.features?t.features:null,t.layers&&!this.features_)if("function"==typeof t.layers)e=t.layers;else{const i=t.layers;e=function(t){return i.includes(t)}}else e=g;this.layerFilter_=e,this.filter_=t.filter&&!this.features_?t.filter:g,this.hitTolerance_=t.hitTolerance?t.hitTolerance:0,this.condition_=t.condition?t.condition:da,this.lastFeature_=null,this.addChangeListener(ta,this.handleActiveChanged_)}handleDownEvent(t){if(!t.originalEvent||!this.condition_(t))return!1;if(this.lastFeature_=this.featuresAtPixel_(t.pixel,t.map),!this.lastCoordinate_&&this.lastFeature_){this.startCoordinate_=t.coordinate,this.lastCoordinate_=t.coordinate,this.handleMoveEvent(t);const e=this.features_||new q([this.lastFeature_]);return this.dispatchEvent(new S_(y_,e,t.coordinate,this.startCoordinate_,t)),!0}return!1}handleUpEvent(t){if(this.lastCoordinate_){this.lastCoordinate_=null,this.handleMoveEvent(t);const e=this.features_||new q([this.lastFeature_]);return this.dispatchEvent(new S_(v_,e,t.coordinate,this.startCoordinate_,t)),this.startCoordinate_=null,!0}return!1}handleDragEvent(t){if(this.lastCoordinate_){const e=t.coordinate,i=e[0]-this.lastCoordinate_[0],n=e[1]-this.lastCoordinate_[1],r=this.features_||new q([this.lastFeature_]);r.forEach((function(t){const e=t.getGeometry();e.translate(i,n),t.setGeometry(e)})),this.lastCoordinate_=e,this.dispatchEvent(new S_(x_,r,e,this.startCoordinate_,t))}}handleMoveEvent(t){const e=t.map.getViewport();this.featuresAtPixel_(t.pixel,t.map)?(e.classList.remove(this.lastCoordinate_?"ol-grab":"ol-grabbing"),e.classList.add(this.lastCoordinate_?"ol-grabbing":"ol-grab")):e.classList.remove("ol-grab","ol-grabbing")}featuresAtPixel_(t,e){return e.forEachFeatureAtPixel(t,function(t,e){if(this.filter_(t,e)&&(!this.features_||this.features_.getArray().includes(t)))return t}.bind(this),{layerFilter:this.layerFilter_,hitTolerance:this.hitTolerance_})}getHitTolerance(){return this.hitTolerance_}setHitTolerance(t){this.hitTolerance_=t}setMap(t){const e=this.getMap();super.setMap(t),this.updateState_(e)}handleActiveChanged_(){this.updateState_(null)}updateState_(t){let e=this.getMap();const i=this.getActive();if((!e||!i)&&(e=e||t,e)){e.getViewport().classList.remove("ol-grab","ol-grabbing")}}},_T.interaction.Translate.TranslateEvent=S_,_T.interaction.defaults={},_T.interaction.defaults.defaults=Ba,_T.layer={},_T.layer.Base=fs,_T.layer.BaseImage=Tc,_T.layer.BaseTile=Ac,_T.layer.BaseVector=Ig,_T.layer.Graticule=class extends zp{constructor(t){t=t||{};const e=Object.assign({updateWhileAnimating:!0,updateWhileInteracting:!0,renderBuffer:0},t);delete e.maxLines,delete e.strokeStyle,delete e.targetSize,delete e.showLabels,delete e.lonLabelFormatter,delete e.latLabelFormatter,delete e.lonLabelPosition,delete e.latLabelPosition,delete e.lonLabelStyle,delete e.latLabelStyle,delete e.intervals,super(e),this.projection_=null,this.maxLat_=1/0,this.maxLon_=1/0,this.minLat_=-1/0,this.minLon_=-1/0,this.maxX_=1/0,this.maxY_=1/0,this.minX_=-1/0,this.minY_=-1/0,this.targetSize_=void 0!==t.targetSize?t.targetSize:100,this.maxLines_=void 0!==t.maxLines?t.maxLines:100,this.meridians_=[],this.parallels_=[],this.strokeStyle_=void 0!==t.strokeStyle?t.strokeStyle:Zp,this.fromLonLatTransform_=void 0,this.toLonLatTransform_=void 0,this.projectionCenterLonLat_=null,this.bottomLeft_=null,this.bottomRight_=null,this.topLeft_=null,this.topRight_=null,this.meridiansLabels_=null,this.parallelsLabels_=null,t.showLabels&&(this.lonLabelFormatter_=null==t.lonLabelFormatter?xi.bind(this,"EW"):t.lonLabelFormatter,this.latLabelFormatter_=null==t.latLabelFormatter?xi.bind(this,"NS"):t.latLabelFormatter,this.lonLabelPosition_=null==t.lonLabelPosition?0:t.lonLabelPosition,this.latLabelPosition_=null==t.latLabelPosition?1:t.latLabelPosition,this.lonLabelStyleBase_=new cg({text:void 0!==t.lonLabelStyle?t.lonLabelStyle.clone():new mg({font:"12px Calibri,sans-serif",textBaseline:"bottom",fill:new rg({color:"rgba(0,0,0,1)"}),stroke:new hg({color:"rgba(255,255,255,1)",width:3})})}),this.lonLabelStyle_=function(t){const e=t.get("graticule_label");return this.lonLabelStyleBase_.getText().setText(e),this.lonLabelStyleBase_}.bind(this),this.latLabelStyleBase_=new cg({text:void 0!==t.latLabelStyle?t.latLabelStyle.clone():new mg({font:"12px Calibri,sans-serif",textAlign:"right",fill:new rg({color:"rgba(0,0,0,1)"}),stroke:new hg({color:"rgba(255,255,255,1)",width:3})})}),this.latLabelStyle_=function(t){const e=t.get("graticule_label");return this.latLabelStyleBase_.getText().setText(e),this.latLabelStyleBase_}.bind(this),this.meridiansLabels_=[],this.parallelsLabels_=[],this.addEventListener(ms,this.drawLabels_.bind(this))),this.intervals_=void 0!==t.intervals?t.intervals:Yp,this.setSource(new zh({loader:this.loaderFunction.bind(this),strategy:this.strategyFunction.bind(this),features:new q,overlaps:!1,useSpatialIndex:!1,wrapX:t.wrapX})),this.featurePool_=[],this.lineStyle_=new cg({stroke:this.strokeStyle_}),this.loadedExtent_=null,this.renderedExtent_=null,this.renderedResolution_=null,this.setRenderOrder(null)}strategyFunction(t,e){let i=t.slice();return this.projection_&&this.getSource().getWrapX()&&Pe(i,this.projection_),this.loadedExtent_&&(ie(this.loadedExtent_,i,e)?i=this.loadedExtent_.slice():this.getSource().removeLoadedExtent(this.loadedExtent_)),[i]}loaderFunction(t,e,i){this.loadedExtent_=t;const n=this.getSource(),r=ye(this.getExtent()||[-1/0,-1/0,1/0,1/0],t);if(this.renderedExtent_&&ee(this.renderedExtent_,r)&&this.renderedResolution_===e)return;if(this.renderedExtent_=r,this.renderedResolution_=e,Ee(r))return;const s=ge(r),o=e*e/4;(!this.projection_||!Ki(this.projection_,i))&&this.updateProjectionInfo_(i),this.createGraticule_(r,s,e,o);let a,l=this.meridians_.length+this.parallels_.length;for(this.meridiansLabels_&&(l+=this.meridians_.length),this.parallelsLabels_&&(l+=this.parallels_.length);l>this.featurePool_.length;)a=new lt,this.featurePool_.push(a);const h=n.getFeaturesCollection();h.clear();let c,u,d=0;for(c=0,u=this.meridians_.length;c<u;++c)a=this.featurePool_[d++],a.setGeometry(this.meridians_[c]),a.setStyle(this.lineStyle_),h.push(a);for(c=0,u=this.parallels_.length;c<u;++c)a=this.featurePool_[d++],a.setGeometry(this.parallels_[c]),a.setStyle(this.lineStyle_),h.push(a)}addMeridian_(t,e,i,n,r,s){const o=this.getMeridian_(t,e,i,n,s);if(we(o.getExtent(),r)){if(this.meridiansLabels_){const e=this.lonLabelFormatter_(t);s in this.meridiansLabels_?this.meridiansLabels_[s].text=e:this.meridiansLabels_[s]={geom:new Wn([]),text:e}}this.meridians_[s++]=o}return s}addParallel_(t,e,i,n,r,s){const o=this.getParallel_(t,e,i,n,s);if(we(o.getExtent(),r)){if(this.parallelsLabels_){const e=this.latLabelFormatter_(t);s in this.parallelsLabels_?this.parallelsLabels_[s].text=e:this.parallelsLabels_[s]={geom:new Wn([]),text:e}}this.parallels_[s++]=o}return s}drawLabels_(t){const e=t.frameState.viewState.rotation,i=t.frameState.viewState.resolution,n=t.frameState.size,r=t.frameState.extent,s=ge(r);let o=r;if(e){const t=n[0]*i,e=n[1]*i;o=[s[0]-t/2,s[1]-e/2,s[0]+t/2,s[1]+e/2]}let a=0,l=0,h=this.latLabelPosition_<.5;const c=this.projection_.getExtent(),u=Se(c);if(this.getSource().getWrapX()&&this.projection_.canWrapX()&&!Yt(c,r)){a=Math.floor((r[0]-c[0])/u),l=Math.ceil((r[2]-c[2])/u);h=h!==Math.abs(e)>Math.PI/2}const d=Al(t);for(let t=a;t<=l;++t){let i,n,c,g,f=this.meridians_.length+this.parallels_.length;if(this.meridiansLabels_)for(n=0,c=this.meridiansLabels_.length;n<c;++n){const a=this.meridians_[n];if(e||0!==t){const i=a.clone();i.translate(t*u,0),i.rotate(-e,s),g=this.getMeridianPoint_(i,o,n),g.rotate(e,s)}else g=this.getMeridianPoint_(a,r,n);i=this.featurePool_[f++],i.setGeometry(g),i.set("graticule_label",this.meridiansLabels_[n].text),d.drawFeature(i,this.lonLabelStyle_(i))}if(this.parallelsLabels_&&(t===a&&h||t===l&&!h))for(n=0,c=this.parallels_.length;n<c;++n){const a=this.parallels_[n];if(e||0!==t){const i=a.clone();i.translate(t*u,0),i.rotate(-e,s),g=this.getParallelPoint_(i,o,n),g.rotate(e,s)}else g=this.getParallelPoint_(a,r,n);i=this.featurePool_[f++],i.setGeometry(g),i.set("graticule_label",this.parallelsLabels_[n].text),d.drawFeature(i,this.latLabelStyle_(i))}}}createGraticule_(t,e,i,n){const r=this.getInterval_(i);if(-1==r)return this.meridians_.length=0,this.parallels_.length=0,this.meridiansLabels_&&(this.meridiansLabels_.length=0),void(this.parallelsLabels_&&(this.parallelsLabels_.length=0));let s=!1;const o=this.projection_.getExtent(),a=Se(o);this.getSource().getWrapX()&&this.projection_.canWrapX()&&!Yt(o,t)&&(Se(t)>=a?(t[0]=o[0],t[2]=o[2]):s=!0);const l=[ii(e[0],this.minX_,this.maxX_),ii(e[1],this.minY_,this.maxY_)],h=this.toLonLatTransform_(l);isNaN(h[1])&&(h[1]=Math.abs(this.maxLat_)>=Math.abs(this.minLat_)?this.maxLat_:this.minLat_);let c=ii(h[0],this.minLon_,this.maxLon_),u=ii(h[1],this.minLat_,this.maxLat_);const d=this.maxLines_;let g,f,p,m,_=t;s||(_=[ii(t[0],this.minX_,this.maxX_),ii(t[1],this.minY_,this.maxY_),ii(t[2],this.minX_,this.maxX_),ii(t[3],this.minY_,this.maxY_)]);const y=Re(_,this.toLonLatTransform_,void 0,8);let x=y[3],v=y[2],S=y[1],w=y[0];if(s||(Zt(_,this.bottomLeft_)&&(w=this.minLon_,S=this.minLat_),Zt(_,this.bottomRight_)&&(v=this.maxLon_,S=this.minLat_),Zt(_,this.topLeft_)&&(w=this.minLon_,x=this.maxLat_),Zt(_,this.topRight_)&&(v=this.maxLon_,x=this.maxLat_),x=ii(x,u,this.maxLat_),v=ii(v,c,this.maxLon_),S=ii(S,this.minLat_,u),w=ii(w,this.minLon_,c)),c=Math.floor(c/r)*r,m=ii(c,this.minLon_,this.maxLon_),f=this.addMeridian_(m,S,x,n,t,0),g=0,s)for(;(m-=r)>=w&&g++<d;)f=this.addMeridian_(m,S,x,n,t,f);else for(;m!=this.minLon_&&g++<d;)m=Math.max(m-r,this.minLon_),f=this.addMeridian_(m,S,x,n,t,f);if(m=ii(c,this.minLon_,this.maxLon_),g=0,s)for(;(m+=r)<=v&&g++<d;)f=this.addMeridian_(m,S,x,n,t,f);else for(;m!=this.maxLon_&&g++<d;)m=Math.min(m+r,this.maxLon_),f=this.addMeridian_(m,S,x,n,t,f);for(this.meridians_.length=f,this.meridiansLabels_&&(this.meridiansLabels_.length=f),u=Math.floor(u/r)*r,p=ii(u,this.minLat_,this.maxLat_),f=this.addParallel_(p,w,v,n,t,0),g=0;p!=this.minLat_&&g++<d;)p=Math.max(p-r,this.minLat_),f=this.addParallel_(p,w,v,n,t,f);for(p=ii(u,this.minLat_,this.maxLat_),g=0;p!=this.maxLat_&&g++<d;)p=Math.min(p+r,this.maxLat_),f=this.addParallel_(p,w,v,n,t,f);this.parallels_.length=f,this.parallelsLabels_&&(this.parallelsLabels_.length=f)}getInterval_(t){const e=this.projectionCenterLonLat_[0],i=this.projectionCenterLonLat_[1];let n=-1;const r=Math.pow(this.targetSize_*t,2),s=[],o=[];for(let t=0,a=this.intervals_.length;t<a;++t){const a=ii(this.intervals_[t]/2,0,90),l=ii(i,-90+a,90-a);s[0]=e-a,s[1]=l-a,o[0]=e+a,o[1]=l+a,this.fromLonLatTransform_(s,s),this.fromLonLatTransform_(o,o);if(Math.pow(o[0]-s[0],2)+Math.pow(o[1]-s[1],2)<=r)break;n=this.intervals_[t]}return n}getMeridian_(t,e,i,n,r){const s=Vp(t,e,i,this.projection_,n);let o=this.meridians_[r];return o?(o.setFlatCoordinates("XY",s),o.changed()):(o=new Op(s,"XY"),this.meridians_[r]=o),o}getMeridianPoint_(t,e,i){const n=t.getFlatCoordinates();let r=1,s=n.length-1;n[r]>n[s]&&(r=s,s=1);const o=Math.max(e[1],n[r]),a=Math.min(e[3],n[s]),l=ii(e[1]+Math.abs(e[1]-e[3])*this.lonLabelPosition_,o,a),h=[n[r-1]+(n[s-1]-n[r-1])*(l-n[r])/(n[s]-n[r]),l],c=this.meridiansLabels_[i].geom;return c.setCoordinates(h),c}getMeridians(){return this.meridians_}getParallel_(t,e,i,n,r){const s=Wp(t,e,i,this.projection_,n);let o=this.parallels_[r];return o?(o.setFlatCoordinates("XY",s),o.changed()):o=new Op(s,"XY"),o}getParallelPoint_(t,e,i){const n=t.getFlatCoordinates();let r=0,s=n.length-2;n[r]>n[s]&&(r=s,s=0);const o=Math.max(e[0],n[r]),a=Math.min(e[2],n[s]),l=ii(e[0]+Math.abs(e[0]-e[2])*this.latLabelPosition_,o,a),h=[l,n[r+1]+(n[s+1]-n[r+1])*(l-n[r])/(n[s]-n[r])],c=this.parallelsLabels_[i].geom;return c.setCoordinates(h),c}getParallels(){return this.parallels_}updateProjectionInfo_(t){const e=Ui("EPSG:4326"),i=t.getWorldExtent();this.maxLat_=i[3],this.maxLon_=i[2],this.minLat_=i[1],this.minLon_=i[0];const n=Hi(t,e);if(this.minLon_<this.maxLon_)this.toLonLatTransform_=n;else{const t=this.minLon_+this.maxLon_/2;this.maxLon_+=360,this.toLonLatTransform_=function(e,i,r){const s=n(e,i,r=r||2);for(let e=0,i=s.length;e<i;e+=r)s[e]<t&&(s[e]+=360);return s}}this.fromLonLatTransform_=Hi(e,t);const r=Re([this.minLon_,this.minLat_,this.maxLon_,this.maxLat_],this.fromLonLatTransform_,void 0,8);this.minX_=r[0],this.maxX_=r[2],this.minY_=r[1],this.maxY_=r[3],this.bottomLeft_=this.fromLonLatTransform_([this.minLon_,this.minLat_]),this.bottomRight_=this.fromLonLatTransform_([this.maxLon_,this.minLat_]),this.topLeft_=this.fromLonLatTransform_([this.minLon_,this.maxLat_]),this.topRight_=this.fromLonLatTransform_([this.maxLon_,this.maxLat_]),this.projectionCenterLonLat_=this.toLonLatTransform_(ge(t.getExtent())),isNaN(this.projectionCenterLonLat_[1])&&(this.projectionCenterLonLat_[1]=Math.abs(this.maxLat_)>=Math.abs(this.minLat_)?this.maxLat_:this.minLat_),this.projection_=t}},_T.layer.Group=ro,_T.layer.Group.GroupEvent=io,_T.layer.Heatmap=class extends Ig{constructor(t){t=t||{};const e=Object.assign({},t);delete e.gradient,delete e.radius,delete e.blur,delete e.weight,super(e),this.gradient_=null,this.addChangeListener(qp,this.handleGradientChanged_),this.setGradient(t.gradient?t.gradient:$p),this.setBlur(void 0!==t.blur?t.blur:15),this.setRadius(void 0!==t.radius?t.radius:8);const i=t.weight?t.weight:"weight";this.weightFunction_="string"==typeof i?function(t){return t.get(i)}:i,this.setRenderOrder(null)}getBlur(){return this.get(Kp)}getGradient(){return this.get(qp)}getRadius(){return this.get(Hp)}handleGradientChanged_(){this.gradient_=function(t){const e=1,i=256,n=Dr(e,i),r=n.createLinearGradient(0,0,e,i),s=1/(t.length-1);for(let e=0,i=t.length;e<i;++e)r.addColorStop(e*s,t[e]);return n.fillStyle=r,n.fillRect(0,0,e,i),n.canvas}(this.getGradient())}setBlur(t){this.set(Kp,t)}setGradient(t){this.set(qp,t)}setRadius(t){this.set(Hp,t)}createRenderer(){return new gf(this,{className:this.getClassName(),attributes:[{name:"weight",callback:function(t){const e=this.weightFunction_(t);return void 0!==e?ii(e,0,1):1}.bind(this)}],vertexShader:"\n precision mediump float;\n uniform mat4 u_projectionMatrix;\n uniform mat4 u_offsetScaleMatrix;\n uniform float u_size;\n attribute vec2 a_position;\n attribute float a_index;\n attribute float a_weight;\n\n varying vec2 v_texCoord;\n varying float v_weight;\n\n void main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix;\n float offsetX = a_index == 0.0 || a_index == 3.0 ? -u_size / 2.0 : u_size / 2.0;\n float offsetY = a_index == 0.0 || a_index == 1.0 ? -u_size / 2.0 : u_size / 2.0;\n vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n float u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;\n float v = a_index == 0.0 || a_index == 1.0 ? 0.0 : 1.0;\n v_texCoord = vec2(u, v);\n v_weight = a_weight;\n }",fragmentShader:"\n precision mediump float;\n uniform float u_blurSlope;\n\n varying vec2 v_texCoord;\n varying float v_weight;\n\n void main(void) {\n vec2 texCoord = v_texCoord * 2.0 - vec2(1.0, 1.0);\n float sqRadius = texCoord.x * texCoord.x + texCoord.y * texCoord.y;\n float value = (1.0 - sqrt(sqRadius)) * u_blurSlope;\n float alpha = smoothstep(0.0, 1.0, value) * v_weight;\n gl_FragColor = vec4(alpha, alpha, alpha, alpha);\n }",hitVertexShader:"\n precision mediump float;\n uniform mat4 u_projectionMatrix;\n uniform mat4 u_offsetScaleMatrix;\n uniform float u_size;\n attribute vec2 a_position;\n attribute float a_index;\n attribute float a_weight;\n attribute vec4 a_hitColor;\n\n varying vec2 v_texCoord;\n varying float v_weight;\n varying vec4 v_hitColor;\n\n void main(void) {\n mat4 offsetMatrix = u_offsetScaleMatrix;\n float offsetX = a_index == 0.0 || a_index == 3.0 ? -u_size / 2.0 : u_size / 2.0;\n float offsetY = a_index == 0.0 || a_index == 1.0 ? -u_size / 2.0 : u_size / 2.0;\n vec4 offsets = offsetMatrix * vec4(offsetX, offsetY, 0.0, 0.0);\n gl_Position = u_projectionMatrix * vec4(a_position, 0.0, 1.0) + offsets;\n float u = a_index == 0.0 || a_index == 3.0 ? 0.0 : 1.0;\n float v = a_index == 0.0 || a_index == 1.0 ? 0.0 : 1.0;\n v_texCoord = vec2(u, v);\n v_hitColor = a_hitColor;\n v_weight = a_weight;\n }",hitFragmentShader:"\n precision mediump float;\n uniform float u_blurSlope;\n\n varying vec2 v_texCoord;\n varying float v_weight;\n varying vec4 v_hitColor;\n\n void main(void) {\n vec2 texCoord = v_texCoord * 2.0 - vec2(1.0, 1.0);\n float sqRadius = texCoord.x * texCoord.x + texCoord.y * texCoord.y;\n float value = (1.0 - sqrt(sqRadius)) * u_blurSlope;\n float alpha = smoothstep(0.0, 1.0, value) * v_weight;\n if (alpha < 0.05) {\n discard;\n }\n\n gl_FragColor = v_hitColor;\n }",uniforms:{u_size:function(){return 2*(this.get(Hp)+this.get(Kp))}.bind(this),u_blurSlope:function(){return this.get(Hp)/Math.max(1,this.get(Kp))}.bind(this)},postProcesses:[{fragmentShader:"\n precision mediump float;\n\n uniform sampler2D u_image;\n uniform sampler2D u_gradientTexture;\n uniform float u_opacity;\n\n varying vec2 v_texCoord;\n\n void main() {\n vec4 color = texture2D(u_image, v_texCoord);\n gl_FragColor.a = color.a * u_opacity;\n gl_FragColor.rgb = texture2D(u_gradientTexture, vec2(0.5, color.a)).rgb;\n gl_FragColor.rgb *= gl_FragColor.a;\n }",uniforms:{u_gradientTexture:function(){return this.gradient_}.bind(this),u_opacity:function(){return this.getOpacity()}.bind(this)}}]})}renderDeclutter(){}},_T.layer.Image=Lc,_T.layer.Layer=vs,_T.layer.Layer.inView=Ss,_T.layer.MapboxVector=class extends Pm{constructor(t){const e=!("declutter"in t)||t.declutter,i=new Qc({state:"loading",format:new Em});super({source:i,background:t.background,declutter:e,className:t.className,opacity:t.opacity,visible:t.visible,zIndex:t.zIndex,minResolution:t.minResolution,maxResolution:t.maxResolution,minZoom:t.minZoom,maxZoom:t.maxZoom,renderOrder:t.renderOrder,renderBuffer:t.renderBuffer,renderMode:t.renderMode,map:t.map,updateWhileAnimating:t.updateWhileAnimating,updateWhileInteracting:t.updateWhileInteracting,preload:t.preload,useInterimTilesOnError:t.useInterimTilesOnError,properties:t.properties}),t.accessToken&&(this.accessToken=t.accessToken);const n=t.styleUrl;olms.applyStyle(this,n,t.layers||t.source,{accessToken:this.accessToken}).then((()=>{i.setState("ready")})).catch((t=>{this.dispatchEvent(new Im(t));this.getSource().setState("error")})),void 0===this.getBackground()&&olms.applyBackground(this,t.styleUrl,{accessToken:this.accessToken})}},_T.layer.Tile=Nc,_T.layer.Vector=zp,_T.layer.VectorImage=class extends Ig{constructor(t){t=t||{};const e=Object.assign({},t);delete e.imageRatio,super(e),this.imageRatio_=void 0!==t.imageRatio?t.imageRatio:1}getImageRatio(){return this.imageRatio_}createRenderer(){return new Tp(this)}},_T.layer.VectorTile=Pm,_T.layer.WebGLPoints=class extends vs{constructor(t){super(Object.assign({},t)),this.parseResult_=tg(t.style),this.styleVariables_=t.style.variables||{},this.hitDetectionDisabled_=!!t.disableHitDetection}createRenderer(){return new gf(this,{vertexShader:this.parseResult_.builder.getSymbolVertexShader(),fragmentShader:this.parseResult_.builder.getSymbolFragmentShader(),hitVertexShader:!this.hitDetectionDisabled_&&this.parseResult_.builder.getSymbolVertexShader(!0),hitFragmentShader:!this.hitDetectionDisabled_&&this.parseResult_.builder.getSymbolFragmentShader(!0),uniforms:this.parseResult_.uniforms,attributes:this.parseResult_.attributes})}updateStyleVariables(t){Object.assign(this.styleVariables_,t),this.changed()}},_T.layer.WebGLTile=Mm,_T.loadingstrategy={},_T.loadingstrategy.all=xl,_T.loadingstrategy.bbox=function(t,e){return[t]},_T.loadingstrategy.tile=function(t){return function(e,i,n){const r=t.getZForResolution(ln(i,n)),s=t.getTileRangeForExtentAndZ(on(e,n),r),o=[],a=[r,0,0];for(a[1]=s.minX;a[1]<=s.maxX;++a[1])for(a[2]=s.minY;a[2]<=s.maxY;++a[2])o.push(sn(t.getTileCoordExtent(a),n));return o}},_T.math={},_T.math.ceil=gi,_T.math.clamp=ii,_T.math.floor=di,_T.math.lerp=hi,_T.math.modulo=li,_T.math.round=ui,_T.math.solveLinearSystem=si,_T.math.squaredDistance=ri,_T.math.squaredSegmentDistance=ni,_T.math.toDegrees=oi,_T.math.toFixed=ci,_T.math.toRadians=ai,_T.net={},_T.net.ClientError=wl,_T.net.ResponseError=Sl,_T.net.getJSON=El,_T.net.jsonp=vl,_T.net.overrideXHR=function(t){"undefined"!=typeof XMLHttpRequest&&(pl=XMLHttpRequest),global.XMLHttpRequest=t},_T.net.resolveUrl=Tl,_T.net.restoreXHR=function(){global.XMLHttpRequest=pl},_T.obj={},_T.obj.clear=y,_T.obj.isEmpty=x,_T.proj={},_T.proj.Projection=Ae,_T.proj.Units={},_T.proj.Units.METERS_PER_UNIT=Fe,_T.proj.Units.fromCode=Me,_T.proj.addCommon=cn,_T.proj.addCoordinateTransforms=Yi,_T.proj.addEquivalentProjections=Xi,_T.proj.addEquivalentTransforms=Vi,_T.proj.addProjection=ji,_T.proj.addProjections=Bi,_T.proj.clearAllProjections=function(){qe(),Qe()},_T.proj.clearUserProjection=function(){Qi=null},_T.proj.cloneTransform=ki,_T.proj.createProjection=Wi,_T.proj.createSafeCoordinateTransform=hn,_T.proj.createTransformFromCoordinateTransform=Zi,_T.proj.disableCoordinateWarning=Di,_T.proj.epsg3857={},_T.proj.epsg3857.EXTENT=De,_T.proj.epsg3857.HALF_SIZE=Ne,_T.proj.epsg3857.MAX_SAFE_Y=Ge,_T.proj.epsg3857.PROJECTIONS=Be,_T.proj.epsg3857.RADIUS=Oe,_T.proj.epsg3857.WORLD_EXTENT=ke,_T.proj.epsg3857.fromEPSG4326=Ue,_T.proj.epsg3857.toEPSG4326=ze,_T.proj.epsg4326={},_T.proj.epsg4326.EXTENT=Ve,_T.proj.epsg4326.METERS_PER_UNIT=We,_T.proj.epsg4326.PROJECTIONS=Ye,_T.proj.epsg4326.RADIUS=Xe,_T.proj.equivalent=Ki,_T.proj.fromLonLat=function(t,e){return Di(),$i(t,"EPSG:4326",void 0!==e?e:"EPSG:3857")},_T.proj.fromUserCoordinate=rn,_T.proj.fromUserExtent=on,_T.proj.fromUserResolution=ln,_T.proj.get=Ui,_T.proj.getPointResolution=zi,_T.proj.getTransform=Hi,_T.proj.getTransformFromProjections=qi,_T.proj.getUserProjection=en,_T.proj.identityTransform=Gi,_T.proj.proj4={},_T.proj.proj4.register=function(t){const e=Object.keys(t.defs),i=e.length;let n,r;for(n=0;n<i;++n){const i=e[n];if(!Ui(i)){const e=t.defs(i);let n=e.units;n||"longlat"!==e.projName||(n="degrees"),ji(new Ae({code:i,axisOrientation:e.axis,metersPerUnit:e.to_meter,units:n}))}}for(n=0;n<i;++n){const s=e[n],o=Ui(s);for(r=0;r<i;++r){const i=e[r],n=Ui(i);if(!ei(s,i))if(t.defs[s]===t.defs[i])Xi([o,n]);else{const e=t(s,i);Yi(o,n,hn(o,n,e.forward),hn(n,o,e.inverse))}}}},_T.proj.projections={},_T.proj.projections.add=$e,_T.proj.projections.clear=qe,_T.proj.projections.get=He,_T.proj.setUserProjection=tn,_T.proj.toLonLat=function(t,e){const i=$i(t,void 0!==e?e:"EPSG:3857","EPSG:4326"),n=i[0];return(n<-180||n>180)&&(i[0]=li(n+180,360)-180),i},_T.proj.toUserCoordinate=nn,_T.proj.toUserExtent=sn,_T.proj.toUserResolution=an,_T.proj.transform=$i,_T.proj.transformExtent=Ji,_T.proj.transformWithProjections=function(t,e,i){return qi(e,i)(t)},_T.proj.transforms={},_T.proj.transforms.add=ti,_T.proj.transforms.clear=Qe,_T.proj.transforms.get=ei,_T.proj.transforms.remove=function(t,e){const i=t.getCode(),n=e.getCode(),r=Je[i][n];return delete Je[i][n],x(Je[i])&&delete Je[i],r},_T.proj.useGeographic=function(){tn("EPSG:4326")},_T.render={},_T.render.Box=Ea,_T.render.Event=Ts,_T.render.Feature=Bp,_T.render.Feature.toFeature=function(t,e){const i=t.getId(),n=Up(t),r=t.getProperties(),s=new lt;return void 0!==e&&s.setGeometryName(e),s.setGeometry(n),void 0!==i&&s.setId(i),s.setProperties(r,!0),s},_T.render.Feature.toGeometry=Up,_T.render.VectorContext=Cl,_T.render.canvas={},_T.render.canvas.Builder=qf,_T.render.canvas.BuilderGroup=np,_T.render.canvas.Executor=pp,_T.render.canvas.ExecutorGroup=_p,_T.render.canvas.ExecutorGroup.getPixelIndexArray=xp,_T.render.canvas.ImageBuilder=Hf,_T.render.canvas.Immediate=bl,_T.render.canvas.Instruction={},_T.render.canvas.Instruction.beginPathInstruction=Yf,_T.render.canvas.Instruction.closePathInstruction=Kf,_T.render.canvas.Instruction.fillInstruction=Wf,_T.render.canvas.Instruction.strokeInstruction=Zf,_T.render.canvas.LineStringBuilder=$f,_T.render.canvas.PolygonBuilder=Jf,_T.render.canvas.TextBuilder=ep,_T.render.canvas.checkedFonts=Vs,_T.render.canvas.defaultFillStyle=Ns,_T.render.canvas.defaultFont=Os,_T.render.canvas.defaultLineCap=Ds,_T.render.canvas.defaultLineDash=ks,_T.render.canvas.defaultLineDashOffset=0,_T.render.canvas.defaultLineJoin=Gs,_T.render.canvas.defaultLineWidth=1,_T.render.canvas.defaultMiterLimit=js,_T.render.canvas.defaultPadding=Xs,_T.render.canvas.defaultStrokeStyle=Bs,_T.render.canvas.defaultTextAlign=Us,_T.render.canvas.defaultTextBaseline=zs,_T.render.canvas.drawImageOrLabel=to,_T.render.canvas.getTextDimensions=Qs,_T.render.canvas.hitdetect={},_T.render.canvas.hitdetect.HIT_DETECT_RESOLUTION=vp,_T.render.canvas.hitdetect.createHitDetectionImageData=Sp,_T.render.canvas.hitdetect.hitDetect=wp,_T.render.canvas.measureAndCacheTextWidth=Js,_T.render.canvas.measureTextHeight=qs,_T.render.canvas.measureTextWidth=$s,_T.render.canvas.registerFont=Ks,_T.render.canvas.rotateAtOffset=function(t,e,i,n){0!==e&&(t.translate(i,n),t.rotate(e),t.translate(-i,-n))},_T.render.canvas.textHeights=Ys,_T.render.getRenderPixel=function(t,e){return bt(t.inversePixelTransform,e.slice(0))},_T.render.getVectorContext=Al,_T.render.toContext=function(t,e){const i=t.canvas,n=(e=e||{}).pixelRatio||mt,r=e.size;r&&(i.width=r[0]*n,i.height=r[1]*n,i.style.width=r[0]+"px",i.style.height=r[1]+"px");const s=[0,0,i.width,i.height],o=Pt([1,0,0,1,0,0],n,n);return new bl(t,n,s,o,0)},_T.render.webgl={},_T.render.webgl.BatchRenderer=pf,_T.render.webgl.LineStringBatchRenderer=_f,_T.render.webgl.MixedGeometryBatch=yf,_T.render.webgl.PointBatchRenderer=vf,_T.render.webgl.PolygonBatchRenderer=wf,_T.render.webgl.utils={},_T.render.webgl.utils.colorDecodeId=uf,_T.render.webgl.utils.colorEncodeId=cf,_T.render.webgl.utils.getBlankImageData=function(){const t=document.createElement("canvas").getContext("2d").createImageData(1,1);return t.data[0]=255,t.data[1]=255,t.data[2]=255,t.data[3]=255,t},_T.render.webgl.utils.writeLineSegmentToBuffers=function(t,e,i,n,r,s,o,a,l,h){const c=5+a.length,u=s.length/c,d=[t[e+0],t[e+1]],g=[t[i],t[i+1]],f=bt(h,[...d]),p=bt(h,[...g]);function m(t,e,i){const n=1e4;return Math.round(1500*e)+Math.round(1500*i)*n+t*n*n}function _(t,e,i){const n=Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1])),r=[(e[0]-t[0])/n,(e[1]-t[1])/n],s=[-r[1],r[0]],o=Math.sqrt((i[0]-t[0])*(i[0]-t[0])+(i[1]-t[1])*(i[1]-t[1])),a=[(i[0]-t[0])/o,(i[1]-t[1])/o],l=0===n||0===o?0:Math.acos(ii(a[0]*r[0]+a[1]*r[1],-1,1));return a[0]*s[0]+a[1]*s[1]>0?l:2*Math.PI-l}const y=null!==r;let x=0,v=0;if(null!==n){x=_(f,p,bt(h,[...[t[n],t[n+1]]]))}if(y){v=_(p,f,bt(h,[...[t[r],t[r+1]]]))}s.push(d[0],d[1],g[0],g[1],m(0,x,v)),s.push(...a),s.push(d[0],d[1],g[0],g[1],m(1,x,v)),s.push(...a),s.push(d[0],d[1],g[0],g[1],m(2,x,v)),s.push(...a),s.push(d[0],d[1],g[0],g[1],m(3,x,v)),s.push(...a),o.push(u,u+1,u+2,u+1,u+3,u+2)},_T.render.webgl.utils.writePointFeatureToBuffers=function(t,e,i,n,r,s){const o=3+r,a=t[e+0],l=t[e+1],h=af;h.length=r;for(let i=0;i<h.length;i++)h[i]=t[e+2+i];let c=s?s.vertexPosition:0,u=s?s.indexPosition:0;const d=c/o;return hf(i,c,a,l,0),h.length&&i.set(h,c+3),c+=o,hf(i,c,a,l,1),h.length&&i.set(h,c+3),c+=o,hf(i,c,a,l,2),h.length&&i.set(h,c+3),c+=o,hf(i,c,a,l,3),h.length&&i.set(h,c+3),c+=o,n[u++]=d,n[u++]=d+1,n[u++]=d+3,n[u++]=d+1,n[u++]=d+2,n[u++]=d+3,lf.vertexPosition=c,lf.indexPosition=u,lf},_T.render.webgl.utils.writePolygonTrianglesToBuffers=function(t,e,i,n,r){const s=2+r;let o=e;const a=t.slice(o,o+r);o+=r;const l=t[o++];let h=0;const c=new Array(l-1);for(let e=0;e<l;e++)h+=t[o++],e<l-1&&(c[e]=h);const u=t.slice(o,o+2*h),d=Ag.exports(u,c,2);for(let t=0;t<d.length;t++)n.push(d[t]+i.length/s);for(let t=0;t<u.length;t+=2)i.push(u[t],u[t+1],...a);return o+2*h},_T.renderer={},_T.renderer.Composite=eo,_T.renderer.Layer=Cc,_T.renderer.Map=ws,_T.renderer.canvas={},_T.renderer.canvas.ImageLayer=Ic,_T.renderer.canvas.Layer=Pc,_T.renderer.canvas.Layer.canvasPool=bc,_T.renderer.canvas.TileLayer=Oc,_T.renderer.canvas.VectorImageLayer=Tp,_T.renderer.canvas.VectorLayer=Ep,_T.renderer.canvas.VectorTileLayer=Rp,_T.renderer.vector={},_T.renderer.vector.defaultOrder=Pl,_T.renderer.vector.getSquaredTolerance=Il,_T.renderer.vector.getTolerance=Ll,_T.renderer.vector.renderFeature=Ml,_T.renderer.webgl={},_T.renderer.webgl.Layer=gd,_T.renderer.webgl.PointsLayer=gf,_T.renderer.webgl.TileLayer=wd,_T.renderer.webgl.TileLayer.Attributes=pd,_T.renderer.webgl.TileLayer.Uniforms=fd,_T.renderer.webgl.VectorLayer=class extends gd{constructor(t,e){const i=e.uniforms||{},n=[1,0,0,1,0,0];i[Wu]=n,super(t,{uniforms:i,postProcesses:e.postProcesses}),this.sourceRevision_=-1,this.previousExtent_=[1/0,1/0,-1/0,-1/0],this.currentTransform_=n;const r={color:function(){return Ef("#ddd")},opacity:function(){return 1},...e.fill&&e.fill.attributes},s={color:function(){return Ef("#eee")},opacity:function(){return 1},width:function(){return 1.5},...e.stroke&&e.stroke.attributes},o={color:function(){return Ef("#eee")},opacity:function(){return 1},...e.point&&e.point.attributes};this.fillVertexShader_=e.fill&&e.fill.vertexShader||Cf,this.fillFragmentShader_=e.fill&&e.fill.fragmentShader||bf,this.fillAttributes_=Mf(r),this.strokeVertexShader_=e.stroke&&e.stroke.vertexShader||Rf,this.strokeFragmentShader_=e.stroke&&e.stroke.fragmentShader||Pf,this.strokeAttributes_=Mf(s),this.pointVertexShader_=e.point&&e.point.vertexShader||If,this.pointFragmentShader_=e.point&&e.point.fragmentShader||Lf,this.pointAttributes_=Mf(o),this.worker_=df(),this.batch_=new yf;const a=this.getLayer().getSource();this.batch_.addFeatures(a.getFeatures()),this.sourceListenKeys_=[N(a,Oh,this.handleSourceFeatureAdded_,this),N(a,Nh,this.handleSourceFeatureChanged_,this),N(a,kh,this.handleSourceFeatureDelete_,this),N(a,Dh,this.handleSourceFeatureClear_,this)]}afterHelperCreated(){this.polygonRenderer_=new wf(this.helper,this.worker_,this.fillVertexShader_,this.fillFragmentShader_,this.fillAttributes_),this.pointRenderer_=new vf(this.helper,this.worker_,this.pointVertexShader_,this.pointFragmentShader_,this.pointAttributes_),this.lineStringRenderer_=new _f(this.helper,this.worker_,this.strokeVertexShader_,this.strokeFragmentShader_,this.strokeAttributes_)}handleSourceFeatureAdded_(t){const e=t.feature;this.batch_.addFeature(e)}handleSourceFeatureChanged_(t){const e=t.feature;this.batch_.changeFeature(e)}handleSourceFeatureDelete_(t){const e=t.feature;this.batch_.removeFeature(e)}handleSourceFeatureClear_(){this.batch_.clear()}renderFrame(t){const e=this.helper.getGL();this.preRender(e,t);const i=this.getLayer().getSource(),n=t.viewState.projection,r=i.getWrapX()&&n.canWrapX(),s=n.getExtent(),o=t.extent,a=r?Se(s):null,l=r?Math.ceil((o[2]-s[2])/a)+1:1;let h=r?Math.floor((o[0]-s[0])/a):0;do{this.polygonRenderer_.render(this.batch_.polygonBatch,this.currentTransform_,t,h*a),this.lineStringRenderer_.render(this.batch_.lineStringBatch,this.currentTransform_,t,h*a),this.pointRenderer_.render(this.batch_.pointBatch,this.currentTransform_,t,h*a)}while(++h<l);this.helper.finalizeDraw(t);const c=this.helper.getCanvas(),u=t.layerStatesArray[t.layerIndex].opacity;return u!==parseFloat(c.style.opacity)&&(c.style.opacity=String(u)),this.postRender(e,t),c}prepareFrameInternal(t){const e=this.getLayer(),i=e.getSource(),n=t.viewState,r=!t.viewHints[Ro]&&!t.viewHints[Po],s=!ee(this.previousExtent_,t.extent),o=this.sourceRevision_<i.getRevision();if(o&&(this.sourceRevision_=i.getRevision()),r&&(s||o)){const r=n.projection,s=n.resolution,o=e instanceof Ig?e.getRenderBuffer():0,a=Xt(t.extent,o*s);i.loadFeatures(a,s,r),this.ready=!1;let l=3;const h=()=>{l--,this.ready=l<=0,this.getLayer().changed()};this.polygonRenderer_.rebuild(this.batch_.polygonBatch,t,"Polygon",h),this.lineStringRenderer_.rebuild(this.batch_.lineStringBatch,t,"LineString",h),this.pointRenderer_.rebuild(this.batch_.pointBatch,t,"Point",h),this.previousExtent_=t.extent.slice()}return this.helper.makeProjectionTransform(t,this.currentTransform_),this.helper.prepareDraw(t),!0}forEachFeatureAtCoordinate(t,e,i,n,r){}disposeInternal(){this.worker_.terminate(),this.layer_=null,this.sourceListenKeys_.forEach((function(t){k(t)})),this.sourceListenKeys_=null,super.disposeInternal()}},_T.renderer.webgl.shaders={},_T.renderer.webgl.shaders.FILL_FRAGMENT_SHADER=bf,_T.renderer.webgl.shaders.FILL_VERTEX_SHADER=Cf,_T.renderer.webgl.shaders.POINT_FRAGMENT_SHADER=Lf,_T.renderer.webgl.shaders.POINT_VERTEX_SHADER=If,_T.renderer.webgl.shaders.STROKE_FRAGMENT_SHADER=Pf,_T.renderer.webgl.shaders.STROKE_VERTEX_SHADER=Rf,_T.renderer.webgl.shaders.packColor=Ef,_T.reproj={},_T.reproj.Image=gc,_T.reproj.Tile=zl,_T.reproj.Triangulation=Ul,_T.reproj.calculateSourceExtentResolution=jl,_T.reproj.calculateSourceResolution=Gl,_T.reproj.canvasPool=Nl,_T.reproj.common={},_T.reproj.common.ERROR_THRESHOLD=.5,_T.reproj.render=Bl,_T.resolutionconstraint={},_T.resolutionconstraint.createMinMaxResolution=ko,_T.resolutionconstraint.createSnapToPower=Do,_T.resolutionconstraint.createSnapToResolutions=No,_T.rotationconstraint={},_T.rotationconstraint.createSnapToN=Bo,_T.rotationconstraint.createSnapToZero=Uo,_T.rotationconstraint.disable=Go,_T.rotationconstraint.none=jo,_T.size={},_T.size.buffer=Ua,_T.size.hasArea=za,_T.size.scale=Xa,_T.size.toSize=Va,_T.source={},_T.source.BingMaps=class extends uh{constructor(t){const e=void 0!==t.hidpi&&t.hidpi;super({cacheSize:t.cacheSize,crossOrigin:"anonymous",interpolate:t.interpolate,opaque:!0,projection:Ui("EPSG:3857"),reprojectionErrorThreshold:t.reprojectionErrorThreshold,state:"loading",tileLoadFunction:t.tileLoadFunction,tilePixelRatio:e?2:1,wrapX:void 0===t.wrapX||t.wrapX,transition:t.transition,zDirection:t.zDirection}),this.hidpi_=e,this.culture_=void 0!==t.culture?t.culture:"en-us",this.maxZoom_=void 0!==t.maxZoom?t.maxZoom:-1,this.apiKey_=t.key,this.imagerySet_=t.imagerySet;vl("https://dev.virtualearth.net/REST/v1/Imagery/Metadata/"+this.imagerySet_+"?uriScheme=https&include=ImageryProviders&key="+this.apiKey_+"&c="+this.culture_,this.handleImageryMetadataResponse.bind(this),void 0,"jsonp")}getApiKey(){return this.apiKey_}getImagerySet(){return this.imagerySet_}handleImageryMetadataResponse(t){if(200!=t.statusCode||"OK"!=t.statusDescription||"ValidCredentials"!=t.authenticationResultCode||1!=t.resourceSets.length||1!=t.resourceSets[0].resources.length)return void this.setState("error");const e=t.resourceSets[0].resources[0],i=-1==this.maxZoom_?e.zoomMax:this.maxZoom_,n=ih(this.getProjection()),r=this.hidpi_?2:1,s=e.imageWidth==e.imageHeight?e.imageWidth/r:[e.imageWidth/r,e.imageHeight/r],o=Ql({extent:n,minZoom:e.zoomMin,maxZoom:i,tileSize:s});this.tileGrid=o;const a=this.culture_,l=this.hidpi_;if(this.tileUrlFunction=ah(e.imageUrlSubdomains.map((function(t){const i=[0,0,0],n=e.imageUrl.replace("{subdomain}",t).replace("{culture}",a);return function(t,e,r){if(t){el(t[0],t[1],t[2],i);let e=n;return l&&(e+="&dpi=d1&device=mobile"),e.replace("{quadkey}",gh(i))}}}))),e.imageryProviders){const t=qi(Ui("EPSG:4326"),this.getProjection());this.setAttributions(function(i){const n=[],r=i.viewState,s=this.getTileGrid(),o=s.getZForResolution(r.resolution,this.zDirection),a=s.getTileCoordForCoordAndZ(r.center,o)[0];return e.imageryProviders.map((function(e){let r=!1;const s=e.coverageAreas;for(let e=0,n=s.length;e<n;++e){const n=s[e];if(a>=n.zoomMin&&a<=n.zoomMax){const e=n.bbox;if(we(Re([e[1],e[0],e[3],e[2]],t),i.extent)){r=!0;break}}}r&&n.push(e.attribution)})),n.push('<a class="ol-attribution-bing-tos" href="https://www.microsoft.com/maps/product/terms.html" target="_blank">Terms of Use</a>'),n}.bind(this))}this.setState("ready")}},_T.source.BingMaps.quadKey=gh,_T.source.CartoDB=class extends fh{constructor(t){super({attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,maxZoom:void 0!==t.maxZoom?t.maxZoom:18,minZoom:t.minZoom,projection:t.projection,transition:t.transition,wrapX:t.wrapX,zDirection:t.zDirection}),this.account_=t.account,this.mapId_=t.map||"",this.config_=t.config||{},this.templateCache_={},this.initializeMap_()}getConfig(){return this.config_}updateConfig(t){Object.assign(this.config_,t),this.initializeMap_()}setConfig(t){this.config_=t||{},this.initializeMap_()}initializeMap_(){const t=JSON.stringify(this.config_);if(this.templateCache_[t])return void this.applyTemplate_(this.templateCache_[t]);let e="https://"+this.account_+".carto.com/api/v1/map";this.mapId_&&(e+="/named/"+this.mapId_);const i=new XMLHttpRequest;i.addEventListener("load",this.handleInitResponse_.bind(this,t)),i.addEventListener("error",this.handleInitError_.bind(this)),i.open("POST",e),i.setRequestHeader("Content-type","application/json"),i.send(JSON.stringify(this.config_))}handleInitResponse_(t,e){const i=e.target;if(!i.status||i.status>=200&&i.status<300){let e;try{e=JSON.parse(i.responseText)}catch(t){return void this.setState("error")}this.applyTemplate_(e),this.templateCache_[t]=e,this.setState("ready")}else this.setState("error")}handleInitError_(t){this.setState("error")}applyTemplate_(t){const e="https://"+t.cdn_url.https+"/"+this.account_+"/api/v1/map/"+t.layergroupid+"/{z}/{x}/{y}.png";this.setUrl(e)}},_T.source.Cluster=class extends zh{constructor(t){super({attributions:t.attributions,wrapX:t.wrapX}),this.resolution=void 0,this.distance=void 0!==t.distance?t.distance:20,this.minDistance=t.minDistance||0,this.interpolationRatio=0,this.features=[],this.geometryFunction=t.geometryFunction||function(t){const e=t.getGeometry();return at("Point"==e.getType(),10),e},this.createCustomCluster_=t.createCluster,this.source=null,this.boundRefresh_=this.refresh.bind(this),this.updateDistance(this.distance,this.minDistance),this.setSource(t.source||null)}clear(t){this.features.length=0,super.clear(t)}getDistance(){return this.distance}getSource(){return this.source}loadFeatures(t,e,i){this.source.loadFeatures(t,e,i),e!==this.resolution&&(this.resolution=e,this.refresh())}setDistance(t){this.updateDistance(t,this.minDistance)}setMinDistance(t){this.updateDistance(this.distance,t)}getMinDistance(){return this.minDistance}setSource(t){this.source&&this.source.removeEventListener(S,this.boundRefresh_),this.source=t,t&&t.addEventListener(S,this.boundRefresh_),this.refresh()}refresh(){this.clear(),this.cluster(),this.addFeatures(this.features)}updateDistance(t,e){const i=0===t?0:Math.min(e,t)/t,n=t!==this.distance||this.interpolationRatio!==i;this.distance=t,this.minDistance=e,this.interpolationRatio=i,n&&this.refresh()}cluster(){if(void 0===this.resolution||!this.source)return;const t=[1/0,1/0,-1/0,-1/0],e=this.distance*this.resolution,i=this.source.getFeatures(),n={};for(let r=0,s=i.length;r<s;r++){const s=i[r];if(!(z(s)in n)){const i=this.geometryFunction(s);if(i){Qt(i.getCoordinates(),t),Xt(t,e,t);const r=this.source.getFeaturesInExtent(t).filter((function(t){const e=z(t);return!(e in n)&&(n[e]=!0,!0)}));this.features.push(this.createCluster(r,t))}}}}createCluster(t,e){const i=[0,0];for(let e=t.length-1;e>=0;--e){const n=this.geometryFunction(t[e]);n?mi(i,n.getCoordinates()):t.splice(e,1)}Ei(i,1/t.length);const n=ge(e),r=this.interpolationRatio,s=new Wn([i[0]*(1-r)+n[0]*r,i[1]*(1-r)+n[1]*r]);return this.createCustomCluster_?this.createCustomCluster_(s,t):new lt({geometry:s,features:t})}},_T.source.DataTile=Xh,_T.source.GeoTIFF=ic,_T.source.IIIF=class extends uh{constructor(t){const e=t||{};let i=e.url||"";i+=i.lastIndexOf("/")===i.length-1||""===i?"":"/";const n=e.version||sc,r=e.sizes||[],s=e.size;at(null!=s&&Array.isArray(s)&&2==s.length&&!isNaN(s[0])&&s[0]>0&&!isNaN(s[1])&&s[1]>0,60);const o=s[0],a=s[1],l=e.tileSize,h=e.tilePixelRatio||1,c=e.format||"jpg",u=e.quality||(e.version==rc?"native":"default");let d=e.resolutions||[];const g=e.supports||[],f=e.extent||[0,-a,o,0],p=null!=r&&Array.isArray(r)&&r.length>0,m=void 0!==l&&("number"==typeof l&&Number.isInteger(l)&&l>0||Array.isArray(l)&&l.length>0),_=null!=g&&Array.isArray(g)&&(g.includes("regionByPx")||g.includes("regionByPct"))&&(g.includes("sizeByWh")||g.includes("sizeByH")||g.includes("sizeByW")||g.includes("sizeByPct"));let y,x,v;if(d.sort((function(t,e){return e-t})),m||_)if(null!=l&&("number"==typeof l&&Number.isInteger(l)&&l>0?(y=l,x=l):Array.isArray(l)&&l.length>0&&((1==l.length||null==l[1]&&Number.isInteger(l[0]))&&(y=l[0],x=l[0]),2==l.length&&(Number.isInteger(l[0])&&Number.isInteger(l[1])?(y=l[0],x=l[1]):null==l[0]&&Number.isInteger(l[1])&&(y=l[1],x=l[1])))),void 0!==y&&void 0!==x||(y=Lo,x=Lo),0==d.length){v=Math.max(Math.ceil(Math.log(o/y)/Math.LN2),Math.ceil(Math.log(a/x)/Math.LN2));for(let t=v;t>=0;t--)d.push(Math.pow(2,t))}else{const t=Math.max(...d);v=Math.round(Math.log(t)/Math.LN2)}else if(y=o,x=a,d=[],p){r.sort((function(t,e){return t[0]-e[0]})),v=-1;const t=[];for(let e=0;e<r.length;e++){const i=o/r[e][0];d.length>0&&d[d.length-1]==i?t.push(e):(d.push(i),v++)}if(t.length>0)for(let e=0;e<t.length;e++)r.splice(t[e]-e,1)}else d.push(1),r.push([o,a]),v=0;const S=new ql({tileSize:[y,x],extent:f,origin:xe(f),resolutions:d}),w=nc.bind(null,Va(l||256).map((function(t){return t*h})));super({attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,interpolate:e.interpolate,projection:e.projection,reprojectionErrorThreshold:e.reprojectionErrorThreshold,state:e.state,tileClass:w,tileGrid:S,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:function(t,e,s){let l,h;const f=t[0];if(f>v)return;const S=t[1],w=t[2],E=d[f];if(!(void 0===S||void 0===w||void 0===E||S<0||Math.ceil(o/E/y)<=S||w<0||Math.ceil(a/E/x)<=w)){if(_||m){const t=S*y*E,e=w*x*E;let i=y*E,r=x*E,s=y,c=x;if(t+i>o&&(i=o-t),e+r>a&&(r=a-e),t+y*E>o&&(s=Math.floor((o-t+E-1)/E)),e+x*E>a&&(c=Math.floor((a-e+E-1)/E)),0==t&&i==o&&0==e&&r==a)l="full";else if(!_||g.includes("regionByPx"))l=t+","+e+","+i+","+r;else if(g.includes("regionByPct")){l="pct:"+dc(t/o*100)+","+dc(e/a*100)+","+dc(i/o*100)+","+dc(r/a*100)}n!=oc||_&&!g.includes("sizeByWh")?!_||g.includes("sizeByW")?h=s+",":g.includes("sizeByH")?h=","+c:g.includes("sizeByWh")?h=s+","+c:g.includes("sizeByPct")&&(h="pct:"+dc(100/E)):h=s+","+c}else if(l="full",p){const t=r[f][0],e=r[f][1];h=n==oc?t==o&&e==a?"max":t+","+e:t==o?"full":t+","}else h=n==oc?"max":"full";return i+l+"/"+h+"/0/"+u+"."+c}},transition:e.transition}),this.zDirection=e.zDirection}},_T.source.Image=yc,_T.source.Image.ImageSourceEvent=_c,_T.source.Image.defaultImageLoadFunction=xc,_T.source.ImageArcGISRest=class extends yc{constructor(t){super({attributions:(t=t||{}).attributions,interpolate:t.interpolate,projection:t.projection,resolutions:t.resolutions}),this.crossOrigin_=void 0!==t.crossOrigin?t.crossOrigin:null,this.hidpi_=void 0===t.hidpi||t.hidpi,this.url_=t.url,this.imageLoadFunction_=void 0!==t.imageLoadFunction?t.imageLoadFunction:xc,this.params_=t.params||{},this.image_=null,this.imageSize_=[0,0],this.renderedRevision_=0,this.ratio_=void 0!==t.ratio?t.ratio:1.5}getParams(){return this.params_}getImageInternal(t,e,i,n){if(void 0===this.url_)return null;e=this.findNearestResolution(e),i=this.hidpi_?i:1;const r=this.image_;if(r&&this.renderedRevision_==this.getRevision()&&r.getResolution()==e&&r.getPixelRatio()==i&&Yt(r.getExtent(),t))return r;const s={F:"image",FORMAT:"PNG32",TRANSPARENT:!0};Object.assign(s,this.params_);const o=((t=t.slice())[0]+t[2])/2,a=(t[1]+t[3])/2;if(1!=this.ratio_){const e=this.ratio_*Se(t)/2,i=this.ratio_*_e(t)/2;t[0]=o-e,t[1]=a-i,t[2]=o+e,t[3]=a+i}const l=e/i,h=Math.ceil(Se(t)/l),c=Math.ceil(_e(t)/l);t[0]=o-l*h/2,t[2]=o+l*h/2,t[1]=a-l*c/2,t[3]=a+l*c/2,this.imageSize_[0]=h,this.imageSize_[1]=c;const u=this.getRequestUrl_(t,this.imageSize_,i,n,s);return this.image_=new Ar(t,e,i,u,this.crossOrigin_,this.imageLoadFunction_),this.renderedRevision_=this.getRevision(),this.image_.addEventListener(S,this.handleImageChange.bind(this)),this.image_}getImageLoadFunction(){return this.imageLoadFunction_}getRequestUrl_(t,e,i,n,r){const s=n.getCode().split(/:(?=\d+$)/).pop();r.SIZE=e[0]+","+e[1],r.BBOX=t.join(","),r.BBOXSR=s,r.IMAGESR=s,r.DPI=Math.round(90*i);const o=this.url_,a=o.replace(/MapServer\/?$/,"MapServer/export").replace(/ImageServer\/?$/,"ImageServer/exportImage");return a==o&&at(!1,50),vc(a,r)}getUrl(){return this.url_}setImageLoadFunction(t){this.image_=null,this.imageLoadFunction_=t,this.changed()}setUrl(t){t!=this.url_&&(this.url_=t,this.image_=null,this.changed())}updateParams(t){Object.assign(this.params_,t),this.image_=null,this.changed()}},_T.source.ImageCanvas=class extends yc{constructor(t){super({attributions:(t=t||{}).attributions,interpolate:t.interpolate,projection:t.projection,resolutions:t.resolutions,state:t.state}),this.canvasFunction_=t.canvasFunction,this.canvas_=null,this.renderedRevision_=0,this.ratio_=void 0!==t.ratio?t.ratio:1.5}getImageInternal(t,e,i,n){e=this.findNearestResolution(e);let r=this.canvas_;if(r&&this.renderedRevision_==this.getRevision()&&r.getResolution()==e&&r.getPixelRatio()==i&&Yt(r.getExtent(),t))return r;Ce(t=t.slice(),this.ratio_);const s=[Se(t)/e*i,_e(t)/e*i],o=this.canvasFunction_.call(this,t,e,i,s,n);return o&&(r=new Nr(t,e,i,o)),this.canvas_=r,this.renderedRevision_=this.getRevision(),r}},_T.source.ImageMapGuide=class extends yc{constructor(t){super({interpolate:t.interpolate,projection:t.projection,resolutions:t.resolutions}),this.crossOrigin_=void 0!==t.crossOrigin?t.crossOrigin:null,this.displayDpi_=void 0!==t.displayDpi?t.displayDpi:96,this.params_=t.params||{},this.url_=t.url,this.imageLoadFunction_=void 0!==t.imageLoadFunction?t.imageLoadFunction:xc,this.hidpi_=void 0===t.hidpi||t.hidpi,this.metersPerUnit_=void 0!==t.metersPerUnit?t.metersPerUnit:1,this.ratio_=void 0!==t.ratio?t.ratio:1,this.useOverlay_=void 0!==t.useOverlay&&t.useOverlay,this.image_=null,this.renderedRevision_=0}getParams(){return this.params_}getImageInternal(t,e,i,n){e=this.findNearestResolution(e),i=this.hidpi_?i:1;let r=this.image_;if(r&&this.renderedRevision_==this.getRevision()&&r.getResolution()==e&&r.getPixelRatio()==i&&Yt(r.getExtent(),t))return r;1!=this.ratio_&&Ce(t=t.slice(),this.ratio_);const s=[Se(t)/e*i,_e(t)/e*i];if(void 0!==this.url_){const o=this.getUrl(this.url_,this.params_,t,s,n);r=new Ar(t,e,i,o,this.crossOrigin_,this.imageLoadFunction_),r.addEventListener(S,this.handleImageChange.bind(this))}else r=null;return this.image_=r,this.renderedRevision_=this.getRevision(),r}getImageLoadFunction(){return this.imageLoadFunction_}updateParams(t){Object.assign(this.params_,t),this.changed()}getUrl(t,e,i,n,r){const s=function(t,e,i,n){const r=Se(t),s=_e(t),o=e[0],a=e[1],l=.0254/n;return a*r>o*s?r*i/(o*l):s*i/(a*l)}(i,n,this.metersPerUnit_,this.displayDpi_),o=ge(i),a={OPERATION:this.useOverlay_?"GETDYNAMICMAPOVERLAYIMAGE":"GETMAPIMAGE",VERSION:"2.0.0",LOCALE:"en",CLIENTAGENT:"ol/source/ImageMapGuide source",CLIP:"1",SETDISPLAYDPI:this.displayDpi_,SETDISPLAYWIDTH:Math.round(n[0]),SETDISPLAYHEIGHT:Math.round(n[1]),SETVIEWSCALE:s,SETVIEWCENTERX:o[0],SETVIEWCENTERY:o[1]};return Object.assign(a,e),vc(t,a)}setImageLoadFunction(t){this.image_=null,this.imageLoadFunction_=t,this.changed()}},_T.source.ImageStatic=class extends yc{constructor(t){const e=void 0!==t.crossOrigin?t.crossOrigin:null,i=void 0!==t.imageLoadFunction?t.imageLoadFunction:xc;super({attributions:t.attributions,interpolate:t.interpolate,projection:Ui(t.projection)}),this.url_=t.url,this.imageExtent_=t.imageExtent,this.image_=new Ar(this.imageExtent_,void 0,1,this.url_,e,i),this.imageSize_=t.imageSize?t.imageSize:null,this.image_.addEventListener(S,this.handleImageChange.bind(this))}getImageExtent(){return this.imageExtent_}getImageInternal(t,e,i,n){return we(t,this.image_.getExtent())?this.image_:null}getUrl(){return this.url_}handleImageChange(t){if(this.image_.getState()==Lr){const t=this.image_.getExtent(),e=this.image_.getImage();let i,n;this.imageSize_?(i=this.imageSize_[0],n=this.imageSize_[1]):(i=e.width,n=e.height);const r=Se(t),s=_e(t),o=r/i,a=s/n;let l=i,h=n;if(o>a?l=Math.round(r/a):h=Math.round(s/o),l!==i||h!==n){const t=Dr(l,h);this.getInterpolate()||(t.imageSmoothingEnabled=!1);const r=t.canvas;t.drawImage(e,0,0,i,n,0,0,r.width,r.height),this.image_.setImage(r)}}super.handleImageChange(t)}},_T.source.ImageWMS=class extends yc{constructor(t){super({attributions:(t=t||{}).attributions,interpolate:t.interpolate,projection:t.projection,resolutions:t.resolutions}),this.crossOrigin_=void 0!==t.crossOrigin?t.crossOrigin:null,this.url_=t.url,this.imageLoadFunction_=void 0!==t.imageLoadFunction?t.imageLoadFunction:xc,this.params_=Object.assign({},t.params),this.v13_=!0,this.updateV13_(),this.serverType_=t.serverType,this.hidpi_=void 0===t.hidpi||t.hidpi,this.image_=null,this.imageSize_=[0,0],this.renderedRevision_=0,this.ratio_=void 0!==t.ratio?t.ratio:1.5}getFeatureInfoUrl(t,e,i,n){if(void 0===this.url_)return;const r=Ui(i),s=this.getProjection();s&&s!==r&&(e=Gl(s,r,t,e),t=$i(t,r,s));const o=pe(t,e,0,wc),a={SERVICE:"WMS",VERSION:Sc,REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.params_.LAYERS};Object.assign(a,this.params_,n);const l=di((t[0]-o[0])/e,4),h=di((o[3]-t[1])/e,4);return a[this.v13_?"I":"X"]=l,a[this.v13_?"J":"Y"]=h,this.getRequestUrl_(o,wc,1,s||r,a)}getLegendUrl(t,e){if(void 0===this.url_)return;const i={SERVICE:"WMS",VERSION:Sc,REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(void 0===e||void 0===e.LAYER){const t=this.params_.LAYERS;if(!(!Array.isArray(t)||1===t.length))return;i.LAYER=t}if(void 0!==t){const e=this.getProjection()?this.getProjection().getMetersPerUnit():1,n=28e-5;i.SCALE=t*e/n}return Object.assign(i,e),vc(this.url_,i)}getParams(){return this.params_}getImageInternal(t,e,i,n){if(void 0===this.url_)return null;e=this.findNearestResolution(e),1==i||this.hidpi_&&void 0!==this.serverType_||(i=1);const r=e/i,s=ge(t),o=pe(s,r,0,[gi(Se(t)/r,4),gi(_e(t)/r,4)]),a=pe(s,r,0,[gi(this.ratio_*Se(t)/r,4),gi(this.ratio_*_e(t)/r,4)]),l=this.image_;if(l&&this.renderedRevision_==this.getRevision()&&l.getResolution()==e&&l.getPixelRatio()==i&&Yt(l.getExtent(),o))return l;const h={SERVICE:"WMS",VERSION:Sc,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};Object.assign(h,this.params_),this.imageSize_[0]=ui(Se(a)/r,4),this.imageSize_[1]=ui(_e(a)/r,4);const c=this.getRequestUrl_(a,this.imageSize_,i,n,h);return this.image_=new Ar(a,e,i,c,this.crossOrigin_,this.imageLoadFunction_),this.renderedRevision_=this.getRevision(),this.image_.addEventListener(S,this.handleImageChange.bind(this)),this.image_}getImageLoadFunction(){return this.imageLoadFunction_}getRequestUrl_(t,e,i,n,r){if(at(void 0!==this.url_,9),r[this.v13_?"CRS":"SRS"]=n.getCode(),"STYLES"in this.params_||(r.STYLES=""),1!=i)switch(this.serverType_){case"geoserver":const t=90*i+.5|0;"FORMAT_OPTIONS"in r?r.FORMAT_OPTIONS+=";dpi:"+t:r.FORMAT_OPTIONS="dpi:"+t;break;case"mapserver":r.MAP_RESOLUTION=90*i;break;case"carmentaserver":case"qgis":r.DPI=90*i;break;default:at(!1,8)}r.WIDTH=e[0],r.HEIGHT=e[1];const s=n.getAxisOrientation();let o;return o=this.v13_&&"ne"==s.substr(0,2)?[t[1],t[0],t[3],t[2]]:t,r.BBOX=o.join(","),vc(this.url_,r)}getUrl(){return this.url_}setImageLoadFunction(t){this.image_=null,this.imageLoadFunction_=t,this.changed()}setUrl(t){t!=this.url_&&(this.url_=t,this.image_=null,this.changed())}updateParams(t){Object.assign(this.params_,t),this.updateV13_(),this.image_=null,this.changed()}updateV13_(){const t=this.params_.VERSION||Sc;this.v13_=pi(t,"1.3")>=0}},_T.source.OGCMapTile=class extends uh{constructor(t){super({attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,projection:t.projection,reprojectionErrorThreshold:t.reprojectionErrorThreshold,state:"loading",tileLoadFunction:t.tileLoadFunction,wrapX:void 0===t.wrapX||t.wrapX,transition:t.transition});Rg({url:t.url,projection:this.getProjection(),mediaType:t.mediaType,context:t.context||null}).then(this.handleTileSetInfo_.bind(this)).catch(this.handleError_.bind(this))}handleTileSetInfo_(t){this.tileGrid=t.grid,this.setTileUrlFunction(t.urlFunction,t.urlTemplate),this.setState("ready")}handleError_(t){console.error(t),this.setState("error")}},_T.source.OGCVectorTile=class extends Qc{constructor(t){super({attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,cacheSize:t.cacheSize,format:t.format,overlaps:t.overlaps,projection:t.projection,tileClass:t.tileClass,transition:t.transition,wrapX:t.wrapX,zDirection:t.zDirection,state:"loading"});Rg({url:t.url,projection:this.getProjection(),mediaType:t.mediaType,supportedMediaTypes:t.format.supportedMediaTypes,context:t.context||null}).then(this.handleTileSetInfo_.bind(this)).catch(this.handleError_.bind(this))}handleTileSetInfo_(t){this.tileGrid=t.grid,this.setTileUrlFunction(t.urlFunction,t.urlTemplate),this.setState("ready")}handleError_(t){console.error(t),this.setState("error")}},_T.source.OSM=class extends fh{constructor(t){let e;e=void 0!==(t=t||{}).attributions?t.attributions:[Ec];const i=void 0!==t.crossOrigin?t.crossOrigin:"anonymous",n=void 0!==t.url?t.url:"https://tile.openstreetmap.org/{z}/{x}/{y}.png";super({attributions:e,attributionsCollapsible:!1,cacheSize:t.cacheSize,crossOrigin:i,interpolate:t.interpolate,maxZoom:void 0!==t.maxZoom?t.maxZoom:19,opaque:void 0===t.opaque||t.opaque,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileLoadFunction:t.tileLoadFunction,transition:t.transition,url:n,wrapX:t.wrapX,zDirection:t.zDirection})}},_T.source.OSM.ATTRIBUTION=Ec,_T.source.Raster=Wc,_T.source.Raster.Processor=Uc,_T.source.Raster.RasterSourceEvent=Vc,_T.source.Raster.newImageData=Gc,_T.source.Source=Zl,_T.source.Stamen=class extends fh{constructor(t){const e=t.layer.indexOf("-"),i=-1==e?t.layer:t.layer.slice(0,e),n=$c[i],r=Hc[t.layer],s=void 0!==t.url?t.url:"https://stamen-tiles-{a-d}.a.ssl.fastly.net/"+t.layer+"/{z}/{x}/{y}."+r.extension;super({attributions:qc,cacheSize:t.cacheSize,crossOrigin:"anonymous",interpolate:t.interpolate,maxZoom:null!=t.maxZoom?t.maxZoom:n.maxZoom,minZoom:null!=t.minZoom?t.minZoom:n.minZoom,opaque:r.opaque,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileLoadFunction:t.tileLoadFunction,transition:t.transition,url:s,wrapX:t.wrapX,zDirection:t.zDirection})}},_T.source.Tile=nh,_T.source.Tile.TileSourceEvent=rh,_T.source.TileArcGISRest=class extends uh{constructor(t){super({attributions:(t=t||{}).attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,projection:t.projection,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction,url:t.url,urls:t.urls,wrapX:void 0===t.wrapX||t.wrapX,transition:t.transition,zDirection:t.zDirection}),this.params_=t.params||{},this.hidpi_=void 0===t.hidpi||t.hidpi,this.tmpExtent_=[1/0,1/0,-1/0,-1/0],this.setKey(this.getKeyForParams_())}getKeyForParams_(){let t=0;const e=[];for(const i in this.params_)e[t++]=i+"-"+this.params_[i];return e.join("/")}getParams(){return this.params_}getRequestUrl_(t,e,i,n,r,s){const o=this.urls;if(!o)return;const a=r.getCode().split(/:(?=\d+$)/).pop();let l;if(s.SIZE=e[0]+","+e[1],s.BBOX=i.join(","),s.BBOXSR=a,s.IMAGESR=a,s.DPI=Math.round(s.DPI?s.DPI*n:90*n),1==o.length)l=o[0];else{l=o[li(ol(t),o.length)]}return vc(l.replace(/MapServer\/?$/,"MapServer/export").replace(/ImageServer\/?$/,"ImageServer/exportImage"),s)}getTilePixelRatio(t){return this.hidpi_?t:1}updateParams(t){Object.assign(this.params_,t),this.setKey(this.getKeyForParams_())}tileUrlFunction(t,e,i){let n=this.getTileGrid();if(n||(n=this.getTileGridForProjection(i)),n.getResolutions().length<=t[0])return;1==e||this.hidpi_||(e=1);const r=n.getTileCoordExtent(t,this.tmpExtent_);let s=Va(n.getTileSize(t[0]),this.tmpSize);1!=e&&(s=Xa(s,e,this.tmpSize));const o={F:"image",FORMAT:"PNG32",TRANSPARENT:!0};return Object.assign(o,this.params_),this.getRequestUrl_(t,s,r,e,i,o)}},_T.source.TileDebug=class extends fh{constructor(t){super({opaque:!1,projection:(t=t||{}).projection,tileGrid:t.tileGrid,wrapX:void 0===t.wrapX||t.wrapX,zDirection:t.zDirection,url:t.template||"z:{z} x:{x} y:{y}",tileLoadFunction:(t,e)=>{const i=t.getTileCoord()[0],n=Va(this.tileGrid.getTileSize(i)),r=Dr(n[0],n[1]);r.strokeStyle="grey",r.strokeRect(.5,.5,n[0]+.5,n[1]+.5),r.fillStyle="grey",r.strokeStyle="white",r.textAlign="center",r.textBaseline="middle",r.font="24px sans-serif",r.lineWidth=4,r.strokeText(e,n[0]/2,n[1]/2,n[0]),r.fillText(e,n[0]/2,n[1]/2,n[0]),t.setImage(r.canvas)}})}},_T.source.TileImage=uh,_T.source.TileJSON=class extends uh{constructor(t){if(super({attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,projection:Ui("EPSG:3857"),reprojectionErrorThreshold:t.reprojectionErrorThreshold,state:"loading",tileLoadFunction:t.tileLoadFunction,wrapX:void 0===t.wrapX||t.wrapX,transition:t.transition,zDirection:t.zDirection}),this.tileJSON_=null,this.tileSize_=t.tileSize,t.url)if(t.jsonp)vl(t.url,this.handleTileJSONResponse.bind(this),this.handleTileJSONError.bind(this));else{const e=new XMLHttpRequest;e.addEventListener("load",this.onXHRLoad_.bind(this)),e.addEventListener("error",this.onXHRError_.bind(this)),e.open("GET",t.url),e.send()}else t.tileJSON?this.handleTileJSONResponse(t.tileJSON):at(!1,51)}onXHRLoad_(t){const e=t.target;if(!e.status||e.status>=200&&e.status<300){let t;try{t=JSON.parse(e.responseText)}catch(t){return void this.handleTileJSONError()}this.handleTileJSONResponse(t)}else this.handleTileJSONError()}onXHRError_(t){this.handleTileJSONError()}getTileJSON(){return this.tileJSON_}handleTileJSONResponse(t){const e=Ui("EPSG:4326"),i=this.getProjection();let n;if(void 0!==t.bounds){const r=qi(e,i);n=Re(t.bounds,r)}const r=ih(i),s=t.minzoom||0,o=Ql({extent:r,maxZoom:t.maxzoom||22,minZoom:s,tileSize:this.tileSize_});if(this.tileGrid=o,this.tileUrlFunction=oh(t.tiles,o),t.attribution&&!this.getAttributions()){const e=void 0!==n?n:r;this.setAttributions((function(i){return we(e,i.extent)?[t.attribution]:null}))}this.tileJSON_=t,this.setState("ready")}handleTileJSONError(){this.setState("error")}},_T.source.TileWMS=class extends uh{constructor(t){t=t||{};const e=Object.assign({},t.params),i=!("TRANSPARENT"in e)||e.TRANSPARENT;super({attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,opaque:!i,projection:t.projection,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileClass:t.tileClass,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction,url:t.url,urls:t.urls,wrapX:void 0===t.wrapX||t.wrapX,transition:t.transition,zDirection:t.zDirection}),this.gutter_=void 0!==t.gutter?t.gutter:0,this.params_=e,this.v13_=!0,this.serverType_=t.serverType,this.hidpi_=void 0===t.hidpi||t.hidpi,this.tmpExtent_=[1/0,1/0,-1/0,-1/0],this.updateV13_(),this.setKey(this.getKeyForParams_())}getFeatureInfoUrl(t,e,i,n){const r=Ui(i),s=this.getProjection();let o=this.getTileGrid();o||(o=this.getTileGridForProjection(r));const a=o.getZForResolution(e,this.zDirection),l=o.getTileCoordForCoordAndZ(t,a);if(o.getResolutions().length<=l[0])return;let h=o.getResolution(l[0]),c=o.getTileCoordExtent(l,this.tmpExtent_),u=Va(o.getTileSize(l[0]),this.tmpSize);const d=this.gutter_;0!==d&&(u=Ua(u,d,this.tmpSize),c=Xt(c,h*d,c)),s&&s!==r&&(h=Gl(s,r,t,h),c=Ji(c,r,s),t=$i(t,r,s));const g={SERVICE:"WMS",VERSION:Sc,REQUEST:"GetFeatureInfo",FORMAT:"image/png",TRANSPARENT:!0,QUERY_LAYERS:this.params_.LAYERS};Object.assign(g,this.params_,n);const f=Math.floor((t[0]-c[0])/h),p=Math.floor((c[3]-t[1])/h);return g[this.v13_?"I":"X"]=f,g[this.v13_?"J":"Y"]=p,this.getRequestUrl_(l,u,c,1,s||r,g)}getLegendUrl(t,e){if(void 0===this.urls[0])return;const i={SERVICE:"WMS",VERSION:Sc,REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(void 0===e||void 0===e.LAYER){const t=this.params_.LAYERS;if(!(!Array.isArray(t)||1===t.length))return;i.LAYER=t}if(void 0!==t){const e=this.getProjection()?this.getProjection().getMetersPerUnit():1,n=28e-5;i.SCALE=t*e/n}return Object.assign(i,e),vc(this.urls[0],i)}getGutter(){return this.gutter_}getParams(){return this.params_}getRequestUrl_(t,e,i,n,r,s){const o=this.urls;if(!o)return;if(s.WIDTH=e[0],s.HEIGHT=e[1],s[this.v13_?"CRS":"SRS"]=r.getCode(),"STYLES"in this.params_||(s.STYLES=""),1!=n)switch(this.serverType_){case"geoserver":const t=90*n+.5|0;"FORMAT_OPTIONS"in s?s.FORMAT_OPTIONS+=";dpi:"+t:s.FORMAT_OPTIONS="dpi:"+t;break;case"mapserver":s.MAP_RESOLUTION=90*n;break;case"carmentaserver":case"qgis":s.DPI=90*n;break;default:at(!1,52)}const a=r.getAxisOrientation(),l=i;if(this.v13_&&"ne"==a.substr(0,2)){let t;t=i[0],l[0]=i[1],l[1]=t,t=i[2],l[2]=i[3],l[3]=t}let h;if(s.BBOX=l.join(","),1==o.length)h=o[0];else{h=o[li(ol(t),o.length)]}return vc(h,s)}getTilePixelRatio(t){return this.hidpi_&&void 0!==this.serverType_?t:1}getKeyForParams_(){let t=0;const e=[];for(const i in this.params_)e[t++]=i+"-"+this.params_[i];return e.join("/")}updateParams(t){Object.assign(this.params_,t),this.updateV13_(),this.setKey(this.getKeyForParams_())}updateV13_(){const t=this.params_.VERSION||Sc;this.v13_=pi(t,"1.3")>=0}tileUrlFunction(t,e,i){let n=this.getTileGrid();if(n||(n=this.getTileGridForProjection(i)),n.getResolutions().length<=t[0])return;1==e||this.hidpi_&&void 0!==this.serverType_||(e=1);const r=n.getResolution(t[0]);let s=n.getTileCoordExtent(t,this.tmpExtent_),o=Va(n.getTileSize(t[0]),this.tmpSize);const a=this.gutter_;0!==a&&(o=Ua(o,a,this.tmpSize),s=Xt(s,r*a,s)),1!=e&&(o=Xa(o,e,this.tmpSize));const l={SERVICE:"WMS",VERSION:Sc,REQUEST:"GetMap",FORMAT:"image/png",TRANSPARENT:!0};return Object.assign(l,this.params_),this.getRequestUrl_(t,o,s,e,i,l)}},_T.source.UTFGrid=class extends nh{constructor(t){if(super({projection:Ui("EPSG:3857"),state:"loading",zDirection:t.zDirection}),this.preemptive_=void 0===t.preemptive||t.preemptive,this.tileUrlFunction_=lh,this.template_=void 0,this.jsonp_=t.jsonp||!1,t.url)if(this.jsonp_)vl(t.url,this.handleTileJSONResponse.bind(this),this.handleTileJSONError.bind(this));else{const e=new XMLHttpRequest;e.addEventListener("load",this.onXHRLoad_.bind(this)),e.addEventListener("error",this.onXHRError_.bind(this)),e.open("GET",t.url),e.send()}else t.tileJSON?this.handleTileJSONResponse(t.tileJSON):at(!1,51)}onXHRLoad_(t){const e=t.target;if(!e.status||e.status>=200&&e.status<300){let t;try{t=JSON.parse(e.responseText)}catch(t){return void this.handleTileJSONError()}this.handleTileJSONResponse(t)}else this.handleTileJSONError()}onXHRError_(t){this.handleTileJSONError()}getTemplate(){return this.template_}forDataAtCoordinateAndResolution(t,e,i,n){if(this.tileGrid){const r=this.tileGrid.getZForResolution(e,this.zDirection),s=this.tileGrid.getTileCoordForCoordAndZ(t,r);this.getTile(s[0],s[1],s[2],1,this.getProjection()).forDataAtCoordinate(t,i,n)}else!0===n?setTimeout((function(){i(null)}),0):i(null)}handleTileJSONError(){this.setState("error")}handleTileJSONResponse(t){const e=Ui("EPSG:4326"),i=this.getProjection();let n;if(void 0!==t.bounds){const r=qi(e,i);n=Re(t.bounds,r)}const r=ih(i),s=t.minzoom||0,o=Ql({extent:r,maxZoom:t.maxzoom||22,minZoom:s});this.tileGrid=o,this.template_=t.template;const a=t.grids;if(a){if(this.tileUrlFunction_=oh(a,o),void 0!==t.attribution){const e=void 0!==n?n:r;this.setAttributions((function(i){return we(e,i.extent)?[t.attribution]:null}))}this.setState("ready")}else this.setState("error")}getTile(t,e,i,n,r){const s=il(t,e,i);if(this.tileCache.containsKey(s))return this.tileCache.get(s);{const o=[t,e,i],a=this.getTileCoordForTileUrlFunction(o,r),l=this.tileUrlFunction_(a,n,r),h=new Jc(o,void 0!==l?H:tt,void 0!==l?l:"",this.tileGrid.getTileCoordExtent(o),this.preemptive_,this.jsonp_);return this.tileCache.set(s,h),h}}useTile(t,e,i){const n=il(t,e,i);this.tileCache.containsKey(n)&&this.tileCache.get(n)}},_T.source.UTFGrid.CustomTile=Jc,_T.source.UrlTile=ch,_T.source.Vector=zh,_T.source.Vector.VectorSourceEvent=Uh,_T.source.VectorTile=Qc,_T.source.VectorTile.defaultLoadFunction=tu,_T.source.WMTS=class extends uh{constructor(t){const e=void 0!==t.requestEncoding?t.requestEncoding:"KVP",i=t.tileGrid;let n=t.urls;void 0===n&&void 0!==t.url&&(n=hh(t.url)),super({attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,projection:t.projection,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileClass:t.tileClass,tileGrid:i,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:t.tilePixelRatio,urls:n,wrapX:void 0!==t.wrapX&&t.wrapX,transition:t.transition,zDirection:t.zDirection}),this.version_=void 0!==t.version?t.version:"1.0.0",this.format_=void 0!==t.format?t.format:"image/jpeg",this.dimensions_=void 0!==t.dimensions?t.dimensions:{},this.layer_=t.layer,this.matrixSet_=t.matrixSet,this.style_=t.style,this.requestEncoding_=e,this.setKey(this.getKeyForDimensions_()),n&&n.length>0&&(this.tileUrlFunction=ah(n.map(this.createFromWMTSTemplate.bind(this))))}setUrls(t){this.urls=t;const e=t.join("\n");this.setTileUrlFunction(ah(t.map(this.createFromWMTSTemplate.bind(this))),e)}getDimensions(){return this.dimensions_}getFormat(){return this.format_}getLayer(){return this.layer_}getMatrixSet(){return this.matrixSet_}getRequestEncoding(){return this.requestEncoding_}getStyle(){return this.style_}getVersion(){return this.version_}getKeyForDimensions_(){let t=0;const e=[];for(const i in this.dimensions_)e[t++]=i+"-"+this.dimensions_[i];return e.join("/")}updateDimensions(t){Object.assign(this.dimensions_,t),this.setKey(this.getKeyForDimensions_())}createFromWMTSTemplate(t){const e=this.requestEncoding_,i={layer:this.layer_,style:this.style_,tilematrixset:this.matrixSet_};"KVP"==e&&Object.assign(i,{Service:"WMTS",Request:"GetTile",Version:this.version_,Format:this.format_}),t="KVP"==e?vc(t,i):t.replace(/\{(\w+?)\}/g,(function(t,e){return e.toLowerCase()in i?i[e.toLowerCase()]:t}));const n=this.tileGrid,r=this.dimensions_;return function(i,s,o){if(i){const s={TileMatrix:n.getMatrixId(i[0]),TileCol:i[1],TileRow:i[2]};Object.assign(s,r);let o=t;return o="KVP"==e?vc(o,s):o.replace(/\{(\w+?)\}/g,(function(t,e){return s[e]})),o}}}},_T.source.WMTS.optionsFromCapabilities=function(t,e){const i=t.Contents.Layer.find((function(t){return t.Identifier==e.layer}));if(!i)return null;const n=t.Contents.TileMatrixSet;let r;r=i.TileMatrixSetLink.length>1?"projection"in e?i.TileMatrixSetLink.findIndex((function(t){const i=n.find((function(e){return e.Identifier==t.TileMatrixSet})).SupportedCRS,r=Ui(i),s=Ui(e.projection);return r&&s?Ki(r,s):i==e.projection})):i.TileMatrixSetLink.findIndex((function(t){return t.TileMatrixSet==e.matrixSet})):0,r<0&&(r=0);const s=i.TileMatrixSetLink[r].TileMatrixSet,o=i.TileMatrixSetLink[r].TileMatrixSetLimits;let a=i.Format[0];"format"in e&&(a=e.format),r=i.Style.findIndex((function(t){return"style"in e?t.Title==e.style:t.isDefault})),r<0&&(r=0);const l=i.Style[r].Identifier,h={};"Dimension"in i&&i.Dimension.forEach((function(t,e,i){const n=t.Identifier;let r=t.Default;void 0===r&&(r=t.Value[0]),h[n]=r}));const c=t.Contents.TileMatrixSet.find((function(t){return t.Identifier==s}));let u;const d=c.SupportedCRS;if(d&&(u=Ui(d)),"projection"in e){const t=Ui(e.projection);t&&(u&&!Ki(t,u)||(u=t))}let g=!1;const f="ne"==u.getAxisOrientation().substr(0,2);let p=c.TileMatrix[0],m={MinTileCol:0,MinTileRow:0,MaxTileCol:p.MatrixWidth-1,MaxTileRow:p.MatrixHeight-1};if(o){m=o[o.length-1];const t=c.TileMatrix.find((t=>t.Identifier===m.TileMatrix||c.Identifier+":"+t.Identifier===m.TileMatrix));t&&(p=t)}const _=28e-5*p.ScaleDenominator/u.getMetersPerUnit(),y=f?[p.TopLeftCorner[1],p.TopLeftCorner[0]]:p.TopLeftCorner,x=p.TileWidth*_,v=p.TileHeight*_;let S=c.BoundingBox;S&&f&&(S=[S[1],S[0],S[3],S[2]]);let w=[y[0]+x*m.MinTileCol,y[1]-v*(1+m.MaxTileRow),y[0]+x*(1+m.MaxTileCol),y[1]-v*m.MinTileRow];if(void 0!==S&&!Yt(S,w)){const t=i.WGS84BoundingBox,e=Ui("EPSG:4326").getExtent();if(w=S,t)g=t[0]===e[0]&&t[2]===e[2];else{const t=Ji(S,c.SupportedCRS,"EPSG:4326");g=t[0]-1e-10<=e[0]&&t[2]+1e-10>=e[2]}}const E=iu(c,w,o),T=[];let C=e.requestEncoding;if(C=void 0!==C?C:"","OperationsMetadata"in t&&"GetTile"in t.OperationsMetadata){const e=t.OperationsMetadata.GetTile.DCP.HTTP.Get;for(let t=0,i=e.length;t<i;++t)if(e[t].Constraint){const i=e[t].Constraint.find((function(t){return"GetEncoding"==t.name})).AllowedValues.Value;if(""===C&&(C=i[0]),"KVP"!==C)break;i.includes("KVP")&&T.push(e[t].href)}else e[t].href&&(C="KVP",T.push(e[t].href))}return 0===T.length&&(C="REST",i.ResourceURL.forEach((function(t){"tile"===t.resourceType&&(a=t.format,T.push(t.template))}))),{urls:T,layer:e.layer,matrixSet:s,format:a,projection:u,requestEncoding:C,tileGrid:E,style:l,dimensions:h,wrapX:g,crossOrigin:e.crossOrigin}},_T.source.XYZ=fh,_T.source.Zoomify=class extends uh{constructor(t){const e=t.size,i=void 0!==t.tierSizeCalculation?t.tierSizeCalculation:"default",n=t.tilePixelRatio||1,r=e[0],s=e[1],o=[],a=t.tileSize||Lo;let l=a*n;switch(i){case"default":for(;r>l||s>l;)o.push([Math.ceil(r/l),Math.ceil(s/l)]),l+=l;break;case"truncated":let t=r,e=s;for(;t>l||e>l;)o.push([Math.ceil(t/l),Math.ceil(e/l)]),t>>=1,e>>=1;break;default:at(!1,53)}o.push([1,1]),o.reverse();const h=[n],c=[0];for(let t=1,e=o.length;t<e;t++)h.push(n<<t),c.push(o[t-1][0]*o[t-1][1]+c[t-1]);h.reverse();const u=new ql({tileSize:a,extent:t.extent||[0,-s,r,0],resolutions:h});let d=t.url;!d||d.includes("{TileGroup}")||d.includes("{tileIndex}")||(d+="{TileGroup}/{z}-{x}-{y}.jpg");const g=hh(d);let f=a*n;const p=ah(g.map((function(t){return function(e,i,n){if(e){const i=e[0],n=e[1],r=e[2],s=n+r*o[i][0],a={z:i,x:n,y:r,tileIndex:s,TileGroup:"TileGroup"+((s+c[i])/f|0)};return t.replace(/\{(\w+?)\}/g,(function(t,e){return a[e]}))}}}))),m=nc.bind(null,Va(a*n));super({attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,projection:t.projection,tilePixelRatio:n,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileClass:m,tileGrid:u,tileUrlFunction:p,transition:t.transition}),this.zDirection=t.zDirection;const _=p(u.getTileCoordForCoordAndResolution(ge(u.getExtent()),h[h.length-1]),1,null),y=new Image;y.addEventListener("error",function(){f=a,this.changed()}.bind(this)),y.src=_}},_T.source.Zoomify.CustomTile=nc,_T.source.common={},_T.source.common.DEFAULT_WMS_VERSION="1.3.0",_T.source.ogcTileUtil={},_T.source.ogcTileUtil.getMapTileUrlTemplate=Tg,_T.source.ogcTileUtil.getTileSetInfo=Rg,_T.source.ogcTileUtil.getVectorTileUrlTemplate=Cg,_T.source.sourcesFromTileGrid=function(t,e){const i=new tl(32),n=t.getExtent();return function(r,s){i.expireCache(),n&&(r=ye(n,r));const o=t.getZForResolution(s),a=[];return t.forEachTileCoord(r,o,(t=>{const n=t.toString();if(!i.containsKey(n)){const r=e(t);i.set(n,r)}a.push(i.get(n))})),a}},_T.source.wms={},_T.source.wms.DEFAULT_VERSION=Sc,_T.sphere={},_T.sphere.DEFAULT_RADIUS=Li,_T.sphere.getArea=function t(e,i){const n=(i=i||{}).radius||Li,r=i.projection||"EPSG:3857",s=e.getType();"GeometryCollection"!==s&&(e=e.clone().transform(r,"EPSG:4326"));let o,a,l,h,c,u,d=0;switch(s){case"Point":case"MultiPoint":case"LineString":case"MultiLineString":case"LinearRing":break;case"Polygon":for(o=e.getCoordinates(),d=Math.abs(Ai(o[0],n)),l=1,h=o.length;l<h;++l)d-=Math.abs(Ai(o[l],n));break;case"MultiPolygon":for(o=e.getCoordinates(),l=0,h=o.length;l<h;++l)for(a=o[l],d+=Math.abs(Ai(a[0],n)),c=1,u=a.length;c<u;++c)d-=Math.abs(Ai(a[c],n));break;case"GeometryCollection":{const n=e.getGeometries();for(l=0,h=n.length;l<h;++l)d+=t(n[l],i);break}default:throw new Error("Unsupported geometry type: "+s)}return d},_T.sphere.getDistance=Mi,_T.sphere.getLength=function t(e,i){const n=(i=i||{}).radius||Li,r=i.projection||"EPSG:3857",s=e.getType();"GeometryCollection"!==s&&(e=e.clone().transform(r,"EPSG:4326"));let o,a,l,h,c,u,d=0;switch(s){case"Point":case"MultiPoint":break;case"LineString":case"LinearRing":o=e.getCoordinates(),d=Fi(o,n);break;case"MultiLineString":case"Polygon":for(o=e.getCoordinates(),l=0,h=o.length;l<h;++l)d+=Fi(o[l],n);break;case"MultiPolygon":for(o=e.getCoordinates(),l=0,h=o.length;l<h;++l)for(a=o[l],c=0,u=a.length;c<u;++c)d+=Fi(a[c],n);break;case"GeometryCollection":{const n=e.getGeometries();for(l=0,h=n.length;l<h;++l)d+=t(n[l],i);break}default:throw new Error("Unsupported geometry type: "+s)}return d},_T.sphere.offset=Oi,_T.string={},_T.string.compareVersions=pi,_T.string.padNumber=fi,_T.structs={},_T.structs.LRUCache=tl,_T.structs.LinkedList=class{constructor(t){this.first_,this.last_,this.head_,this.circular_=void 0===t||t,this.length_=0}insertItem(t){const e={prev:void 0,next:void 0,data:t},i=this.head_;if(i){const t=i.next;e.prev=i,e.next=t,i.next=e,t&&(t.prev=e),i===this.last_&&(this.last_=e)}else this.first_=e,this.last_=e,this.circular_&&(e.next=e,e.prev=e);this.head_=e,this.length_++}removeItem(){const t=this.head_;if(t){const e=t.next,i=t.prev;e&&(e.prev=i),i&&(i.next=e),this.head_=e||i,this.first_===this.last_?(this.head_=void 0,this.first_=void 0,this.last_=void 0):this.first_===t?this.first_=this.head_:this.last_===t&&(this.last_=i?this.head_.prev:this.head_),this.length_--}}firstItem(){if(this.head_=this.first_,this.head_)return this.head_.data}lastItem(){if(this.head_=this.last_,this.head_)return this.head_.data}nextItem(){if(this.head_&&this.head_.next)return this.head_=this.head_.next,this.head_.data}getNextItem(){if(this.head_&&this.head_.next)return this.head_.next.data}prevItem(){if(this.head_&&this.head_.prev)return this.head_=this.head_.prev,this.head_.data}getPrevItem(){if(this.head_&&this.head_.prev)return this.head_.prev.data}getCurrItem(){if(this.head_)return this.head_.data}setFirstItem(){this.circular_&&this.head_&&(this.first_=this.head_,this.last_=this.head_.prev)}concat(t){if(t.head_){if(this.head_){const e=this.head_.next;this.head_.next=t.first_,t.first_.prev=this.head_,e.prev=t.last_,t.last_.next=e,this.length_+=t.length_}else this.head_=t.head_,this.first_=t.first_,this.last_=t.last_,this.length_=t.length_;t.head_=void 0,t.first_=void 0,t.last_=void 0,t.length_=0}}getLength(){return this.length_}},_T.structs.PriorityQueue=To,_T.structs.PriorityQueue.DROP=Eo,_T.structs.RBush=Ah,_T.style={},_T.style.Circle=ng,_T.style.Fill=rg,_T.style.Icon=lg,_T.style.IconImage=og,_T.style.IconImage.get=ag,_T.style.IconImageCache=es,_T.style.IconImageCache.shared=ns,_T.style.Image=eg,_T.style.RegularShape=ig,_T.style.Stroke=hg,_T.style.Style=cg,_T.style.Style.createDefaultStyle=gg,_T.style.Style.createEditingStyle=fg,_T.style.Style.toFunction=ug,_T.style.Text=mg,_T.style.expressions={},_T.style.expressions.Operators=Ld,_T.style.expressions.PALETTE_TEXTURE_ARRAY=qd,_T.style.expressions.arrayToGlsl=Od,_T.style.expressions.colorToGlsl=Nd,_T.style.expressions.expressionToGlsl=Gd,_T.style.expressions.getStringNumberEquivalent=Dd,_T.style.expressions.getValueType=Md,_T.style.expressions.isTypeUnique=Fd,_T.style.expressions.numberToGlsl=Ad,_T.style.expressions.stringToGlsl=kd,_T.style.expressions.uniformNameForVariable=Kd,_T.style.flat={},_T.style.flat.toStyle=_g,_T.tilecoord={},_T.tilecoord.createOrUpdate=el,_T.tilecoord.fromKey=sl,_T.tilecoord.getCacheKeyForTileKey=rl,_T.tilecoord.getKey=nl,_T.tilecoord.getKeyZXY=il,_T.tilecoord.hash=ol,_T.tilecoord.withinExtentAndZ=al,_T.tilegrid={},_T.tilegrid.TileGrid=ql,_T.tilegrid.WMTS=eu,_T.tilegrid.WMTS.createFromCapabilitiesMatrixSet=iu,_T.tilegrid.common={},_T.tilegrid.common.DEFAULT_MAX_ZOOM=42,_T.tilegrid.common.DEFAULT_TILE_SIZE=Lo,_T.tilegrid.createForExtent=Jl,_T.tilegrid.createForProjection=eh,_T.tilegrid.createXYZ=Ql,_T.tilegrid.extentFromProjection=ih,_T.tilegrid.getForProjection=Hl,_T.tilegrid.wrapX=$l,_T.tileurlfunction={},_T.tileurlfunction.createFromTemplate=sh,_T.tileurlfunction.createFromTemplates=oh,_T.tileurlfunction.createFromTileUrlFunctions=ah,_T.tileurlfunction.expandUrl=hh,_T.tileurlfunction.nullTileUrlFunction=lh,_T.transform={},_T.transform.apply=bt,_T.transform.compose=Mt,_T.transform.composeCssTransform=function(t,e,i,n,r,s,o){return Nt(Mt([1,0,0,1,0,0],t,e,i,n,r,s,o))},_T.transform.create=St,_T.transform.determinant=At,_T.transform.invert=function(t){return Ft(t,t)},_T.transform.makeInverse=Ft,_T.transform.makeScale=It,_T.transform.multiply=Et,_T.transform.reset=wt,_T.transform.rotate=Rt,_T.transform.scale=Pt,_T.transform.set=Tt,_T.transform.setFromArray=Ct,_T.transform.toString=Nt,_T.transform.translate=Lt,_T.uri={},_T.uri.appendParams=vc,_T.util={},_T.util.VERSION="latest",_T.util.abstract=B,_T.util.getUid=z,_T.vec={},_T.vec.mat4={},_T.vec.mat4.create=Xu,_T.vec.mat4.fromTransform=Vu,_T.webgl={},_T.webgl.ARRAY_BUFFER=nu,_T.webgl.Buffer=Gu,_T.webgl.Buffer.getArrayClassForType=ju,_T.webgl.DYNAMIC_DRAW=ou,_T.webgl.ELEMENT_ARRAY_BUFFER=ru,_T.webgl.FLOAT=au,_T.webgl.Helper=nd,_T.webgl.Helper.computeAttributesStride=rd,_T.webgl.PaletteTexture=od,_T.webgl.PostProcessingPass=zu,_T.webgl.RenderTarget=ld,_T.webgl.STATIC_DRAW=su,_T.webgl.STREAM_DRAW=35040,_T.webgl.ShaderBuilder={},_T.webgl.ShaderBuilder.ShaderBuilder=Qd,_T.webgl.ShaderBuilder.parseLiteralStyle=tg,_T.webgl.TileTexture=dd,_T.webgl.UNSIGNED_BYTE=5121,_T.webgl.UNSIGNED_INT=5125,_T.webgl.UNSIGNED_SHORT=5123,_T.webgl.getContext=hu,_T.webgl.getSupportedExtensions=function(){if(!cu){const t=hu(document.createElement("canvas"));t&&(cu=t.getSupportedExtensions())}return cu},_T.xml={},_T.xml.OBJECT_PROPERTY_NODE_FACTORY=bu,_T.xml.XML_SCHEMA_INSTANCE_URI=uu,_T.xml.createElementNS=du,_T.xml.getAllTextContent=gu,_T.xml.getAllTextContent_=fu,_T.xml.getAttributeNS=mu,_T.xml.getDocument=Du,_T.xml.getXMLSerializer=Nu,_T.xml.isDocument=pu,_T.xml.makeArrayExtender=yu,_T.xml.makeArrayPusher=xu,_T.xml.makeArraySerializer=Tu,_T.xml.makeChildAppender=Eu,_T.xml.makeObjectPropertyPusher=Su,_T.xml.makeObjectPropertySetter=wu,_T.xml.makeReplacer=vu,_T.xml.makeSequence=Ru,_T.xml.makeSimpleNodeFactory=Cu,_T.xml.makeStructureNS=Pu,_T.xml.parse=_u,_T.xml.parseNode=Iu,_T.xml.pushParseAndPop=Lu,_T.xml.pushSerializeAndPop=Fu,_T.xml.registerDocument=function(t){Ou=t},_T.xml.registerXMLSerializer=function(t){Au=t},_T.xml.serialize=Mu,_T}()
;/* @license
Papa Parse
v5.3.1
https://github.com/mholt/PapaParse
License: MIT
*/
!function(e,t){"function"==typeof define&&define.amd?define([],t):"object"==typeof module&&"undefined"!=typeof exports?module.exports=t():e.Papa=t()}(this,function s(){"use strict";var f="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==f?f:{};var n=!f.document&&!!f.postMessage,o=n&&/blob:/i.test((f.location||{}).protocol),a={},h=0,b={parse:function(e,t){var i=(t=t||{}).dynamicTyping||!1;M(i)&&(t.dynamicTypingFunction=i,i={});if(t.dynamicTyping=i,t.transform=!!M(t.transform)&&t.transform,t.worker&&b.WORKERS_SUPPORTED){var r=function(){if(!b.WORKERS_SUPPORTED)return!1;var e=(i=f.URL||f.webkitURL||null,r=s.toString(),b.BLOB_URL||(b.BLOB_URL=i.createObjectURL(new Blob(["(",r,")();"],{type:"text/javascript"})))),t=new f.Worker(e);var i,r;return t.onmessage=_,t.id=h++,a[t.id]=t}();return r.userStep=t.step,r.userChunk=t.chunk,r.userComplete=t.complete,r.userError=t.error,t.step=M(t.step),t.chunk=M(t.chunk),t.complete=M(t.complete),t.error=M(t.error),delete t.worker,void r.postMessage({input:e,config:t,workerId:r.id})}var n=null;b.NODE_STREAM_INPUT,"string"==typeof e?n=t.download?new l(t):new p(t):!0===e.readable&&M(e.read)&&M(e.on)?n=new g(t):(f.File&&e instanceof File||e instanceof Object)&&(n=new c(t));return n.stream(e)},unparse:function(e,t){var n=!1,_=!0,m=",",y="\r\n",s='"',a=s+s,i=!1,r=null,o=!1;!function(){if("object"!=typeof t)return;"string"!=typeof t.delimiter||b.BAD_DELIMITERS.filter(function(e){return-1!==t.delimiter.indexOf(e)}).length||(m=t.delimiter);("boolean"==typeof t.quotes||"function"==typeof t.quotes||Array.isArray(t.quotes))&&(n=t.quotes);"boolean"!=typeof t.skipEmptyLines&&"string"!=typeof t.skipEmptyLines||(i=t.skipEmptyLines);"string"==typeof t.newline&&(y=t.newline);"string"==typeof t.quoteChar&&(s=t.quoteChar);"boolean"==typeof t.header&&(_=t.header);if(Array.isArray(t.columns)){if(0===t.columns.length)throw new Error("Option columns is empty");r=t.columns}void 0!==t.escapeChar&&(a=t.escapeChar+s);"boolean"==typeof t.escapeFormulae&&(o=t.escapeFormulae)}();var h=new RegExp(j(s),"g");"string"==typeof e&&(e=JSON.parse(e));if(Array.isArray(e)){if(!e.length||Array.isArray(e[0]))return u(null,e,i);if("object"==typeof e[0])return u(r||Object.keys(e[0]),e,i)}else if("object"==typeof e)return"string"==typeof e.data&&(e.data=JSON.parse(e.data)),Array.isArray(e.data)&&(e.fields||(e.fields=e.meta&&e.meta.fields),e.fields||(e.fields=Array.isArray(e.data[0])?e.fields:"object"==typeof e.data[0]?Object.keys(e.data[0]):[]),Array.isArray(e.data[0])||"object"==typeof e.data[0]||(e.data=[e.data])),u(e.fields||[],e.data||[],i);throw new Error("Unable to serialize unrecognized input");function u(e,t,i){var r="";"string"==typeof e&&(e=JSON.parse(e)),"string"==typeof t&&(t=JSON.parse(t));var n=Array.isArray(e)&&0<e.length,s=!Array.isArray(t[0]);if(n&&_){for(var a=0;a<e.length;a++)0<a&&(r+=m),r+=v(e[a],a);0<t.length&&(r+=y)}for(var o=0;o<t.length;o++){var h=n?e.length:t[o].length,u=!1,f=n?0===Object.keys(t[o]).length:0===t[o].length;if(i&&!n&&(u="greedy"===i?""===t[o].join("").trim():1===t[o].length&&0===t[o][0].length),"greedy"===i&&n){for(var d=[],l=0;l<h;l++){var c=s?e[l]:l;d.push(t[o][c])}u=""===d.join("").trim()}if(!u){for(var p=0;p<h;p++){0<p&&!f&&(r+=m);var g=n&&s?e[p]:p;r+=v(t[o][g],p)}o<t.length-1&&(!i||0<h&&!f)&&(r+=y)}}return r}function v(e,t){if(null==e)return"";if(e.constructor===Date)return JSON.stringify(e).slice(1,25);!0===o&&"string"==typeof e&&null!==e.match(/^[=+\-@].*$/)&&(e="'"+e);var i=e.toString().replace(h,a),r="boolean"==typeof n&&n||"function"==typeof n&&n(e,t)||Array.isArray(n)&&n[t]||function(e,t){for(var i=0;i<t.length;i++)if(-1<e.indexOf(t[i]))return!0;return!1}(i,b.BAD_DELIMITERS)||-1<i.indexOf(m)||" "===i.charAt(0)||" "===i.charAt(i.length-1);return r?s+i+s:i}}};if(b.RECORD_SEP=String.fromCharCode(30),b.UNIT_SEP=String.fromCharCode(31),b.BYTE_ORDER_MARK="\ufeff",b.BAD_DELIMITERS=["\r","\n",'"',b.BYTE_ORDER_MARK],b.WORKERS_SUPPORTED=!n&&!!f.Worker,b.NODE_STREAM_INPUT=1,b.LocalChunkSize=10485760,b.RemoteChunkSize=5242880,b.DefaultDelimiter=",",b.Parser=E,b.ParserHandle=i,b.NetworkStreamer=l,b.FileStreamer=c,b.StringStreamer=p,b.ReadableStreamStreamer=g,f.jQuery){var d=f.jQuery;d.fn.parse=function(o){var i=o.config||{},h=[];return this.each(function(e){if(!("INPUT"===d(this).prop("tagName").toUpperCase()&&"file"===d(this).attr("type").toLowerCase()&&f.FileReader)||!this.files||0===this.files.length)return!0;for(var t=0;t<this.files.length;t++)h.push({file:this.files[t],inputElem:this,instanceConfig:d.extend({},i)})}),e(),this;function e(){if(0!==h.length){var e,t,i,r,n=h[0];if(M(o.before)){var s=o.before(n.file,n.inputElem);if("object"==typeof s){if("abort"===s.action)return e="AbortError",t=n.file,i=n.inputElem,r=s.reason,void(M(o.error)&&o.error({name:e},t,i,r));if("skip"===s.action)return void u();"object"==typeof s.config&&(n.instanceConfig=d.extend(n.instanceConfig,s.config))}else if("skip"===s)return void u()}var a=n.instanceConfig.complete;n.instanceConfig.complete=function(e){M(a)&&a(e,n.file,n.inputElem),u()},b.parse(n.file,n.instanceConfig)}else M(o.complete)&&o.complete()}function u(){h.splice(0,1),e()}}}function u(e){this._handle=null,this._finished=!1,this._completed=!1,this._halted=!1,this._input=null,this._baseIndex=0,this._partialLine="",this._rowCount=0,this._start=0,this._nextChunk=null,this.isFirstChunk=!0,this._completeResults={data:[],errors:[],meta:{}},function(e){var t=w(e);t.chunkSize=parseInt(t.chunkSize),e.step||e.chunk||(t.chunkSize=null);this._handle=new i(t),(this._handle.streamer=this)._config=t}.call(this,e),this.parseChunk=function(e,t){if(this.isFirstChunk&&M(this._config.beforeFirstChunk)){var i=this._config.beforeFirstChunk(e);void 0!==i&&(e=i)}this.isFirstChunk=!1,this._halted=!1;var r=this._partialLine+e;this._partialLine="";var n=this._handle.parse(r,this._baseIndex,!this._finished);if(!this._handle.paused()&&!this._handle.aborted()){var s=n.meta.cursor;this._finished||(this._partialLine=r.substring(s-this._baseIndex),this._baseIndex=s),n&&n.data&&(this._rowCount+=n.data.length);var a=this._finished||this._config.preview&&this._rowCount>=this._config.preview;if(o)f.postMessage({results:n,workerId:b.WORKER_ID,finished:a});else if(M(this._config.chunk)&&!t){if(this._config.chunk(n,this._handle),this._handle.paused()||this._handle.aborted())return void(this._halted=!0);n=void 0,this._completeResults=void 0}return this._config.step||this._config.chunk||(this._completeResults.data=this._completeResults.data.concat(n.data),this._completeResults.errors=this._completeResults.errors.concat(n.errors),this._completeResults.meta=n.meta),this._completed||!a||!M(this._config.complete)||n&&n.meta.aborted||(this._config.complete(this._completeResults,this._input),this._completed=!0),a||n&&n.meta.paused||this._nextChunk(),n}this._halted=!0},this._sendError=function(e){M(this._config.error)?this._config.error(e):o&&this._config.error&&f.postMessage({workerId:b.WORKER_ID,error:e,finished:!1})}}function l(e){var r;(e=e||{}).chunkSize||(e.chunkSize=b.RemoteChunkSize),u.call(this,e),this._nextChunk=n?function(){this._readChunk(),this._chunkLoaded()}:function(){this._readChunk()},this.stream=function(e){this._input=e,this._nextChunk()},this._readChunk=function(){if(this._finished)this._chunkLoaded();else{if(r=new XMLHttpRequest,this._config.withCredentials&&(r.withCredentials=this._config.withCredentials),n||(r.onload=v(this._chunkLoaded,this),r.onerror=v(this._chunkError,this)),r.open(this._config.downloadRequestBody?"POST":"GET",this._input,!n),this._config.downloadRequestHeaders){var e=this._config.downloadRequestHeaders;for(var t in e)r.setRequestHeader(t,e[t])}if(this._config.chunkSize){var i=this._start+this._config.chunkSize-1;r.setRequestHeader("Range","bytes="+this._start+"-"+i)}try{r.send(this._config.downloadRequestBody)}catch(e){this._chunkError(e.message)}n&&0===r.status&&this._chunkError()}},this._chunkLoaded=function(){4===r.readyState&&(r.status<200||400<=r.status?this._chunkError():(this._start+=this._config.chunkSize?this._config.chunkSize:r.responseText.length,this._finished=!this._config.chunkSize||this._start>=function(e){var t=e.getResponseHeader("Content-Range");if(null===t)return-1;return parseInt(t.substring(t.lastIndexOf("/")+1))}(r),this.parseChunk(r.responseText)))},this._chunkError=function(e){var t=r.statusText||e;this._sendError(new Error(t))}}function c(e){var r,n;(e=e||{}).chunkSize||(e.chunkSize=b.LocalChunkSize),u.call(this,e);var s="undefined"!=typeof FileReader;this.stream=function(e){this._input=e,n=e.slice||e.webkitSlice||e.mozSlice,s?((r=new FileReader).onload=v(this._chunkLoaded,this),r.onerror=v(this._chunkError,this)):r=new FileReaderSync,this._nextChunk()},this._nextChunk=function(){this._finished||this._config.preview&&!(this._rowCount<this._config.preview)||this._readChunk()},this._readChunk=function(){var e=this._input;if(this._config.chunkSize){var t=Math.min(this._start+this._config.chunkSize,this._input.size);e=n.call(e,this._start,t)}var i=r.readAsText(e,this._config.encoding);s||this._chunkLoaded({target:{result:i}})},this._chunkLoaded=function(e){this._start+=this._config.chunkSize,this._finished=!this._config.chunkSize||this._start>=this._input.size,this.parseChunk(e.target.result)},this._chunkError=function(){this._sendError(r.error)}}function p(e){var i;u.call(this,e=e||{}),this.stream=function(e){return i=e,this._nextChunk()},this._nextChunk=function(){if(!this._finished){var e,t=this._config.chunkSize;return t?(e=i.substring(0,t),i=i.substring(t)):(e=i,i=""),this._finished=!i,this.parseChunk(e)}}}function g(e){u.call(this,e=e||{});var t=[],i=!0,r=!1;this.pause=function(){u.prototype.pause.apply(this,arguments),this._input.pause()},this.resume=function(){u.prototype.resume.apply(this,arguments),this._input.resume()},this.stream=function(e){this._input=e,this._input.on("data",this._streamData),this._input.on("end",this._streamEnd),this._input.on("error",this._streamError)},this._checkIsFinished=function(){r&&1===t.length&&(this._finished=!0)},this._nextChunk=function(){this._checkIsFinished(),t.length?this.parseChunk(t.shift()):i=!0},this._streamData=v(function(e){try{t.push("string"==typeof e?e:e.toString(this._config.encoding)),i&&(i=!1,this._checkIsFinished(),this.parseChunk(t.shift()))}catch(e){this._streamError(e)}},this),this._streamError=v(function(e){this._streamCleanUp(),this._sendError(e)},this),this._streamEnd=v(function(){this._streamCleanUp(),r=!0,this._streamData("")},this),this._streamCleanUp=v(function(){this._input.removeListener("data",this._streamData),this._input.removeListener("end",this._streamEnd),this._input.removeListener("error",this._streamError)},this)}function i(m){var a,o,h,r=Math.pow(2,53),n=-r,s=/^\s*-?(\d+\.?|\.\d+|\d+\.\d+)([eE][-+]?\d+)?\s*$/,u=/^(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))|(\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z))$/,t=this,i=0,f=0,d=!1,e=!1,l=[],c={data:[],errors:[],meta:{}};if(M(m.step)){var p=m.step;m.step=function(e){if(c=e,_())g();else{if(g(),0===c.data.length)return;i+=e.data.length,m.preview&&i>m.preview?o.abort():(c.data=c.data[0],p(c,t))}}}function y(e){return"greedy"===m.skipEmptyLines?""===e.join("").trim():1===e.length&&0===e[0].length}function g(){if(c&&h&&(k("Delimiter","UndetectableDelimiter","Unable to auto-detect delimiting character; defaulted to '"+b.DefaultDelimiter+"'"),h=!1),m.skipEmptyLines)for(var e=0;e<c.data.length;e++)y(c.data[e])&&c.data.splice(e--,1);return _()&&function(){if(!c)return;function e(e,t){M(m.transformHeader)&&(e=m.transformHeader(e,t)),l.push(e)}if(Array.isArray(c.data[0])){for(var t=0;_()&&t<c.data.length;t++)c.data[t].forEach(e);c.data.splice(0,1)}else c.data.forEach(e)}(),function(){if(!c||!m.header&&!m.dynamicTyping&&!m.transform)return c;function e(e,t){var i,r=m.header?{}:[];for(i=0;i<e.length;i++){var n=i,s=e[i];m.header&&(n=i>=l.length?"__parsed_extra":l[i]),m.transform&&(s=m.transform(s,n)),s=v(n,s),"__parsed_extra"===n?(r[n]=r[n]||[],r[n].push(s)):r[n]=s}return m.header&&(i>l.length?k("FieldMismatch","TooManyFields","Too many fields: expected "+l.length+" fields but parsed "+i,f+t):i<l.length&&k("FieldMismatch","TooFewFields","Too few fields: expected "+l.length+" fields but parsed "+i,f+t)),r}var t=1;!c.data.length||Array.isArray(c.data[0])?(c.data=c.data.map(e),t=c.data.length):c.data=e(c.data,0);m.header&&c.meta&&(c.meta.fields=l);return f+=t,c}()}function _(){return m.header&&0===l.length}function v(e,t){return i=e,m.dynamicTypingFunction&&void 0===m.dynamicTyping[i]&&(m.dynamicTyping[i]=m.dynamicTypingFunction(i)),!0===(m.dynamicTyping[i]||m.dynamicTyping)?"true"===t||"TRUE"===t||"false"!==t&&"FALSE"!==t&&(function(e){if(s.test(e)){var t=parseFloat(e);if(n<t&&t<r)return!0}return!1}(t)?parseFloat(t):u.test(t)?new Date(t):""===t?null:t):t;var i}function k(e,t,i,r){var n={type:e,code:t,message:i};void 0!==r&&(n.row=r),c.errors.push(n)}this.parse=function(e,t,i){var r=m.quoteChar||'"';if(m.newline||(m.newline=function(e,t){e=e.substring(0,1048576);var i=new RegExp(j(t)+"([^]*?)"+j(t),"gm"),r=(e=e.replace(i,"")).split("\r"),n=e.split("\n"),s=1<n.length&&n[0].length<r[0].length;if(1===r.length||s)return"\n";for(var a=0,o=0;o<r.length;o++)"\n"===r[o][0]&&a++;return a>=r.length/2?"\r\n":"\r"}(e,r)),h=!1,m.delimiter)M(m.delimiter)&&(m.delimiter=m.delimiter(e),c.meta.delimiter=m.delimiter);else{var n=function(e,t,i,r,n){var s,a,o,h;n=n||[",","\t","|",";",b.RECORD_SEP,b.UNIT_SEP];for(var u=0;u<n.length;u++){var f=n[u],d=0,l=0,c=0;o=void 0;for(var p=new E({comments:r,delimiter:f,newline:t,preview:10}).parse(e),g=0;g<p.data.length;g++)if(i&&y(p.data[g]))c++;else{var _=p.data[g].length;l+=_,void 0!==o?0<_&&(d+=Math.abs(_-o),o=_):o=_}0<p.data.length&&(l/=p.data.length-c),(void 0===a||d<=a)&&(void 0===h||h<l)&&1.99<l&&(a=d,s=f,h=l)}return{successful:!!(m.delimiter=s),bestDelimiter:s}}(e,m.newline,m.skipEmptyLines,m.comments,m.delimitersToGuess);n.successful?m.delimiter=n.bestDelimiter:(h=!0,m.delimiter=b.DefaultDelimiter),c.meta.delimiter=m.delimiter}var s=w(m);return m.preview&&m.header&&s.preview++,a=e,o=new E(s),c=o.parse(a,t,i),g(),d?{meta:{paused:!0}}:c||{meta:{paused:!1}}},this.paused=function(){return d},this.pause=function(){d=!0,o.abort(),a=M(m.chunk)?"":a.substring(o.getCharIndex())},this.resume=function(){t.streamer._halted?(d=!1,t.streamer.parseChunk(a,!0)):setTimeout(t.resume,3)},this.aborted=function(){return e},this.abort=function(){e=!0,o.abort(),c.meta.aborted=!0,M(m.complete)&&m.complete(c),a=""}}function j(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function E(e){var S,O=(e=e||{}).delimiter,x=e.newline,I=e.comments,T=e.step,D=e.preview,A=e.fastMode,L=S=void 0===e.quoteChar?'"':e.quoteChar;if(void 0!==e.escapeChar&&(L=e.escapeChar),("string"!=typeof O||-1<b.BAD_DELIMITERS.indexOf(O))&&(O=","),I===O)throw new Error("Comment character same as delimiter");!0===I?I="#":("string"!=typeof I||-1<b.BAD_DELIMITERS.indexOf(I))&&(I=!1),"\n"!==x&&"\r"!==x&&"\r\n"!==x&&(x="\n");var F=0,z=!1;this.parse=function(r,t,i){if("string"!=typeof r)throw new Error("Input must be a string");var n=r.length,e=O.length,s=x.length,a=I.length,o=M(T),h=[],u=[],f=[],d=F=0;if(!r)return C();if(A||!1!==A&&-1===r.indexOf(S)){for(var l=r.split(x),c=0;c<l.length;c++){if(f=l[c],F+=f.length,c!==l.length-1)F+=x.length;else if(i)return C();if(!I||f.substring(0,a)!==I){if(o){if(h=[],k(f.split(O)),R(),z)return C()}else k(f.split(O));if(D&&D<=c)return h=h.slice(0,D),C(!0)}}return C()}for(var p=r.indexOf(O,F),g=r.indexOf(x,F),_=new RegExp(j(L)+j(S),"g"),m=r.indexOf(S,F);;)if(r[F]!==S)if(I&&0===f.length&&r.substring(F,F+a)===I){if(-1===g)return C();F=g+s,g=r.indexOf(x,F),p=r.indexOf(O,F)}else if(-1!==p&&(p<g||-1===g))f.push(r.substring(F,p)),F=p+e,p=r.indexOf(O,F);else{if(-1===g)break;if(f.push(r.substring(F,g)),w(g+s),o&&(R(),z))return C();if(D&&h.length>=D)return C(!0)}else for(m=F,F++;;){if(-1===(m=r.indexOf(S,m+1)))return i||u.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:h.length,index:F}),E();if(m===n-1)return E(r.substring(F,m).replace(_,S));if(S!==L||r[m+1]!==L){if(S===L||0===m||r[m-1]!==L){-1!==p&&p<m+1&&(p=r.indexOf(O,m+1)),-1!==g&&g<m+1&&(g=r.indexOf(x,m+1));var y=b(-1===g?p:Math.min(p,g));if(r[m+1+y]===O){f.push(r.substring(F,m).replace(_,S)),r[F=m+1+y+e]!==S&&(m=r.indexOf(S,F)),p=r.indexOf(O,F),g=r.indexOf(x,F);break}var v=b(g);if(r.substring(m+1+v,m+1+v+s)===x){if(f.push(r.substring(F,m).replace(_,S)),w(m+1+v+s),p=r.indexOf(O,F),m=r.indexOf(S,F),o&&(R(),z))return C();if(D&&h.length>=D)return C(!0);break}u.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:h.length,index:F}),m++}}else m++}return E();function k(e){h.push(e),d=F}function b(e){var t=0;if(-1!==e){var i=r.substring(m+1,e);i&&""===i.trim()&&(t=i.length)}return t}function E(e){return i||(void 0===e&&(e=r.substring(F)),f.push(e),F=n,k(f),o&&R()),C()}function w(e){F=e,k(f),f=[],g=r.indexOf(x,F)}function C(e){return{data:h,errors:u,meta:{delimiter:O,linebreak:x,aborted:z,truncated:!!e,cursor:d+(t||0)}}}function R(){T(C()),h=[],u=[]}},this.abort=function(){z=!0},this.getCharIndex=function(){return F}}function _(e){var t=e.data,i=a[t.workerId],r=!1;if(t.error)i.userError(t.error,t.file);else if(t.results&&t.results.data){var n={abort:function(){r=!0,m(t.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:y,resume:y};if(M(i.userStep)){for(var s=0;s<t.results.data.length&&(i.userStep({data:t.results.data[s],errors:t.results.errors,meta:t.results.meta},n),!r);s++);delete t.results}else M(i.userChunk)&&(i.userChunk(t.results,n,t.file),delete t.results)}t.finished&&!r&&m(t.workerId,t.results)}function m(e,t){var i=a[e];M(i.userComplete)&&i.userComplete(t),i.terminate(),delete a[e]}function y(){throw new Error("Not implemented.")}function w(e){if("object"!=typeof e||null===e)return e;var t=Array.isArray(e)?[]:{};for(var i in e)t[i]=w(e[i]);return t}function v(e,t){return function(){e.apply(t,arguments)}}function M(e){return"function"==typeof e}return o&&(f.onmessage=function(e){var t=e.data;void 0===b.WORKER_ID&&t&&(b.WORKER_ID=t.workerId);if("string"==typeof t.input)f.postMessage({workerId:b.WORKER_ID,results:b.parse(t.input,t.config),finished:!0});else if(f.File&&t.input instanceof File||t.input instanceof Object){var i=b.parse(t.input,t.config);i&&f.postMessage({workerId:b.WORKER_ID,results:i,finished:!0})}}),(l.prototype=Object.create(u.prototype)).constructor=l,(c.prototype=Object.create(u.prototype)).constructor=c,(p.prototype=Object.create(p.prototype)).constructor=p,(g.prototype=Object.create(u.prototype)).constructor=g,b});
;(function(){"use strict";function MapplicGeo(element){let self=this;this.o={extent:[-18878672.443631265,-9326678.110352932,21196344.241947223,19298333.807917416],center:[23.41,46.82],minZoom:1,maxZoom:18,rotation:!1,rotate:0,data:'data.json',csv:!1,sidebar:!1,search:!0,searchfields:['title','about'],sortbytitle:!1,padding:[0,0,0,0],portrait:800,rightSidebar:!1,portraitSidebarAbove:!1,thumbnail:!0,minHeight:0,maxHeight:Infinity,improvedPerformance:!1,hidpi:!0,constrainResolution:!1,renderBuffer:1000,attribution:!0,attributionCollapsible:!1,deeplinking:!0,mouseWheel:!0,fullscreen:!1,mouseWheelShift:!1,zoomButtons:!1,resetButton:!1,levelselector:!1,maptilerkey:!1,mapboxtoken:!1,bingmapskey:!1,showFullExtent:!0,globalSample:!1,blurOnZoomOut:!0,resetZoomOnBlur:!1,moreText:!1,hoverTooltip:!0,hoverTooltipFollow:!1,customcss:null}
this.localize={search:'Search',more:'More',pdir:'mgeo/'}
this.wp=!1;this.data=null;this.init=function(options){Object.assign(this.o,options);self.el=element;if(typeof mgeo_localize!=='undefined'){Object.assign(this.localize,mgeo_localize);this.wp=!0}
self.preloader=document.createElement('div');self.preloader.classList.add('mgeo-preloader');self.el.appendChild(self.preloader);if(self.el.dataset.json)self.o.data=self.el.dataset.json;if(self.el.dataset.jsonstr){this.processData(JSON.parse(self.el.dataset.jsonstr));self.el.removeAttribute('data-jsonstr')}else self.getJSON(self.o.data).then(this.processData)}
this.processData=function(json){self.data=json;if(json.settings)delete json.settings.data;Object.assign(self.o,json.settings);if(self.o.moreText)self.localize.more=self.o.moreText;if(self.o.improvedPerformance){self.o.hidpi=!1;self.o.renderBuffer=200}
self.dir=new Directory().init();self.styles=new Styles().init();self.container=new Container().init();self.actions=new Actions().init();if(self.o.sidebar)self.sidebar=new Sidebar().init();if(self.o.deeplinking)self.deeplinking=new Deeplinking().init();self.styles.addStyles(json.styles);self.dir.registerGroups(json.groups);self.container.addLayers(json.layers);self.dir.resolveLocations(json.locations);self.container.addMarkers(json.locations);self.container.resize();if(self.o.sidebar){if(self.o.search)self.sidebar.addGroups(json.groups);self.sidebar.addLocations(json.locations)}
self.getCSV(self.o.csv).then(function(csv){self.dir.resolveLocations(csv.data,!0);self.container.addMarkers(csv.data);if(self.o.sidebar)self.sidebar.addLocations(csv.data);self.ready()}).catch(function(error){self.ready()})}
this.getJSON=function(source){return new Promise(function(resolve,reject){if(typeof source==='object')resolve(source);else if(typeof source==='string'){var headers=new Headers();headers.append('pragma','no-cache');headers.append('cache-control','no-cache');fetch(source,{headers:headers}).then(response=>response.json()).then(data=>{resolve(data)}).catch(function(error){resolve({})})}else resolve('invaild json')})}
this.getCSV=function(source){return new Promise(function(resolve,reject){if(typeof Papa==='undefined')reject('CSV parser missing');Papa.parse(source,{header:!0,download:!0,encoding:'UTF-8',skipEmptyLines:!0,transformHeader:function(h){return h.trim().toLowerCase()},complete:function(results){resolve(results)},error:function(err){reject(err)}})})}
this.ready=function(){setTimeout(function(){self.deeplinking?.check()},400);self.el.dispatchEvent(new CustomEvent('mapready',{detail:self}));self.preloader.style.opacity=0;setTimeout(function(){self.el.removeChild(self.preloader)},200)}
function Sidebar(){const s=this;this.el=null;this.header=null;this.list=null;this.toggle=null;this.tags=null;this.filters=null;this.popup=null;this.init=function(){this.el=document.createElement('div');this.el.classList.add('mgeo-sidebar');if(self.o.rightSidebar)this.el.classList.add('mgeo-sidebar-right');self.container.addSidebarControl(this.el);let el=document.createElement('div');el.classList.add('mgeo-sidebar-dir');this.el.appendChild(el);if(self.o.search){this.header=document.createElement('div');this.header.classList.add('mgeo-sidebar-header');el.appendChild(this.header);const magnifier=self.styles.getIcon('magnifier');this.header.appendChild(magnifier);const clear=document.createElement('button');clear.classList.add('mgeo-filter-clear');clear.appendChild(self.styles.getIcon('cross'));this.header.appendChild(clear);const wrap=document.createElement('div');this.header.appendChild(wrap);const input=document.createElement('input');input.classList.add('mgeo-search-input');input.setAttribute('type','text');input.setAttribute('spellcheck','false');input.setAttribute('placeholder',self.localize.search);input.addEventListener('keyup',function(e){let change=!0;if(input.value){if(self.dir.filters.keyword!=input.value)self.dir.filters.keyword=input.value.replace(/\s+/g,' ').trim();else change=!1}else delete self.dir.filters.keyword;if(change){s.el.classList.toggle('mgeo-sidebar-header-opened',input.value.length<1);s.search();s.refreshCounts()}});input.addEventListener('focus',function(){if(input.value.length<1)s.el.classList.add('mgeo-sidebar-header-opened')});document.addEventListener('click',function(e){if(s.header!=e.target&&!s.header.contains(e.target))s.el.classList.remove('mgeo-sidebar-header-opened')});wrap.appendChild(input);clear.addEventListener('click',function(e){e.preventDefault();input.value='';s.tags.innerHTML='';self.dir.filters={};s.el.classList.remove('mgeo-sidebar-tagsrow');s.search();s.refreshCounts()});this.toggle=document.createElement('button');this.toggle.classList.add('mgeo-search-toggle');this.toggle.appendChild(self.styles.getIcon('filter'));this.toggle.addEventListener('click',function(e){e.preventDefault();s.el.classList.toggle('mgeo-sidebar-header-opened')});this.header.appendChild(this.toggle);this.tags=document.createElement('div');this.tags.classList.add('mgeo-sidebar-tags');this.header.appendChild(this.tags);this.filters=document.createElement('div');this.filters.classList.add('mgeo-filters');this.header.appendChild(this.filters);const dim=document.createElement('div');dim.classList.add('mgeo-sidebar-dim');el.appendChild(dim)}else this.el.classList.add('mgeo-sidebar-nosearch');this.list=document.createElement('ul');this.list.classList.add('mgeo-sidebar-list');el.appendChild(this.list);return this}
this.search=function(){self.dir.search(this.list);if(Object.keys(self.dir.filters).length===0)self.el.classList.remove('mgeo-filter-active');else self.el.classList.add('mgeo-filter-active')}
this.refreshCounts=function(){if(!this.filters)return!1;const filters=this.filters.querySelectorAll('.mgeo-filter');for(const filter of filters){let count=0;const items=s.list.querySelectorAll('.mgeo-dir-item:not(.mgeo-hidden)');for(const item of items){const location=self.dir.l[item.dataset.location];if(location.res.group==filter.dataset.filter)count++}
filter.querySelector('.mgeo-count').innerHTML='('+count+')'}}
this.removeLocation=function(id){this.list.querySelector('.mgeo-dir-item[data-location="'+id+'"]').remove()}
this.addLocation=function(location){if(String(location.res.hide)!='true'&&!location.res.disabled){let item=self.dir.getItem(location);if(item)this.list.appendChild(item);if(self.o.sortbytitle)self.dir.sortBy(this.list,'title');this.refreshCounts()}}
this.addLocations=function(locations){for(let id in locations){let location=locations[id];if(String(location.res.hide)!='true'&&!location.res.disabled&&location.id!=location.sample){let item=self.dir.getItem(location);if(item)this.list.appendChild(item)}}
if(self.o.sortbytitle)self.dir.sortBy(this.list,'title');this.refreshCounts()}
this.addTag=function(group){const tag=document.createElement('button');let groups=[];if(self.dir.filters.group)groups=self.dir.filters.group.split(',');if(!groups.includes(group.id)){groups.push(group.id);self.dir.filters.group=groups.toString();tag.classList.add('mgeo-tag');tag.dataset.filter=group.id;tag.innerHTML=group.title;if(group.color)tag.style.backgroundColor=group.color;this.tags.appendChild(tag);tag.appendChild(self.styles.getIcon('cross'));tag.addEventListener('click',function(e){e.preventDefault();s.removeTag(group.id);s.el.classList.remove('mgeo-sidebar-header-opened')});s.search();this.el.classList.remove('mgeo-sidebar-header-opened');this.el.classList.add('mgeo-sidebar-tagsrow')}}
this.removeTag=function(id){let groups=[];if(self.dir.filters.group){groups=self.dir.filters.group.split(',');let i=groups.indexOf(id);if(i>-1){groups.splice(i,1)
self.dir.filters.group=groups.toString()}
if(groups.length<1)delete self.dir.filters.group}
let tag=this.tags.querySelector('button[data-filter="'+id+'"]');this.tags.removeChild(tag);s.search();if(this.tags.querySelectorAll('.mgeo-tag').length<1)this.el.classList.remove('mgeo-sidebar-tagsrow')}
this.addGroups=function(groups){if(!groups)return!1;if(groups.length>0)this.toggle.style.display='block';const ul=document.createElement('ul');let added=!1;groups.forEach(function(group){if(group.hide=='true')return;const item=document.createElement('li');item.classList.add('mgeo-group','mgeo-filter');item.dataset.filter=group.id;const link=document.createElement('a');link.addEventListener('click',function(){s.addTag(group)});item.appendChild(link);const thumb=self.dir.getThumbnail(group.title,group.thumbnail);link.appendChild(thumb);if(group.color&&thumb)thumb.style.backgroundColor=thumb.style.borderColor=group.color;const title=document.createElement('h4');title.classList.add('mgeo-group-title');title.innerHTML=group.title;link.appendChild(title);const count=document.createElement('span');count.classList.add('mgeo-count');count.innerHTML='(0)';link.appendChild(count);if(group.about){const about=document.createElement('span');about.classList.add('mgeo-dir-about');about.innerHTML=group.about;link.appendChild(about)}else title.classList.add('mgeo-title-margin');ul.appendChild(item);added=!0});if(added)this.el.classList.add('mgeo-sidebar-filterable');if(this.filters)this.filters.appendChild(ul)}
this.addPopup=function(location,small=!1){if(!location)return!1;if(this.popup)this.hidePopup();this.popup=document.createElement('div');this.popup.classList.add('mgeo-popup');this.popup.dataset.location=location.id;let container=document.createElement('div');container.classList.add('mgeo-popup-container');let close=document.createElement('button');close.classList.add('mgeo-close');close.appendChild(self.styles.getIcon('cross'));close.addEventListener('click',function(e){e.preventDefault();s.hidePopup();return!1});container.appendChild(close);if(location.res.image){let ic=document.createElement('div');ic.classList.add('mgeo-popup-image');let image=document.createElement('img');image.src=location.res.image;ic.appendChild(image);this.popup.appendChild(ic)}
if(location.res.title){let title=document.createElement('h1');title.classList.add('mgeo-title');title.innerHTML=location.res.title;container.appendChild(title)}
if(location.res.about){let about=document.createElement('h4');about.classList.add('mgeo-about');about.innerHTML=location.res.about;container.appendChild(about)}
if(location.res.desc){let content=document.createElement('div');content.classList.add('mgeo-popup-content');content.innerHTML=location.res.desc;container.appendChild(content)}
let buttons=document.createElement('div');buttons.classList.add('mgeo-buttons');container.appendChild(buttons);if(location.res.link){let more=document.createElement('a');more.classList.add('mgeo-more');more.href=location.res.link;more.innerHTML=self.localize.more;if(location.res.fill)more.style.backgroundColor=location.res.fill;buttons.appendChild(more)}
this.popup.appendChild(container);this.el.prepend(this.popup);this.el.classList.add('mgeo-sidebar-popup');self.el.dispatchEvent(new CustomEvent('popuprender',{detail:s.popup}))}
this.hidePopup=function(){if(!this.popup)return!1;this.el.removeChild(this.popup);this.popup=null;this.el.classList.remove('mgeo-sidebar-popup');self.actions.blur()}}
function Styles(){const s=this;this.s=[];this.icons={'cross':{path:'M8,0.809L7.191,0L4,3.191L0.809,0L0,0.809L3.191,4L0,7.191L0.809,8L4,4.809L7.191,8L8,7.191L4.809,4L8,0.809z',viewbox:'0 0 8 8'},'magnifier':{path:'M15.967,14.803l-4.253-4.285c0.848-1.103,1.364-2.477,1.379-3.971C13.093,2.937,10.156,0,6.546,0S0,2.937,0,6.546c0,3.609,2.937,6.546,6.546,6.546c1.477,0,2.84-0.507,3.94-1.349L14.772,16L15.967,14.803z M1.64,6.579c0-2.706,2.201-4.907,4.907-4.907c2.675,0,4.876,2.203,4.906,4.907c0,2.706-2.2,4.905-4.906,4.905S1.64,9.284,1.64,6.579z',viewbox:'0 0 16 16'},'filter':{path:'M1,11h7v2H1V11z M8,3v2h7V3H8z M4,7h2V1H4v2H1v2h3V7z M12,9h-2v6h2v-2h3v-2h-3V9z',viewbox:'0 0 16 16'},'reset':{path:'M11,3H5l3-3L11,3z M5,13l6,0.01L8,16L5,13z M3,11L0,8l3-3V11z M13,5l3,3l-3,3V5z M8,5C6.34,5,5,6.34,5,8s1.34,3,3,3s3-1.34,3-3S9.66,5,8,5z M8,10c-1.1,0-2-0.9-2-2s0.9-2,2-2s2,0.9,2,2S9.1,10,8,10z',viewbox:'0 0 16 16'},'compass':{path:'M8,4 5,11 8,9 11,11z',viewbox:'0 0 16 16'}}
this.init=function(){if(self.o.customcss){const style=document.createElement('style');style.innerHTML=self.o.customcss;document.body.appendChild(style)}
return this}
this.addStyles=function(styles){if(!styles)return!1;for(const style of styles)this.s[style.class]=style}
this.getIcon=function(name){const icon=this.icons[name];if(!icon)return null;const ns='http://www.w3.org/2000/svg';const svg=document.createElementNS(ns,'svg');svg.classList.add('mgeo-icon','mgeo-icon-'+name);svg.setAttribute('viewBox',icon.viewbox);const path=document.createElementNS(ns,'path');path.setAttribute('d',icon.path);svg.appendChild(path);return svg}}
function Deeplinking(){const s=this;let params;this.init=function(){params=new URLSearchParams(window.location.search);window.onpopstate=function(){s.check()}
return this}
this.set=function(key,value){params.set(key,value);this.update()}
this.delete=function(key){params.delete(key);this.update()}
this.check=function(){params=new URLSearchParams(window.location.search);const location=self.dir.l[params.get('location')];if(location)self.actions.focus(location,!0);else self.actions.blur(!0)}
this.update=function(){window.history.pushState({},'',`${window.location.pathname}?${params}`)}}
function Actions(){this.focused=null;this.a={'':'(Default)','none':'None','zoom':'Zoom','tooltip':'Tooltip','sidebar':'Sidebar popup','open-link':'Open link','open-link-new-tab':'Open link in new tab','isolate':'Isolate layer'}
this.init=function(){return this}
this.focus=function(location,deep=!1){if(!location)return!1;this.blur();this.focused=location;self.container.focusLocation(location);switch(location.res.action){case 'none':return!1;break;case 'zoom':self.container.zoomTo(location);return!1;break;case 'isolate':self.container.zoomTo(location);return!1;break;case 'open-link':window.location.href=location.link;return!1;break;case 'open-link-new-tab':window.open(location.link,'_blank');return!1;break;case 'sidebar':if(self.sidebar){self.container.addTooltip(location,!0);self.sidebar.addPopup(location);self.container.zoomTo(location);break}
default:const tooltip=self.container.addTooltip(location);self.container.zoomTo(location,tooltip.offsetHeight)}
if(self.deeplinking&&!deep)self.deeplinking.set('location',location.id);self.el.dispatchEvent(new CustomEvent('locationfocus',{detail:{location:location}}))}
this.blur=function(deep=!1){if(!this.focused)return!1;self.container.blurLocation(this.focused);this.focused=null;self.container.hideTooltip();self.sidebar?.hidePopup();if(self.deeplinking&&!deep)self.deeplinking.delete('location');if(self.o.resetZoomOnBlur)self.container.resetZoom();self.el.dispatchEvent(new CustomEvent('locationblur'))}}
function Directory(){const s=this;this.filters={};this.l={};this.g={};this.def={};this.init=function(){return this}
this.replaceVars=function(template,location){if(!location.id||!template)return!1;template=template.replace(/\{\{([^}]+)\}\}/g,function(match){match=match.slice(2,-2).toLowerCase();var sub=match.split('.');if(sub.length>1){var temp=location;sub.forEach(function(item){if(!temp[item]){temp='{{'+match+'}}';return}
temp=temp[item]});return temp}else{if(!location[match])return'{{'+match+'}}';return location[match]}});return template}
this.search=function(list=null){for(const id in s.l){let location=s.l[id],matched=!0;for(const attr in s.filters){let filter=s.filters[attr];let current=!1;if(attr=='keyword'){self.o.searchfields.forEach(function(field){if(location.res[field]&&!current)current=!(s.normalizeString(location.res[field]).indexOf(s.normalizeString(filter))==-1)})}else if(location.res.group&&attr=='group'){let groups=location.res.group;if(typeof groups=='string')groups=groups.split(',');groups.forEach(function(group){if(self.dir.filters.group.split(',').includes(group))current=!0})}
matched=matched&¤t}
let item=list.querySelector('.mgeo-dir-item[data-location="'+location.id+'"]');if(item){if(matched)item.classList.remove('mgeo-hidden');else item.classList.add('mgeo-hidden')}
if(Object.keys(s.filters).length===0)self.container.blurLocation(location);else if(matched)self.container.highlightLocation(location);else self.container.disableLocation(location)}}
this.getDirectory=function(attribute,pattern,sortby=!1){const regex=new RegExp(pattern,'i');const dir=document.createElement('ul');for(var id in s.l){let location=s.l[id];if(attribute&&pattern&&!regex.test(location[attribute]))return!0;if(String(location.hide)!='true')dir.appendChild(s.getItem(location))}
if(sortby)this.sortBy(dir,sortby);return dir}
this.getThumbnail=function(name,field){let elem=null;if(field){if(field.match(/(http(s)?:\/\/.)?(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/g)){elem=document.createElement('img');elem.classList.add('mgeo-thumb');elem.setAttribute('alt',name);elem.src=field}else{elem=document.createElement('div');elem.setAttribute('aria-hidden',!0);elem.classList.add('mgeo-thumb','mgeo-thumb-placeholder');elem.innerHTML=field}}else{let text='';if(name){let words=name.split(' ');if(words[0])text+=words[0][0];if(words[1])text+=words[1][0]}
elem=document.createElement('div');elem.setAttribute('aria-hidden',!0);elem.classList.add('mgeo-thumb','mgeo-thumb-placeholder');elem.innerHTML=text.toUpperCase()}
return elem}
this.getItem=function(location){if(!location.id)location=s.getLocation(location);if(!location)return!1;const item=document.createElement('li');item.classList.add('mgeo-dir-item');item.dataset.location=location.id;item.dataset.sort=location.title;const a=document.createElement('a');item.appendChild(a);a.addEventListener('click',function(e){e.preventDefault();self.actions.focus(location)});if(self.o.thumbnail){const thumbEl=self.dir.getThumbnail(location.title,location.res.thumbnail);a.appendChild(thumbEl)}
if(location.res.title){const titleEl=document.createElement('h4');titleEl.classList.add('mgeo-dir-title');titleEl.innerHTML=location.res.title;a.appendChild(titleEl)}
if(location.res.about){const aboutEl=document.createElement('span');aboutEl.classList.add('mgeo-dir-about');aboutEl.innerHTML=location.res.about;a.appendChild(aboutEl)}
return item}
this.registerGroups=function(groups){if(!groups)return!1;groups.forEach(function(group){if(group.id)s.g[group.id]=group})}
this.modifyLocation=function(id=null,obj=null){if(!id){let location=s.resolveLocation(obj);self.container.addMarker(location);self.sidebar?.addLocation(location)}else if(!obj){self.container.removeMarker(s.l[id]);self.sidebar?.removeLocation(id);delete s.l[id]}else{if(id==obj.id){Object.assign(s.l[id],obj);s.resolveLocation(s.l[id])}else{if(s.l[id].res?.marker)s.l[id].res.marker.setId(obj.id);s.l[obj.id]=Object.assign(s.l[id],obj);s.resolveLocation(s.l[obj.id]);delete s.l[id]}
self.sidebar?.removeLocation(id);self.sidebar?.addLocation(s.l[obj.id])}}
this.resolveLocations=function(locations,external=!1){if(!locations)return!1;locations.forEach(function(location){s.resolveLocation(location,external)})}
this.resolveLocation=function(location,external=!1){if(!location.id)return;if(external){location.external=!0;Object.keys(location).forEach(function(attr){if(location[attr]==='')delete location[attr]})}
let res=location.res?Object.assign({},location.res):{};delete location.res;if(location.sample&&s.l[location.sample])res=Object.assign({},s.l[location.sample]);else if(!location.sample&&s.l[self.o.globalSample])res=Object.assign({},s.l[self.o.globalSample]);location.res=Object.assign(res,location);delete location.res.sample;delete location.res.coord;location.res.desc=s.replaceVars(location.res.desc,location.res);if(!location.res.fill&&s.g[location.res.group]?.color)location.res.fill=s.g[location.res.group]?.color;if(!location.res.style&&s.g[location.res.group]?.style)location.res.style=s.g[location.res.group]?.style;location.res.isolated=self.container.l[location.res.layer]?.object.parentLayer||location.res.layer||!1;if(location.res.action=='isolate')location.res.isolated=location.id;s.l[location.id]=location;return s.l[location.id]}
this.getLocation=function(id){return s.l[id]}
this.normalizeString=function(s){if(s)return s.toString().toLowerCase().normalize('NFD').replace(/[\u0300-\u036f]/g,"");else return''}
this.sort=function(dir,order=1){let items=Array.from(dir.getElementsByClassName('mgeo-dir-item'));items.sort(function(a,b){a=a.dataset.sort;b=b.dataset.sort;if(isNaN(a)||isNaN(b))return(a<b)?-1*order:1*order;else return(a-b)*order});items.forEach(function(item){dir.appendChild(item)})}
this.sortBy=function(dir,attribute,order=1){let items=Array.from(dir.getElementsByClassName('mgeo-dir-item'));items.forEach(function(item){item.dataset.sort=s.normalizeString(s.l[item.dataset.location][attribute])});this.sort(dir,order)}}
function Container(){const s=this;let map;let globalMarkers;let tooltip;let hovertip;let overlay;let overControl=!1;let fillZoom;let ratio=1;let sidebarParent;let hovered=null;let extentInteraction=null;let markerDrag=null;let markerHandle=null;let zones={};let levelSelector;let fzi=0;let extf={};let nullStyle=new ol.style.Style(null);let cache={fill:{},stroke:{},image:{},text:{},style:{}}
this.controls=null;this.extent=null;this.width=0;this.height=0;this.isolation=!1;this.l={};this.layers={};this.emptyfeatures=0;this.init=function(){this.el=document.createElement('div');this.el.classList.add('mgeo-container');self.el.appendChild(this.el);const observer=new ResizeObserver(function(entries){if(s.width!=s.el.offsetWidth||s.height!=s.el.offsetHeight)s.resize()});observer.observe(this.el);self.o.extent=this.safeExtent(self.o.extent);ratio=ol.extent.getWidth(self.o.extent)/ol.extent.getHeight(self.o.extent);this.controls=document.createElement('div');this.controls.classList.add('mgeo-controls');const controls=new ol.Collection();if(self.o.rotation)controls.push(new ol.control.Rotate({target:this.getControlZone('mgeo-'+self.o.rotation),label:self.styles.getIcon('compass')}));if(self.o.fullscreen)controls.push(new ol.control.FullScreen({target:this.getControlZone('mgeo-'+self.o.fullscreen)}));if(self.o.resetButton)controls.push(new ol.control.Control({target:this.getControlZone('mgeo-'+self.o.resetButton),element:this.resetControl()}));if(self.o.zoomButtons)controls.push(new ol.control.Zoom({target:this.getControlZone('mgeo-'+self.o.zoomButtons)}));if(self.o.attribution)controls.push(new ol.control.Attribution({target:this.getControlZone('mgeo-bottom-right'),collapsible:self.o.attributionCollapsible}));map=new ol.Map({target:this.el,controls:controls});map.getInteractions().forEach(function(interaction){if(interaction instanceof ol.interaction.MouseWheelZoom)map.removeInteraction(interaction)});if(self.o.mouseWheel){let mousewheelcond=ol.events.condition.always;if(self.o.mouseWheelShift)mousewheelcond=ol.events.condition.shiftKeyOnly;map.addInteraction(new ol.interaction.MouseWheelZoom({condition:mousewheelcond}))}
let oc=this.el.getElementsByClassName('ol-overlaycontainer-stopevent')[0];oc.appendChild(this.controls);if(self.o.hoverTooltip)this.hoverTooltip();overlay=new ol.Overlay({});map.addOverlay(overlay);let hovered=null;map.on('pointermove',function(e){const feature=this.forEachFeatureAtPixel(e.pixel,function(feature){return feature},{hitTolerance:4});if(feature&&feature.getId()&&!markerDrag){const location=self.dir.l[feature.getId()];if(location!=hovered){if(hovered!=self.actions.focused)s.setLocationStyle(hovered,'base');if(location!=self.actions.focused)s.setLocationStyle(location,'hover');hovered=location}}else if(hovered!=self.actions.focused){s.setLocationStyle(hovered,'base');hovered=null}});map.on('singleclick',this.featureClick);map.on('pointermove',function(e){const pixel=map.getEventPixel(e.originalEvent);const hit=map.hasFeatureAtPixel(pixel);map.getTargetElement().style.cursor=hit?'pointer':''});return this}
this.newLayer=function(layer){if(!layer.id)return!1;let object;let style=s.getStyle(layer.style);if(!style){style=new ol.style.Style({fill:new ol.style.Fill({color:'#f4f4f4',}),stroke:new ol.style.Stroke({color:'#bbb',width:0.5,})})}
switch(layer.type){case 'osm':object=new ol.layer.Tile({source:new ol.source.OSM({interpolate:!0})});break;case 'markers':object=new ol.layer.Vector({updateWhileInteracting:!self.o.improvedPerformance,updateWhileAnimating:!self.o.improvedPerformance,className:'mgeo-markers',source:new ol.source.Vector({wrapX:!1}),renderBuffer:self.o.renderBuffer});break;case 'stamen':object=new ol.layer.Tile({source:new ol.source.Stamen({layer:layer.source})});break;case 'image':let extent=layer.extent?s.safeExtent(layer.extent):s.safeExtent(self.o.extent);object=new ol.layer.Image({source:new ol.source.ImageStatic({url:layer.source,imageExtent:extent})});break;case 'xyz':object=new ol.layer.Tile({source:new ol.source.XYZ({url:layer.source})});break;case 'mapbox':const mapboxStyles={'bright':'mapbox://styles/mapbox/bright-v9','streets':'mapbox://styles/mapbox/streets-v11','outdoors':'mapbox://styles/mapbox/outdoors-v11','light':'mapbox://styles/mapbox/light-v10','dark':'mapbox://styles/mapbox/dark-v10',}
object=new ol.layer.MapboxVector({styleUrl:mapboxStyles[layer.source],accessToken:self.o.mapboxtoken});break;case 'bingmaps':object=new ol.layer.Tile({preload:Infinity,source:new ol.source.BingMaps({key:self.o.bingmapskey,hidpi:!0,imagerySet:layer.source})});break;case 'maptiler':const maptilerStyles={'basic':'https://api.maptiler.com/maps/basic/{z}/{x}/{y}@2x.png?key=','satellite-v2':'https://api.maptiler.com/tiles/satellite-v2/{z}/{x}/{y}.jpg?key=','bright':'https://api.maptiler.com/maps/bright/{z}/{x}/{y}@2x.png?key=','pastel':'https://api.maptiler.com/maps/pastel/{z}/{x}/{y}@2x.png?key=','hybrid':'https://api.maptiler.com/maps/hybrid/{z}/{x}/{y}@2x.jpg?key=','streets':'https://api.maptiler.com/maps/streets/{z}/{x}/{y}@2x.png?key=','topo':'https://api.maptiler.com/maps/topo/{z}/{x}/{y}@2x.png?key=','voyager':'https://api.maptiler.com/maps/voyager/{z}/{x}/{y}@2x.png?key='}
object=new ol.layer.Tile({source:new ol.source.XYZ({attributions:'<a href="https://www.maptiler.com/copyright/" target="_blank">© MapTiler</a> '+'<a href="https://www.openstreetmap.org/copyright" target="_blank">© OpenStreetMap contributors</a>',url:maptilerStyles[layer.source]+self.o.maptilerkey,tileSize:512,tilePixelRatio:2})});break;case 'geojson':case 'topojson':case 'builtin':let format;if(layer.type=='geojson')format=new ol.format.GeoJSON();else if(layer.type=='topojson'||layer.type=='builtin')format=new ol.format.TopoJSON();let source=new ol.source.Vector({attributions:'© <a href="https://www.mapplic.com" target="_blank">Mapplic GEO</a>',url:(layer.type=='builtin')?self.localize.pdir+'maps/'+layer.source:layer.source,format:format,wrapX:!1,overlaps:!1});source.on('addfeature',function(e){let id=e.feature.getId();if(id){extf[id]=e.feature;let location=self.dir.l[id];if(location){location.res.feature=e.feature;location.res.offset=[0,0];location.res.layer=layer.id;if(!location.res.layer)location.res.layer=layer.id;s.setLocationStyle(location)}else s.emptyfeatures++}});object=new ol.layer.Vector({updateWhileInteracting:!self.o.improvedPerformance,updateWhileAnimating:!self.o.improvedPerformance,renderBuffer:self.o.renderBuffer,source:source,style:style});break;case 'svg':object=new ol.layer.Layer({className:'different-layer',render:function(){return null}});var svgContainer=document.createElement('div');var xhr=new XMLHttpRequest();xhr.open('GET',layer.source);xhr.addEventListener('load',function(){var svg=xhr.responseXML.documentElement;svgContainer.ownerDocument.importNode(svg);svgContainer.appendChild(svg);svgContainer.style.width=svg.getAttribute('width');svgContainer.style.height=svg.getAttribute('height');svgContainer.style.transformOrigin='top left';svgContainer.className='mgeo-svg-layer';var width=parseFloat(svgContainer.style.width);var height=parseFloat(svgContainer.style.height);var svgExtent=s.safeExtent(layer.extent);var svgWidth=ol.extent.getWidth(svgExtent);var svgCenter=ol.extent.getCenter(svgExtent);var svgResolution=svgWidth/width;object.render=function(frameState){var scale=svgResolution/frameState.viewState.resolution;var center=frameState.viewState.center;var size=frameState.size;var cssTransform=ol.transform.composeCssTransform(size[0]/2,size[1]/2,scale,scale,frameState.viewState.rotation,(svgCenter[0]-center[0])/svgResolution-width/2,(center[1]-svgCenter[1])/svgResolution-height/2);svgContainer.style.transform=cssTransform;svgContainer.style.opacity=this.getOpacity();return svgContainer}
object.setExtent(svgExtent)});xhr.send();break;default:return!1}
if(layer.extent)object.setExtent(this.safeExtent(layer.extent));if(layer.minZoom)object.setMinZoom(layer.minZoom);if(layer.maxZoom)object.setMaxZoom(layer.maxZoom);return object}
this.addLayers=function(layers){this.layers=layers;if(!layers)layers=[];if(layers.length<1)layers.push({'id':'example-layer','title':'Example Layer','type':'osm'});if(self.o.levelselector)map.addControl(new ol.control.Control({target:this.getControlZone('mgeo-'+self.o.levelselector),element:this.levelSelectorControl(layers)}));for(const layer of layers){if(layer.disabled===!0)continue;if(layer.id)s.l[layer.id]=layer;let object;if(layer.layers){const c=new ol.Collection();for(const sub of layer.layers){if(sub.disabled===!0)continue;if(sub.id)s.l[sub.id]=sub;sub.object=this.newLayer(sub);sub.object.parentLayer=layer.id;c.push(sub.object)}
object=new ol.layer.Group({layers:c})}else object=this.newLayer(layer);if(object){map.addLayer(object);layer.object=object;if(layer.hide)object.setVisible(!1);if(layer.opacity)object.setOpacity(parseFloat(layer.opacity))}}
globalMarkers=this.newLayer({id:'global',type:'markers'});map.addLayer(globalMarkers)}
this.safeExtent=function(extent){if(!extent)return!1;if(Array.isArray(extent))return extent;else return extent.split(',').map(Number)}
this.fit=function(extent,options){map.getView().fit(this.safeExtent(extent),options)}
this.startMarkerDrag=function(id,field=null){const location=self.dir.l[id];if(!location)return!1;let marker=location.res.marker;if(!marker)marker=this.getMarkerHandle(location);const c=new ol.Collection();c.push(marker,!0);if(markerDrag)this.stopMarkerDrag(markerDrag);markerDrag=new ol.interaction.Modify({features:c});map.addInteraction(markerDrag);markerDrag.on('modifyend',function(e){const coord=marker.getGeometry().getCoordinates();const lonlat=ol.proj.toLonLat(coord);location.res.coord=coord;if(field)field.value=lonlat[1].toFixed(6)+','+lonlat[0].toFixed(6)})}
this.stopMarkerDrag=function(){if(markerDrag){map.removeInteraction(markerDrag);markerDrag=null;this.hideMarkerHandle()}}
this.getMarkerHandle=function(location){if(!markerHandle){markerHandle=new ol.Feature({geometry:new ol.geom.Point(s.resolvedPosition(location))});globalMarkers.getSource().addFeature(markerHandle)}else{markerHandle.getGeometry().setCoordinates(s.resolvedPosition(location));markerHandle.setStyle(null)}
return markerHandle}
this.hideMarkerHandle=function(){if(!markerHandle)return!1;markerHandle.setStyle(new ol.style.Style({}))}
this.editExtent=function(field){if(!field)this.removeExtentInteraction();let extent=field.value.split(',').map(Number);if(extentInteraction){map.removeInteraction(extentInteraction);extentInteraction=null;this.mapView();this.resetZoom(0)}else{extentInteraction=s.addExtentInteraction(extent);this.mapView([-18878672.443631265,-9326678.110352932,21196344.241947223,19298333.807917416],1,20);map.getView().fit(self.o.extent,{duration:600,padding:[50,50,50,50]});extentInteraction.on('extentchanged',function(e){field.value=extentInteraction.getExtent()})}}
this.addExtentInteraction=function(extent){const extentStyle=new ol.style.Style({stroke:new ol.style.Stroke({color:'rgba(100, 100, 100, 0.4)',lineJoin:'miter',width:3})});const extentInteraction=new ol.interaction.Extent({condition:ol.events.condition.shiftKeyOnly,boxStyle:extentStyle,extent:extent});map.addInteraction(extentInteraction);return extentInteraction}
this.removeExtentInteraction=function(){map.removeInteraction(extentInteraction);extentInteraction=null}
this.mapView=function(extent=self.o.extent,minZoom=self.o.minZoom,maxZoom=self.o.maxZoom,zoom=1,center=null,duration=0){if(extent)this.extent=extent;if(!center)center=ol.extent.getCenter(extent);let view=new ol.View({projection:'EPSG:3857',center:center,enableRotation:self.o.rotation,rotation:self.o.rotate,extent:extent,minZoom:minZoom,maxZoom:maxZoom,constrainOnlyCenter:!0,padding:self.o.padding,showFullExtent:self.o.showFullExtent,zoom:zoom,constrainResolution:self.o.constrainResolution});map.setView(view);if(duration>=0)view.fit(this.extent,{duration:duration});fillZoom=Math.floor(view.getZoomForResolution(view.getResolutionForExtent(extent)));view.setMinZoom(fillZoom);view.on('change:resolution',function(e){if(!fillZoom)return!1;if(self.o.blurOnZoomOut&&view.getZoom()<=fillZoom)self.actions.blur()});map.updateSize();self.el.style.height='auto';return view}
this.resize=function(){let view=map.getView();let sw=0;if(self.o.sidebar){if(self.el.offsetWidth<self.o.portrait){if(self.o.portraitSidebarAbove)self.el.insertBefore(self.sidebar.el,self.el.firstChild);else self.el.appendChild(self.sidebar.el);self.el.classList.add('mgeo-portrait')}else{sidebarParent.appendChild(self.sidebar.el);self.el.classList.remove('mgeo-portrait');sw=self.sidebar.el.offsetWidth}
if(self.o.rightSidebar){self.o.padding[1]=sw;this.controls.style.right=sw+'px'}else{self.o.padding[3]=sw;this.controls.style.left=sw+'px'}}
let h=(this.el.offsetWidth-sw)/ratio;h=Math.min(Math.max(h,self.o.minHeight),self.o.maxHeight);self.container.el.style.height=h+'px';map.updateSize();s.width=s.el.offsetWidth;s.height=s.el.offsetHeight;this.mapView(s.extent||self.o.extent,self.o.minZoom,self.o.maxZoom,view.getZoom())}
this.getControlZone=function(name){if(zones[name])return zones[name];else{const el=document.createElement('div');el.classList.add('mgeo-control-zone',name);this.controls.appendChild(el);zones[name]=el;return zones[name]}}
this.addSidebarControl=function(el){let sidebar=new ol.control.Control({element:el});map.addControl(sidebar);sidebarParent=el.parentElement;el.addEventListener('mouseenter',function(){overControl=!0});el.addEventListener('mouseleave',function(){overControl=!1})}
this.resetControl=function(){const button=document.createElement('button');button.addEventListener('click',function(e){e.preventDefault();s.resetIsolation();s.resetZoom();self.actions.blur();self.el.dispatchEvent(new CustomEvent('mapreset'))});button.appendChild(self.styles.getIcon('reset'));const element=document.createElement('div');element.classList.add('ol-reset','ol-unselectable','ol-control');element.appendChild(button);return element}
this.levelSelectorControl=function(layers){levelSelector=document.createElement('div');levelSelector.classList.add('mgeo-level-switcher','ol-unselectable','ol-control');for(const layer of layers){if(!layer.disabled&&layer.selectable){const button=document.createElement('button');button.setAttribute('data-level',layer.id);button.innerHTML=layer.title;if(!layer.hide)button.classList.add('mgeo-selected');button.addEventListener('click',function(e){e.preventDefault();s.switchLevel(layer.id)});levelSelector.appendChild(button)}}
return levelSelector}
this.switchLevel=function(target){const selected=levelSelector?.getElementsByClassName('mgeo-selected')[0];if(selected){selected.classList.remove('mgeo-selected');s.l[selected.getAttribute('data-level')].object.setVisible(!1)}
s.l[target].object.setVisible(!0);levelSelector?.querySelector('button[data-level="'+target+'"]')?.classList.add('mgeo-selected')}
this.resetZoom=function(duration=600){map.getView().fit(this.extent,{duration:duration})}
this.resolvedPosition=function(location){if(!location.res)location.res={};if(!location.res.coord){if(location.coord){let coord=location.coord.split(',');location.res.coord=ol.proj.fromLonLat([coord[1],coord[0]])}else if(location.res.feature)location.res.coord=ol.extent.getCenter(location.res.feature.getGeometry().getExtent());else return!1}
return location.res.coord}
this.focusLocation=function(location){this.setLocationStyle(location,'active')}
this.blurLocation=function(location){if(location.res?.feature)location.res.feature.highlight=!1;this.setLocationStyle(location,'base')}
this.highlightLocation=function(location){if(location.res?.marker)location.res.marker.setStyle(this.getMarkerStyle(location,'base'));else if(location.res?.feature&&location.res?.style){location.res.feature.setStyle(this.getStyle(location.res.style,'hover',location.res.label));location.res.feature.highlight=!0}}
this.disableLocation=function(location){if(location.res?.marker)location.res.marker.setStyle(nullStyle);else if(location.res?.feature&&location.res?.style){location.res.feature.setStyle(this.getStyle(location.res.style,'base',location.res.label))
location.res.feature.highlight=!1}}
this.applyIsolation=function(location){if(!location){this.resetIsolation(-1);return!1}
if(!this.l[location.id]?.object)return!1;if(this.isolation){if(this.isolation.tid==location.id)return!1}
let initial=this.isolation.parent,pid=this.l[location.res.layer].object.parentLayer||location.res.layer;this.isolation={tid:location.id,target:this.l[location.id]?.object,pid:pid,parent:this.l[pid]?.object}
if(initial)this.isolation.initial=initial;else this.isolation.initial=this.isolation.parent;this.isolation.target.setVisible(!0);this.isolation.parent.setVisible(!1);setTimeout(function(){let view=map.getView();s.mapView(s.safeExtent(s.l[location.id].extent)||location.res.feature.getGeometry().getExtent(),s.l[location.id].minZoom,s.l[location.id].maxZoom,view.getZoom(),view.getCenter(),-1)},500)}
this.resetIsolation=function(duration=400){if(!this.isolation)return!1;this.isolation.target.setVisible(!1);this.isolation.initial.setVisible(!0);this.isolation=!1;let view=map.getView();this.mapView(self.o.extent,self.o.minZoom,self.o.maxZoom,view.getZoom(),view.getCenter(),duration)}
this.hoverTooltip=function(){hovertip=document.createElement('div');hovertip.classList.add('mgeo-tooltip','mgeo-hover-tooltip');this.el.appendChild(hovertip);const title=document.createElement('h4');title.classList.add('mgeo-title');hovertip.appendChild(title);const overlay=new ol.Overlay({element:hovertip});map.addOverlay(overlay);map.on('pointermove',function(e){const feature=this.forEachFeatureAtPixel(e.pixel,function(feature){return feature},{hitTolerance:4});if(feature&&feature.getId()&&!overControl){const location=self.dir.l[feature.getId()];if(location&&location.res.title&&location!=self.actions.focused){location.res.feature=feature;let coord=e.coordinate;if(!self.o.hoverTooltipFollow)coord=s.resolvedPosition(location);title.innerHTML=location.res.title;overlay.setPosition(coord);if(location.res.offset)overlay.setOffset(location.res.offset);hovertip.style.left=Math.round(-hovertip.offsetWidth/2)+'px';hovertip.style.opacity=1}else hovertip.style.opacity=0}else hovertip.style.opacity=0})}
this.featureClick=function(e){const feature=this.forEachFeatureAtPixel(e.pixel,function(feature){return feature},{hitTolerance:4});if(feature){self.el.dispatchEvent(new CustomEvent('featureclick',{detail:{feature:feature,coord:e.coordinate}}));let location=self.dir.getLocation(feature.getId());if(location){location.res.feature=feature;self.actions.focus(location)}}}
this.zoomTo=function(location,pt=0){let duration=500,padding=[pt,0,0,0],geometry=location?.res.feature?.getGeometry(),extent=!1;if(location.res.layer){const i=location.res.isolated||location.res.layer;const isolate=self.dir.l[i]?.action=='isolate'?self.dir.l[i]:!1;this.applyIsolation(isolate);if(!isolate)this.switchLevel(self.container.l[location.res.layer].object.parentLayer||location.res.layer);else extent=this.safeExtent(self.container.l[isolate.id].extent)}
const view=map.getView();if(geometry&&geometry.getType()!='Point')view.fit(extent||geometry.getExtent(),{duration:duration,padding:padding});else{let zoom=(location&&location.res.zoom)||Math.min(self.o.maxZoom,Math.round(view.getZoom()*2));let respos=s.resolvedPosition(location);if(zoom>=0&&respos){view.fit(new ol.geom.Point(respos),{padding:padding,maxZoom:zoom,duration:duration})}}}
this.addTooltip=function(location,small=!1){if(!location)return!1;if(hovertip)hovertip.style.opacity=0;tooltip=document.createElement('div');tooltip.classList.add('mgeo-tooltip','mgeo-popup');tooltip.dataset.location=location.id;if(location.res.group)tooltip.dataset.group=location.res.group;this.el.appendChild(tooltip);let container=document.createElement('div');container.classList.add('mgeo-popup-container');let close=document.createElement('button');close.classList.add('mgeo-close');close.appendChild(self.styles.getIcon('cross'));close.addEventListener('click',function(e){e.preventDefault();self.actions.blur();return!1});container.appendChild(close);if(location.res.title){let title=document.createElement('h4');title.classList.add('mgeo-title');title.innerHTML=location.res.title;container.appendChild(title)}
if(!small){if(location.res.image){let ic=document.createElement('div');ic.classList.add('mgeo-tooltip-image');let image=document.createElement('img');image.src=location.res.image;ic.appendChild(image);tooltip.prepend(ic)}
if(location.res.about){let about=document.createElement('h5');about.classList.add('mgeo-about');about.innerHTML=location.res.about;container.appendChild(about)}
if(location.res.desc){let content=document.createElement('div');content.classList.add('mgeo-popup-content');content.innerHTML=location.res.desc;container.appendChild(content)}
let buttons=document.createElement('div');buttons.classList.add('mgeo-buttons');container.appendChild(buttons);if(location.res.link){let more=document.createElement('a');more.classList.add('mgeo-more');more.href=location.res.link;more.innerHTML=self.localize.more;if(location.res.fill)more.style.backgroundColor=location.res.fill;buttons.appendChild(more)}}else tooltip.classList.add('mgeo-tooltip-small');tooltip.appendChild(container);overlay.setElement(tooltip);overlay.setPosition(s.resolvedPosition(location));if(location.res.offset)overlay.setOffset(location.res.offset);tooltip.style.left=Math.round(-tooltip.offsetWidth/2)+'px';tooltip.style.opacity=1;tooltip.addEventListener('mouseenter',function(){overControl=!0});tooltip.addEventListener('mouseleave',function(){overControl=!1});if(!small)self.el.dispatchEvent(new CustomEvent('popuprender',{detail:tooltip}));return tooltip}
this.hideTooltip=function(){let tooltip=overlay.getElement();if(!tooltip)return!1;tooltip.style.opacity=0;tooltip.style.pointerEvents='none'}
this.getFill=function(color){if(!color)return undefined;if(!cache.fill[color])cache.fill[color]=new ol.style.Fill({color:color});return cache.fill[color]}
this.getStroke=function(color,width=1){if(!color)return undefined;let key=Array.prototype.join.call(arguments,'-');if(!cache.stroke[key])cache.stroke[key]=new ol.style.Stroke({color:color,width:width});return cache.stroke[key]}
this.getText=function(text,fill='#fff',font='bold 10px sans-serif',offsetY=2){if(!text)return undefined;let key=Array.prototype.join.call(arguments,'-');if(!cache.text[key])cache.text[key]=new ol.style.Text({text:text,fill:this.getFill(fill),font:font,offsetY:offsetY});return cache.text[key]}
this.getStyle=function(name,state='base',text=!1){let key=Array.prototype.join.call(arguments,'-');if(cache.style[key])return cache.style[key];else{const style=self.styles.s[name];if(!style)return!1;else{cache.style[key]=new ol.style.Style({fill:this.getFill(style[state]?.fill||style.base?.fill),stroke:this.getStroke(style[state]?.stroke||style.base?.stroke,style.base.strokeWidth),text:this.getText(text,style.base.textColor||'#888','11px sans-serif'),zIndex:fzi++});return cache.style[key]}}}
this.setLocationStyle=function(location,state='base'){if(!location)return!1;if(location.res?.marker)location.res.marker.setStyle(this.getMarkerStyle(location,state));else if(location.res?.feature){if(location.res.style){const text=location.res.type=='text'?location.res.label||location.res.title:!1;if(location.res.feature.highlight&&state=='base')state='hover';location.res.feature.setStyle(this.getStyle(location.res.style,state,text))}else if(location.res.fill)location.res.feature.setStyle(new ol.style.Style({fill:this.getFill(location.res.fill),stroke:this.getStroke('#aaa',1)}))}}
this.markers={'pin':{'src':self.localize.pdir+'/markers/pin.svg','size':[21,28],'anchor':[0.5,1],'textY':-16},'pin1':{'src':self.localize.pdir+'/markers/pin1.svg','size':[20,26],'anchor':[0.5,1],'textY':-16},'pin2':{'src':self.localize.pdir+'/markers/pin2.svg','size':[22,26],'anchor':[0.5,1],'textY':-14},'pin3':{'src':self.localize.pdir+'/markers/pin3.svg','size':[16,24],'anchor':[0.5,1],'textY':-14},'round1':{'src':self.localize.pdir+'/markers/round1.svg','size':[20,20],'anchor':[0.5,0.5],'textY':2},}
this.getMarkerStyle=function(location,state='base'){let style,base=self.styles.s[location.res.style]?.['base'],fill=self.styles.s[location.res.style]?.[state]?.fill||base?.fill||location.res?.fill,textColor=base?.textColor;const m=this.markers[location.res.type];const type=m?'marker':location.res.type;switch(type){case 'hidden':return!1;case 'marker':location.res.offset=[0,-m.size[1]*m.anchor[1]*Math.min(location.res.scale||1,1)];style=new ol.style.Style({image:new ol.style.Icon({anchor:m.anchor,src:m.src,scale:Math.min(location.res.scale||1,1),color:fill}),text:this.getText(location.res.label,textColor,'bold 10px sans-serif',m.textY)});break;case 'text':style=new ol.style.Style({text:this.getText(location.res?.label,textColor,'bold 12px sans-serif')});break;case 'thumb':if(!location.res.thumbnail)break;location.res.offset=[0,-20];style=new ol.style.Style({image:new ol.style.Icon({src:location.res.thumbnail,scale:location.res.scale||1,color:fill})});break;case 'square':location.res.offset=[0,-(location.res.scale*10||10)];style=new ol.style.Style({image:new ol.style.RegularShape({fill:this.getFill(fill),stroke:this.getStroke(self.styles.s[location.res.style]?.['base'].stroke||null,self.styles.s[location.res.style]?.['base'].strokeWidth),radius:-location.res.offset[1]/0.785,angle:0.785,points:4}),text:this.getText(location.res?.label,textColor)});break;case 'dot-l':case 'dot-r':location.res.offset=[0,-(location.res.scale*5||4)];let text=this.getText(location.res?.label,textColor||'#000','12px sans-serif',1);if(text){if(type=='dot-r'){text.setTextAlign('right');text.setOffsetX(location.res.offset[1]-4)}else{text.setTextAlign('left');text.setOffsetX(-location.res.offset[1]+4)}
text.setBackgroundFill(this.getFill('rgba(255,255,255,0.01)'))}
style=new ol.style.Style({image:new ol.style.Circle({fill:this.getFill(fill),stroke:this.getStroke(self.styles.s[location.res.style]?.['base'].stroke||null,self.styles.s[location.res.style]?.['base'].strokeWidth),radius:-location.res.offset[1]}),text:text});break;case 'circle':default:location.res.offset=[0,-(location.res.scale*10||10)];style=new ol.style.Style({image:new ol.style.Circle({fill:this.getFill(fill),stroke:this.getStroke(self.styles.s[location.res.style]?.['base'].stroke||null,self.styles.s[location.res.style]?.['base'].strokeWidth),radius:-location.res.offset[1]}),text:this.getText(location.res?.label,textColor)})}
if(state=='active')style.setZIndex(fzi++);return style}
this.addMarkers=function(locations){if(!locations)return!1;locations.forEach(function(location){if(!location.res.disabled&&location.id!=location.sample)self.container.addMarker(location)})}
this.addMarker=function(location){const res=s.resolvedPosition(location);if(!location||!location.res.type||location.res.type=='text')return!1;const f=new ol.Feature({geometry:new ol.geom.Point(res)});let style=this.getMarkerStyle(location);if(!style)return!1;style.setZIndex(fzi++);f.setStyle(style);f.setId(location.id);location.res.marker=f;const layer=s.l[location?.res?.layer]?.object?.getSource()||globalMarkers.getSource();layer.addFeature(f)}
this.removeMarker=function(location){const layer=s.l[location?.res?.layer]?.object?.getSource()||globalMarkers.getSource();layer.removeFeature(location.res.marker)}
this.getCoord=function(coord=map.getView().getCenter()){const pair=ol.proj.toLonLat(coord);return pair[1].toFixed(6)+','+pair[0].toFixed(6)}}}
document.querySelectorAll('.mgeo-map').forEach(function(el){let geo=new MapplicGeo(el);geo.init()})})()
;