PageSourceSearch

https://www.geonetzwerk.ruhr/typo3temp/assets/compressed/merged-78…511b55acbbfabb7f4730e08a17702.js?1791279526

js geonetzwerk.ruhr collected 2026-10-06 16:52:39 UTC 1,150,036 bytes, 2,388 lines download raw bytes

1
vendor: 86,927 bytes, lines 2-3
2/*! jQuery v3.3.1 | (c) JS Foundation and other contributors | jquery.org/license */
3!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(e,t){"use strict";var n=[],r=e.document,i=Object.getPrototypeOf,o=n.slice,a=n.concat,s=n.push,u=n.indexOf,l={},c=l.toString,f=l.hasOwnProperty,p=f.toString,d=p.call(Object),h={},g=function e(t){return"function"==typeof t&&"number"!=typeof t.nodeType},y=function e(t){return null!=t&&t===t.window},v={type:!0,src:!0,noModule:!0};function m(e,t,n){var i,o=(t=t||r).createElement("script");if(o.text=e,n)for(i in v)n[i]&&(o[i]=n[i]);t.head.appendChild(o).parentNode.removeChild(o)}function x(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[c.call(e)]||"object":typeof e}var b="3.3.1",w=function(e,t){return new w.fn.init(e,t)},T=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;w.fn=w.prototype={jquery:"3.3.1",constructor:w,length:0,toArray:function(){return o.call(this)},get:function(e){return null==e?o.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=w.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return w.each(this,e)},map:function(e){return this.pushStack(w.map(this,function(t,n){return e.call(t,n,t)}))},slice:function(){return this.pushStack(o.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n<t?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:s,sort:n.sort,splice:n.splice},w.extend=w.fn.extend=function(){var e,t,n,r,i,o,a=arguments[0]||{},s=1,u=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[s]||{},s++),"object"==typeof a||g(a)||(a={}),s===u&&(a=this,s--);s<u;s++)if(null!=(e=arguments[s]))for(t in e)n=a[t],a!==(r=e[t])&&(l&&r&&(w.isPlainObject(r)||(i=Array.isArray(r)))?(i?(i=!1,o=n&&Array.isArray(n)?n:[]):o=n&&w.isPlainObject(n)?n:{},a[t]=w.extend(l,o,r)):void 0!==r&&(a[t]=r));return a},w.extend({expando:"jQuery"+("3.3.1"+Math.random()).replace(/\D/g,""),isReady:!0,error:function(e){throw new Error(e)},noop:function(){},isPlainObject:function(e){var t,n;return!(!e||"[object Object]"!==c.call(e))&&(!(t=i(e))||"function"==typeof(n=f.call(t,"constructor")&&t.constructor)&&p.call(n)===d)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e){m(e)},each:function(e,t){var n,r=0;if(C(e)){for(n=e.length;r<n;r++)if(!1===t.call(e[r],r,e[r]))break}else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},trim:function(e){return null==e?"":(e+"").replace(T,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(C(Object(e))?w.merge(n,"string"==typeof e?[e]:e):s.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:u.call(t,e,n)},merge:function(e,t){for(var n=+t.length,r=0,i=e.length;r<n;r++)e[i++]=t[r];return e.length=i,e},grep:function(e,t,n){for(var r,i=[],o=0,a=e.length,s=!n;o<a;o++)(r=!t(e[o],o))!==s&&i.push(e[o]);return i},map:function(e,t,n){var r,i,o=0,s=[];if(C(e))for(r=e.length;o<r;o++)null!=(i=t(e[o],o,n))&&s.push(i);else for(o in e)null!=(i=t(e[o],o,n))&&s.push(i);return a.apply([],s)},guid:1,support:h}),"function"==typeof Symbol&&(w.fn[Symbol.iterator]=n[Symbol.iterator]),w.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(e,t){l["[object "+t+"]"]=t.toLowerCase()});function C(e){var t=!!e&&"length"in e&&e.length,n=x(e);return!g(e)&&!y(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}var E=function(e){var t,n,r,i,o,a,s,u,l,c,f,p,d,h,g,y,v,m,x,b="sizzle"+1*new Date,w=e.document,T=0,C=0,E=ae(),k=ae(),S=ae(),D=function(e,t){return e===t&&(f=!0),0},N={}.hasOwnProperty,A=[],j=A.pop,q=A.push,L=A.push,H=A.slice,O=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1},P="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",R="(?:\\\\.|[\\w-]|[^\0-\\xa0])+",I="\\["+M+"*("+R+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+R+"))|)"+M+"*\\]",W=":("+R+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+I+")*)|.*)\\)|)",$=new RegExp(M+"+","g"),B=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),F=new RegExp("^"+M+"*,"+M+"*"),_=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),z=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),X=new RegExp(W),U=new RegExp("^"+R+"$"),V={ID:new RegExp("^#("+R+")"),CLASS:new RegExp("^\\.("+R+")"),TAG:new RegExp("^("+R+"|[*])"),ATTR:new RegExp("^"+I),PSEUDO:new RegExp("^"+W),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+P+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},G=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Q=/^[^{]+\{\s*\[native \w/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,K=/[+~]/,Z=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),ee=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},te=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ne=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},re=function(){p()},ie=me(function(e){return!0===e.disabled&&("form"in e||"label"in e)},{dir:"parentNode",next:"legend"});try{L.apply(A=H.call(w.childNodes),w.childNodes),A[w.childNodes.length].nodeType}catch(e){L={apply:A.length?function(e,t){q.apply(e,H.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function oe(e,t,r,i){var o,s,l,c,f,h,v,m=t&&t.ownerDocument,T=t?t.nodeType:9;if(r=r||[],"string"!=typeof e||!e||1!==T&&9!==T&&11!==T)return r;if(!i&&((t?t.ownerDocument||t:w)!==d&&p(t),t=t||d,g)){if(11!==T&&(f=J.exec(e)))if(o=f[1]){if(9===T){if(!(l=t.getElementById(o)))return r;if(l.id===o)return r.push(l),r}else if(m&&(l=m.getElementById(o))&&x(t,l)&&l.id===o)return r.push(l),r}else{if(f[2])return L.apply(r,t.getElementsByTagName(e)),r;if((o=f[3])&&n.getElementsByClassName&&t.getElementsByClassName)return L.apply(r,t.getElementsByClassName(o)),r}if(n.qsa&&!S[e+" "]&&(!y||!y.test(e))){if(1!==T)m=t,v=e;else if("object"!==t.nodeName.toLowerCase()){(c=t.getAttribute("id"))?c=c.replace(te,ne):t.setAttribute("id",c=b),s=(h=a(e)).length;while(s--)h[s]="#"+c+" "+ve(h[s]);v=h.join(","),m=K.test(e)&&ge(t.parentNode)||t}if(v)try{return L.apply(r,m.querySelectorAll(v)),r}catch(e){}finally{c===b&&t.removeAttribute("id")}}}return u(e.replace(B,"$1"),t,r,i)}function ae(){var e=[];function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}return t}function se(e){return e[b]=!0,e}function ue(e){var t=d.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function le(e,t){var n=e.split("|"),i=n.length;while(i--)r.attrHandle[n[i]]=t}function ce(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function fe(e){return function(t){return"input"===t.nodeName.toLowerCase()&&t.type===e}}function pe(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function de(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&ie(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function he(e){return se(function(t){return t=+t,se(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function ge(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}n=oe.support={},o=oe.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},p=oe.setDocument=function(e){var t,i,a=e?e.ownerDocument||e:w;return a!==d&&9===a.nodeType&&a.documentElement?(d=a,h=d.documentElement,g=!o(d),w!==d&&(i=d.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",re,!1):i.attachEvent&&i.attachEvent("onunload",re)),n.attributes=ue(function(e){return e.className="i",!e.getAttribute("className")}),n.getElementsByTagName=ue(function(e){return e.appendChild(d.createComment("")),!e.getElementsByTagName("*").length}),n.getElementsByClassName=Q.test(d.getElementsByClassName),n.getById=ue(function(e){return h.appendChild(e).id=b,!d.getElementsByName||!d.getElementsByName(b).length}),n.getById?(r.filter.ID=function(e){var t=e.replace(Z,ee);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&g){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(Z,ee);return function(e){var n="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&g){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),r.find.TAG=n.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):n.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},r.find.CLASS=n.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&g)return t.getElementsByClassName(e)},v=[],y=[],(n.qsa=Q.test(d.querySelectorAll))&&(ue(function(e){h.appendChild(e).innerHTML="<a id='"+b+"'></a><select id='"+b+"-\r\\' msallowcapture=''><option selected=''></option></select>",e.querySelectorAll("[msallowcapture^='']").length&&y.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||y.push("\\["+M+"*(?:value|"+P+")"),e.querySelectorAll("[id~="+b+"-]").length||y.push("~="),e.querySelectorAll(":checked").length||y.push(":checked"),e.querySelectorAll("a#"+b+"+*").length||y.push(".#.+[+~]")}),ue(function(e){e.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var t=d.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&y.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&y.push(":enabled",":disabled"),h.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&y.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),y.push(",.*:")})),(n.matchesSelector=Q.test(m=h.matches||h.webkitMatchesSelector||h.mozMatchesSelector||h.oMatchesSelector||h.msMatchesSelector))&&ue(function(e){n.disconnectedMatch=m.call(e,"*"),m.call(e,"[s!='']:x"),v.push("!=",W)}),y=y.length&&new RegExp(y.join("|")),v=v.length&&new RegExp(v.join("|")),t=Q.test(h.compareDocumentPosition),x=t||Q.test(h.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return f=!0,0;var r=!e.compareDocumentPosition-!t.compareDocumentPosition;return r||(1&(r=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!n.sortDetached&&t.compareDocumentPosition(e)===r?e===d||e.ownerDocument===w&&x(w,e)?-1:t===d||t.ownerDocument===w&&x(w,t)?1:c?O(c,e)-O(c,t):0:4&r?-1:1)}:function(e,t){if(e===t)return f=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===d?-1:t===d?1:i?-1:o?1:c?O(c,e)-O(c,t):0;if(i===o)return ce(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?ce(a[r],s[r]):a[r]===w?-1:s[r]===w?1:0},d):d},oe.matches=function(e,t){return oe(e,null,null,t)},oe.matchesSelector=function(e,t){if((e.ownerDocument||e)!==d&&p(e),t=t.replace(z,"='$1']"),n.matchesSelector&&g&&!S[t+" "]&&(!v||!v.test(t))&&(!y||!y.test(t)))try{var r=m.call(e,t);if(r||n.disconnectedMatch||e.document&&11!==e.document.nodeType)return r}catch(e){}return oe(t,d,null,[e]).length>0},oe.contains=function(e,t){return(e.ownerDocument||e)!==d&&p(e),x(e,t)},oe.attr=function(e,t){(e.ownerDocument||e)!==d&&p(e);var i=r.attrHandle[t.toLowerCase()],o=i&&N.call(r.attrHandle,t.toLowerCase())?i(e,t,!g):void 0;return void 0!==o?o:n.attributes||!g?e.getAttribute(t):(o=e.getAttributeNode(t))&&o.specified?o.value:null},oe.escape=function(e){return(e+"").replace(te,ne)},oe.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},oe.uniqueSort=function(e){var t,r=[],i=0,o=0;if(f=!n.detectDuplicates,c=!n.sortStable&&e.slice(0),e.sort(D),f){while(t=e[o++])t===e[o]&&(i=r.push(o));while(i--)e.splice(r[i],1)}return c=null,e},i=oe.getText=function(e){var t,n="",r=0,o=e.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=i(e)}else if(3===o||4===o)return e.nodeValue}else while(t=e[r++])n+=i(t);return n},(r=oe.selectors={cacheLength:50,createPseudo:se,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Z,ee),e[3]=(e[3]||e[4]||e[5]||"").replace(Z,ee),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||oe.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&oe.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return V.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=a(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Z,ee).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=E[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&E(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=oe.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace($," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,f,p,d,h,g=o!==a?"nextSibling":"previousSibling",y=t.parentNode,v=s&&t.nodeName.toLowerCase(),m=!u&&!s,x=!1;if(y){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===v:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?y.firstChild:y.lastChild],a&&m){x=(d=(l=(c=(f=(p=y)[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]||[])[0]===T&&l[1])&&l[2],p=d&&y.childNodes[d];while(p=++d&&p&&p[g]||(x=d=0)||h.pop())if(1===p.nodeType&&++x&&p===t){c[e]=[T,d,x];break}}else if(m&&(x=d=(l=(c=(f=(p=t)[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]||[])[0]===T&&l[1]),!1===x)while(p=++d&&p&&p[g]||(x=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===v:1===p.nodeType)&&++x&&(m&&((c=(f=p[b]||(p[b]={}))[p.uniqueID]||(f[p.uniqueID]={}))[e]=[T,x]),p===t))break;return(x-=i)===r||x%r==0&&x/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||oe.error("unsupported pseudo: "+e);return i[b]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?se(function(e,n){var r,o=i(e,t),a=o.length;while(a--)e[r=O(e,o[a])]=!(n[r]=o[a])}):function(e){return i(e,0,n)}):i}},pseudos:{not:se(function(e){var t=[],n=[],r=s(e.replace(B,"$1"));return r[b]?se(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}}),has:se(function(e){return function(t){return oe(e,t).length>0}}),contains:se(function(e){return e=e.replace(Z,ee),function(t){return(t.textContent||t.innerText||i(t)).indexOf(e)>-1}}),lang:se(function(e){return U.test(e||"")||oe.error("unsupported lang: "+e),e=e.replace(Z,ee).toLowerCase(),function(t){var n;do{if(n=g?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===h},focus:function(e){return e===d.activeElement&&(!d.hasFocus||d.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:de(!1),disabled:de(!0),checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return Y.test(e.nodeName)},input:function(e){return G.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:he(function(){return[0]}),last:he(function(e,t){return[t-1]}),eq:he(function(e,t,n){return[n<0?n+t:n]}),even:he(function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e}),odd:he(function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e}),lt:he(function(e,t,n){for(var r=n<0?n+t:n;--r>=0;)e.push(r);return e}),gt:he(function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e})}}).pseudos.nth=r.pseudos.eq;for(t in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})r.pseudos[t]=fe(t);for(t in{submit:!0,reset:!0})r.pseudos[t]=pe(t);function ye(){}ye.prototype=r.filters=r.pseudos,r.setFilters=new ye,a=oe.tokenize=function(e,t){var n,i,o,a,s,u,l,c=k[e+" "];if(c)return t?0:c.slice(0);s=e,u=[],l=r.preFilter;while(s){n&&!(i=F.exec(s))||(i&&(s=s.slice(i[0].length)||s),u.push(o=[])),n=!1,(i=_.exec(s))&&(n=i.shift(),o.push({value:n,type:i[0].replace(B," ")}),s=s.slice(n.length));for(a in r.filter)!(i=V[a].exec(s))||l[a]&&!(i=l[a](i))||(n=i.shift(),o.push({value:n,type:a,matches:i}),s=s.slice(n.length));if(!n)break}return t?s.length:s?oe.error(e):k(e,u).slice(0)};function ve(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function me(e,t,n){var r=t.dir,i=t.next,o=i||r,a=n&&"parentNode"===o,s=C++;return t.first?function(t,n,i){while(t=t[r])if(1===t.nodeType||a)return e(t,n,i);return!1}:function(t,n,u){var l,c,f,p=[T,s];if(u){while(t=t[r])if((1===t.nodeType||a)&&e(t,n,u))return!0}else while(t=t[r])if(1===t.nodeType||a)if(f=t[b]||(t[b]={}),c=f[t.uniqueID]||(f[t.uniqueID]={}),i&&i===t.nodeName.toLowerCase())t=t[r]||t;else{if((l=c[o])&&l[0]===T&&l[1]===s)return p[2]=l[2];if(c[o]=p,p[2]=e(t,n,u))return!0}return!1}}function xe(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function be(e,t,n){for(var r=0,i=t.length;r<i;r++)oe(e,t[r],n);return n}function we(e,t,n,r,i){for(var o,a=[],s=0,u=e.length,l=null!=t;s<u;s++)(o=e[s])&&(n&&!n(o,r,i)||(a.push(o),l&&t.push(s)));return a}function Te(e,t,n,r,i,o){return r&&!r[b]&&(r=Te(r)),i&&!i[b]&&(i=Te(i,o)),se(function(o,a,s,u){var l,c,f,p=[],d=[],h=a.length,g=o||be(t||"*",s.nodeType?[s]:s,[]),y=!e||!o&&t?g:we(g,p,e,s,u),v=n?i||(o?e:h||r)?[]:a:y;if(n&&n(y,v,s,u),r){l=we(v,d),r(l,[],s,u),c=l.length;while(c--)(f=l[c])&&(v[d[c]]=!(y[d[c]]=f))}if(o){if(i||e){if(i){l=[],c=v.length;while(c--)(f=v[c])&&l.push(y[c]=f);i(null,v=[],l,u)}c=v.length;while(c--)(f=v[c])&&(l=i?O(o,f):p[c])>-1&&(o[l]=!(a[l]=f))}}else v=we(v===a?v.splice(h,v.length):v),i?i(null,a,v,u):L.apply(a,v)})}function Ce(e){for(var t,n,i,o=e.length,a=r.relative[e[0].type],s=a||r.relative[" "],u=a?1:0,c=me(function(e){return e===t},s,!0),f=me(function(e){return O(t,e)>-1},s,!0),p=[function(e,n,r){var i=!a&&(r||n!==l)||((t=n).nodeType?c(e,n,r):f(e,n,r));return t=null,i}];u<o;u++)if(n=r.relative[e[u].type])p=[me(xe(p),n)];else{if((n=r.filter[e[u].type].apply(null,e[u].matches))[b]){for(i=++u;i<o;i++)if(r.relative[e[i].type])break;return Te(u>1&&xe(p),u>1&&ve(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(B,"$1"),n,u<i&&Ce(e.slice(u,i)),i<o&&Ce(e=e.slice(i)),i<o&&ve(e))}p.push(n)}return xe(p)}function Ee(e,t){var n=t.length>0,i=e.length>0,o=function(o,a,s,u,c){var f,h,y,v=0,m="0",x=o&&[],b=[],w=l,C=o||i&&r.find.TAG("*",c),E=T+=null==w?1:Math.random()||.1,k=C.length;for(c&&(l=a===d||a||c);m!==k&&null!=(f=C[m]);m++){if(i&&f){h=0,a||f.ownerDocument===d||(p(f),s=!g);while(y=e[h++])if(y(f,a||d,s)){u.push(f);break}c&&(T=E)}n&&((f=!y&&f)&&v--,o&&x.push(f))}if(v+=m,n&&m!==v){h=0;while(y=t[h++])y(x,b,a,s);if(o){if(v>0)while(m--)x[m]||b[m]||(b[m]=j.call(u));b=we(b)}L.apply(u,b),c&&!o&&b.length>0&&v+t.length>1&&oe.uniqueSort(u)}return c&&(T=E,l=w),x};return n?se(o):o}return s=oe.compile=function(e,t){var n,r=[],i=[],o=S[e+" "];if(!o){t||(t=a(e)),n=t.length;while(n--)(o=Ce(t[n]))[b]?r.push(o):i.push(o);(o=S(e,Ee(i,r))).selector=e}return o},u=oe.select=function(e,t,n,i){var o,u,l,c,f,p="function"==typeof e&&e,d=!i&&a(e=p.selector||e);if(n=n||[],1===d.length){if((u=d[0]=d[0].slice(0)).length>2&&"ID"===(l=u[0]).type&&9===t.nodeType&&g&&r.relative[u[1].type]){if(!(t=(r.find.ID(l.matches[0].replace(Z,ee),t)||[])[0]))return n;p&&(t=t.parentNode),e=e.slice(u.shift().value.length)}o=V.needsContext.test(e)?0:u.length;while(o--){if(l=u[o],r.relative[c=l.type])break;if((f=r.find[c])&&(i=f(l.matches[0].replace(Z,ee),K.test(u[0].type)&&ge(t.parentNode)||t))){if(u.splice(o,1),!(e=i.length&&ve(u)))return L.apply(n,i),n;break}}}return(p||s(e,d))(i,t,!g,n,!t||K.test(e)&&ge(t.parentNode)||t),n},n.sortStable=b.split("").sort(D).join("")===b,n.detectDuplicates=!!f,p(),n.sortDetached=ue(function(e){return 1&e.compareDocumentPosition(d.createElement("fieldset"))}),ue(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||le("type|href|height|width",function(e,t,n){if(!n)return e.getAttribute(t,"type"===t.toLowerCase()?1:2)}),n.attributes&&ue(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||le("value",function(e,t,n){if(!n&&"input"===e.nodeName.toLowerCase())return e.defaultValue}),ue(function(e){return null==e.getAttribute("disabled")})||le(P,function(e,t,n){var r;if(!n)return!0===e[t]?t.toLowerCase():(r=e.getAttributeNode(t))&&r.specified?r.value:null}),oe}(e);w.find=E,w.expr=E.selectors,w.expr[":"]=w.expr.pseudos,w.uniqueSort=w.unique=E.uniqueSort,w.text=E.getText,w.isXMLDoc=E.isXML,w.contains=E.contains,w.escapeSelector=E.escape;var k=function(e,t,n){var r=[],i=void 0!==n;while((e=e[t])&&9!==e.nodeType)if(1===e.nodeType){if(i&&w(e).is(n))break;r.push(e)}return r},S=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},D=w.expr.match.needsContext;function N(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}var A=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,t,n){return g(t)?w.grep(e,function(e,r){return!!t.call(e,r,e)!==n}):t.nodeType?w.grep(e,function(e){return e===t!==n}):"string"!=typeof t?w.grep(e,function(e){return u.call(t,e)>-1!==n}):w.filter(t,e,n)}w.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?w.find.matchesSelector(r,e)?[r]:[]:w.find.matches(e,w.grep(t,function(e){return 1===e.nodeType}))},w.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(w(e).filter(function(){for(t=0;t<r;t++)if(w.contains(i[t],this))return!0}));for(n=this.pushStack([]),t=0;t<r;t++)w.find(e,i[t],n);return r>1?w.uniqueSort(n):n},filter:function(e){return this.pushStack(j(this,e||[],!1))},not:function(e){return this.pushStack(j(this,e||[],!0))},is:function(e){return!!j(this,"string"==typeof e&&D.test(e)?w(e):e||[],!1).length}});var q,L=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(w.fn.init=function(e,t,n){var i,o;if(!e)return this;if(n=n||q,"string"==typeof e){if(!(i="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:L.exec(e))||!i[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(i[1]){if(t=t instanceof w?t[0]:t,w.merge(this,w.parseHTML(i[1],t&&t.nodeType?t.ownerDocument||t:r,!0)),A.test(i[1])&&w.isPlainObject(t))for(i in t)g(this[i])?this[i](t[i]):this.attr(i,t[i]);return this}return(o=r.getElementById(i[2]))&&(this[0]=o,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):g(e)?void 0!==n.ready?n.ready(e):e(w):w.makeArray(e,this)}).prototype=w.fn,q=w(r);var H=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};w.fn.extend({has:function(e){var t=w(e,this),n=t.length;return this.filter(function(){for(var e=0;e<n;e++)if(w.contains(this,t[e]))return!0})},closest:function(e,t){var n,r=0,i=this.length,o=[],a="string"!=typeof e&&w(e);if(!D.test(e))for(;r<i;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?a.index(n)>-1:1===n.nodeType&&w.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?w.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?u.call(w(e),this[0]):u.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(w.uniqueSort(w.merge(this.get(),w(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function P(e,t){while((e=e[t])&&1!==e.nodeType);return e}w.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return k(e,"parentNode")},parentsUntil:function(e,t,n){return k(e,"parentNode",n)},next:function(e){return P(e,"nextSibling")},prev:function(e){return P(e,"previousSibling")},nextAll:function(e){return k(e,"nextSibling")},prevAll:function(e){return k(e,"previousSibling")},nextUntil:function(e,t,n){return k(e,"nextSibling",n)},prevUntil:function(e,t,n){return k(e,"previousSibling",n)},siblings:function(e){return S((e.parentNode||{}).firstChild,e)},children:function(e){return S(e.firstChild)},contents:function(e){return N(e,"iframe")?e.contentDocument:(N(e,"template")&&(e=e.content||e),w.merge([],e.childNodes))}},function(e,t){w.fn[e]=function(n,r){var i=w.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=w.filter(r,i)),this.length>1&&(O[e]||w.uniqueSort(i),H.test(e)&&i.reverse()),this.pushStack(i)}});var M=/[^\x20\t\r\n\f]+/g;function R(e){var t={};return w.each(e.match(M)||[],function(e,n){t[n]=!0}),t}w.Callbacks=function(e){e="string"==typeof e?R(e):w.extend({},e);var t,n,r,i,o=[],a=[],s=-1,u=function(){for(i=i||e.once,r=t=!0;a.length;s=-1){n=a.shift();while(++s<o.length)!1===o[s].apply(n[0],n[1])&&e.stopOnFalse&&(s=o.length,n=!1)}e.memory||(n=!1),t=!1,i&&(o=n?[]:"")},l={add:function(){return o&&(n&&!t&&(s=o.length-1,a.push(n)),function t(n){w.each(n,function(n,r){g(r)?e.unique&&l.has(r)||o.push(r):r&&r.length&&"string"!==x(r)&&t(r)})}(arguments),n&&!t&&u()),this},remove:function(){return w.each(arguments,function(e,t){var n;while((n=w.inArray(t,o,n))>-1)o.splice(n,1),n<=s&&s--}),this},has:function(e){return e?w.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],a.push(n),t||u()),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!r}};return l};function I(e){return e}function W(e){throw e}function $(e,t,n,r){var i;try{e&&g(i=e.promise)?i.call(e).done(t).fail(n):e&&g(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}w.extend({Deferred:function(t){var n=[["notify","progress",w.Callbacks("memory"),w.Callbacks("memory"),2],["resolve","done",w.Callbacks("once memory"),w.Callbacks("once memory"),0,"resolved"],["reject","fail",w.Callbacks("once memory"),w.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},"catch":function(e){return i.then(null,e)},pipe:function(){var e=arguments;return w.Deferred(function(t){w.each(n,function(n,r){var i=g(e[r[4]])&&e[r[4]];o[r[1]](function(){var e=i&&i.apply(this,arguments);e&&g(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[r[0]+"With"](this,i?[e]:arguments)})}),e=null}).promise()},then:function(t,r,i){var o=0;function a(t,n,r,i){return function(){var s=this,u=arguments,l=function(){var e,l;if(!(t<o)){if((e=r.apply(s,u))===n.promise())throw new TypeError("Thenable self-resolution");l=e&&("object"==typeof e||"function"==typeof e)&&e.then,g(l)?i?l.call(e,a(o,n,I,i),a(o,n,W,i)):(o++,l.call(e,a(o,n,I,i),a(o,n,W,i),a(o,n,I,n.notifyWith))):(r!==I&&(s=void 0,u=[e]),(i||n.resolveWith)(s,u))}},c=i?l:function(){try{l()}catch(e){w.Deferred.exceptionHook&&w.Deferred.exceptionHook(e,c.stackTrace),t+1>=o&&(r!==W&&(s=void 0,u=[e]),n.rejectWith(s,u))}};t?c():(w.Deferred.getStackHook&&(c.stackTrace=w.Deferred.getStackHook()),e.setTimeout(c))}}return w.Deferred(function(e){n[0][3].add(a(0,e,g(i)?i:I,e.notifyWith)),n[1][3].add(a(0,e,g(t)?t:I)),n[2][3].add(a(0,e,g(r)?r:W))}).promise()},promise:function(e){return null!=e?w.extend(e,i):i}},o={};return w.each(n,function(e,t){var a=t[2],s=t[5];i[t[1]]=a.add,s&&a.add(function(){r=s},n[3-e][2].disable,n[3-e][3].disable,n[0][2].lock,n[0][3].lock),a.add(t[3].fire),o[t[0]]=function(){return o[t[0]+"With"](this===o?void 0:this,arguments),this},o[t[0]+"With"]=a.fireWith}),i.promise(o),t&&t.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),i=o.call(arguments),a=w.Deferred(),s=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?o.call(arguments):n,--t||a.resolveWith(r,i)}};if(t<=1&&($(e,a.done(s(n)).resolve,a.reject,!t),"pending"===a.state()||g(i[n]&&i[n].then)))return a.then();while(n--)$(i[n],s(n),a.reject);return a.promise()}});var B=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;w.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&B.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},w.readyException=function(t){e.setTimeout(function(){throw t})};var F=w.Deferred();w.fn.ready=function(e){return F.then(e)["catch"](function(e){w.readyException(e)}),this},w.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--w.readyWait:w.isReady)||(w.isReady=!0,!0!==e&&--w.readyWait>0||F.resolveWith(r,[w]))}}),w.ready.then=F.then;function _(){r.removeEventListener("DOMContentLoaded",_),e.removeEventListener("load",_),w.ready()}"complete"===r.readyState||"loading"!==r.readyState&&!r.documentElement.doScroll?e.setTimeout(w.ready):(r.addEventListener("DOMContentLoaded",_),e.addEventListener("load",_));var z=function(e,t,n,r,i,o,a){var s=0,u=e.length,l=null==n;if("object"===x(n)){i=!0;for(s in n)z(e,t,s,n[s],!0,o,a)}else if(void 0!==r&&(i=!0,g(r)||(a=!0),l&&(a?(t.call(e,r),t=null):(l=t,t=function(e,t,n){return l.call(w(e),n)})),t))for(;s<u;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return i?e:l?t.call(e):u?t(e[0],n):o},X=/^-ms-/,U=/-([a-z])/g;function V(e,t){return t.toUpperCase()}function G(e){return e.replace(X,"ms-").replace(U,V)}var Y=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function Q(){this.expando=w.expando+Q.uid++}Q.uid=1,Q.prototype={cache:function(e){var t=e[this.expando];return t||(t={},Y(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,i=this.cache(e);if("string"==typeof t)i[G(t)]=n;else for(r in t)i[G(r)]=t[r];return i},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][G(t)]},access:function(e,t,n){return void 0===t||t&&"string"==typeof t&&void 0===n?this.get(e,t):(this.set(e,t,n),void 0!==n?n:t)},remove:function(e,t){var n,r=e[this.expando];if(void 0!==r){if(void 0!==t){n=(t=Array.isArray(t)?t.map(G):(t=G(t))in r?[t]:t.match(M)||[]).length;while(n--)delete r[t[n]]}(void 0===t||w.isEmptyObject(r))&&(e.nodeType?e[this.expando]=void 0:delete e[this.expando])}},hasData:function(e){var t=e[this.expando];return void 0!==t&&!w.isEmptyObject(t)}};var J=new Q,K=new Q,Z=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,ee=/[A-Z]/g;function te(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:Z.test(e)?JSON.parse(e):e)}function ne(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(ee,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n=te(n)}catch(e){}K.set(e,t,n)}else n=void 0;return n}w.extend({hasData:function(e){return K.hasData(e)||J.hasData(e)},data:function(e,t,n){return K.access(e,t,n)},removeData:function(e,t){K.remove(e,t)},_data:function(e,t,n){return J.access(e,t,n)},_removeData:function(e,t){J.remove(e,t)}}),w.fn.extend({data:function(e,t){var n,r,i,o=this[0],a=o&&o.attributes;if(void 0===e){if(this.length&&(i=K.get(o),1===o.nodeType&&!J.get(o,"hasDataAttrs"))){n=a.length;while(n--)a[n]&&0===(r=a[n].name).indexOf("data-")&&(r=G(r.slice(5)),ne(o,r,i[r]));J.set(o,"hasDataAttrs",!0)}return i}return"object"==typeof e?this.each(function(){K.set(this,e)}):z(this,function(t){var n;if(o&&void 0===t){if(void 0!==(n=K.get(o,e)))return n;if(void 0!==(n=ne(o,e)))return n}else this.each(function(){K.set(this,e,t)})},null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){K.remove(this,e)})}}),w.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=J.get(e,t),n&&(!r||Array.isArray(n)?r=J.access(e,t,w.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=w.queue(e,t),r=n.length,i=n.shift(),o=w._queueHooks(e,t),a=function(){w.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return J.get(e,n)||J.access(e,n,{empty:w.Callbacks("once memory").add(function(){J.remove(e,[t+"queue",n])})})}}),w.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?w.queue(this[0],e):void 0===t?this:this.each(function(){var n=w.queue(this,e,t);w._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&w.dequeue(this,e)})},dequeue:function(e){return this.each(function(){w.dequeue(this,e)})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,i=w.Deferred(),o=this,a=this.length,s=function(){--r||i.resolveWith(o,[o])};"string"!=typeof e&&(t=e,e=void 0),e=e||"fx";while(a--)(n=J.get(o[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),i.promise(t)}});var re=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,ie=new RegExp("^(?:([+-])=|)("+re+")([a-z%]*)$","i"),oe=["Top","Right","Bottom","Left"],ae=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&w.contains(e.ownerDocument,e)&&"none"===w.css(e,"display")},se=function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i};function ue(e,t,n,r){var i,o,a=20,s=r?function(){return r.cur()}:function(){return w.css(e,t,"")},u=s(),l=n&&n[3]||(w.cssNumber[t]?"":"px"),c=(w.cssNumber[t]||"px"!==l&&+u)&&ie.exec(w.css(e,t));if(c&&c[3]!==l){u/=2,l=l||c[3],c=+u||1;while(a--)w.style(e,t,c+l),(1-o)*(1-(o=s()/u||.5))<=0&&(a=0),c/=o;c*=2,w.style(e,t,c+l),n=n||[]}return n&&(c=+c||+u||0,i=n[1]?c+(n[1]+1)*n[2]:+n[2],r&&(r.unit=l,r.start=c,r.end=i)),i}var le={};function ce(e){var t,n=e.ownerDocument,r=e.nodeName,i=le[r];return i||(t=n.body.appendChild(n.createElement(r)),i=w.css(t,"display"),t.parentNode.removeChild(t),"none"===i&&(i="block"),le[r]=i,i)}function fe(e,t){for(var n,r,i=[],o=0,a=e.length;o<a;o++)(r=e[o]).style&&(n=r.style.display,t?("none"===n&&(i[o]=J.get(r,"display")||null,i[o]||(r.style.display="")),""===r.style.display&&ae(r)&&(i[o]=ce(r))):"none"!==n&&(i[o]="none",J.set(r,"display",n)));for(o=0;o<a;o++)null!=i[o]&&(e[o].style.display=i[o]);return e}w.fn.extend({show:function(){return fe(this,!0)},hide:function(){return fe(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){ae(this)?w(this).show():w(this).hide()})}});var pe=/^(?:checkbox|radio)$/i,de=/<([a-z][^\/\0>\x20\t\r\n\f]+)/i,he=/^$|^module$|\/(?:java|ecma)script/i,ge={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ge.optgroup=ge.option,ge.tbody=ge.tfoot=ge.colgroup=ge.caption=ge.thead,ge.th=ge.td;function ye(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&N(e,t)?w.merge([e],n):n}function ve(e,t){for(var n=0,r=e.length;n<r;n++)J.set(e[n],"globalEval",!t||J.get(t[n],"globalEval"))}var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d<h;d++)if((o=e[d])||0===o)if("object"===x(o))w.merge(p,o.nodeType?[o]:o);else if(me.test(o)){a=a||f.appendChild(t.createElement("div")),s=(de.exec(o)||["",""])[1].toLowerCase(),u=ge[s]||ge._default,a.innerHTML=u[1]+w.htmlPrefilter(o)+u[2],c=u[0];while(c--)a=a.lastChild;w.merge(p,a.childNodes),(a=f.firstChild).textContent=""}else p.push(t.createTextNode(o));f.textContent="",d=0;while(o=p[d++])if(r&&w.inArray(o,r)>-1)i&&i.push(o);else if(l=w.contains(o.ownerDocument,o),a=ye(f.appendChild(o),"script"),l&&ve(a),n){c=0;while(o=a[c++])he.test(o.type||"")&&n.push(o)}return f}!function(){var e=r.createDocumentFragment().appendChild(r.createElement("div")),t=r.createElement("input");t.setAttribute("type","radio"),t.setAttribute("checked","checked"),t.setAttribute("name","t"),e.appendChild(t),h.checkClone=e.cloneNode(!0).cloneNode(!0).lastChild.checked,e.innerHTML="<textarea>x</textarea>",h.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue}();var be=r.documentElement,we=/^key/,Te=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ce=/^([^.]*)(?:\.(.+)|)/;function Ee(){return!0}function ke(){return!1}function Se(){try{return r.activeElement}catch(e){}}function De(e,t,n,r,i,o){var a,s;if("object"==typeof t){"string"!=typeof n&&(r=r||n,n=void 0);for(s in t)De(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=ke;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return w().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=w.guid++)),e.each(function(){w.event.add(this,t,i,r,n)})}w.event={global:{},add:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,y=J.get(e);if(y){n.handler&&(n=(o=n).handler,i=o.selector),i&&w.find.matchesSelector(be,i),n.guid||(n.guid=w.guid++),(u=y.events)||(u=y.events={}),(a=y.handle)||(a=y.handle=function(t){return"undefined"!=typeof w&&w.event.triggered!==t.type?w.event.dispatch.apply(e,arguments):void 0}),l=(t=(t||"").match(M)||[""]).length;while(l--)d=g=(s=Ce.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=w.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=w.event.special[d]||{},c=w.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&w.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(e,r,h,a)||e.addEventListener&&e.addEventListener(d,a)),f.add&&(f.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),w.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,y=J.hasData(e)&&J.get(e);if(y&&(u=y.events)){l=(t=(t||"").match(M)||[""]).length;while(l--)if(s=Ce.exec(t[l])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){f=w.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,y.handle)||w.removeEvent(e,d,y.handle),delete u[d])}else for(d in u)w.event.remove(e,d+t[l],n,r,!0);w.isEmptyObject(u)&&J.remove(e,"handle events")}},dispatch:function(e){var t=w.event.fix(e),n,r,i,o,a,s,u=new Array(arguments.length),l=(J.get(this,"events")||{})[t.type]||[],c=w.event.special[t.type]||{};for(u[0]=t,n=1;n<arguments.length;n++)u[n]=arguments[n];if(t.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,t)){s=w.event.handlers.call(this,t,l),n=0;while((o=s[n++])&&!t.isPropagationStopped()){t.currentTarget=o.elem,r=0;while((a=o.handlers[r++])&&!t.isImmediatePropagationStopped())t.rnamespace&&!t.rnamespace.test(a.namespace)||(t.handleObj=a,t.data=a.data,void 0!==(i=((w.event.special[a.origType]||{}).handle||a.handler).apply(o.elem,u))&&!1===(t.result=i)&&(t.preventDefault(),t.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,t),t.result}},handlers:function(e,t){var n,r,i,o,a,s=[],u=t.delegateCount,l=e.target;if(u&&l.nodeType&&!("click"===e.type&&e.button>=1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==e.type||!0!==l.disabled)){for(o=[],a={},n=0;n<u;n++)void 0===a[i=(r=t[n]).selector+" "]&&(a[i]=r.needsContext?w(i,this).index(l)>-1:w.find(i,this,null,[l]).length),a[i]&&o.push(r);o.length&&s.push({elem:l,handlers:o})}return l=this,u<t.length&&s.push({elem:l,handlers:t.slice(u)}),s},addProp:function(e,t){Object.defineProperty(w.Event.prototype,e,{enumerable:!0,configurable:!0,get:g(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[e]},set:function(t){Object.defineProperty(this,e,{enumerable:!0,configurable:!0,writable:!0,value:t})}})},fix:function(e){return e[w.expando]?e:new w.Event(e)},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==Se()&&this.focus)return this.focus(),!1},delegateType:"focusin"},blur:{trigger:function(){if(this===Se()&&this.blur)return this.blur(),!1},delegateType:"focusout"},click:{trigger:function(){if("checkbox"===this.type&&this.click&&N(this,"input"))return this.click(),!1},_default:function(e){return N(e.target,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},w.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},w.Event=function(e,t){if(!(this instanceof w.Event))return new w.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?Ee:ke,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&w.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[w.expando]=!0},w.Event.prototype={constructor:w.Event,isDefaultPrevented:ke,isPropagationStopped:ke,isImmediatePropagationStopped:ke,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=Ee,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=Ee,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=Ee,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},w.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,"char":!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:function(e){var t=e.button;return null==e.which&&we.test(e.type)?null!=e.charCode?e.charCode:e.keyCode:!e.which&&void 0!==t&&Te.test(e.type)?1&t?1:2&t?3:4&t?2:0:e.which}},w.event.addProp),w.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(e,t){w.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return i&&(i===r||w.contains(r,i))||(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),w.fn.extend({on:function(e,t,n,r){return De(this,e,t,n,r)},one:function(e,t,n,r){return De(this,e,t,n,r,1)},off:function(e,t,n){var r,i;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,w(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(i in e)this.off(i,t,e[i]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=ke),this.each(function(){w.event.remove(this,e,n,t)})}});var Ne=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,Ae=/<script|<style|<link/i,je=/checked\s*(?:[^=]|=\s*.checked.)/i,qe=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function Le(e,t){return N(e,"table")&&N(11!==t.nodeType?t:t.firstChild,"tr")?w(e).children("tbody")[0]||e:e}function He(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Oe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Pe(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(J.hasData(e)&&(o=J.access(e),a=J.set(t,o),l=o.events)){delete a.handle,a.events={};for(i in l)for(n=0,r=l[i].length;n<r;n++)w.event.add(t,i,l[i][n])}K.hasData(e)&&(s=K.access(e),u=w.extend({},s),K.set(t,u))}}function Me(e,t){var n=t.nodeName.toLowerCase();"input"===n&&pe.test(e.type)?t.checked=e.checked:"input"!==n&&"textarea"!==n||(t.defaultValue=e.defaultValue)}function Re(e,t,n,r){t=a.apply([],t);var i,o,s,u,l,c,f=0,p=e.length,d=p-1,y=t[0],v=g(y);if(v||p>1&&"string"==typeof y&&!h.checkClone&&je.test(y))return e.each(function(i){var o=e.eq(i);v&&(t[0]=y.call(this,i,o.html())),Re(o,t,n,r)});if(p&&(i=xe(t,e[0].ownerDocument,!1,e,r),o=i.firstChild,1===i.childNodes.length&&(i=o),o||r)){for(u=(s=w.map(ye(i,"script"),He)).length;f<p;f++)l=i,f!==d&&(l=w.clone(l,!0,!0),u&&w.merge(s,ye(l,"script"))),n.call(e[f],l,f);if(u)for(c=s[s.length-1].ownerDocument,w.map(s,Oe),f=0;f<u;f++)l=s[f],he.test(l.type||"")&&!J.access(l,"globalEval")&&w.contains(c,l)&&(l.src&&"module"!==(l.type||"").toLowerCase()?w._evalUrl&&w._evalUrl(l.src):m(l.textContent.replace(qe,""),c,l))}return e}function Ie(e,t,n){for(var r,i=t?w.filter(t,e):e,o=0;null!=(r=i[o]);o++)n||1!==r.nodeType||w.cleanData(ye(r)),r.parentNode&&(n&&w.contains(r.ownerDocument,r)&&ve(ye(r,"script")),r.parentNode.removeChild(r));return e}w.extend({htmlPrefilter:function(e){return e.replace(Ne,"<$1></$2>")},clone:function(e,t,n){var r,i,o,a,s=e.cloneNode(!0),u=w.contains(e.ownerDocument,e);if(!(h.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||w.isXMLDoc(e)))for(a=ye(s),r=0,i=(o=ye(e)).length;r<i;r++)Me(o[r],a[r]);if(t)if(n)for(o=o||ye(e),a=a||ye(s),r=0,i=o.length;r<i;r++)Pe(o[r],a[r]);else Pe(e,s);return(a=ye(s,"script")).length>0&&ve(a,!u&&ye(e,"script")),s},cleanData:function(e){for(var t,n,r,i=w.event.special,o=0;void 0!==(n=e[o]);o++)if(Y(n)){if(t=n[J.expando]){if(t.events)for(r in t.events)i[r]?w.event.remove(n,r):w.removeEvent(n,r,t.handle);n[J.expando]=void 0}n[K.expando]&&(n[K.expando]=void 0)}}}),w.fn.extend({detach:function(e){return Ie(this,e,!0)},remove:function(e){return Ie(this,e)},text:function(e){return z(this,function(e){return void 0===e?w.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return Re(this,arguments,function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Le(this,e).appendChild(e)})},prepend:function(){return Re(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Le(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return Re(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return Re(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(w.cleanData(ye(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return w.clone(this,e,t)})},html:function(e){return z(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ae.test(e)&&!ge[(de.exec(e)||["",""])[1].toLowerCase()]){e=w.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(w.cleanData(ye(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=[];return Re(this,arguments,function(t){var n=this.parentNode;w.inArray(this,e)<0&&(w.cleanData(ye(this)),n&&n.replaceChild(t,this))},e)}}),w.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){w.fn[e]=function(e){for(var n,r=[],i=w(e),o=i.length-1,a=0;a<=o;a++)n=a===o?this:this.clone(!0),w(i[a])[t](n),s.apply(r,n.get());return this.pushStack(r)}});var We=new RegExp("^("+re+")(?!px)[a-z%]+$","i"),$e=function(t){var n=t.ownerDocument.defaultView;return n&&n.opener||(n=e),n.getComputedStyle(t)},Be=new RegExp(oe.join("|"),"i");!function(){function t(){if(c){l.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",c.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",be.appendChild(l).appendChild(c);var t=e.getComputedStyle(c);i="1%"!==t.top,u=12===n(t.marginLeft),c.style.right="60%",s=36===n(t.right),o=36===n(t.width),c.style.position="absolute",a=36===c.offsetWidth||"absolute",be.removeChild(l),c=null}}function n(e){return Math.round(parseFloat(e))}var i,o,a,s,u,l=r.createElement("div"),c=r.createElement("div");c.style&&(c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",h.clearCloneStyle="content-box"===c.style.backgroundClip,w.extend(h,{boxSizingReliable:function(){return t(),o},pixelBoxStyles:function(){return t(),s},pixelPosition:function(){return t(),i},reliableMarginLeft:function(){return t(),u},scrollboxSize:function(){return t(),a}}))}();function Fe(e,t,n){var r,i,o,a,s=e.style;return(n=n||$e(e))&&(""!==(a=n.getPropertyValue(t)||n[t])||w.contains(e.ownerDocument,e)||(a=w.style(e,t)),!h.pixelBoxStyles()&&We.test(a)&&Be.test(t)&&(r=s.width,i=s.minWidth,o=s.maxWidth,s.minWidth=s.maxWidth=s.width=a,a=n.width,s.width=r,s.minWidth=i,s.maxWidth=o)),void 0!==a?a+"":a}function _e(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}var ze=/^(none|table(?!-c[ea]).+)/,Xe=/^--/,Ue={position:"absolute",visibility:"hidden",display:"block"},Ve={letterSpacing:"0",fontWeight:"400"},Ge=["Webkit","Moz","ms"],Ye=r.createElement("div").style;function Qe(e){if(e in Ye)return e;var t=e[0].toUpperCase()+e.slice(1),n=Ge.length;while(n--)if((e=Ge[n]+t)in Ye)return e}function Je(e){var t=w.cssProps[e];return t||(t=w.cssProps[e]=Qe(e)||e),t}function Ke(e,t,n){var r=ie.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function Ze(e,t,n,r,i,o){var a="width"===t?1:0,s=0,u=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(u+=w.css(e,n+oe[a],!0,i)),r?("content"===n&&(u-=w.css(e,"padding"+oe[a],!0,i)),"margin"!==n&&(u-=w.css(e,"border"+oe[a]+"Width",!0,i))):(u+=w.css(e,"padding"+oe[a],!0,i),"padding"!==n?u+=w.css(e,"border"+oe[a]+"Width",!0,i):s+=w.css(e,"border"+oe[a]+"Width",!0,i));return!r&&o>=0&&(u+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-u-s-.5))),u}function et(e,t,n){var r=$e(e),i=Fe(e,t,r),o="border-box"===w.css(e,"boxSizing",!1,r),a=o;if(We.test(i)){if(!n)return i;i="auto"}return a=a&&(h.boxSizingReliable()||i===e.style[t]),("auto"===i||!parseFloat(i)&&"inline"===w.css(e,"display",!1,r))&&(i=e["offset"+t[0].toUpperCase()+t.slice(1)],a=!0),(i=parseFloat(i)||0)+Ze(e,t,n||(o?"border":"content"),a,r,i)+"px"}w.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Fe(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=G(t),u=Xe.test(t),l=e.style;if(u||(t=Je(s)),a=w.cssHooks[t]||w.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:l[t];"string"==(o=typeof n)&&(i=ie.exec(n))&&i[1]&&(n=ue(e,t,i),o="number"),null!=n&&n===n&&("number"===o&&(n+=i&&i[3]||(w.cssNumber[s]?"":"px")),h.clearCloneStyle||""!==n||0!==t.indexOf("background")||(l[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(u?l.setProperty(t,n):l[t]=n))}},css:function(e,t,n,r){var i,o,a,s=G(t);return Xe.test(t)||(t=Je(s)),(a=w.cssHooks[t]||w.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Fe(e,t,r)),"normal"===i&&t in Ve&&(i=Ve[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),w.each(["height","width"],function(e,t){w.cssHooks[t]={get:function(e,n,r){if(n)return!ze.test(w.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?et(e,t,r):se(e,Ue,function(){return et(e,t,r)})},set:function(e,n,r){var i,o=$e(e),a="border-box"===w.css(e,"boxSizing",!1,o),s=r&&Ze(e,t,r,a,o);return a&&h.scrollboxSize()===o.position&&(s-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-Ze(e,t,"border",!1,o)-.5)),s&&(i=ie.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=w.css(e,t)),Ke(e,n,s)}}}),w.cssHooks.marginLeft=_e(h.reliableMarginLeft,function(e,t){if(t)return(parseFloat(Fe(e,"marginLeft"))||e.getBoundingClientRect().left-se(e,{marginLeft:0},function(){return e.getBoundingClientRect().left}))+"px"}),w.each({margin:"",padding:"",border:"Width"},function(e,t){w.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+oe[r]+t]=o[r]||o[r-2]||o[0];return i}},"margin"!==e&&(w.cssHooks[e+t].set=Ke)}),w.fn.extend({css:function(e,t){return z(this,function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=$e(e),i=t.length;a<i;a++)o[t[a]]=w.css(e,t[a],!1,r);return o}return void 0!==n?w.style(e,t,n):w.css(e,t)},e,t,arguments.length>1)}});function tt(e,t,n,r,i){return new tt.prototype.init(e,t,n,r,i)}w.Tween=tt,tt.prototype={constructor:tt,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||w.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(w.cssNumber[n]?"":"px")},cur:function(){var e=tt.propHooks[this.prop];return e&&e.get?e.get(this):tt.propHooks._default.get(this)},run:function(e){var t,n=tt.propHooks[this.prop];return this.options.duration?this.pos=t=w.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):tt.propHooks._default.set(this),this}},tt.prototype.init.prototype=tt.prototype,tt.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=w.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){w.fx.step[e.prop]?w.fx.step[e.prop](e):1!==e.elem.nodeType||null==e.elem.style[w.cssProps[e.prop]]&&!w.cssHooks[e.prop]?e.elem[e.prop]=e.now:w.style(e.elem,e.prop,e.now+e.unit)}}},tt.propHooks.scrollTop=tt.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},w.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},w.fx=tt.prototype.init,w.fx.step={};var nt,rt,it=/^(?:toggle|show|hide)$/,ot=/queueHooks$/;function at(){rt&&(!1===r.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(at):e.setTimeout(at,w.fx.interval),w.fx.tick())}function st(){return e.setTimeout(function(){nt=void 0}),nt=Date.now()}function ut(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=oe[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function lt(e,t,n){for(var r,i=(pt.tweeners[t]||[]).concat(pt.tweeners["*"]),o=0,a=i.length;o<a;o++)if(r=i[o].call(n,t,e))return r}function ct(e,t,n){var r,i,o,a,s,u,l,c,f="width"in t||"height"in t,p=this,d={},h=e.style,g=e.nodeType&&ae(e),y=J.get(e,"fxshow");n.queue||(null==(a=w._queueHooks(e,"fx")).unqueued&&(a.unqueued=0,s=a.empty.fire,a.empty.fire=function(){a.unqueued||s()}),a.unqueued++,p.always(function(){p.always(function(){a.unqueued--,w.queue(e,"fx").length||a.empty.fire()})}));for(r in t)if(i=t[r],it.test(i)){if(delete t[r],o=o||"toggle"===i,i===(g?"hide":"show")){if("show"!==i||!y||void 0===y[r])continue;g=!0}d[r]=y&&y[r]||w.style(e,r)}if((u=!w.isEmptyObject(t))||!w.isEmptyObject(d)){f&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(l=y&&y.display)&&(l=J.get(e,"display")),"none"===(c=w.css(e,"display"))&&(l?c=l:(fe([e],!0),l=e.style.display||l,c=w.css(e,"display"),fe([e]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===w.css(e,"float")&&(u||(p.done(function(){h.display=l}),null==l&&(c=h.display,l="none"===c?"":c)),h.display="inline-block")),n.overflow&&(h.overflow="hidden",p.always(function(){h.overflow=n.overflow[0],h.overflowX=n.overflow[1],h.overflowY=n.overflow[2]})),u=!1;for(r in d)u||(y?"hidden"in y&&(g=y.hidden):y=J.access(e,"fxshow",{display:l}),o&&(y.hidden=!g),g&&fe([e],!0),p.done(function(){g||fe([e]),J.remove(e,"fxshow");for(r in d)w.style(e,r,d[r])})),u=lt(g?y[r]:0,r,p),r in y||(y[r]=u.start,g&&(u.end=u.start,u.start=0))}}function ft(e,t){var n,r,i,o,a;for(n in e)if(r=G(n),i=t[r],o=e[n],Array.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),(a=w.cssHooks[r])&&"expand"in a){o=a.expand(o),delete e[r];for(n in o)n in e||(e[n]=o[n],t[n]=i)}else t[r]=i}function pt(e,t,n){var r,i,o=0,a=pt.prefilters.length,s=w.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;for(var t=nt||st(),n=Math.max(0,l.startTime+l.duration-t),r=1-(n/l.duration||0),o=0,a=l.tweens.length;o<a;o++)l.tweens[o].run(r);return s.notifyWith(e,[l,r,n]),r<1&&a?n:(a||s.notifyWith(e,[l,1,0]),s.resolveWith(e,[l]),!1)},l=s.promise({elem:e,props:w.extend({},t),opts:w.extend(!0,{specialEasing:{},easing:w.easing._default},n),originalProperties:t,originalOptions:n,startTime:nt||st(),duration:n.duration,tweens:[],createTween:function(t,n){var r=w.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;n<r;n++)l.tweens[n].run(1);return t?(s.notifyWith(e,[l,1,0]),s.resolveWith(e,[l,t])):s.rejectWith(e,[l,t]),this}}),c=l.props;for(ft(c,l.opts.specialEasing);o<a;o++)if(r=pt.prefilters[o].call(l,e,c,l.opts))return g(r.stop)&&(w._queueHooks(l.elem,l.opts.queue).stop=r.stop.bind(r)),r;return w.map(c,lt,l),g(l.opts.start)&&l.opts.start.call(e,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),w.fx.timer(w.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l}w.Animation=w.extend(pt,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return ue(n.elem,e,ie.exec(t),n),n}]},tweener:function(e,t){g(e)?(t=e,e=["*"]):e=e.match(M);for(var n,r=0,i=e.length;r<i;r++)n=e[r],pt.tweeners[n]=pt.tweeners[n]||[],pt.tweeners[n].unshift(t)},prefilters:[ct],prefilter:function(e,t){t?pt.prefilters.unshift(e):pt.prefilters.push(e)}}),w.speed=function(e,t,n){var r=e&&"object"==typeof e?w.extend({},e):{complete:n||!n&&t||g(e)&&e,duration:e,easing:n&&t||t&&!g(t)&&t};return w.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in w.fx.speeds?r.duration=w.fx.speeds[r.duration]:r.duration=w.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){g(r.old)&&r.old.call(this),r.queue&&w.dequeue(this,r.queue)},r},w.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ae).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=w.isEmptyObject(e),o=w.speed(t,n,r),a=function(){var t=pt(this,w.extend({},e),o);(i||J.get(this,"finish"))&&t.stop(!0)};return a.finish=a,i||!1===o.queue?this.each(a):this.queue(o.queue,a)},stop:function(e,t,n){var r=function(e){var t=e.stop;delete e.stop,t(n)};return"string"!=typeof e&&(n=t,t=e,e=void 0),t&&!1!==e&&this.queue(e||"fx",[]),this.each(function(){var t=!0,i=null!=e&&e+"queueHooks",o=w.timers,a=J.get(this);if(i)a[i]&&a[i].stop&&r(a[i]);else for(i in a)a[i]&&a[i].stop&&ot.test(i)&&r(a[i]);for(i=o.length;i--;)o[i].elem!==this||null!=e&&o[i].queue!==e||(o[i].anim.stop(n),t=!1,o.splice(i,1));!t&&n||w.dequeue(this,e)})},finish:function(e){return!1!==e&&(e=e||"fx"),this.each(function(){var t,n=J.get(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=w.timers,a=r?r.length:0;for(n.finish=!0,w.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;t<a;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}}),w.each(["toggle","show","hide"],function(e,t){var n=w.fn[t];w.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ut(t,!0),e,r,i)}}),w.each({slideDown:ut("show"),slideUp:ut("hide"),slideToggle:ut("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){w.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),w.timers=[],w.fx.tick=function(){var e,t=0,n=w.timers;for(nt=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||w.fx.stop(),nt=void 0},w.fx.timer=function(e){w.timers.push(e),w.fx.start()},w.fx.interval=13,w.fx.start=function(){rt||(rt=!0,at())},w.fx.stop=function(){rt=null},w.fx.speeds={slow:600,fast:200,_default:400},w.fn.delay=function(t,n){return t=w.fx?w.fx.speeds[t]||t:t,n=n||"fx",this.queue(n,function(n,r){var i=e.setTimeout(n,t);r.stop=function(){e.clearTimeout(i)}})},function(){var e=r.createElement("input"),t=r.createElement("select").appendChild(r.createElement("option"));e.type="checkbox",h.checkOn=""!==e.value,h.optSelected=t.selected,(e=r.createElement("input")).value="t",e.type="radio",h.radioValue="t"===e.value}();var dt,ht=w.expr.attrHandle;w.fn.extend({attr:function(e,t){return z(this,w.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){w.removeAttr(this,e)})}}),w.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?w.prop(e,t,n):(1===o&&w.isXMLDoc(e)||(i=w.attrHooks[t.toLowerCase()]||(w.expr.match.bool.test(t)?dt:void 0)),void 0!==n?null===n?void w.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=w.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!h.radioValue&&"radio"===t&&N(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(M);if(i&&1===e.nodeType)while(n=i[r++])e.removeAttribute(n)}}),dt={set:function(e,t,n){return!1===t?w.removeAttr(e,n):e.setAttribute(n,n),n}},w.each(w.expr.match.bool.source.match(/\w+/g),function(e,t){var n=ht[t]||w.find.attr;ht[t]=function(e,t,r){var i,o,a=t.toLowerCase();return r||(o=ht[a],ht[a]=i,i=null!=n(e,t,r)?a:null,ht[a]=o),i}});var gt=/^(?:input|select|textarea|button)$/i,yt=/^(?:a|area)$/i;w.fn.extend({prop:function(e,t){return z(this,w.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[w.propFix[e]||e]})}}),w.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&w.isXMLDoc(e)||(t=w.propFix[t]||t,i=w.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=w.find.attr(e,"tabindex");return t?parseInt(t,10):gt.test(e.nodeName)||yt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),h.optSelected||(w.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),w.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){w.propFix[this.toLowerCase()]=this});function vt(e){return(e.match(M)||[]).join(" ")}function mt(e){return e.getAttribute&&e.getAttribute("class")||""}function xt(e){return Array.isArray(e)?e:"string"==typeof e?e.match(M)||[]:[]}w.fn.extend({addClass:function(e){var t,n,r,i,o,a,s,u=0;if(g(e))return this.each(function(t){w(this).addClass(e.call(this,t,mt(this)))});if((t=xt(e)).length)while(n=this[u++])if(i=mt(n),r=1===n.nodeType&&" "+vt(i)+" "){a=0;while(o=t[a++])r.indexOf(" "+o+" ")<0&&(r+=o+" ");i!==(s=vt(r))&&n.setAttribute("class",s)}return this},removeClass:function(e){var t,n,r,i,o,a,s,u=0;if(g(e))return this.each(function(t){w(this).removeClass(e.call(this,t,mt(this)))});if(!arguments.length)return this.attr("class","");if((t=xt(e)).length)while(n=this[u++])if(i=mt(n),r=1===n.nodeType&&" "+vt(i)+" "){a=0;while(o=t[a++])while(r.indexOf(" "+o+" ")>-1)r=r.replace(" "+o+" "," ");i!==(s=vt(r))&&n.setAttribute("class",s)}return this},toggleClass:function(e,t){var n=typeof e,r="string"===n||Array.isArray(e);return"boolean"==typeof t&&r?t?this.addClass(e):this.removeClass(e):g(e)?this.each(function(n){w(this).toggleClass(e.call(this,n,mt(this),t),t)}):this.each(function(){var t,i,o,a;if(r){i=0,o=w(this),a=xt(e);while(t=a[i++])o.hasClass(t)?o.removeClass(t):o.addClass(t)}else void 0!==e&&"boolean"!==n||((t=mt(this))&&J.set(this,"__className__",t),this.setAttribute&&this.setAttribute("class",t||!1===e?"":J.get(this,"__className__")||""))})},hasClass:function(e){var t,n,r=0;t=" "+e+" ";while(n=this[r++])if(1===n.nodeType&&(" "+vt(mt(n))+" ").indexOf(t)>-1)return!0;return!1}});var bt=/\r/g;w.fn.extend({val:function(e){var t,n,r,i=this[0];{if(arguments.length)return r=g(e),this.each(function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,w(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=w.map(i,function(e){return null==e?"":e+""})),(t=w.valHooks[this.type]||w.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))});if(i)return(t=w.valHooks[i.type]||w.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(bt,""):null==n?"":n}}}),w.extend({valHooks:{option:{get:function(e){var t=w.find.attr(e,"value");return null!=t?t:vt(w.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],u=a?o+1:i.length;for(r=o<0?u:a?o:0;r<u;r++)if(((n=i[r]).selected||r===o)&&!n.disabled&&(!n.parentNode.disabled||!N(n.parentNode,"optgroup"))){if(t=w(n).val(),a)return t;s.push(t)}return s},set:function(e,t){var n,r,i=e.options,o=w.makeArray(t),a=i.length;while(a--)((r=i[a]).selected=w.inArray(w.valHooks.option.get(r),o)>-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),w.each(["radio","checkbox"],function(){w.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=w.inArray(w(e).val(),t)>-1}},h.checkOn||(w.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),h.focusin="onfocusin"in e;var wt=/^(?:focusinfocus|focusoutblur)$/,Tt=function(e){e.stopPropagation()};w.extend(w.event,{trigger:function(t,n,i,o){var a,s,u,l,c,p,d,h,v=[i||r],m=f.call(t,"type")?t.type:t,x=f.call(t,"namespace")?t.namespace.split("."):[];if(s=h=u=i=i||r,3!==i.nodeType&&8!==i.nodeType&&!wt.test(m+w.event.triggered)&&(m.indexOf(".")>-1&&(m=(x=m.split(".")).shift(),x.sort()),c=m.indexOf(":")<0&&"on"+m,t=t[w.expando]?t:new w.Event(m,"object"==typeof t&&t),t.isTrigger=o?2:3,t.namespace=x.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+x.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=i),n=null==n?[t]:w.makeArray(n,[t]),d=w.event.special[m]||{},o||!d.trigger||!1!==d.trigger.apply(i,n))){if(!o&&!d.noBubble&&!y(i)){for(l=d.delegateType||m,wt.test(l+m)||(s=s.parentNode);s;s=s.parentNode)v.push(s),u=s;u===(i.ownerDocument||r)&&v.push(u.defaultView||u.parentWindow||e)}a=0;while((s=v[a++])&&!t.isPropagationStopped())h=s,t.type=a>1?l:d.bindType||m,(p=(J.get(s,"events")||{})[t.type]&&J.get(s,"handle"))&&p.apply(s,n),(p=c&&s[c])&&p.apply&&Y(s)&&(t.result=p.apply(s,n),!1===t.result&&t.preventDefault());return t.type=m,o||t.isDefaultPrevented()||d._default&&!1!==d._default.apply(v.pop(),n)||!Y(i)||c&&g(i[m])&&!y(i)&&((u=i[c])&&(i[c]=null),w.event.triggered=m,t.isPropagationStopped()&&h.addEventListener(m,Tt),i[m](),t.isPropagationStopped()&&h.removeEventListener(m,Tt),w.event.triggered=void 0,u&&(i[c]=u)),t.result}},simulate:function(e,t,n){var r=w.extend(new w.Event,n,{type:e,isSimulated:!0});w.event.trigger(r,null,t)}}),w.fn.extend({trigger:function(e,t){return this.each(function(){w.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return w.event.trigger(e,t,n,!0)}}),h.focusin||w.each({focus:"focusin",blur:"focusout"},function(e,t){var n=function(e){w.event.simulate(t,e.target,w.event.fix(e))};w.event.special[t]={setup:function(){var r=this.ownerDocument||this,i=J.access(r,t);i||r.addEventListener(e,n,!0),J.access(r,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this,i=J.access(r,t)-1;i?J.access(r,t,i):(r.removeEventListener(e,n,!0),J.remove(r,t))}}});var Ct=e.location,Et=Date.now(),kt=/\?/;w.parseXML=function(t){var n;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){n=void 0}return n&&!n.getElementsByTagName("parsererror").length||w.error("Invalid XML: "+t),n};var St=/\[\]$/,Dt=/\r?\n/g,Nt=/^(?:submit|button|image|reset|file)$/i,At=/^(?:input|select|textarea|keygen)/i;function jt(e,t,n,r){var i;if(Array.isArray(t))w.each(t,function(t,i){n||St.test(e)?r(e,i):jt(e+"["+("object"==typeof i&&null!=i?t:"")+"]",i,n,r)});else if(n||"object"!==x(t))r(e,t);else for(i in t)jt(e+"["+i+"]",t[i],n,r)}w.param=function(e,t){var n,r=[],i=function(e,t){var n=g(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(Array.isArray(e)||e.jquery&&!w.isPlainObject(e))w.each(e,function(){i(this.name,this.value)});else for(n in e)jt(n,e[n],t,i);return r.join("&")},w.fn.extend({serialize:function(){return w.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=w.prop(this,"elements");return e?w.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!w(this).is(":disabled")&&At.test(this.nodeName)&&!Nt.test(e)&&(this.checked||!pe.test(e))}).map(function(e,t){var n=w(this).val();return null==n?null:Array.isArray(n)?w.map(n,function(e){return{name:t.name,value:e.replace(Dt,"\r\n")}}):{name:t.name,value:n.replace(Dt,"\r\n")}}).get()}});var qt=/%20/g,Lt=/#.*$/,Ht=/([?&])_=[^&]*/,Ot=/^(.*?):[ \t]*([^\r\n]*)$/gm,Pt=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Mt=/^(?:GET|HEAD)$/,Rt=/^\/\//,It={},Wt={},$t="*/".concat("*"),Bt=r.createElement("a");Bt.href=Ct.href;function Ft(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(M)||[];if(g(n))while(r=o[i++])"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function _t(e,t,n,r){var i={},o=e===Wt;function a(s){var u;return i[s]=!0,w.each(e[s]||[],function(e,s){var l=s(t,n,r);return"string"!=typeof l||o||i[l]?o?!(u=l):void 0:(t.dataTypes.unshift(l),a(l),!1)}),u}return a(t.dataTypes[0])||!i["*"]&&a("*")}function zt(e,t){var n,r,i=w.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&w.extend(!0,e,r),e}function Xt(e,t,n){var r,i,o,a,s=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){u.unshift(i);break}if(u[0]in n)o=u[0];else{for(i in n){if(!u[0]||e.converters[i+" "+u[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==u[0]&&u.unshift(o),n[o]}function Ut(e,t,n,r){var i,o,a,s,u,l={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)l[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!u&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(a=l[u+" "+o]||l["* "+o]))for(i in l)if((s=i.split(" "))[1]===o&&(a=l[u+" "+s[0]]||l["* "+s[0]])){!0===a?a=l[i]:!0!==l[i]&&(o=s[0],c.unshift(s[1]));break}if(!0!==a)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+u+" to "+o}}}return{state:"success",data:t}}w.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ct.href,type:"GET",isLocal:Pt.test(Ct.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":$t,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":w.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?zt(zt(e,w.ajaxSettings),t):zt(w.ajaxSettings,e)},ajaxPrefilter:Ft(It),ajaxTransport:Ft(Wt),ajax:function(t,n){"object"==typeof t&&(n=t,t=void 0),n=n||{};var i,o,a,s,u,l,c,f,p,d,h=w.ajaxSetup({},n),g=h.context||h,y=h.context&&(g.nodeType||g.jquery)?w(g):w.event,v=w.Deferred(),m=w.Callbacks("once memory"),x=h.statusCode||{},b={},T={},C="canceled",E={readyState:0,getResponseHeader:function(e){var t;if(c){if(!s){s={};while(t=Ot.exec(a))s[t[1].toLowerCase()]=t[2]}t=s[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return c?a:null},setRequestHeader:function(e,t){return null==c&&(e=T[e.toLowerCase()]=T[e.toLowerCase()]||e,b[e]=t),this},overrideMimeType:function(e){return null==c&&(h.mimeType=e),this},statusCode:function(e){var t;if(e)if(c)E.always(e[E.status]);else for(t in e)x[t]=[x[t],e[t]];return this},abort:function(e){var t=e||C;return i&&i.abort(t),k(0,t),this}};if(v.promise(E),h.url=((t||h.url||Ct.href)+"").replace(Rt,Ct.protocol+"//"),h.type=n.method||n.type||h.method||h.type,h.dataTypes=(h.dataType||"*").toLowerCase().match(M)||[""],null==h.crossDomain){l=r.createElement("a");try{l.href=h.url,l.href=l.href,h.crossDomain=Bt.protocol+"//"+Bt.host!=l.protocol+"//"+l.host}catch(e){h.crossDomain=!0}}if(h.data&&h.processData&&"string"!=typeof h.data&&(h.data=w.param(h.data,h.traditional)),_t(It,h,n,E),c)return E;(f=w.event&&h.global)&&0==w.active++&&w.event.trigger("ajaxStart"),h.type=h.type.toUpperCase(),h.hasContent=!Mt.test(h.type),o=h.url.replace(Lt,""),h.hasContent?h.data&&h.processData&&0===(h.contentType||"").indexOf("application/x-www-form-urlencoded")&&(h.data=h.data.replace(qt,"+")):(d=h.url.slice(o.length),h.data&&(h.processData||"string"==typeof h.data)&&(o+=(kt.test(o)?"&":"?")+h.data,delete h.data),!1===h.cache&&(o=o.replace(Ht,"$1"),d=(kt.test(o)?"&":"?")+"_="+Et+++d),h.url=o+d),h.ifModified&&(w.lastModified[o]&&E.setRequestHeader("If-Modified-Since",w.lastModified[o]),w.etag[o]&&E.setRequestHeader("If-None-Match",w.etag[o])),(h.data&&h.hasContent&&!1!==h.contentType||n.contentType)&&E.setRequestHeader("Content-Type",h.contentType),E.setRequestHeader("Accept",h.dataTypes[0]&&h.accepts[h.dataTypes[0]]?h.accepts[h.dataTypes[0]]+("*"!==h.dataTypes[0]?", "+$t+"; q=0.01":""):h.accepts["*"]);for(p in h.headers)E.setRequestHeader(p,h.headers[p]);if(h.beforeSend&&(!1===h.beforeSend.call(g,E,h)||c))return E.abort();if(C="abort",m.add(h.complete),E.done(h.success),E.fail(h.error),i=_t(Wt,h,n,E)){if(E.readyState=1,f&&y.trigger("ajaxSend",[E,h]),c)return E;h.async&&h.timeout>0&&(u=e.setTimeout(function(){E.abort("timeout")},h.timeout));try{c=!1,i.send(b,k)}catch(e){if(c)throw e;k(-1,e)}}else k(-1,"No Transport");function k(t,n,r,s){var l,p,d,b,T,C=n;c||(c=!0,u&&e.clearTimeout(u),i=void 0,a=s||"",E.readyState=t>0?4:0,l=t>=200&&t<300||304===t,r&&(b=Xt(h,E,r)),b=Ut(h,b,E,l),l?(h.ifModified&&((T=E.getResponseHeader("Last-Modified"))&&(w.lastModified[o]=T),(T=E.getResponseHeader("etag"))&&(w.etag[o]=T)),204===t||"HEAD"===h.type?C="nocontent":304===t?C="notmodified":(C=b.state,p=b.data,l=!(d=b.error))):(d=C,!t&&C||(C="error",t<0&&(t=0))),E.status=t,E.statusText=(n||C)+"",l?v.resolveWith(g,[p,C,E]):v.rejectWith(g,[E,C,d]),E.statusCode(x),x=void 0,f&&y.trigger(l?"ajaxSuccess":"ajaxError",[E,h,l?p:d]),m.fireWith(g,[E,C]),f&&(y.trigger("ajaxComplete",[E,h]),--w.active||w.event.trigger("ajaxStop")))}return E},getJSON:function(e,t,n){return w.get(e,t,n,"json")},getScript:function(e,t){return w.get(e,void 0,t,"script")}}),w.each(["get","post"],function(e,t){w[t]=function(e,n,r,i){return g(n)&&(i=i||r,r=n,n=void 0),w.ajax(w.extend({url:e,type:t,dataType:i,data:n,success:r},w.isPlainObject(e)&&e))}}),w._evalUrl=function(e){return w.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},w.fn.extend({wrapAll:function(e){var t;return this[0]&&(g(e)&&(e=e.call(this[0])),t=w(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstElementChild)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return g(e)?this.each(function(t){w(this).wrapInner(e.call(this,t))}):this.each(function(){var t=w(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=g(e);return this.each(function(n){w(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){w(this).replaceWith(this.childNodes)}),this}}),w.expr.pseudos.hidden=function(e){return!w.expr.pseudos.visible(e)},w.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},w.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var Vt={0:200,1223:204},Gt=w.ajaxSettings.xhr();h.cors=!!Gt&&"withCredentials"in Gt,h.ajax=Gt=!!Gt,w.ajaxTransport(function(t){var n,r;if(h.cors||Gt&&!t.crossDomain)return{send:function(i,o){var a,s=t.xhr();if(s.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)s[a]=t.xhrFields[a];t.mimeType&&s.overrideMimeType&&s.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");for(a in i)s.setRequestHeader(a,i[a]);n=function(e){return function(){n&&(n=r=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(Vt[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=n(),r=s.onerror=s.ontimeout=n("error"),void 0!==s.onabort?s.onabort=r:s.onreadystatechange=function(){4===s.readyState&&e.setTimeout(function(){n&&r()})},n=n("abort");try{s.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}}),w.ajaxPrefilter(function(e){e.crossDomain&&(e.contents.script=!1)}),w.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return w.globalEval(e),e}}}),w.ajaxPrefilter("script",function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")}),w.ajaxTransport("script",function(e){if(e.crossDomain){var t,n;return{send:function(i,o){t=w("<script>").prop({charset:e.scriptCharset,src:e.url}).on("load error",n=function(e){t.remove(),n=null,e&&o("error"===e.type?404:200,e.type)}),r.head.appendChild(t[0])},abort:function(){n&&n()}}}});var Yt=[],Qt=/(=)\?(?=&|$)|\?\?/;w.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Yt.pop()||w.expando+"_"+Et++;return this[e]=!0,e}}),w.ajaxPrefilter("json jsonp",function(t,n,r){var i,o,a,s=!1!==t.jsonp&&(Qt.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Qt.test(t.data)&&"data");if(s||"jsonp"===t.dataTypes[0])return i=t.jsonpCallback=g(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,s?t[s]=t[s].replace(Qt,"$1"+i):!1!==t.jsonp&&(t.url+=(kt.test(t.url)?"&":"?")+t.jsonp+"="+i),t.converters["script json"]=function(){return a||w.error(i+" was not called"),a[0]},t.dataTypes[0]="json",o=e[i],e[i]=function(){a=arguments},r.always(function(){void 0===o?w(e).removeProp(i):e[i]=o,t[i]&&(t.jsonpCallback=n.jsonpCallback,Yt.push(i)),a&&g(o)&&o(a[0]),a=o=void 0}),"script"}),h.createHTMLDocument=function(){var e=r.implementation.createHTMLDocument("").body;return e.innerHTML="<form></form><form></form>",2===e.childNodes.length}(),w.parseHTML=function(e,t,n){if("string"!=typeof e)return[];"boolean"==typeof t&&(n=t,t=!1);var i,o,a;return t||(h.createHTMLDocument?((i=(t=r.implementation.createHTMLDocument("")).createElement("base")).href=r.location.href,t.head.appendChild(i)):t=r),o=A.exec(e),a=!n&&[],o?[t.createElement(o[1])]:(o=xe([e],t,a),a&&a.length&&w(a).remove(),w.merge([],o.childNodes))},w.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return s>-1&&(r=vt(e.slice(s)),e=e.slice(0,s)),g(t)?(n=t,t=void 0):t&&"object"==typeof t&&(i="POST"),a.length>0&&w.ajax({url:e,type:i||"GET",dataType:"html",data:t}).done(function(e){o=arguments,a.html(r?w("<div>").append(w.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},w.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){w.fn[t]=function(e){return this.on(t,e)}}),w.expr.pseudos.animated=function(e){return w.grep(w.timers,function(t){return e===t.elem}).length},w.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l,c=w.css(e,"position"),f=w(e),p={};"static"===c&&(e.style.position="relative"),s=f.offset(),o=w.css(e,"top"),u=w.css(e,"left"),(l=("absolute"===c||"fixed"===c)&&(o+u).indexOf("auto")>-1)?(a=(r=f.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),g(t)&&(t=t.call(e,n,w.extend({},s))),null!=t.top&&(p.top=t.top-s.top+a),null!=t.left&&(p.left=t.left-s.left+i),"using"in t?t.using.call(e,p):f.css(p)}},w.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){w.offset.setOffset(this,e,t)});var t,n,r=this[0];if(r)return r.getClientRects().length?(t=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:t.top+n.pageYOffset,left:t.left+n.pageXOffset}):{top:0,left:0}},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===w.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===w.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=w(e).offset()).top+=w.css(e,"borderTopWidth",!0),i.left+=w.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-w.css(r,"marginTop",!0),left:t.left-i.left-w.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===w.css(e,"position"))e=e.offsetParent;return e||be})}}),w.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n="pageYOffset"===t;w.fn[e]=function(r){return z(this,function(e,r,i){var o;if(y(e)?o=e:9===e.nodeType&&(o=e.defaultView),void 0===i)return o?o[t]:e[r];o?o.scrollTo(n?o.pageXOffset:i,n?i:o.pageYOffset):e[r]=i},e,r,arguments.length)}}),w.each(["top","left"],function(e,t){w.cssHooks[t]=_e(h.pixelPosition,function(e,n){if(n)return n=Fe(e,t),We.test(n)?w(e).position()[t]+"px":n})}),w.each({Height:"height",Width:"width"},function(e,t){w.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){w.fn[r]=function(i,o){var a=arguments.length&&(n||"boolean"!=typeof i),s=n||(!0===i||!0===o?"margin":"border");return z(this,function(t,n,i){var o;return y(t)?0===r.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(o=t.documentElement,Math.max(t.body["scroll"+e],o["scroll"+e],t.body["offset"+e],o["offset"+e],o["client"+e])):void 0===i?w.css(t,n,s):w.style(t,n,i,s)},t,a?i:void 0,a)}})}),w.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,t){w.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),w.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),w.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}}),w.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),g(e))return r=o.call(arguments,2),i=function(){return e.apply(t||this,r.concat(o.call(arguments)))},i.guid=e.guid=e.guid||w.guid++,i},w.holdReady=function(e){e?w.readyWait++:w.ready(!0)},w.isArray=Array.isArray,w.parseJSON=JSON.parse,w.nodeName=N,w.isFunction=g,w.isWindow=y,w.camelCase=G,w.type=x,w.now=Date.now,w.isNumeric=function(e){var t=w.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},"function"==typeof define&&define.amd&&define("jquery",[],function(){return w});var Jt=e.jQuery,Kt=e.$;return w.noConflict=function(t){return e.$===w&&(e.$=Kt),t&&e.jQuery===w&&(e.jQuery=Jt),w},t||(e.jQuery=e.$=w),w});
vendor: 5,111 bytes, lines 4-10
4
5/*! jQuery UI - v1.12.1 - 2018-04-24
6* http://jqueryui.com
7* Includes: widget.js, position.js, data.js, disable-selection.js, focusable.js, form-reset-mixin.js, jquery-1-7.js, keycode.js, labels.js, scroll-parent.js, tabbable.js, unique-id.js, widgets/datepicker.js
8* Copyright jQuery Foundation and other contributors; Licensed MIT */
9
10(function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)})(function(t){function e(t){for(var e=t.css("visibility");"inherit"===e;)t=t.parent(),e=t.css("visibility");return"hidden"!==e}function i(t){for(var e,i;t.length&&t[0]!==document;){if(e=t.css("position"),("absolute"===e||"relative"===e||"fixed"===e)&&(i=parseInt(t.css("zIndex"),10),!isNaN(i)&&0!==i))return i;t=t.parent()}return 0}function s(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},t.extend(this._defaults,this.regional[""]),this.regional.en=t.extend(!0,{},this.regional[""]),this.regional["en-US"]=t.extend(!0,{},this.regional.en),this.dpDiv=n(t("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function n(e){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return e.on("mouseout",i,function(){t(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).removeClass("ui-datepicker-next-hover")}).on("mouseover",i,o)}function o(){t.datepicker._isDisabledDatepicker(h.inline?h.dpDiv.parent()[0]:h.input[0])||(t(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),t(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).addClass("ui-datepicker-next-hover"))}function a(e,i){t.extend(e,i);for(var s in i)null==i[s]&&(e[s]=i[s]);return e}t.ui=t.ui||{},t.ui.version="1.12.1";var r=0,l=Array.prototype.slice;t.cleanData=function(e){return function(i){var s,n,o;for(o=0;null!=(n=i[o]);o++)try{s=t._data(n,"events"),s&&s.remove&&t(n).triggerHandler("remove")}catch(a){}e(i)}}(t.cleanData),t.widget=function(e,i,s){var n,o,a,r={},l=e.split(".")[0];e=e.split(".")[1];var h=l+"-"+e;return s||(s=i,i=t.Widget),t.isArray(s)&&(s=t.extend.apply(null,[{}].concat(s))),t.expr[":"][h.toLowerCase()]=function(e){return!!t.data(e,h)},t[l]=t[l]||{},n=t[l][e],o=t[l][e]=function(t,e){return this._createWidget?(arguments.length&&this._createWidget(t,e),void 0):new o(t,e)},t.extend(o,n,{version:s.version,_proto:t.extend({},s),_childConstructors:[]}),a=new i,a.options=t.widget.extend({},a.options),t.each(s,function(e,s){return t.isFunction(s)?(r[e]=function(){function t(){return i.prototype[e].apply(this,arguments)}function n(t){return i.prototype[e].apply(this,t)}return function(){var e,i=this._super,o=this._superApply;return this._super=t,this._superApply=n,e=s.apply(this,arguments),this._super=i,this._superApply=o,e}}(),void 0):(r[e]=s,void 0)}),o.prototype=t.widget.extend(a,{widgetEventPrefix:n?a.widgetEventPrefix||e:e},r,{constructor:o,namespace:l,widgetName:e,widgetFullName:h}),n?(t.each(n._childConstructors,function(e,i){var s=i.prototype;t.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete n._childConstructors):i._childConstructors.push(o),t.widget.bridge(e,o),o}
vendor: 4,241 bytes, line 10
10,t.widget.extend=function(e){for(var i,s,n=l.call(arguments,1),o=0,a=n.length;a>o;o++)for(i in n[o])s=n[o][i],n[o].hasOwnProperty(i)&&void 0!==s&&(e[i]=t.isPlainObject(s)?t.isPlainObject(e[i])?t.widget.extend({},e[i],s):t.widget.extend({},s):s);return e},t.widget.bridge=function(e,i){var s=i.prototype.widgetFullName||e;t.fn[e]=function(n){var o="string"==typeof n,a=l.call(arguments,1),r=this;return o?this.length||"instance"!==n?this.each(function(){var i,o=t.data(this,s);return"instance"===n?(r=o,!1):o?t.isFunction(o[n])&&"_"!==n.charAt(0)?(i=o[n].apply(o,a),i!==o&&void 0!==i?(r=i&&i.jquery?r.pushStack(i.get()):i,!1):void 0):t.error("no such method '"+n+"' for "+e+" widget instance"):t.error("cannot call methods on "+e+" prior to initialization; "+"attempted to call method '"+n+"'")}):r=void 0:(a.length&&(n=t.widget.extend.apply(null,[n].concat(a))),this.each(function(){var e=t.data(this,s);e?(e.option(n||{}),e._init&&e._init()):t.data(this,s,new i(n,this))})),r}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(e,i){i=t(i||this.defaultElement||this)[0],this.element=t(i),this.uuid=r++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=t(),this.hoverable=t(),this.focusable=t(),this.classesElementLookup={},i!==this&&(t.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===i&&this.destroy()}}),this.document=t(i.style?i.ownerDocument:i.document||i),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){var e=this;this._destroy(),t.each(this.classesElementLookup,function(t,i){e._removeClass(i,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:t.noop,widget:function(){return this.element},option:function(e,i){var s,n,o,a=e;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof e)if(a={},s=e.split("."),e=s.shift(),s.length){for(n=a[e]=t.widget.extend({},this.options[e]),o=0;s.length-1>o;o++)n[s[o]]=n[s[o]]||{},n=n[s[o]];if(e=s.pop(),1===arguments.length)return void 0===n[e]?null:n[e];n[e]=i}else{if(1===arguments.length)return void 0===this.options[e]?null:this.options[e];a[e]=i}return this._setOptions(a),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(e){var i,s,n;for(i in e)n=this.classesElementLookup[i],e[i]!==this.options.classes[i]&&n&&n.length&&(s=t(n.get()),this._removeClass(n,i),s.addClass(this._classes({element:s,keys:i,classes:e,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(e){function i(i,o){var a,r;for(r=0;i.length>r;r++)a=n.classesElementLookup[i[r]]||t(),a=e.add?t(t.unique(a.get().concat(e.element.get()))):t(a.not(e.element).get()),n.classesElementLookup[i[r]]=a,s.push(i[r]),o&&e.classes[i[r]]&&s.push(e.classes[i[r]])}var s=[],n=this;return e=t.extend({element:this.element,classes:this.options.classes||{}},e),this._on(e.element,{remove:"_untrackClassesElement"}),e.keys&&i(e.keys.match(/\S+/g)||[],!0),e.extra&&i(e.extra.match(/\S+/g)||[]),s.join(" ")},_untrackClassesElement:function(e){var i=this;t.each(i.classesElementLookup,function(s,n){-1!==t.inArray(e.target,n)&&(i.classesElementLookup[s]=t(n.not(e.target).get()))})}
vendor: 6,709 bytes, line 10
10,_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,s){s="boolean"==typeof s?s:i;var n="string"==typeof t||null===t,o={extra:n?e:i,keys:n?t:e,element:n?this.element:t,add:s};return o.element.toggleClass(this._classes(o),s),this},_on:function(e,i,s){var n,o=this;"boolean"!=typeof e&&(s=i,i=e,e=!1),s?(i=n=t(i),this.bindings=this.bindings.add(i)):(s=i,i=this.element,n=this.widget()),t.each(s,function(s,a){function r(){return e||o.options.disabled!==!0&&!t(this).hasClass("ui-state-disabled")?("string"==typeof a?o[a]:a).apply(o,arguments):void 0}"string"!=typeof a&&(r.guid=a.guid=a.guid||r.guid||t.guid++);var l=s.match(/^([\w:-]*)\s*(.*)$/),h=l[1]+o.eventNamespace,c=l[2];c?n.on(h,c,r):i.on(h,r)})},_off:function(e,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.off(i).off(i),this.bindings=t(this.bindings.not(e).get()),this.focusable=t(this.focusable.not(e).get()),this.hoverable=t(this.hoverable.not(e).get())},_delay:function(t,e){function i(){return("string"==typeof t?s[t]:t).apply(s,arguments)}var s=this;return setTimeout(i,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){this._addClass(t(e.currentTarget),null,"ui-state-hover")},mouseleave:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){this._addClass(t(e.currentTarget),null,"ui-state-focus")},focusout:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-focus")}})},_trigger:function(e,i,s){var n,o,a=this.options[e];if(s=s||{},i=t.Event(i),i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(n in o)n in i||(i[n]=o[n]);return this.element.trigger(i,s),!(t.isFunction(a)&&a.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(s,n,o){"string"==typeof n&&(n={effect:n});var a,r=n?n===!0||"number"==typeof n?i:n.effect||i:e;n=n||{},"number"==typeof n&&(n={duration:n}),a=!t.isEmptyObject(n),n.complete=o,n.delay&&s.delay(n.delay),a&&t.effects&&t.effects.effect[r]?s[e](n):r!==e&&s[r]?s[r](n.duration,n.easing,o):s.queue(function(i){t(this)[e](),o&&o.call(s[0]),i()})}}),t.widget,function(){function e(t,e,i){return[parseFloat(t[0])*(u.test(t[0])?e/100:1),parseFloat(t[1])*(u.test(t[1])?i/100:1)]}function i(e,i){return parseInt(t.css(e,i),10)||0}function s(e){var i=e[0];return 9===i.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(i)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}var n,o=Math.max,a=Math.abs,r=/left|center|right/,l=/top|center|bottom/,h=/[\+\-]\d+(\.[\d]+)?%?/,c=/^\w+/,u=/%$/,d=t.fn.position;t.position={scrollbarWidth:function(){if(void 0!==n)return n;var e,i,s=t("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),o=s.children()[0];return t("body").append(s),e=o.offsetWidth,s.css("overflow","scroll"),i=o.offsetWidth,e===i&&(i=s[0].clientWidth),s.remove(),n=e-i},getScrollInfo:function(e){var i=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),s=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),n="scroll"===i||"auto"===i&&e.width<e.element[0].scrollWidth,o="scroll"===s||"auto"===s&&e.height<e.element[0].scrollHeight;return{width:o?t.position.scrollbarWidth():0,height:n?t.position.scrollbarWidth():0}},getWithinInfo:function(e){var i=t(e||window),s=t.isWindow(i[0]),n=!!i[0]&&9===i[0].nodeType,o=!s&&!n;return{element:i,isWindow:s,isDocument:n,offset:o?t(e).offset():{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:i.outerWidth(),height:i.outerHeight()}}},t.fn.position=function(n){if(!n||!n.of)return d.apply(this,arguments);n=t.extend({},n);var u,p,f,g,m,_,v=t(n.of),b=t.position.getWithinInfo(n.within),y=t.position.getScrollInfo(b),w=(n.collision||"flip").split(" "),k={};return _=s(v),v[0].preventDefault&&(n.at="left top"),p=_.width,f=_.height,g=_.offset,m=t.extend({},g),t.each(["my","at"],function(){var t,e,i=(n[this]||"").split(" ");1===i.length&&(i=r.test(i[0])?i.concat(["center"]):l.test(i[0])?["center"].concat(i):["center","center"]),i[0]=r.test(i[0])?i[0]:"center",i[1]=l.test(i[1])?i[1]:"center",t=h.exec(i[0]),e=h.exec(i[1]),k[this]=[t?t[0]:0,e?e[0]:0],n[this]=[c.exec(i[0])[0],c.exec(i[1])[0]]}),1===w.length&&(w[1]=w[0]),"right"===n.at[0]?m.left+=p:"center"===n.at[0]&&(m.left+=p/2),"bottom"===n.at[1]?m.top+=f:"center"===n.at[1]&&(m.top+=f/2),u=e(k.at,p,f),m.left+=u[0],m.top+=u[1],this.each(function(){var s,r,l=t(this),h=l.outerWidth(),c=l.outerHeight(),d=i(this,"marginLeft"),_=i(this,"marginTop"),x=h+d+i(this,"marginRight")+y.width,C=c+_+i(this,"marginBottom")+y.height,D=t.extend({},m),T=e(k.my,l.outerWidth(),l.outerHeight());"right"===n.my[0]?D.left-=h:"center"===n.my[0]&&(D.left-=h/2),"bottom"===n.my[1]?D.top-=c:"center"===n.my[1]&&(D.top-=c/2),D.left+=T[0],D.top+=T[1],s={marginLeft:d,marginTop:_},t.each(["left","top"],function(e,i){t.ui.position[w[e]]&&t.ui.position[w[e]][i](D,{targetWidth:p,targetHeight:f,elemWidth:h,elemHeight:c,collisionPosition:s,collisionWidth:x,collisionHeight:C,offset:[u[0]+T[0],u[1]+T[1]],my:n.my,at:n.at,within:b,elem:l})}),n.using&&(r=function(t){var e=g.left-D.left,i=e+p-h,s=g.top-D.top,r=s+f-c,u={target:{element:v,left:g.left,top:g.top,width:p,height:f},element:{element:l,left:D.left,top:D.top,width:h,height:c},horizontal:0>i?"left":e>0?"right":"center",vertical:0>r?"top":s>0?"bottom":"middle"};h>p&&p>a(e+i)&&(u.horizontal="center"),c>f&&f>a(s+r)&&(u.vertical="middle"),u.important=o(a(e),a(i))>o(a(s),a(r))?"horizontal":"vertical",n.using.call(this,t,u)}),l.offset(t.extend(D,{using:r}))})},t.ui.position={fit:{left:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollLeft:s.offset.left,a=s.width,r=t.left-e.collisionPosition.marginLeft,l=n-r,h=r+e.collisionWidth-a-n;e.collisionWidth>a?l>0&&0>=h?(i=t.left+l+e.collisionWidth-a-n,t.left+=l-i):t.left=h>0&&0>=l?n:l>h?n+a-e.collisionWidth:n:l>0?t.left+=l:h>0?t.left-=h:t.left=o(t.left-r,t.left)},top:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollTop:s.offset.top,a=e.within.height,r=t.top-e.collisionPosition.marginTop,l=n-r,h=r+e.collisionHeight-a-n;e.collisionHeight>a?l>0&&0>=h?(i=t.top+l+e.collisionHeight-a-n,t.top+=l-i):t.top=h>0&&0>=l?n:l>h?n+a-e.collisionHeight:n:l>
vendor: 4,336 bytes, line 10
100?t.top+=l:h>0?t.top-=h:t.top=o(t.top-r,t.top)}},flip:{left:function(t,e){var i,s,n=e.within,o=n.offset.left+n.scrollLeft,r=n.width,l=n.isWindow?n.scrollLeft:n.offset.left,h=t.left-e.collisionPosition.marginLeft,c=h-l,u=h+e.collisionWidth-r-l,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,p="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,f=-2*e.offset[0];0>c?(i=t.left+d+p+f+e.collisionWidth-r-o,(0>i||a(c)>i)&&(t.left+=d+p+f)):u>0&&(s=t.left-e.collisionPosition.marginLeft+d+p+f-l,(s>0||u>a(s))&&(t.left+=d+p+f))},top:function(t,e){var i,s,n=e.within,o=n.offset.top+n.scrollTop,r=n.height,l=n.isWindow?n.scrollTop:n.offset.top,h=t.top-e.collisionPosition.marginTop,c=h-l,u=h+e.collisionHeight-r-l,d="top"===e.my[1],p=d?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,f="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,g=-2*e.offset[1];0>c?(s=t.top+p+f+g+e.collisionHeight-r-o,(0>s||a(c)>s)&&(t.top+=p+f+g)):u>0&&(i=t.top-e.collisionPosition.marginTop+p+f+g-l,(i>0||u>a(i))&&(t.top+=p+f+g))}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}}}(),t.ui.position,t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo(function(e){return function(i){return!!t.data(i,e)}}):function(e,i,s){return!!t.data(e,s[3])}}),t.fn.extend({disableSelection:function(){var t="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.on(t+".ui-disableSelection",function(t){t.preventDefault()})}}(),enableSelection:function(){return this.off(".ui-disableSelection")}}),t.ui.focusable=function(i,s){var n,o,a,r,l,h=i.nodeName.toLowerCase();return"area"===h?(n=i.parentNode,o=n.name,i.href&&o&&"map"===n.nodeName.toLowerCase()?(a=t("img[usemap='#"+o+"']"),a.length>0&&a.is(":visible")):!1):(/^(input|select|textarea|button|object)$/.test(h)?(r=!i.disabled,r&&(l=t(i).closest("fieldset")[0],l&&(r=!l.disabled))):r="a"===h?i.href||s:s,r&&t(i).is(":visible")&&e(t(i)))},t.extend(t.expr[":"],{focusable:function(e){return t.ui.focusable(e,null!=t.attr(e,"tabindex"))}}),t.ui.focusable,t.fn.form=function(){return"string"==typeof this[0].form?this.closest("form"):t(this[0].form)},t.ui.formResetMixin={_formResetHandler:function(){var e=t(this);setTimeout(function(){var i=e.data("ui-form-reset-instances");t.each(i,function(){this.refresh()})})},_bindFormResetHandler:function(){if(this.form=this.element.form(),this.form.length){var t=this.form.data("ui-form-reset-instances")||[];t.length||this.form.on("reset.ui-form-reset",this._formResetHandler),t.push(this),this.form.data("ui-form-reset-instances",t)}},_unbindFormResetHandler:function(){if(this.form.length){var e=this.form.data("ui-form-reset-instances");e.splice(t.inArray(this,e),1),e.length?this.form.data("ui-form-reset-instances",e):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset")}}},"1.7"===t.fn.jquery.substring(0,3)&&(t.each(["Width","Height"],function(e,i){function s(e,i,s,o){return t.each(n,function(){i-=parseFloat(t.css(e,"padding"+this))||0,s&&(i-=parseFloat(t.css(e,"border"+this+"Width"))||0),o&&(i-=parseFloat(t.css(e,"margin"+this))||0)}),i}var n="Width"===i?["Left","Right"]:["Top","Bottom"],o=i.toLowerCase(),a={innerWidth:t.fn.innerWidth,innerHeight:t.fn.innerHeight,outerWidth:t.fn.outerWidth,outerHeight:t.fn.outerHeight};t.fn["inner"+i]=function(e){return void 0===e?a["inner"+i].call(this):this.each(function(){t(this).css(o,s(this,e)+"px")})},t.fn["outer"+i]=function(e,n){return"number"!=typeof e?a["outer"+i].call(this,e):this.each(function(){t(this).css(o,s(this,e,!0,n)+"px")})}}),t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.ui.keyCode={BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38},t.ui.escapeSelector=function(){var t=/([!"#$%&'()*+,./:;<=>?@[\]^`{|}~])/g;return function(e){return e.replace(t,"\\$1")}}(),t.fn.labels=function(){var e,i,s,n,o;return this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(n=this.eq(0).parents("label"),s=this.attr("id"),s&&(e=this.eq(0).parents().last(
vendor: 7,583 bytes, line 10
10),o=e.add(e.length?e.siblings():this.siblings()),i="label[for='"+t.ui.escapeSelector(s)+"']",n=n.add(o.find(i).addBack(i))),this.pushStack(n))},t.fn.scrollParent=function(e){var i=this.css("position"),s="absolute"===i,n=e?/(auto|scroll|hidden)/:/(auto|scroll)/,o=this.parents().filter(function(){var e=t(this);return s&&"static"===e.css("position")?!1:n.test(e.css("overflow")+e.css("overflow-y")+e.css("overflow-x"))}).eq(0);return"fixed"!==i&&o.length?o:t(this[0].ownerDocument||document)},t.extend(t.expr[":"],{tabbable:function(e){var i=t.attr(e,"tabindex"),s=null!=i;return(!s||i>=0)&&t.ui.focusable(e,s)}}),t.fn.extend({uniqueId:function(){var t=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++t)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&t(this).removeAttr("id")})}}),t.extend(t.ui,{datepicker:{version:"1.12.1"}});var h;t.extend(s.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(t){return a(this._defaults,t||{}),this},_attachDatepicker:function(e,i){var s,n,o;s=e.nodeName.toLowerCase(),n="div"===s||"span"===s,e.id||(this.uuid+=1,e.id="dp"+this.uuid),o=this._newInst(t(e),n),o.settings=t.extend({},i||{}),"input"===s?this._connectDatepicker(e,o):n&&this._inlineDatepicker(e,o)},_newInst:function(e,i){var s=e[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1");return{id:s,input:e,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?n(t("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(e,i){var s=t(e);i.append=t([]),i.trigger=t([]),s.hasClass(this.markerClassName)||(this._attachments(s,i),s.addClass(this.markerClassName).on("keydown",this._doKeyDown).on("keypress",this._doKeyPress).on("keyup",this._doKeyUp),this._autoSize(i),t.data(e,"datepicker",i),i.settings.disabled&&this._disableDatepicker(e))},_attachments:function(e,i){var s,n,o,a=this._get(i,"appendText"),r=this._get(i,"isRTL");i.append&&i.append.remove(),a&&(i.append=t("<span class='"+this._appendClass+"'>"+a+"</span>"),e[r?"before":"after"](i.append)),e.off("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),s=this._get(i,"showOn"),("focus"===s||"both"===s)&&e.on("focus",this._showDatepicker),("button"===s||"both"===s)&&(n=this._get(i,"buttonText"),o=this._get(i,"buttonImage"),i.trigger=t(this._get(i,"buttonImageOnly")?t("<img/>").addClass(this._triggerClass).attr({src:o,alt:n,title:n}):t("<button type='button'></button>").addClass(this._triggerClass).html(o?t("<img/>").attr({src:o,alt:n,title:n}):n)),e[r?"before":"after"](i.trigger),i.trigger.on("click",function(){return t.datepicker._datepickerShowing&&t.datepicker._lastInput===e[0]?t.datepicker._hideDatepicker():t.datepicker._datepickerShowing&&t.datepicker._lastInput!==e[0]?(t.datepicker._hideDatepicker(),t.datepicker._showDatepicker(e[0])):t.datepicker._showDatepicker(e[0]),!1}))},_autoSize:function(t){if(this._get(t,"autoSize")&&!t.inline){var e,i,s,n,o=new Date(2009,11,20),a=this._get(t,"dateFormat");a.match(/[DM]/)&&(e=function(t){for(i=0,s=0,n=0;t.length>n;n++)t[n].length>i&&(i=t[n].length,s=n);return s},o.setMonth(e(this._get(t,a.match(/MM/)?"monthNames":"monthNamesShort"))),o.setDate(e(this._get(t,a.match(/DD/)?"dayNames":"dayNamesShort"))+20-o.getDay())),t.input.attr("size",this._formatDate(t,o).length)}},_inlineDatepicker:function(e,i){var s=t(e);s.hasClass(this.markerClassName)||(s.addClass(this.markerClassName).append(i.dpDiv),t.data(e,"datepicker",i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(e),i.dpDiv.css("display","block"))},_dialogDatepicker:function(e,i,s,n,o){var r,l,h,c,u,d=this._dialogInst;return d||(this.uuid+=1,r="dp"+this.uuid,this._dialogInput=t("<input type='text' id='"+r+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.on("keydown",this._doKeyDown),t("body").append(this._dialogInput),d=this._dialogInst=this._newInst(this._dialogInput,!1),d.settings={},t.data(this._dialogInput[0],"datepicker",d)),a(d.settings,n||{}),i=i&&i.constructor===Date?this._formatDate(d,i):i,this._dialogInput.val(i),this._pos=o?o.length?o:[o.pageX,o.pageY]:null,this._pos||(l=document.documentElement.clientWidth,h=document.documentElement.clientHeight,c=document.documentElement.scrollLeft||document.body.scrollLeft,u=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[l/2-100+c,h/2-150+u]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),d.settings.onSelect=s,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),t.blockUI&&t.blockUI(this.dpDiv),t.data(this._dialogInput[0],"datepicker",d),this},_destroyDatepicker:function(e){var i,s=t(e),n=t.data(e,"datepicker");s.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),t.removeData(e,"datepicker"),"input"===i?(n.append.remove(),n.trigger.remove(),s.removeClass(this.markerClassName).off("focus",this._showDatepicker).off("keydown",this._doKeyDown).off("keypress",this._doKeyPress).off("keyup",this._doKeyUp)):("div"===i||"span"===i)&&s.removeClass(this.markerClassName).empty(),h===n&&(h=null))},_enableDatepicker:function(e){var i,s,n=t(e),o=t.data(e,"datepicker");n.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),"input"===i?(e.disabled=!1,o.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().removeClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=t.map(this._disabledInputs,function(t){return t===e?null:t}))},_disableDatepicker:function(e){var i,s,n=t(e),o=t.data(e,"datepicker");n.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),"input"===i?(e.disabled=!0,o.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):("div"===i||"span"===i)&&(s=n.children("."+this._inlineClass),s.children().addClass("ui-state-disabled"),s.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=t.map(this._disabledInputs,function(t){return t===e?null:t}),this._disabledInputs[this._disabledInputs.length]=e)},_isDisabledDatepicker:function(t){if(!t)return!1;for(var e=0;this._disabledInputs.length>e;e++)if(this._disabledInputs[e]===t)return!0;return!1},_getInst:function(e){try{return t.data(e,"datepicker")}catch(i){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(e,i,s){var n,o,r,l,h=this._getInst(e);return 2===arguments.length&&"string"==typeof i?"defaults"===i?t.extend({},t.datepicker._defaults):h?"all"===i?t.extend({},h.settings):this._get(h,i):null:(n=i||{},"string"==typeof i&&(n={},n[i]=s),h&&(this._curInst===h&&this._hideDatepicker(),o=this._getDateDatepicker(e,!0),r=this._getMinMaxDate(h,"min"),l=this._getMinMaxDate(h,"max"),a(h.settings,n),null!==r&&void 0!==n.dateFormat&&void 0===n.minDate&&(h.settings.minDate=this._formatDate(h,r)),null!==l&&void 0!==n.dateFormat&&void 0===n.maxDate&&(h.settings.maxDate=this._formatDate(h,l)),"disabled"in n&&(n.disabled?this._disableDatepicker(e):this._enableDatepicker(e)),this._attachments(t(e),h),this._autoSize(h),this._setDate(h,o),this._updateAlternate(h),this._updateDatepicker(h)),void 0)}
vendor: 4,566 bytes, lines 10-11
10,_changeDatepicker:function(t,e,i){this._optionDatepicker(t,e,i)},_refreshDatepicker:function(t){var e=this._getInst(t);e&&this._updateDatepicker(e)},_setDateDatepicker:function(t,e){var i=this._getInst(t);i&&(this._setDate(i,e),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(t,e){var i=this._getInst(t);return i&&!i.inline&&this._setDateFromField(i,e),i?this._getDate(i):null},_doKeyDown:function(e){var i,s,n,o=t.datepicker._getInst(e.target),a=!0,r=o.dpDiv.is(".ui-datepicker-rtl");if(o._keyEvent=!0,t.datepicker._datepickerShowing)switch(e.keyCode){case 9:t.datepicker._hideDatepicker(),a=!1;break;case 13:return n=t("td."+t.datepicker._dayOverClass+":not(."+t.datepicker._currentClass+")",o.dpDiv),n[0]&&t.datepicker._selectDay(e.target,o.selectedMonth,o.selectedYear,n[0]),i=t.datepicker._get(o,"onSelect"),i?(s=t.datepicker._formatDate(o),i.apply(o.input?o.input[0]:null,[s,o])):t.datepicker._hideDatepicker(),!1;case 27:t.datepicker._hideDatepicker();break;case 33:t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(o,"stepBigMonths"):-t.datepicker._get(o,"stepMonths"),"M");break;case 34:t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(o,"stepBigMonths"):+t.datepicker._get(o,"stepMonths"),"M");break;case 35:(e.ctrlKey||e.metaKey)&&t.datepicker._clearDate(e.target),a=e.ctrlKey||e.metaKey;break;case 36:(e.ctrlKey||e.metaKey)&&t.datepicker._gotoToday(e.target),a=e.ctrlKey||e.metaKey;break;case 37:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,r?1:-1,"D"),a=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(o,"stepBigMonths"):-t.datepicker._get(o,"stepMonths"),"M");break;case 38:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,-7,"D"),a=e.ctrlKey||e.metaKey;break;case 39:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,r?-1:1,"D"),a=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(o,"stepBigMonths"):+t.datepicker._get(o,"stepMonths"),"M");break;case 40:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,7,"D"),a=e.ctrlKey||e.metaKey;break;default:a=!1}else 36===e.keyCode&&e.ctrlKey?t.datepicker._showDatepicker(this):a=!1;a&&(e.preventDefault(),e.stopPropagation())},_doKeyPress:function(e){var i,s,n=t.datepicker._getInst(e.target);return t.datepicker._get(n,"constrainInput")?(i=t.datepicker._possibleChars(t.datepicker._get(n,"dateFormat")),s=String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),e.ctrlKey||e.metaKey||" ">s||!i||i.indexOf(s)>-1):void 0},_doKeyUp:function(e){var i,s=t.datepicker._getInst(e.target);if(s.input.val()!==s.lastVal)try{i=t.datepicker.parseDate(t.datepicker._get(s,"dateFormat"),s.input?s.input.val():null,t.datepicker._getFormatConfig(s)),i&&(t.datepicker._setDateFromField(s),t.datepicker._updateAlternate(s),t.datepicker._updateDatepicker(s))}catch(n){}return!0},_showDatepicker:function(e){if(e=e.target||e,"input"!==e.nodeName.toLowerCase()&&(e=t("input",e.parentNode)[0]),!t.datepicker._isDisabledDatepicker(e)&&t.datepicker._lastInput!==e){var s,n,o,r,l,h,c;s=t.datepicker._getInst(e),t.datepicker._curInst&&t.datepicker._curInst!==s&&(t.datepicker._curInst.dpDiv.stop(!0,!0),s&&t.datepicker._datepickerShowing&&t.datepicker._hideDatepicker(t.datepicker._curInst.input[0])),n=t.datepicker._get(s,"beforeShow"),o=n?n.apply(e,[e,s]):{},o!==!1&&(a(s.settings,o),s.lastVal=null,t.datepicker._lastInput=e,t.datepicker._setDateFromField(s),t.datepicker._inDialog&&(e.value=""),t.datepicker._pos||(t.datepicker._pos=t.datepicker._findPos(e),t.datepicker._pos[1]+=e.offsetHeight),r=!1,t(e).parents().each(function(){return r|="fixed"===t(this).css("position"),!r}),l={left:t.datepicker._pos[0],top:t.datepicker._pos[1]},t.datepicker._pos=null,s.dpDiv.empty(),s.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),t.datepicker._updateDatepicker(s),l=t.datepicker._checkOffset(s,l,r),s.dpDiv.css({position:t.datepicker._inDialog&&t.blockUI?"static":r?"fixed":"absolute",display:"none",left:l.left+"px",top:l.top+"px"}),s.inline||(h=t.datepicker._get(s,"showAnim"),c=t.datepicker._get(s,"duration"),s.dpDiv.css("z-index",i(t(e))+1),t.datepicker._datepickerShowing=!0,t.effects&&t.effects.effect[h]?s.dpDiv.show(h,t.datepicker._get(s,"showOptions"),c):s.dpDiv[h||"show"](h?c:null),t.datepicker._shouldFocusInput(s)&&s.input.trigger("focus"),t.datepicker._curInst=s))
11}},_updateDatepicker:function(e){this.maxRows=4,h=e,e.dpDiv.empty().append(this._generateHTML(e)),this._attachHandlers(e);
vendor: 10,556 bytes, line 11
11var i,s=this._getNumberOfMonths(e),n=s[1],a=17,r=e.dpDiv.find("."+this._dayOverClass+" a");r.length>0&&o.apply(r.get(0)),e.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),n>1&&e.dpDiv.addClass("ui-datepicker-multi-"+n).css("width",a*n+"em"),e.dpDiv[(1!==s[0]||1!==s[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),e.dpDiv[(this._get(e,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),e===t.datepicker._curInst&&t.datepicker._datepickerShowing&&t.datepicker._shouldFocusInput(e)&&e.input.trigger("focus"),e.yearshtml&&(i=e.yearshtml,setTimeout(function(){i===e.yearshtml&&e.yearshtml&&e.dpDiv.find("select.ui-datepicker-year:first").replaceWith(e.yearshtml),i=e.yearshtml=null},0))},_shouldFocusInput:function(t){return t.input&&t.input.is(":visible")&&!t.input.is(":disabled")&&!t.input.is(":focus")},_checkOffset:function(e,i,s){var n=e.dpDiv.outerWidth(),o=e.dpDiv.outerHeight(),a=e.input?e.input.outerWidth():0,r=e.input?e.input.outerHeight():0,l=document.documentElement.clientWidth+(s?0:t(document).scrollLeft()),h=document.documentElement.clientHeight+(s?0:t(document).scrollTop());return i.left-=this._get(e,"isRTL")?n-a:0,i.left-=s&&i.left===e.input.offset().left?t(document).scrollLeft():0,i.top-=s&&i.top===e.input.offset().top+r?t(document).scrollTop():0,i.left-=Math.min(i.left,i.left+n>l&&l>n?Math.abs(i.left+n-l):0),i.top-=Math.min(i.top,i.top+o>h&&h>o?Math.abs(o+r):0),i},_findPos:function(e){for(var i,s=this._getInst(e),n=this._get(s,"isRTL");e&&("hidden"===e.type||1!==e.nodeType||t.expr.filters.hidden(e));)e=e[n?"previousSibling":"nextSibling"];return i=t(e).offset(),[i.left,i.top]},_hideDatepicker:function(e){var i,s,n,o,a=this._curInst;!a||e&&a!==t.data(e,"datepicker")||this._datepickerShowing&&(i=this._get(a,"showAnim"),s=this._get(a,"duration"),n=function(){t.datepicker._tidyDialog(a)},t.effects&&(t.effects.effect[i]||t.effects[i])?a.dpDiv.hide(i,t.datepicker._get(a,"showOptions"),s,n):a.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?s:null,n),i||n(),this._datepickerShowing=!1,o=this._get(a,"onClose"),o&&o.apply(a.input?a.input[0]:null,[a.input?a.input.val():"",a]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),t.blockUI&&(t.unblockUI(),t("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(t){t.dpDiv.removeClass(this._dialogClass).off(".ui-datepicker-calendar")},_checkExternalClick:function(e){if(t.datepicker._curInst){var i=t(e.target),s=t.datepicker._getInst(i[0]);(i[0].id!==t.datepicker._mainDivId&&0===i.parents("#"+t.datepicker._mainDivId).length&&!i.hasClass(t.datepicker.markerClassName)&&!i.closest("."+t.datepicker._triggerClass).length&&t.datepicker._datepickerShowing&&(!t.datepicker._inDialog||!t.blockUI)||i.hasClass(t.datepicker.markerClassName)&&t.datepicker._curInst!==s)&&t.datepicker._hideDatepicker()}},_adjustDate:function(e,i,s){var n=t(e),o=this._getInst(n[0]);this._isDisabledDatepicker(n[0])||(this._adjustInstDate(o,i+("M"===s?this._get(o,"showCurrentAtPos"):0),s),this._updateDatepicker(o))},_gotoToday:function(e){var i,s=t(e),n=this._getInst(s[0]);this._get(n,"gotoCurrent")&&n.currentDay?(n.selectedDay=n.currentDay,n.drawMonth=n.selectedMonth=n.currentMonth,n.drawYear=n.selectedYear=n.currentYear):(i=new Date,n.selectedDay=i.getDate(),n.drawMonth=n.selectedMonth=i.getMonth(),n.drawYear=n.selectedYear=i.getFullYear()),this._notifyChange(n),this._adjustDate(s)},_selectMonthYear:function(e,i,s){var n=t(e),o=this._getInst(n[0]);o["selected"+("M"===s?"Month":"Year")]=o["draw"+("M"===s?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(o),this._adjustDate(n)},_selectDay:function(e,i,s,n){var o,a=t(e);t(n).hasClass(this._unselectableClass)||this._isDisabledDatepicker(a[0])||(o=this._getInst(a[0]),o.selectedDay=o.currentDay=t("a",n).html(),o.selectedMonth=o.currentMonth=i,o.selectedYear=o.currentYear=s,this._selectDate(e,this._formatDate(o,o.currentDay,o.currentMonth,o.currentYear)))},_clearDate:function(e){var i=t(e);this._selectDate(i,"")},_selectDate:function(e,i){var s,n=t(e),o=this._getInst(n[0]);i=null!=i?i:this._formatDate(o),o.input&&o.input.val(i),this._updateAlternate(o),s=this._get(o,"onSelect"),s?s.apply(o.input?o.input[0]:null,[i,o]):o.input&&o.input.trigger("change"),o.inline?this._updateDatepicker(o):(this._hideDatepicker(),this._lastInput=o.input[0],"object"!=typeof o.input[0]&&o.input.trigger("focus"),this._lastInput=null)},_updateAlternate:function(e){var i,s,n,o=this._get(e,"altField");o&&(i=this._get(e,"altFormat")||this._get(e,"dateFormat"),s=this._getDate(e),n=this.formatDate(i,s,this._getFormatConfig(e)),t(o).val(n))},noWeekends:function(t){var e=t.getDay();return[e>0&&6>e,""]},iso8601Week:function(t){var e,i=new Date(t.getTime());return i.setDate(i.getDate()+4-(i.getDay()||7)),e=i.getTime(),i.setMonth(0),i.setDate(1),Math.floor(Math.round((e-i)/864e5)/7)+1},parseDate:function(e,i,s){if(null==e||null==i)throw"Invalid arguments";if(i="object"==typeof i?""+i:i+"",""===i)return null;var n,o,a,r,l=0,h=(s?s.shortYearCutoff:null)||this._defaults.shortYearCutoff,c="string"!=typeof h?h:(new Date).getFullYear()%100+parseInt(h,10),u=(s?s.dayNamesShort:null)||this._defaults.dayNamesShort,d=(s?s.dayNames:null)||this._defaults.dayNames,p=(s?s.monthNamesShort:null)||this._defaults.monthNamesShort,f=(s?s.monthNames:null)||this._defaults.monthNames,g=-1,m=-1,_=-1,v=-1,b=!1,y=function(t){var i=e.length>n+1&&e.charAt(n+1)===t;return i&&n++,i},w=function(t){var e=y(t),s="@"===t?14:"!"===t?20:"y"===t&&e?4:"o"===t?3:2,n="y"===t?s:1,o=RegExp("^\\d{"+n+","+s+"}"),a=i.substring(l).match(o);if(!a)throw"Missing number at position "+l;return l+=a[0].length,parseInt(a[0],10)},k=function(e,s,n){var o=-1,a=t.map(y(e)?n:s,function(t,e){return[[e,t]]}).sort(function(t,e){return-(t[1].length-e[1].length)});if(t.each(a,function(t,e){var s=e[1];return i.substr(l,s.length).toLowerCase()===s.toLowerCase()?(o=e[0],l+=s.length,!1):void 0}),-1!==o)return o+1;throw"Unknown name at position "+l},x=function(){if(i.charAt(l)!==e.charAt(n))throw"Unexpected literal at position "+l;l++};for(n=0;e.length>n;n++)if(b)"'"!==e.charAt(n)||y("'")?x():b=!1;else switch(e.charAt(n)){case"d":_=w("d");break;case"D":k("D",u,d);break;case"o":v=w("o");break;case"m":m=w("m");break;case"M":m=k("M",p,f);break;case"y":g=w("y");break;case"@":r=new Date(w("@")),g=r.getFullYear(),m=r.getMonth()+1,_=r.getDate();break;case"!":r=new Date((w("!")-this._ticksTo1970)/1e4),g=r.getFullYear(),m=r.getMonth()+1,_=r.getDate();break;case"'":y("'")?x():b=!0;break;default:x()}if(i.length>l&&(a=i.substr(l),!/^\s+/.test(a)))throw"Extra/unparsed characters found in date: "+a;if(-1===g?g=(new Date).getFullYear():100>g&&(g+=(new Date).getFullYear()-(new Date).getFullYear()%100+(c>=g?0:-100)),v>-1)for(m=1,_=v;;){if(o=this._getDaysInMonth(g,m-1),o>=_)break;m++,_-=o}if(r=this._daylightSavingAdjust(new Date(g,m-1,_)),r.getFullYear()!==g||r.getMonth()+1!==m||r.getDate()!==_)throw"Invalid date";return r},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:1e7*60*60*24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925)),formatDate:function(t,e,i){if(!e)return"";var s,n=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,o=(i?i.dayNames:null)||this._defaults.dayNames,a=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,r=(i?i.monthNames:null)||this._defaults.monthNames,l=function(e){var i=t.length>s+1&&t.charAt(s+1)===e;return i&&s++,i},h=function(t,e,i){var s=""+e;if(l(t))for(;i>s.length;)s="0"+s;return s},c=function(t,e,i,s){return l(t)?s[e]:i[e]},u="",d=!1;if(e)for(s=0;t.length>s;s++)if(d)"'"!==t.charAt(s)||l("'")?u+=t.charAt(s):d=!1;else switch(t.charAt(s)){case"d":u+=h("d",e.getDate(),2);break;case"D":u+=c("D",e.getDay(),n,o);break;case"o":u+=h("o",Math.round((new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()-new Date(e.getFullYear(),0,0).getTime())/864e5),3);break;case"m":u+=h("m",e.getMonth()+1,2);break;case"M":u+=c("M",e.getMonth(),a,r);break;case"y":u+=l("y")?e.getFullYear():(10>e.getFullYear()%100?"0":"")+e.getFullYear()%100;break;case"@":u+=e.getTime();break;case"!":u+=1e4*e.getTime()+this._ticksTo1970;break;case"'":l("'")?u+="'":d=!0;break;default:u+=t.charAt(s)}return u},_possibleChars:function(t){var e,i="",s=!1,n=function(i){var s=t.length>e+1&&t.charAt(e+1)===i;return s&&e++,s};for(e=0;t.length>e;e++)if(s)"'"!==t.charAt(e)||n("'")?i+=t.charAt(e):s=!1;else switch(t.charAt(e)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":n("'")?i+="'":s=!0;break;default:i+=t.charAt(e)}return i},_get:function(t,e){return void 0!==t.settings[e]?t.settings[e]:this._defaults[e]},_setDateFromField:function(t,e){if(t.input.val()!==t.lastVal){var i=this._get(t,"dateFormat"),s=t.lastVal=t.input?t.input.val():null,n=this._getDefaultDate(t),o=n,a=this._getFormatConfig(t);try{o=this.parseDate(i,s,a)||n}catch(r){s=e?"":s}t.selectedDay=o.getDate(),t.drawMonth=t.selectedMonth=o.getMonth(),t.drawYear=t.selectedYear=o.getFullYear(),t.currentDay=s?o.getDate():0,t.currentMonth=s?o.getMonth():0,t.currentYear=s?o.getFullYear():0,this._adjustInstDate(t)}},_getDefaultDate:function(t){return this._restrictMinMax(t,this._determineDate(t,this._get(t,"defaultDate"),new Date))},_determineDate:function(e,i,s){var n=function(t){var e=new Date;return e.setDate(e.getDate()+t),e},o=function(i){try{return t.datepicker.parseDate(t.datepicker._get(e,"dateFormat"),i,t.datepicker._getFormatConfig(e))}catch(s){}for(var n=(i.toLowerCase().match(/^c/)?t.datepicker._getDate(e):null)||new Date,o=n.getFullYear(),a=n.getMonth(),r=n.getDate(),l=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,h=l.exec(i);h;){switch(h[2]||"d"){case"d":case"D":r+=parseInt(h[1],10);break;case"w":case"W":r+=7*parseInt(h[1],10);break;case"m":case"M":a+=parseInt(h[1],10),r=Math.min(r,t.datepicker._getDaysInMonth(o,a));break;case"y":case"Y":o+=parseInt(h[1],10),r=Math.min(r,t.datepicker._getDaysInMonth(o,a))}h=l.exec(i)}return new Date(o,a,r)},a=null==i||""===i?s:"string"==typeof i?o(i):"number"==typeof i?isNaN(i)?s:n(i):new Date(i.getTime());return a=a&&"Invalid Date"==""+a?s:a,a&&(a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0)),this._daylightSavingAdjust(a)},_daylightSavingAdjust:function(t){return t?(t.setHours(t.getHours()>12?t.getHours()+2:0),t):null}
vendor: 6,672 bytes, line 11
11,_setDate:function(t,e,i){var s=!e,n=t.selectedMonth,o=t.selectedYear,a=this._restrictMinMax(t,this._determineDate(t,e,new Date));t.selectedDay=t.currentDay=a.getDate(),t.drawMonth=t.selectedMonth=t.currentMonth=a.getMonth(),t.drawYear=t.selectedYear=t.currentYear=a.getFullYear(),n===t.selectedMonth&&o===t.selectedYear||i||this._notifyChange(t),this._adjustInstDate(t),t.input&&t.input.val(s?"":this._formatDate(t))},_getDate:function(t){var e=!t.currentYear||t.input&&""===t.input.val()?null:this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return e},_attachHandlers:function(e){var i=this._get(e,"stepMonths"),s="#"+e.id.replace(/\\\\/g,"\\");e.dpDiv.find("[data-handler]").map(function(){var e={prev:function(){t.datepicker._adjustDate(s,-i,"M")},next:function(){t.datepicker._adjustDate(s,+i,"M")},hide:function(){t.datepicker._hideDatepicker()},today:function(){t.datepicker._gotoToday(s)},selectDay:function(){return t.datepicker._selectDay(s,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return t.datepicker._selectMonthYear(s,this,"M"),!1},selectYear:function(){return t.datepicker._selectMonthYear(s,this,"Y"),!1}};t(this).on(this.getAttribute("data-event"),e[this.getAttribute("data-handler")])})},_generateHTML:function(t){var e,i,s,n,o,a,r,l,h,c,u,d,p,f,g,m,_,v,b,y,w,k,x,C,D,T,I,M,P,S,N,H,z,A,O,E,W,F,L,R=new Date,Y=this._daylightSavingAdjust(new Date(R.getFullYear(),R.getMonth(),R.getDate())),B=this._get(t,"isRTL"),j=this._get(t,"showButtonPanel"),q=this._get(t,"hideIfNoPrevNext"),K=this._get(t,"navigationAsDateFormat"),U=this._getNumberOfMonths(t),V=this._get(t,"showCurrentAtPos"),X=this._get(t,"stepMonths"),$=1!==U[0]||1!==U[1],G=this._daylightSavingAdjust(t.currentDay?new Date(t.currentYear,t.currentMonth,t.currentDay):new Date(9999,9,9)),J=this._getMinMaxDate(t,"min"),Q=this._getMinMaxDate(t,"max"),Z=t.drawMonth-V,te=t.drawYear;if(0>Z&&(Z+=12,te--),Q)for(e=this._daylightSavingAdjust(new Date(Q.getFullYear(),Q.getMonth()-U[0]*U[1]+1,Q.getDate())),e=J&&J>e?J:e;this._daylightSavingAdjust(new Date(te,Z,1))>e;)Z--,0>Z&&(Z=11,te--);for(t.drawMonth=Z,t.drawYear=te,i=this._get(t,"prevText"),i=K?this.formatDate(i,this._daylightSavingAdjust(new Date(te,Z-X,1)),this._getFormatConfig(t)):i,s=this._canAdjustMonth(t,-1,te,Z)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(B?"e":"w")+"'>"+i+"</span></a>":q?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(B?"e":"w")+"'>"+i+"</span></a>",n=this._get(t,"nextText"),n=K?this.formatDate(n,this._daylightSavingAdjust(new Date(te,Z+X,1)),this._getFormatConfig(t)):n,o=this._canAdjustMonth(t,1,te,Z)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(B?"w":"e")+"'>"+n+"</span></a>":q?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+n+"'><span class='ui-icon ui-icon-circle-triangle-"+(B?"w":"e")+"'>"+n+"</span></a>",a=this._get(t,"currentText"),r=this._get(t,"gotoCurrent")&&t.currentDay?G:Y,a=K?this.formatDate(a,r,this._getFormatConfig(t)):a,l=t.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(t,"closeText")+"</button>",h=j?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(B?l:"")+(this._isInRange(t,r)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+a+"</button>":"")+(B?"":l)+"</div>":"",c=parseInt(this._get(t,"firstDay"),10),c=isNaN(c)?0:c,u=this._get(t,"showWeek"),d=this._get(t,"dayNames"),p=this._get(t,"dayNamesMin"),f=this._get(t,"monthNames"),g=this._get(t,"monthNamesShort"),m=this._get(t,"beforeShowDay"),_=this._get(t,"showOtherMonths"),v=this._get(t,"selectOtherMonths"),b=this._getDefaultDate(t),y="",k=0;U[0]>k;k++){for(x="",this.maxRows=4,C=0;U[1]>C;C++){if(D=this._daylightSavingAdjust(new Date(te,Z,t.selectedDay)),T=" ui-corner-all",I="",$){if(I+="<div class='ui-datepicker-group",U[1]>1)switch(C){case 0:I+=" ui-datepicker-group-first",T=" ui-corner-"+(B?"right":"left");break;case U[1]-1:I+=" ui-datepicker-group-last",T=" ui-corner-"+(B?"left":"right");break;default:I+=" ui-datepicker-group-middle",T=""}I+="'>"}for(I+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+T+"'>"+(/all|left/.test(T)&&0===k?B?o:s:"")+(/all|right/.test(T)&&0===k?B?s:o:"")+this._generateMonthYearHeader(t,Z,te,J,Q,k>0||C>0,f,g)+"</div><table class='ui-datepicker-calendar'><thead>"+"<tr>",M=u?"<th class='ui-datepicker-week-col'>"+this._get(t,"weekHeader")+"</th>":"",w=0;7>w;w++)P=(w+c)%7,M+="<th scope='col'"+((w+c+6)%7>=5?" class='ui-datepicker-week-end'":"")+">"+"<span title='"+d[P]+"'>"+p[P]+"</span></th>";for(I+=M+"</tr></thead><tbody>",S=this._getDaysInMonth(te,Z),te===t.selectedYear&&Z===t.selectedMonth&&(t.selectedDay=Math.min(t.selectedDay,S)),N=(this._getFirstDayOfMonth(te,Z)-c+7)%7,H=Math.ceil((N+S)/7),z=$?this.maxRows>H?this.maxRows:H:H,this.maxRows=z,A=this._daylightSavingAdjust(new Date(te,Z,1-N)),O=0;z>O;O++){for(I+="<tr>",E=u?"<td class='ui-datepicker-week-col'>"+this._get(t,"calculateWeek")(A)+"</td>":"",w=0;7>w;w++)W=m?m.apply(t.input?t.input[0]:null,[A]):[!0,""],F=A.getMonth()!==Z,L=F&&!v||!W[0]||J&&J>A||Q&&A>Q,E+="<td class='"+((w+c+6)%7>=5?" ui-datepicker-week-end":"")+(F?" ui-datepicker-other-month":"")+(A.getTime()===D.getTime()&&Z===t.selectedMonth&&t._keyEvent||b.getTime()===A.getTime()&&b.getTime()===D.getTime()?" "+this._dayOverClass:"")+(L?" "+this._unselectableClass+" ui-state-disabled":"")+(F&&!_?"":" "+W[1]+(A.getTime()===G.getTime()?" "+this._currentClass:"")+(A.getTime()===Y.getTime()?" ui-datepicker-today":""))+"'"+(F&&!_||!W[2]?"":" title='"+W[2].replace(/'/g,"&#39;")+"'")+(L?"":" data-handler='selectDay' data-event='click' data-month='"+A.getMonth()+"' data-year='"+A.getFullYear()+"'")+">"+(F&&!_?"&#xa0;":L?"<span class='ui-state-default'>"+A.getDate()+"</span>":"<a class='ui-state-default"+(A.getTime()===Y.getTime()?" ui-state-highlight":"")+(A.getTime()===G.getTime()?" ui-state-active":"")+(F?" ui-priority-secondary":"")+"' href='#'>"+A.getDate()+"</a>")+"</td>",A.setDate(A.getDate()+1),A=this._daylightSavingAdjust(A);I+=E+"</tr>"}Z++,Z>11&&(Z=0,te++),I+="</tbody></table>"+($?"</div>"+(U[0]>0&&C===U[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),x+=I}y+=x}return y+=h,t._keyEvent=!1,y}
11,_generateMonthYearHeader:function(t,e,i,s,n,o,a,r){var l,h,c,u,d,p,f,g,m=this._get(t,"changeMonth"),_=this._get(t,"changeYear"),v=this._get(t,"showMonthAfterYear"),b="<div class='ui-datepicker-title'>",y="";if(o||!m)y+="<span class='ui-datepicker-month'>"+a[e]+"</span>";else{for(l=s&&s.getFullYear()===i,h=n&&n.getFullYear()===i,y+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",c=0;12>c;c++)(!l||c>=s.getMonth())&&(!h||n.getMonth()>=c)&&(y+="<option value='"+c+"'"+(c===e?" selected='selected'":"")+">"+r[c]+"</option>");y+="</select>"}if(v||(b+=y+(!o&&m&&_?"":"&#xa0;")),!t.yearshtml)if(t.yearshtml="",o||!_)b+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(u=this._get(t,"yearRange").split(":"),d=(new Date).getFullYear(),p=function(t){var e=t.match(/c[+\-].*/)?i+parseInt(t.substring(1),10):t.match(/[+\-].*/)?d+parseInt(t,10):parseInt(t,10);return isNaN(e)?d:e},f=p(u[0]),g=Math.max(f,p(u[1]||"")),f=s?Math.max(f,s.getFullYear()):f,g=n?Math.min(g,n.getFullYear()):g,t.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";g>=f;f++)t.yearshtml+="<option value='"+f+"'"+(f===i?" selected='selected'":"")+">"+f+"</option>";t.yearshtml+="</select>",b+=t.yearshtml,t.yearshtml=null}return b+=this._get(t,"yearSuffix"),v&&(b+=(!o&&m&&_?"":"&#xa0;")+y),b+="</div>"},_adjustInstDate:function(t,e,i){var s=t.selectedYear+("Y"===i?e:0),n=t.selectedMonth+("M"===i?e:0),o=Math.min(t.selectedDay,this._getDaysInMonth(s,n))+("D"===i?e:0),a=this._restrictMinMax(t,this._daylightSavingAdjust(new Date(s,n,o)));t.selectedDay=a.getDate(),t.drawMonth=t.selectedMonth=a.getMonth(),t.drawYear=t.selectedYear=a.getFullYear(),("M"===i||"Y"===i)&&this._notifyChange(t)},_restrictMinMax:function(t,e){var i=this._getMinMaxDate(t,"min"),s=this._getMinMaxDate(t,"max"),n=i&&i>e?i:e;return s&&n>s?s:n},_notifyChange:function(t){var e=this._get(t,"onChangeMonthYear");e&&e.apply(t.input?t.input[0]:null,[t.selectedYear,t.selectedMonth+1,t])},_getNumberOfMonths:function(t){var e=this._get(t,"numberOfMonths");return null==e?[1,1]:"number"==typeof e?[1,e]:e},_getMinMaxDate:function(t,e){return this._determineDate(t,this._get(t,e+"Date"),null)},_getDaysInMonth:function(t,e){return 32-this._daylightSavingAdjust(new Date(t,e,32)).getDate()},_getFirstDayOfMonth:function(t,e){return new Date(t,e,1).getDay()},_canAdjustMonth:function(t,e,i,s){var n=this._getNumberOfMonths(t),o=this._daylightSavingAdjust(new Date(i,s+(0>e?e:n[0]*n[1]),1));return 0>e&&o.setDate(this._getDaysInMonth(o.getFullYear(),o.getMonth())),this._isInRange(t,o)},_isInRange:function(t,e){var i,s,n=this._getMinMaxDate(t,"min"),o=this._getMinMaxDate(t,"max"),a=null,r=null,l=this._get(t,"yearRange");return l&&(i=l.split(":"),s=(new Date).getFullYear(),a=parseInt(i[0],10),r=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(a+=s),i[1].match(/[+\-].*/)&&(r+=s)),(!n||e.getTime()>=n.getTime())&&(!o||e.getTime()<=o.getTime())&&(!a||e.getFullYear()>=a)&&(!r||r>=e.getFullYear())},_getFormatConfig:function(t){var e=this._get(t,"shortYearCutoff");return e="string"!=typeof e?e:(new Date).getFullYear()%100+parseInt(e,10),{shortYearCutoff:e,dayNamesShort:this._get(t,"dayNamesShort"),dayNames:this._get(t,"dayNames"),monthNamesShort:this._get(t,"monthNamesShort"),monthNames:this._get(t,"monthNames")}},_formatDate:function(t,e,i,s){e||(t.currentDay=t.selectedDay,t.currentMonth=t.selectedMonth,t.currentYear=t.selectedYear);var n=e?"object"==typeof e?e:this._daylightSavingAdjust(new Date(s,i,e)):this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return this.formatDate(this._get(t,"dateFormat"),n,this._getFormatConfig(t))}}),t.fn.datepicker=function(e){if(!this.length)return this;t.datepicker.initialized||(t(document).on("mousedown",t.datepicker._checkExternalClick),t.datepicker.initialized=!0),0===t("#"+t.datepicker._mainDivId).length&&t("body").append(t.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"!=typeof e||"isDisabled"!==e&&"getDate"!==e&&"widget"!==e?"option"===e&&2===arguments.length&&"string"==typeof arguments[1]?t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this[0]].concat(i)):this.each(function(){"string"==typeof e?t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this].concat(i)):t.datepicker._attachDatepicker(this,e)}):t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this[0]].concat(i))},t.datepicker=new s,t.datepicker.initialized=!1,t.datepicker.uuid=(new Date).getTime(),t.datepicker.version="1.12.1",t.datepicker});
12/*!
13 * Bowser - a browser detector
14 * https://github.com/ded/bowser
15 * MIT License | (c) Dustin Diaz 2015
16 */
17!function(e,t,n){typeof module!="undefined"&&module.exports?module.exports=n():typeof define=="function"&&define.amd?define(t,n):e[t]=n()}(this,"bowser",function(){function t(t){function n(e){var n=t.match(e);return n&&n.length>1&&n[1]||""}function r(e){var n=t.match(e);return n&&n.length>1&&n[2]||""}function N(e){switch(e){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return undefined}}var i=n(/(ipod|iphone|ipad)/i).toLowerCase(),s=/like android/i.test(t),o=!s&&/android/i.test(t),u=/nexus\s*[0-6]\s*/i.test(t),a=!u&&/nexus\s*[0-9]+/i.test(t),f=/CrOS/.test(t),l=/silk/i.test(t),c=/sailfish/i.test(t),h=/tizen/i.test(t),p=/(web|hpw)os/i.test(t),d=/windows phone/i.test(t),v=/SamsungBrowser/i.test(t),m=!d&&/windows/i.test(t),g=!i&&!l&&/macintosh/i.test(t),y=!o&&!c&&!h&&!p&&/linux/i.test(t),b=r(/edg([ea]|ios)\/(\d+(\.\d+)?)/i),w=n(/version\/(\d+(\.\d+)?)/i),E=/tablet/i.test(t)&&!/tablet pc/i.test(t),S=!E&&/[^-]mobi/i.test(t),x=/xbox/i.test(t),T;/opera/i.test(t)?T={name:"Opera",opera:e,version:w||n(/(?:opera|opr|opios)[\s\/](\d+(\.\d+)?)/i)}:/opr\/|opios/i.test(t)?T={name:"Opera",opera:e,version:n(/(?:opr|opios)[\s\/](\d+(\.\d+)?)/i)||w}:/SamsungBrowser/i.test(t)?T={name:"Samsung Internet for Android",samsungBrowser:e,version:w||n(/(?:SamsungBrowser)[\s\/](\d+(\.\d+)?)/i)}:/coast/i.test(t)?T={name:"Opera Coast",coast:e,version:w||n(/(?:coast)[\s\/](\d+(\.\d+)?)/i)}:/yabrowser/i.test(t)?T={name:"Yandex Browser",yandexbrowser:e,version:w||n(/(?:yabrowser)[\s\/](\d+(\.\d+)?)/i)}:/ucbrowser/i.test(t)?T={name:"UC Browser",ucbrowser:e,version:n(/(?:ucbrowser)[\s\/](\d+(?:\.\d+)+)/i)}:/mxios/i.test(t)?T={name:"Maxthon",maxthon:e,version:n(/(?:mxios)[\s\/](\d+(?:\.\d+)+)/i)}:/epiphany/i.test(t)?T={name:"Epiphany",epiphany:e,version:n(/(?:epiphany)[\s\/](\d+(?:\.\d+)+)/i)}:/puffin/i.test(t)?T={name:"Puffin",puffin:e,version:n(/(?:puffin)[\s\/](\d+(?:\.\d+)?)/i)}:/sleipnir/i.test(t)?T={name:"Sleipnir",sleipnir:e,version:n(/(?:sleipnir)[\s\/](\d+(?:\.\d+)+)/i)}:/k-meleon/i.test(t)?T={name:"K-Meleon",kMeleon:e,version:n(/(?:k-meleon)[\s\/](\d+(?:\.\d+)+)/i)}:d?(T={name:"Windows Phone",osname:"Windows Phone",windowsphone:e},b?(T.msedge=e,T.version=b):(T.msie=e,T.version=n(/iemobile\/(\d+(\.\d+)?)/i))):/msie|trident/i.test(t)?T={name:"Internet Explorer",msie:e,version:n(/(?:msie |rv:)(\d+(\.\d+)?)/i)}:f?T={name:"Chrome",osname:"Chrome OS",chromeos:e,chromeBook:e,chrome:e,version:n(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:/edg([ea]|ios)/i.test(t)?T={name:"Microsoft Edge",msedge:e,version:b}:/vivaldi/i.test(t)?T={name:"Vivaldi",vivaldi:e,version:n(/vivaldi\/(\d+(\.\d+)?)/i)||w}:c?T={name:"Sailfish",osname:"Sailfish OS",sailfish:e,version:n(/sailfish\s?browser\/(\d+(\.\d+)?)/i)}:/seamonkey\//i.test(t)?T={name:"SeaMonkey",seamonkey:e,version:n(/seamonkey\/(\d+(\.\d+)?)/i)}:/firefox|iceweasel|fxios/i.test(t)?(T={name:"Firefox",firefox:e,version:n(/(?:firefox|iceweasel|fxios)[ \/](\d+(\.\d+)?)/i)},/\((mobile|tablet);[^\)]*rv:[\d\.]+\)/i.test(t)&&(T.firefoxos=e,T.osname="Firefox OS")):l?T={name:"Amazon Silk",silk:e,version:n(/silk\/(\d+(\.\d+)?)/i)}:/phantom/i.test(t)?T={name:"PhantomJS",phantom:e,version:n(/phantomjs\/(\d+(\.\d+)?)/i)}:/slimerjs/i.test(t)?T={name:"SlimerJS",slimer:e,version:n(/slimerjs\/(\d+(\.\d+)?)/i)}:/blackberry|\bbb\d+/i.test(t)||/rim\stablet/i.test(t)?T={name:"BlackBerry",osname:"BlackBerry OS",blackberry:e,version:w||n(/blackberry[\d]+\/(\d+(\.\d+)?)/i)}:p?(T={name:"WebOS",osname:"WebOS",webos:e,version:w||n(/w(?:eb)?osbrowser\/(\d+(\.\d+)?)/i)},/touchpad\//i.test(t)&&(T.touchpad=e)):/bada/i.test(t)?T={name:"Bada",osname:"Bada",bada:e,version:n(/dolfin\/(\d+(\.\d+)?)/i)}:h?T={name:"Tizen",osname:"Tizen",tizen:e,version:n(/(?:tizen\s?)?browser\/(\d+(\.\d+)?)/i)||w}:/qupzilla/i.test(t)?T={name:"QupZilla",qupzilla:e,version:n(/(?:qupzilla)[\s\/](\d+(?:\.\d+)+)/i)||w}:/chromium/i.test(t)?T={name:"Chromium",chromium:e,version:n(/(?:chromium)[\s\/](\d+(?:\.\d+)?)/i)||w}:/chrome|crios|crmo/i.test(t)?T={name:"Chrome",chrome:e,version:n(/(?:chrome|crios|crmo)\/(\d+(\.\d+)?)/i)}:o?T={name:"Android",version:w}:/safari|applewebkit/i.test(t)?(T={name:"Safari",safari:e},w&&(T.version=w)):i?(T={name:i=="iphone"?"iPhone":i=="ipad"?"iPad":"iPod"},w&&(T.version=w)):/googlebot/i.test(t)?T={name:"Googlebot",googlebot:e,version:n(/googlebot\/(\d+(\.\d+))/i)||w}:T={name:n(/^(.*)\/(.*) /),version:r(/^(.*)\/(.*) /)},!T.msedge&&/(apple)?webkit/i.test(t)?(/(apple)?webkit\/537\.36/i.test(t)?(T.name=T.name||"Blink",T.blink=e):(T.name=T.name||"Webkit",T.webkit=e),!T.version&&w&&(T.version=w)):!T.opera&&/gecko\//i.test(t)&&(T.name=T.name||"Gecko",T.gecko=e,T.version=T.version||n(/gecko\/(\d+(\.\d+)?)/i)),!T.windowsphone&&(o||T.silk)?(T.android=e,T.osname="Android"):!T.windowsphone&&i?(T[i]=e,T.ios=e,T.osname="iOS"):g?(T.mac=e,T.osname="macOS"):x?(T.xbox=e,T.osname="Xbox"):m?(T.windows=e,T.osname="Windows"):y&&(T.linux=e,T.osname="Linux");var C="";T.windows?C=N(n(/Windows ((NT|XP)( \d\d?.\d)?)/i)):T.windowsphone?C=n(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i):T.mac?(C=n(/Mac OS X (\d+([_\.\s]\d+)*)/i),C=C.replace(/[_\s]/g,".")):i?(C=n(/os (\d+([_\s]\d+)*) like mac os x/i),C=C.replace(/[_\s]/g,".")):o?C=n(/android[ \/-](\d+(\.\d+)*)/i):T.webos?C=n(/(?:web|hpw)os\/(\d+(\.\d+)*)/i):T.blackberry?C=n(/rim\stablet\sos\s(\d+(\.\d+)*)/i):T.bada?C=n(/bada\/(\d+(\.\d+)*)/i):T.tizen&&(C=n(/tizen[\/\s](\d+(\.\d+)*)/i)),C&&(T.osversion=C);var k=!T.windows&&C.split(".")[0];if(E||a||i=="ipad"||o&&(k==3||k>=4&&!S)||T.silk)T.tablet=e;else if(S||i=="iphone"||i=="ipod"||o||u||T.blackberry||T.webos||T.bada)T.mobile=e;return T.msedge||T.msie&&T.version>=10||T.yandexbrowser&&T.version>
17=15||T.vivaldi&&T.version>=1||T.chrome&&T.version>=20||T.samsungBrowser&&T.version>=4||T.firefox&&T.version>=20||T.safari&&T.version>=6||T.opera&&T.version>=10||T.ios&&T.osversion&&T.osversion.split(".")[0]>=6||T.blackberry&&T.version>=10.1||T.chromium&&T.version>=20?T.a=e:T.msie&&T.version<10||T.chrome&&T.version<20||T.firefox&&T.version<20||T.safari&&T.version<6||T.opera&&T.version<10||T.ios&&T.osversion&&T.osversion.split(".")[0]<6||T.chromium&&T.version<20?T.c=e:T.x=e,T}function r(e){return e.split(".").length}function i(e,t){var n=[],r;if(Array.prototype.map)return Array.prototype.map.call(e,t);for(r=0;r<e.length;r++)n.push(t(e[r]));return n}function s(e){var t=Math.max(r(e[0]),r(e[1])),n=i(e,function(e){var n=t-r(e);return e+=(new Array(n+1)).join(".0"),i(e.split("."),function(e){return(new Array(20-e.length)).join("0")+e}).reverse()});while(--t>=0){if(n[0][t]>n[1][t])return 1;if(n[0][t]!==n[1][t])return-1;if(t===0)return 0}}function o(e,r,i){var o=n;typeof r=="string"&&(i=r,r=void 0),r===void 0&&(r=!1),i&&(o=t(i));var u=""+o.version;for(var a in e)if(e.hasOwnProperty(a)&&o[a]){if(typeof e[a]!="string")throw new Error("Browser version in the minVersion map should be a string: "+a+": "+String(e));return s([u,e[a]])<0}return r}function u(e,t,n){return!o(e,t,n)}var e=!0,n=t(typeof navigator!="undefined"?navigator.userAgent||"":"");return n.test=function(e){for(var t=0;t<e.length;++t){var r=e[t];if(typeof r=="string"&&r in n)return!0}return!1},n.isUnsupportedBrowser=o,n.compareVersions=s,n.check=u,n._detect=t,n.detect=t,n})
18$.fn.isOnScreen=function(b){var d=$(window);var a={top:d.scrollTop(),left:d.scrollLeft()};a.right=a.left+d.width();a.bottom=a.top+d.height();var c=this.offset();c.right=c.left+this.outerWidth();c.bottom=c.top+this.outerHeight();if(b){return(!(a.right<c.right||a.left>c.left||a.bottom<c.bottom||a.top>c.top))}else{return(!(a.right<c.left||a.left>c.right||a.bottom<c.top||a.top>c.bottom))}};
19/*!
20 * jQuery Accordion 0.0.1
21 * (c) 2014 Victor Fernandez <[email protected]>
22 * MIT Licensed.
23 */
24
25;(function ( $, window, document, undefined ) {
26
27	var pluginName = 'accordion',
28		defaults = {
29			transitionSpeed: 300,
30			transitionEasing: 'ease',
31			controlElement: '[data-control]',
32			contentElement: '[data-content]',
33			groupElement: '[data-accordion-group]',
34			singleOpen: true
35		};
36
37	function Accordion(element, options) {
38		this.element = element;
39		this.options = $.extend({}, defaults, options);
40		this._defaults = defaults;
41		this._name = pluginName;
42		this.init();
43	}
44
45	Accordion.prototype.init = function () {
46		var self = this,
47			opts = self.options;
48
49		var $accordion = $(self.element),
50			$controls = $accordion.find('> ' + opts.controlElement),
51			$content =  $accordion.find('> ' + opts.contentElement);
52
53		var accordionParentsQty = $accordion.parents('[data-accordion]').length,
54			accordionHasParent = accordionParentsQty > 0;
55
56		var closedCSS = { 'max-height': 0, 'overflow': 'hidden' };
57
58		var CSStransitions = supportsTransitions();
59
60		function debounce(func, threshold, execAsap) {
61			var timeout;
62
63			return function debounced() {
64				var obj = this,
65					args = arguments;
66
67				function delayed() {
68					if (!execAsap) func.apply(obj, args);
69					timeout = null;
70				};
71
72				if (timeout) clearTimeout(timeout);
73				else if (execAsap) func.apply(obj, args);
74
75				timeout = setTimeout(delayed, threshold || 100);
76			};
77		}
78
79		function supportsTransitions() {
80			var b = document.body || document.documentElement,
81				s = b.style,
82				p = 'transition';
83
84			if (typeof s[p] == 'string') {
85				return true;
86			}
87
88			var v = ['Moz', 'webkit', 'Webkit', 'Khtml', 'O', 'ms'];
89
90			p = 'Transition';
91
92			for (var i=0; i<v.length; i++) {
93				if (typeof s[v[i] + p] == 'string') {
94					return true;
95				}
96			}
97
98			return false;
99		}
100
101		function requestAnimFrame(cb) {
102			if(window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame) {
103				return  requestAnimationFrame(cb) ||
104					webkitRequestAnimationFrame(cb) ||
105					mozRequestAnimationFrame(cb);
106			} else {
107				return setTimeout(cb, 1000 / 60);
108			}
109		}
110
111		function toggleTransition($el, remove) {
112			if(!remove) {
113				$content.css({
114					'-webkit-transition': 'max-height ' + opts.transitionSpeed + 'ms ' + opts.transitionEasing,
115					'transition': 'max-height ' + opts.transitionSpeed + 'ms ' + opts.transitionEasing
116				});
117			} else {
118				$content.css({
119					'-webkit-transition': '',
120					'transition': ''
121				});
122			}
123		}
124
125		function calculateHeight($el) {
126			var height = 0;
127
128			$el.children().each(function() {
129				height = height + $(this).outerHeight(true);
130			});
131
132			$el.data('oHeight', height);
133		}
134
135		function updateParentHeight($parentAccordion, $currentAccordion, qty, operation) {
136			var $content = $parentAccordion.filter('.accordion--open').find('> [data-content]'),
137				$childs = $content.find('[data-accordion].accordion--open > [data-content]'),
138				$matched;
139
140			if(!opts.singleOpen) {
141				$childs = $childs.not($currentAccordion.siblings('[data-accordion].accordion--open').find('> [data-content]'));
142			}
143
144			$matched = $content.add($childs);
145
146			if($parentAccordion.hasClass('accordion--open')) {
147				$matched.each(function() {
148					var currentHeight = $(this).data('oHeight');
149
150					switch (operation) {
151						case '+':
152							$(this).data('oHeight', currentHeight + qty);
153							break;
154						case '-':
155							$(this).data('oHeight', currentHeight - qty);
156							break;
157						default:
158							throw 'updateParentHeight method needs an operation';
159					}
160
161					$(this).css('max-height', $(this).data('oHeight'));
162				});
163			}
164		}
165
166		function refreshHeight($accordion) {
167			if($accordion.hasClass('accordion--open')) {
168				var $content = $accordion.find('> [data-content]'),
169					$childs = $content.find('[data-accordion].accordion--open > [data-content]'),
170					$matched = $content.add($childs);
171
172				calculateHeight($matched);
173
174				$matched.css('max-height', $matched.data('oHeight'));
175			}
176		}
177
178		function closeAccordion($accordion, $content) {
179			$accordion.trigger('accordion.close');
180
181			if(CSStransitions) {
182				if(accordionHasParent) {
183					var $parentAccordions = $accordion.parents('[data-accordion]');
184
185					updateParentHeight($parentAccordions, $accordion, $content.data('oHeight'), '-');
186				}
187
188				$content.css(closedCSS);
189
190				$accordion.removeClass('accordion--open');
191			} else {
192				$content.css('max-height', $content.data('oHeight'));
193
194				$content.animate(closedCSS, opts.transitionSpeed);
195
196				$accordion.removeClass('accordion--open');
197			}
198		}
199
200		function openAccordion($accordion, $content) {
201			$accordion.trigger('accordion.accordion--open');
202			if(CSStransitions) {
203				toggleTransition($content);
204
205				if(accordionHasParent) {
206					var $parentAccordions = $accordion.parents('[data-accordion]');
207
208					updateParentHeight($parentAccordions, $accordion, $content.data('oHeight'), '+');
209				}
210
211				requestAnimFrame(function() {
212					$content.css('max-height', $content.data('oHeight'));
213				});
214
215				$accordion.addClass('accordion--open');
216			} else {
217				$content.animate({
218					'max-height': $content.data('oHeight')
219				}, opts.transitionSpeed, function() {
220					$content.css({'max-height': 'none'});
221				});
222
223				$accordion.addClass('accordion--open');
224			}
225		}
226
227		function closeSiblingAccordions($accordion) {
228			var $accordionGroup = $accordion.closest(opts.groupElement);
229
230			var $siblings = $accordion.siblings('[data-accordion]').filter('.accordion--open'),
231				$siblingsChildren = $siblings.find('[data-accordion]').filter('.accordion--open');
232
233			var $otherAccordions = $siblings.add($siblingsChildren);
234
235			$otherAccordions.each(function() {
236				var $accordion = $(this),
237					$content = $accordion.find(opts.contentElement);
238
239				closeAccordion($accordion, $content);
240			});
241
242			$otherAccordions.removeClass('accordion--open');
243		}
244
245		function toggleAccordion() {
246			var isAccordionGroup = (opts.singleOpen) ? $accordion.parents(opts.groupElement).length > 0 : false;
247
248			calculateHeight($content);
249
250			if(isAccordionGroup) {
251				closeSiblingAccordions($accordion);
252			}
253
254			if($accordion.hasClass('accordion--open')) {
255				closeAccordion($accordion, $content);
256			} else {
257				openAccordion($accordion, $content);
258			}
259			return false;
260		}
261
262		function addEventListeners() {
263			$controls.on('click', toggleAccordion);
264
265			$controls.on('accordion.toggle', function() {
266				if(opts.singleOpen && $controls.length > 1) {
267					return false;
268				}
269
270				toggleAccordion();
271			});
272
273			$(window).on('resize', debounce(function() {
274				refreshHeight($accordion);
275			}));
276		}
277
278		function setup() {
279			$content.each(function() {
280				var $curr = $(this);
281
282				if($curr.css('max-height') != 0) {
283					if(!$curr.closest('[data-accordion]').hasClass('accordion--open')) {
284						$curr.css({ 'max-height': 0, 'overflow': 'hidden' });
285					} else {
286						toggleTransition($curr);
287						calculateHeight($curr);
288
289						$curr.css('max-height', $curr.data('oHeight'));
290					}
291				}
292			});
293
294
295			if(!$accordion.attr('data-accordion')) {
296				$accordion.attr('data-accordion', '');
297				$accordion.find(opts.controlElement).attr('data-control', '');
298				$accordion.find(opts.contentElement).attr('data-content', '');
299			}
300		}
301
302		setup();
303		addEventListeners();
304	};
305
306	$.fn[pluginName] = function ( options ) {
307		return this.each(function () {
308			if (!$.data(this, 'plugin_' + pluginName)) {
309				$.data(this, 'plugin_' + pluginName,
310					new Accordion( this, options ));
311			}
312		});
313	}
314
315})( jQuery, window, document );
316!function(t,s){"object"==typeof exports&&"undefined"!=typeof module?module.exports=s():"function"==typeof define&&define.amd?define(s):t.proj4=s()}(this,function(){"use strict";function t(t,s){if(t[s])return t[s];for(var i,a=Object.keys(t),h=s.toLowerCase().replace(dt,""),e=-1;++e<a.length;)if(i=a[e],i.toLowerCase().replace(dt,"")===h)return t[i]}function s(t){if("string"!=typeof t)throw new Error("not a string");this.text=t.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=_t}function i(t){return new s(t).output()}function a(t,s,i){Array.isArray(s)&&(i.unshift(s),s=null);var a=s?{}:t,e=i.reduce(function(t,s){return h(s,t),t},a);s&&(t[s]=e)}function h(t,s){if(Array.isArray(t)){var i=t.shift();if("PARAMETER"===i&&(i=t.shift()),1===t.length)return Array.isArray(t[0])?(s[i]={},void h(t[0],s[i])):void(s[i]=t[0]);if(t.length)if("TOWGS84"!==i){Array.isArray(i)||(s[i]={});var e;switch(i){case"UNIT":case"PRIMEM":case"VERT_DATUM":return s[i]={name:t[0].toLowerCase(),convert:t[1]},void(3===t.length&&h(t[2],s[i]));case"SPHEROID":case"ELLIPSOID":return s[i]={name:t[0],a:t[1],rf:t[2]},void(4===t.length&&h(t[3],s[i]));
316case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"EDATUM":case"ENGINEERINGDATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":case"COMPD_CS":case"COMPOUNDCRS":case"ENGINEERINGCRS":case"ENGCRS":case"FITTED_CS":case"LOCAL_DATUM":case"DATUM":return t[0]=["name",t[0]],void a(s,i,t);default:for(e=-1;++e<t.length;)if(!Array.isArray(t[e]))return h(t,s[i]);return a(s,i,t)}}else s[i]=t;else s[i]=!0}else s[t]=!0}function e(t,s){var i=s[0],a=s[1];!(i in t)&&a in t&&(t[i]=t[a],3===s.length&&(t[i]=s[2](t[i])))}function n(t){return t*At}function r(t){function s(s){return s*(t.to_meter||1)}"GEOGCS"===t.type?t.projName="longlat":"LOCAL_CS"===t.type?(t.projName="identity",t.local=!0):"object"==typeof t.PROJECTION?t.projName=Object.keys(t.PROJECTION)[0]:t.projName=t.PROJECTION,t.UNIT&&(t.units=t.UNIT.name.toLowerCase(),"metre"===t.units&&(t.units="meter"),t.UNIT.convert&&("GEOGCS"===t.type?t.DATUM&&t.DATUM.SPHEROID&&(t.to_meter=t.UNIT.convert*t.DATUM.SPHEROID.a):t.to_meter=t.UNIT.convert));var i=t.GEOGCS;"GEOGCS"===t.type&&(i=t),i&&(i.DATUM?t.datumCode=i.DATUM.name.toLowerCase():t.datumCode=i.name.toLowerCase(),"d_"===t.datumCode.slice(0,2)&&(t.datumCode=t.datumCode.slice(2)),"new_zealand_geodetic_datum_1949"!==t.datumCode&&"new_zealand_1949"!==t.datumCode||(t.datumCode="nzgd49"),"wgs_1984"===t.datumCode&&("Mercator_Auxiliary_Sphere"===t.PROJECTION&&(t.sphere=!0),t.datumCode="wgs84"),"_ferro"===t.datumCode.slice(-6)&&(t.datumCode=t.datumCode.slice(0,-6)),"_jakarta"===t.datumCode.slice(-8)&&(t.datumCode=t.datumCode.slice(0,-8)),~t.datumCode.indexOf("belge")&&(t.datumCode="rnb72"),i.DATUM&&i.DATUM.SPHEROID&&(t.ellps=i.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),"international"===t.ellps.toLowerCase().slice(0,13)&&(t.ellps="intl"),t.a=i.DATUM.SPHEROID.a,t.rf=parseFloat(i.DATUM.SPHEROID.rf,10)),i.DATUM&&i.DATUM.TOWGS84&&(t.datum_params=i.DATUM.TOWGS84),~t.datumCode.indexOf("osgb_1936")&&(t.datumCode="osgb36"),~t.datumCode.indexOf("osni_1952")&&(t.datumCode="osni52"),(~t.datumCode.indexOf("tm65")||~t.datumCode.indexOf("geodetic_datum_of_1965"))&&(t.datumCode="ire65"),"ch1903+"===t.datumCode&&(t.datumCode="ch1903"),~t.datumCode.indexOf("israel")&&(t.datumCode="isr93")),t.b&&!isFinite(t.b)&&(t.b=t.a);[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_2","Standard_Parallel_2"],["false_easting","False_Easting"],["false_northing","False_Northing"],["central_meridian","Central_Meridian"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",n],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",n],["x0","false_easting",s],["y0","false_northing",s],["long0","central_meridian",n],["lat0","latitude_of_origin",n],["lat0","standard_parallel_1",n],["lat1","standard_parallel_1",n],["lat2","standard_parallel_2",n],["azimuth","Azimuth"],["alpha","azimuth",n],["srsCode","name"]].forEach(function(s){return e(t,s)}),t.long0||!t.longc||"Albers_Conic_Equal_Area"!==t.projName&&"Lambert_Azimuthal_Equal_Area"!==t.projName||(t.long0=t.longc),t.lat_ts||!t.lat1||"Stereographic_South_Pole"!==t.projName&&"Polar Stereographic (variant B)"!==t.projName||(t.lat0=n(t.lat1>0?90:-90),t.lat_ts=t.lat1)}function o(t){var s=this;if(2===arguments.length){var i=arguments[1];"string"==typeof i?"+"===i.charAt(0)?o[t]=yt(arguments[1]):o[t]=Ct(arguments[1]):o[t]=i}else if(1===arguments.length){if(Array.isArray(t))return t.map(function(t){Array.isArray(t)?o.apply(s,t):o(t)});if("string"==typeof t){if(t in o)return o[t]}else"EPSG"in t?o["EPSG:"+t.EPSG]=t:"ESRI"in t?o["ESRI:"+t.ESRI]=t:"IAU2000"in t?o["IAU2000:"+t.IAU2000]=t:console.log(t);return}}function l(t){return"string"==typeof t}function M(t){return t in o}function c(t){return Et.some(function(s){return t.indexOf(s)>-1})}function u(s){var i=t(s,"authority");if(i){var a=t(i,"epsg");return a&&Pt.indexOf(a)>-1}}function f(s){var i=t(s,"extension");if(i)return t(i,"proj4")}function m(t){return"+"===t[0]}function p(t){if(!l(t))return t;if(M(t))return o[t];if(c(t)){var s=Ct(t);if(u(s))return o["EPSG:3857"];var i=f(s);return i?yt(i):s}return m(t)?yt(t):void 0}function d(t){return t}function y(t,s){var i=Tt.length;
316return t.names?(Tt[i]=t,t.names.forEach(function(t){Gt[t.toLowerCase()]=i}),this):(console.log(s),!0)}function _(t,s,i,a){var h=t*t,e=s*s,n=(h-e)/h,r=0;return a?(h=(t*=1-n*(et+n*(nt+n*rt)))*t,n=0):r=Math.sqrt(n),{es:n,e:r,ep2:(h-e)/e}}function x(s,i,a,h,e){if(!s){var n=t(zt,h);n||(n=Lt),s=n.a,i=n.b,a=n.rf}return a&&!i&&(i=(1-1/a)*s),(0===a||Math.abs(s-i)<ot)&&(e=!0,i=s),{a:s,b:i,rf:a,sphere:e}}function v(t,s,i,a,h,e){var n={};return n.datum_type=void 0===t||"none"===t?it:st,s&&(n.datum_params=s.map(parseFloat),0===n.datum_params[0]&&0===n.datum_params[1]&&0===n.datum_params[2]||(n.datum_type=$),n.datum_params.length>3&&(0===n.datum_params[3]&&0===n.datum_params[4]&&0===n.datum_params[5]&&0===n.datum_params[6]||(n.datum_type=tt,n.datum_params[3]*=at,n.datum_params[4]*=at,n.datum_params[5]*=at,n.datum_params[6]=n.datum_params[6]/1e6+1))),n.a=i,n.b=a,n.es=h,n.ep2=e,n}function Projection(s,i){if(!(this instanceof Projection))return new Projection(s);i=i||function(t){if(t)throw t};var a=p(s);if("object"==typeof a){var h=Projection.projections.get(a.projName);if(h){if(a.datumCode&&"none"!==a.datumCode){var e=t(Dt,a.datumCode);e&&(a.datum_params=e.towgs84?e.towgs84.split(","):null,a.ellps=e.ellipse,a.datumName=e.datumName?e.datumName:a.datumCode)}a.k0=a.k0||1,a.axis=a.axis||"enu",a.ellps=a.ellps||"wgs84";var n=x(a.a,a.b,a.rf,a.ellps,a.sphere),r=_(n.a,n.b,n.rf,a.R_A),o=a.datum||v(a.datumCode,a.datum_params,n.a,n.b,r.es,r.ep2);Nt(this,a),Nt(this,h),this.a=n.a,this.b=n.b,this.rf=n.rf,this.sphere=n.sphere,this.es=r.es,this.e=r.e,this.ep2=r.ep2,this.datum=o,this.init(),i(null,this)}else i(s)}else i(s)}function g(t,s){return t.datum_type===s.datum_type&&(!(t.a!==s.a||Math.abs(t.es-s.es)>5e-11)&&(t.datum_type===$?t.datum_params[0]===s.datum_params[0]&&t.datum_params[1]===s.datum_params[1]&&t.datum_params[2]===s.datum_params[2]:t.datum_type!==tt||t.datum_params[0]===s.datum_params[0]&&t.datum_params[1]===s.datum_params[1]&&t.datum_params[2]===s.datum_params[2]&&t.datum_params[3]===s.datum_params[3]&&t.datum_params[4]===s.datum_params[4]&&t.datum_params[5]===s.datum_params[5]&&t.datum_params[6]===s.datum_params[6]))}function b(t,s,i){var a,h,e,n,r=t.x,o=t.y,l=t.z?t.z:0;if(o<-ht&&o>-1.001*ht)o=-ht;else if(o>ht&&o<1.001*ht)o=ht;else{if(o<-ht)return{x:-1/0,y:-1/0,z:t.z};if(o>ht)return{x:1/0,y:1/0,z:t.z}}return r>Math.PI&&(r-=2*Math.PI),h=Math.sin(o),n=Math.cos(o),e=h*h,a=i/Math.sqrt(1-s*e),{x:(a+l)*n*Math.cos(r),y:(a+l)*n*Math.sin(r),z:(a*(1-s)+l)*h}}function w(t,s,i,a){var h,e,n,r,o,l,M,c,u,f,m,p,d,y,_,x,v=t.x,g=t.y,b=t.z?t.z:0;if(h=Math.sqrt(v*v+g*g),e=Math.sqrt(v*v+g*g+b*b),h/i<1e-12){if(y=0,e/i<1e-12)return _=ht,x=-a,{x:t.x,y:t.y,z:t.z}}else y=Math.atan2(g,v);n=b/e,c=(r=h/e)*(1-s)*(o=1/Math.sqrt(1-s*(2-s)*r*r)),u=n*o,d=0;do{d++,l=s*(M=i/Math.sqrt(1-s*u*u))/(M+(x=h*c+b*u-M*(1-s*u*u))),p=(m=n*(o=1/Math.sqrt(1-l*(2-l)*r*r)))*c-(f=r*(1-l)*o)*u,c=f,u=m}while(p*p>1e-24&&d<30);return _=Math.atan(m/Math.abs(f)),{x:y,y:_,z:x}}function A(t,s,i){if(s===$)return{x:t.x+i[0],y:t.y+i[1],z:t.z+i[2]};if(s===tt){var a=i[0],h=i[1],e=i[2],n=i[3],r=i[4],o=i[5],l=i[6];return{x:l*(t.x-o*t.y+r*t.z)+a,y:l*(o*t.x+t.y-n*t.z)+h,z:l*(-r*t.x+n*t.y+t.z)+e}}}function C(t,s,i){if(s===$)return{x:t.x-i[0],y:t.y-i[1],z:t.z-i[2]};if(s===tt){var a=i[0],h=i[1],e=i[2],n=i[3],r=i[4],o=i[5],l=i[6],M=(t.x-a)/l,c=(t.y-h)/l,u=(t.z-e)/l;return{x:M+o*c-r*u,y:-o*M+c+n*u,z:r*M-n*c+u}}}function E(t){return t===$||t===tt}function P(t){if("function"==typeof Number.isFinite){if(Number.isFinite(t))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof t||t!==t||!isFinite(t))throw new TypeError("coordinates must be finite numbers")}function N(t,s){return(t.datum.datum_type===$||t.datum.datum_type===tt)&&"WGS84"!==s.datumCode||(s.datum.datum_type===$||s.datum.datum_type===tt)&&"WGS84"!==t.datumCode}function S(t,s,i){var a;return Array.isArray(i)&&(i=Ft(i)),Qt(i),t.datum&&s.datum&&N(t,s)&&(i=S(t,a=new Projection("WGS84"),i),t=a),"enu"!==t.axis&&(i=Ut(t,!1,i)),"longlat"===t.projName?i={x:i.x*lt,y:i.y*lt,z:i.z||0}:(t.to_meter&&(i={x:i.x*t.to_meter,y:i.y*t.to_meter,z:i.z||0}),i=t.inverse(i)),t.from_greenwich&&(i.x+=t.from_greenwich),i=Bt(t.datum,s.datum,i),s.from_greenwich&&(i={x:i.x-s.from_greenwich,y:i.y,z:i.z||0}),"longlat"===s.projName?i={x:i.x*Mt,y:i.y*Mt,z:i.z||0}:(i=s.forward(i),s.to_meter&&(i={x:i.x/s.to_meter,y:i.y/s.to_meter,z:i.z||0})),"enu"!==s.axis?Ut(s,!0,i):i}function k(t,s,i){var a,h,e;return Array.isArray(i)?(a=S(t,s,i)||{x:NaN,y:NaN},i.length>2?void 0!==t.name&&"geocent"===t.name||void 0!==s.name&&"geocent"===s.name?"number"==typeof a.z?[a.x,a.y,a.z].concat(i.splice(3)):[a.x,a.y,i[2]].concat(i.splice(3)):[a.x,a.y].concat(i.splice(2)):[a.x,a.y]):(h=S(t,s,i),2===(e=Object.keys(i)).length?h:(e.forEach(function(a){if
316(void 0!==t.name&&"geocent"===t.name||void 0!==s.name&&"geocent"===s.name){if("x"===a||"y"===a||"z"===a)return}else if("x"===a||"y"===a)return;h[a]=i[a]}),h))}function q(t){return t instanceof Projection?t:t.oProj?t.oProj:Projection(t)}function I(t,s,i){t=q(t);var a,h=!1;return void 0===s?(s=t,t=Wt,h=!0):(void 0!==s.x||Array.isArray(s))&&(i=s,s=t,t=Wt,h=!0),s=q(s),i?k(t,s,i):(a={forward:function(i){return k(t,s,i)},inverse:function(i){return k(s,t,i)}},h&&(a.oProj=s),a)}function O(t,s){return s=s||5,D(j({lat:t[1],lon:t[0]}),s)}function R(t){var s=z(Q(t.toUpperCase()));return s.lat&&s.lon?[s.lon,s.lat]:[(s.left+s.right)/2,(s.top+s.bottom)/2]}function G(t){return t*(Math.PI/180)}function T(t){return t/Math.PI*180}function j(t){var s,i,a,h,e,n,r,o=t.lat,l=t.lon,M=6378137,c=G(o),u=G(l);r=Math.floor((l+180)/6)+1,180===l&&(r=60),o>=56&&o<64&&l>=3&&l<12&&(r=32),o>=72&&o<84&&(l>=0&&l<9?r=31:l>=9&&l<21?r=33:l>=21&&l<33?r=35:l>=33&&l<42&&(r=37)),n=G(6*(r-1)-180+3),s=M/Math.sqrt(1-.00669438*Math.sin(c)*Math.sin(c)),i=Math.tan(c)*Math.tan(c),a=.006739496752268451*Math.cos(c)*Math.cos(c);var f=.9996*s*((h=Math.cos(c)*(u-n))+(1-i+a)*h*h*h/6+(5-18*i+i*i+72*a-.39089081163157013)*h*h*h*h*h/120)+5e5,m=.9996*((e=M*(.9983242984503243*c-.002514607064228144*Math.sin(2*c)+2639046602129982e-21*Math.sin(4*c)-3.418046101696858e-9*Math.sin(6*c)))+s*Math.tan(c)*(h*h/2+(5-i+9*a+4*a*a)*h*h*h*h/24+(61-58*i+i*i+600*a-2.2240339282485886)*h*h*h*h*h*h/720));return o<0&&(m+=1e7),{northing:Math.round(m),easting:Math.round(f),zoneNumber:r,zoneLetter:L(o)}}function z(t){var s=t.northing,i=t.easting,a=t.zoneLetter,h=t.zoneNumber;if(h<0||h>60)return null;var e,n,r,o,l,M,c,u,f=6378137,m=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),p=i-5e5,d=s;a<"N"&&(d-=1e7),M=6*(h-1)-180+3,u=(c=d/.9996/6367449.145945056)+(3*m/2-27*m*m*m/32)*Math.sin(2*c)+(21*m*m/16-55*m*m*m*m/32)*Math.sin(4*c)+151*m*m*m/96*Math.sin(6*c),e=f/Math.sqrt(1-.00669438*Math.sin(u)*Math.sin(u)),n=Math.tan(u)*Math.tan(u),r=.006739496752268451*Math.cos(u)*Math.cos(u),o=.99330562*f/Math.pow(1-.00669438*Math.sin(u)*Math.sin(u),1.5),l=p/(.9996*e);var y=u-e*Math.tan(u)/o*(l*l/2-(5+3*n+10*r-4*r*r-.06065547077041606)*l*l*l*l/24+(61+90*n+298*r+45*n*n-1.6983531815716497-3*r*r)*l*l*l*l*l*l/720);y=T(y);var _=(l-(1+2*n+r)*l*l*l/6+(5-2*r+28*n-3*r*r+.05391597401814761+24*n*n)*l*l*l*l*l/120)/Math.cos(u);_=M+T(_);var x;if(t.accuracy){var v=z({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});x={top:v.lat,right:v.lon,bottom:y,left:_}}else x={lat:y,lon:_};return x}function L(t){var s="Z";return 84>=t&&t>=72?s="X":72>t&&t>=64?s="W":64>t&&t>=56?s="V":56>t&&t>=48?s="U":48>t&&t>=40?s="T":40>t&&t>=32?s="S":32>t&&t>=24?s="R":24>t&&t>=16?s="Q":16>t&&t>=8?s="P":8>t&&t>=0?s="N":0>t&&t>=-8?s="M":-8>t&&t>=-16?s="L":-16>t&&t>=-24?s="K":-24>t&&t>=-32?s="J":-32>t&&t>=-40?s="H":-40>t&&t>=-48?s="G":-48>t&&t>=-56?s="F":-56>t&&t>=-64?s="E":-64>t&&t>=-72?s="D":-72>t&&t>=-80&&(s="C"),s}function D(t,s){var i="00000"+t.easting,a="00000"+t.northing;return t.zoneNumber+t.zoneLetter+B(t.easting,t.northing,t.zoneNumber)+i.substr(i.length-5,s)+a.substr(a.length-5,s)}function B(t,s,i){var a=U(i);return F(Math.floor(t/1e5),Math.floor(s/1e5)%20,a)}function U(t){var s=t%Ht;return 0===s&&(s=Ht),s}function F(t,s,i){var a=i-1,h=Kt.charCodeAt(a),e=Xt.charCodeAt(a),n=h+t-1,r=e+s,o=!1;return n>$t&&(n=n-$t+Jt-1,o=!0),(n===Vt||h<Vt&&n>Vt||(n>Vt||h<Vt)&&o)&&n++,(n===Zt||h<Zt&&n>Zt||(n>Zt||h<Zt)&&o)&&++n===Vt&&n++,n>$t&&(n=n-$t+Jt-1),r>Yt?(r=r-Yt+Jt-1,o=!0):o=!1,(r===Vt||e<Vt&&r>Vt||(r>Vt||e<Vt)&&o)&&r++,(r===Zt||e<Zt&&r>Zt||(r>Zt||e<Zt)&&o)&&++r===Vt&&r++,r>Yt&&(r=r-Yt+Jt-1),String.fromCharCode(n)+String.fromCharCode(r)}function Q(t){if(t&&0===t.length)throw"MGRSPoint coverting from nothing";for(var s,i=t.length,a=null,h="",e=0;!/[A-Z]/.test(s=t.charAt(e));){if(e>=2)throw"MGRSPoint bad conversion from: "+t;h+=s,e++}var n=parseInt(h,10);if(0===e||e+3>i)throw"MGRSPoint bad conversion from: "+t;var r=t.charAt(e++);if(r<="A"||"B"===r||"Y"===r||r>="Z"||"I"===r||"O"===r)throw"MGRSPoint zone letter "+r+" not handled: "+t;a=t.substring(e,e+=2);for(var o=U(n),l=W(a.charAt(0),o),M=H(a.charAt(1),o);M<K(r);)M+=2e6;var c=i-e;if(c%2!=0)throw"MGRSPoint has to have an even number \nof digits after the zone letter and two 100km letters - front \nhalf for easting meters, second half for \nnorthing meters"+t;var u,f,m,p,d,y=c/2,_=0,x=0;return y>0&&(u=1e5/Math.pow(10,y),f=t.substring(e,e+y),_=parseFloat(f)*u,m=t.substring(e+y),x=parseFloat(m)*u),p=_+l,d=x+M,{easting:p,northing:d,zoneLetter:r,zoneNumber:n,accuracy:u}}function W(t,s){for(var i=Kt.charCodeAt(s-1),a=1e5,h=!1;i!==t.charCodeAt(0);){if(++i===Vt&&i++,i===Zt&&i++,i>$t){if(h)throw"Bad character: "+t;i=Jt,h=!0}a+=1e5}return a}function H(t,s){if(t>"V")throw"MGRSPoint given invalid Northing "+t;for(var i=Xt.charCodeAt(s-1),a=0,h=!1;i!==t.charCodeAt(0);){if(++i===Vt&&i++,i===Zt&&i++,i>Yt){if(h)throw"Bad character: "+t;i=Jt,h=!0}a+=1e5}return a}function K(t){var s;switch(t){case"C":s=11e5;break;case"D":s=2e6;break;case"E":s=28e5;break;case"F":s=37e5;break;case"G":s=46e5;break;case"H":s=55e5;break;case"J":s=64e5;break;case"K":s=73e5;break;case"L":s=82e5;break;case"M":s=91e5;break;case"N":s=0;break;case"P":s=8e5;break;case"Q":s=17e5;break;case"R":s=26e5;break;case"S":s=35e5;break;case"T":s=44e5;break;case"U":s=53e5;break;case"V":s=62e5;break;case"W":s=7e6;break;case"X":s=79e5;break;default:s=-1}if(s>=0)return s;throw"Invalid zone letter: "+t}function Point(t,s,i){if(!(this instanceof Point))return new Point(t,s,i);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if("object"==typeof t)this.x=t.x,this.y=t.y,this.z=t.z||0;else if("string"==typeof t&&void 0===s){var a=t.split(",");this.x=parseFloat(a[0],10),this.y=parseFloat(a[1],10),this.z=parseFloat(a[2],10)||0}else this.x=t,this.y=s,this.z=i||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}function X(t){var s,i=[];return i[0]=t*Ts,s=t*t,i[0]+=s*js,i[1]=s*Ls,s*=t,i[0]+=s*zs,i[1]+=s*Ds,i[2]=s*Bs,i}function J(t,s){var i=t+t;return t+s[0]*Math.sin(i)+s[1]*Math.sin(i+i)+s[2]*Math.sin(i+i+i)}function V(t,s,i,a){var h;return t<ot?(a.value=ri.AREA_0,h=0):(h=Math.atan2(s,i),Math.abs(h)<=ct?a.value=ri.AREA_0:h>ct&&h<=ht+ct?(a.value=ri.AREA_1,h-=ht):h>ht+ct||h<=-(ht+ct)?(a.value=ri.AREA_2,h=h>=0?h-ft:h+ft):(a.value=ri.AREA_3,h+=ht)),h}function Z(t,s){var i=t+s;return i<-ft?i+=ut:i>+ft&&(i-=ut),i}function Y(t,s,i,a){for(var h=s;a;--a){var e=t(h);if(h-=e,Math.abs(e)<i)break}return h}var $=1,tt=2,st=4,it=5,at=484813681109536e-20,ht=Math.PI/2,et=.16666666666666666,nt=.04722222222222222,rt=.022156084656084655,ot=1e-10,lt=.017453292519943295,Mt=57.29577951308232,ct=Math.PI/4,ut=2*Math.PI,ft=3.14159265359,mt={};mt.greenwich=0,mt.lisbon=-9.131906111111,mt.paris=2.337229166667,mt.bogota=-74.080916666667,mt.madrid=-3.687938888889,mt.rome=12.452333333333,mt.bern=7.439583333333,mt.jakarta=106.807719444444,mt.ferro=-17.666666666667,mt.brussels=4.367975,mt.stockholm=18.058277777778,mt.athens=23.7163375,mt.oslo=10.722916666667;var pt={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}},dt=/[\s_\-\/\(\)]/g,yt=function(s){var i,a,h,e={},n=s.split("+").map(function(t){return t.trim()}).filter(function(t){return t}).reduce(function(t,s){var i=s.split("=");return i.push(!0),t[i[0].toLowerCase()]=i[1],t},{}),r={proj:"projName",datum:"datumCode",rf:function(t){e.rf=parseFloat(t)},lat_0:function(t){e.lat0=t*lt},lat_1:function(t){e.lat1=t*lt},lat_2:function(t){e.lat2=t*lt},lat_ts:function(t){e.lat_ts=t*lt},lon_0:function(t){e.long0=t*lt},lon_1:function(t){e.long1=t*lt},lon_2:function(t){e.long2=t*lt},alpha:function(t){e.alpha=parseFloat(t)*lt},lonc:function(t){e.longc=t*lt},x_0:function(t){e.x0=parseFloat(t)},y_0:function(t){e.y0=parseFloat(t)},k_0:function(t){e.k0=parseFloat(t)},k:function(t){e.k0=parseFloat(t)},a:function(t){e.a=parseFloat(t)}
vendor: 3,694 bytes, line 316
316,b:function(t){e.b=parseFloat(t)},r_a:function(){e.R_A=!0},zone:function(t){e.zone=parseInt(t,10)},south:function(){e.utmSouth=!0},towgs84:function(t){e.datum_params=t.split(",").map(function(t){return parseFloat(t)})},to_meter:function(t){e.to_meter=parseFloat(t)},units:function(s){e.units=s;var i=t(pt,s);i&&(e.to_meter=i.to_meter)},from_greenwich:function(t){e.from_greenwich=t*lt},pm:function(s){var i=t(mt,s);e.from_greenwich=(i||parseFloat(s))*lt},nadgrids:function(t){"@null"===t?e.datumCode="none":e.nadgrids=t},axis:function(t){3===t.length&&-1!=="ewnsud".indexOf(t.substr(0,1))&&-1!=="ewnsud".indexOf(t.substr(1,1))&&-1!=="ewnsud".indexOf(t.substr(2,1))&&(e.axis=t)}};for(i in n)a=n[i],i in r?"function"==typeof(h=r[i])?h(a):e[h]=a:e[i]=a;return"string"==typeof e.datumCode&&"WGS84"!==e.datumCode&&(e.datumCode=e.datumCode.toLowerCase()),e},_t=1,xt=/\s/,vt=/[A-Za-z]/,gt=/[A-Za-z84]/,bt=/[,\]]/,wt=/[\d\.E\-\+]/;s.prototype.readCharicter=function(){var t=this.text[this.place++];if(4!==this.state)for(;xt.test(t);){if(this.place>=this.text.length)return;t=this.text[this.place++]}switch(this.state){case _t:return this.neutral(t);case 2:return this.keyword(t);case 4:return this.quoted(t);case 5:return this.afterquote(t);case 3:return this.number(t);case-1:return}},s.prototype.afterquote=function(t){if('"'===t)return this.word+='"',void(this.state=4);if(bt.test(t))return this.word=this.word.trim(),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in afterquote yet, index '+this.place)},s.prototype.afterItem=function(t){return","===t?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=_t)):"]"===t?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=_t,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},s.prototype.number=function(t){if(!wt.test(t)){if(bt.test(t))return this.word=parseFloat(this.word),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in number yet, index '+this.place)}this.word+=t},s.prototype.quoted=function(t){'"'!==t?this.word+=t:this.state=5},s.prototype.keyword=function(t){if(gt.test(t))this.word+=t;else{if("["===t){var s=[];return s.push(this.word),this.level++,null===this.root?this.root=s:this.currentObject.push(s),this.stack.push(this.currentObject),this.currentObject=s,void(this.state=_t)}if(!bt.test(t))throw new Error("havn't handled \""+t+'" in keyword yet, index '+this.place);this.afterItem(t)}},s.prototype.neutral=function(t){if(vt.test(t))return this.word=t,void(this.state=2);if('"'===t)return this.word="",void(this.state=4);if(wt.test(t))return this.word=t,void(this.state=3);{if(!bt.test(t))throw new Error("havn't handled \""+t+'" in neutral yet, index '+this.place);this.afterItem(t)}},s.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(-1===this.state)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};var At=.017453292519943295,Ct=function(t){var s=i(t),a=s.shift(),e=s.shift();s.unshift(["name",e]),s.unshift(["type",a]);var n={};return h(s,n),r(n),n};!function(t){t("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),t("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),t("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),t.WGS84=t["EPSG:4326"],t["EPSG:3785"]=t["EPSG:3857"],t.GOOGLE=t["EPSG:3857"],t["EPSG:900913"]=t["EPSG:3857"],t["EPSG:102113"]=t["EPSG:3857"]}(o);
vendor: 15,952 bytes, line 316
316var Et=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"],Pt=["3857","900913","3785","102113"],Nt=function(t,s){t=t||{};var i,a;if(!s)return t;for(a in s)void 0!==(i=s[a])&&(t[a]=i);return t},St=function(t,s,i){var a=t*s;return i/Math.sqrt(1-a*a)},kt=function(t){return t<0?-1:1},qt=function(t){return Math.abs(t)<=ft?t:t-kt(t)*ut},It=function(t,s,i){var a=t*i,h=.5*t;return a=Math.pow((1-a)/(1+a),h),Math.tan(.5*(ht-s))/a},Ot=function(t,s){for(var i,a,h=.5*t,e=ht-2*Math.atan(s),n=0;n<=15;n++)if(i=t*Math.sin(e),a=ht-2*Math.atan(s*Math.pow((1-i)/(1+i),h))-e,e+=a,Math.abs(a)<=1e-10)return e;return-9999},Rt=[{init:function(){var t=this.b/this.a;this.es=1-t*t,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=St(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)},forward:function(t){var s=t.x,i=t.y;if(i*Mt>90&&i*Mt<-90&&s*Mt>180&&s*Mt<-180)return null;var a,h;if(Math.abs(Math.abs(i)-ht)<=ot)return null;if(this.sphere)a=this.x0+this.a*this.k0*qt(s-this.long0),h=this.y0+this.a*this.k0*Math.log(Math.tan(ct+.5*i));else{var e=Math.sin(i),n=It(this.e,i,e);a=this.x0+this.a*this.k0*qt(s-this.long0),h=this.y0-this.a*this.k0*Math.log(n)}return t.x=a,t.y=h,t},inverse:function(t){var s,i,a=t.x-this.x0,h=t.y-this.y0;if(this.sphere)i=ht-2*Math.atan(Math.exp(-h/(this.a*this.k0)));else{var e=Math.exp(-h/(this.a*this.k0));if(-9999===(i=Ot(this.e,e)))return null}return s=qt(this.long0+a/(this.a*this.k0)),t.x=s,t.y=i,t},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},{init:function(){},forward:d,inverse:d,names:["longlat","identity"]}],Gt={},Tt=[],jt={start:function(){Rt.forEach(y)},add:y,get:function(t){if(!t)return!1;var s=t.toLowerCase();return void 0!==Gt[s]&&Tt[Gt[s]]?Tt[Gt[s]]:void 0}},zt={};zt.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"},zt.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},zt.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},zt.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"},zt.airy={a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},zt.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},zt.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},zt.mod_airy={a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},zt.andrae={a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},zt.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},zt.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},zt.bessel={a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},zt.bess_nam={a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},zt.clrk66={a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},zt.clrk80={a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},zt.clrk58={a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},zt.CPM={a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},zt.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},zt.engelis={a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},zt.evrst30={a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},zt.evrst48={a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},zt.evrst56={a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},zt.evrst69={a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},zt.evrstSS={a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},zt.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},zt.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"},zt.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"},zt.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"},zt.hough={a:6378270,rf:297,ellipseName:"Hough"},zt.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},zt.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"},zt.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"},zt.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"},zt.new_intl={a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},zt.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},zt.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},zt.SEasia={a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},zt.walbeck={a:6376896,b:6355834.8467,ellipseName:"Walbeck"},zt.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"},zt.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"},zt.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"};var Lt=zt.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};zt.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var Dt={};Dt.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},Dt.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},Dt.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},Dt.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},Dt.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},Dt.potsdam={towgs84:"606.0,23.0,413.0",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},Dt.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},Dt.hermannskogel={towgs84:"653.0,-212.0,449.0",ellipse:"bessel",datumName:"Hermannskogel"},Dt.osni52={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},Dt.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},Dt.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},Dt.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},Dt.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},Dt.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},Dt.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},Dt.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},Dt.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"},Projection.projections=jt,Projection.projections.start();var Bt=function(t,s,i){return g(t,s)?i:t.datum_type===it||s.datum_type===it?i:t.es!==s.es||t.a!==s.a||E(t.datum_type)||E(s.datum_type)?(i=b(i,t.es,t.a),E(t.datum_type)&&(i=A(i,t.datum_type,t.datum_params)),E(s.datum_type)&&(i=C(i,s.datum_type,s.datum_params)),w(i,s.es,s.a,s.b)):i},Ut=function(t,s,i){var a,h,e,n=i.x,r=i.y,o=i.z||0,l={};for(e=0;e<3;e++)if(!s||2!==e||void 0!==i.z)switch(0===e?(a=n,h="x"):1===e?(a=r,h="y"):(a=o,h="z"),t.axis[e]){case"e":l[h]=a;break;case"w":l[h]=-a;break;case"n":l[h]=a;break;case"s":l[h]=-a;break;case"u":void 0!==i[h]&&(l.z=a);break;case"d":void 0!==i[h]&&(l.z=-a);break;default:return null}return l},Ft=function(t){var s={x:t[0],y:t[1]};return t.length>2&&(s.z=t[2]),t.length>3&&(s.m=t[3]),s},Qt=function(t){P(t.x),P(t.y)},Wt=Projection("WGS84"),Ht=6,Kt="AJSAJS",Xt="AFAFAF",Jt=65,Vt=73,Zt=79,Yt=86,$t=90,ts={forward:O,inverse:function(t){var s=z(Q(t.toUpperCase()));return s.lat&&s.lon?[s.lon,s.lat,s.lon,s.lat]:[s.left,s.bottom,s.right,s.top]},toPoint:R};Point.fromMGRS=function(t){return new Point(R(t))},Point.prototype.toMGRS=function(t){return O([this.x,this.y],t)};var ss=.01068115234375,is=function(t){var s=[];s[0]=1-t*(.25+t*(.046875+t*(.01953125+t*ss))),s[1]=t*(.75-t*(.046875+t*(.01953125+t*ss)));var i=t*t;return s[2]=i*(.46875-t*(.013020833333333334+.007120768229166667*t)),i*=t,s[3]=i*(.3645833333333333-.005696614583333333*t),s[4]=i*t*.3076171875,s},as=function(t,s,i,a){return i*=s,s*=s,a[0]*t-i*(a[1]+s*(a[2]+s*(a[3]+s*a[4])))},hs=function(t,s,i){for(var a=1/(1-s),h=t,e=20;e;--e){var n=Math.sin(h),r=1-s*n*n;if(r=(as(h,n,Math.cos(h),i)-t)*(r*Math.sqrt(r))*a,h-=r,Math.abs(r)<ot)return h}return h},es={init:function(){this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.es&&(this.en=is(this.es),this.ml0=as(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))},forward:function(t){var s,i,a,h=t.x,e=t.y,n=qt(h-this.long0),r=Math.sin(e),o=Math.cos(e);if(this.es){var l=o*n,M=Math.pow(l,2),c=this.ep2*Math.pow(o,2),u=Math.pow(c,2),f=Math.abs(o)>ot?Math.tan(e):0,m=Math.pow(f,2),p=Math.pow(m,2);s=1-this.es*Math.pow(r,2),l/=Math.sqrt(s);var d=as(e,r,o,this.en);i=this.a*(this.k0*l*(1+M/6*(1-m+c+M/20*(5-18*m+p+14*c-58*m*c+M/42*(61+179*p-p*m-479*m)))))+this.x0,a=this.a*(this.k0*(d-this.ml0+r*n*l/2*(1+M/12*(5-m+9*c+4*u+M/30*(61+p-58*m+270*c-330*m*c+M/56*(1385+543*p-p*m-3111*m))))))+this.y0}else{var y=o*Math.sin(n);if(Math.abs(Math.abs(y)-1)<ot)return 93;if(i=.5*this.a*this.k0*Math.log((1+y)/(1-y))+this.x0,a=o*Math.cos(n)/Math.sqrt(1-Math.pow(y,2)),(y=Math.abs(a))>=1){if(y-1>ot)return 93;a=0}else a=Math.acos(a);e<0&&(a=-a),a=this.a*this.k0*(a-this.lat0)+this.y0}return t.x=i,t.y=a,t},inverse:function(t){var s,i,a,h,e=(t.x-this.x0)*(1/this.a),n=(t.y-this.y0)*(1/this.a);if(this.es)if(s=this.ml0+n/this.k0,i=hs(s,this.es,this.en),Math.abs(i)<ht){var r=Math.sin(i),o=Math.cos(i),l=Math.abs(o)>ot?Math.tan(i):0,M=this.ep2*Math.pow(o,2),c=Math.pow(M,2),u=Math.pow(l,2),f=Math.pow(u,2);s=1-this.es*Math.pow(r,2);var m=e*Math.sqrt(s)/this.k0,p=Math.pow(m,2);a=i-(s*=l)*p/(1-this.es)*.5*(1-p/12*(5+3*u-9*M*u+M-4*c-p/30*(61+90*u-252*M*u+45*f+46*M-p/56*(1385+3633*u+4095*f+1574*f*u)))),h=qt(this.long0+m*(1-p/6*(1+2*u+M-p/20*(5+28*u+24*f+8*M*u+6*M-p/42*(61+662*u+1320*f+720*f*u))))/o)}else a=ht*kt(n),h=0;else{var d=Math.exp(e/this.k0),y=.5*(d-1/d),_=this.lat0+n/this.k0,x=Math.cos(_);s=Math.sqrt((1-Math.pow(x,2))/(1+Math.pow(y,2))),a=Math.asin(s),n<0&&(a=-a),h=0===y&&0===x?0:qt(Math.atan2(y,x)+this.long0)}return t.x=h,t.y=a,t},names:["Transverse_Mercator","Transverse Mercator","tmerc"]},ns=function(t){var s=Math.exp(t);return s=(s-1/s)/2},rs=function(t,s){t=Math.abs(t),s=Math.abs(s);var i=Math.max(t,s),a=Math.min(t,s)/(i||1);return i*Math.sqrt(1+Math.pow(a,2))},os=function(t){var s=1+t,i=s-1;return 0===i?t:t*Math.log(s)/i},ls=function(t){var s=Math.abs(t);return s=os(s*(1+s/(rs(1,s)+1))),t<0?-s:s},Ms=function(t,s){for(var i,a=2*Math.cos(2*s),h=t.length-1,e=t[h],n=0;--h>=0;)i=a*e-n+t[h],n=e,e=i;return s+i*Math.sin(2*s)},cs=function(t,s){for(var i,a=2*Math.cos(s),h=t.length-1,e=t[h],n=0;--h>=0;)i=a*e-n+t[h],n=e,e=i;return Math.sin(s)*i},us=function(t){var s=Math.exp(t);return s=(s+1/s)/2},fs=function(t,s,i){for(var a,h,e=Math.sin(s),n=Math.cos(s),r=ns(i),o=us(i),l=2*n*o,M=-2*e*r,c=t.length-1,u=t[c],f=0,m=0,p=0;--c>=0;)a=m,h=f,u=l*(m=u)-a-M*(f=p)+t[c],p=M*m-h+l*f;return l=e*o,M=n*r,[l*u-M*p,l*p+M*u]},ms={init:function(){if(void 0===this.es||this.es<=0)throw new Error("incorrect elliptical usage");this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var t=this.es/(1+Math.sqrt(1-this.es)),s=t/(2-t),i=s;this.cgb[0]=s*(2+s*(-2/3+s*(s*(116/45+s*(26/45+s*(-2854/675)))-2))),this.cbg[0]=s*(s*(2/3+s*(4/3+s*(-82/45+s*(32/45+s*(4642/4725)))))-2),i*=s,this.cgb[1]=i*(7/3+s*(s*(-227/45+s*(2704/315+s*(2323/945)))-1.6)),this.cbg[1]=i*(5/3+s*(-16/15+s*(-13/9+s*(904/315+s*(-1522/945))))),i*=s,this.cgb[2]=i*(56/15+s*(-136/35+s*(-1262/105+s*(73814/2835)))),this.cbg[2]=i*(-26/15+s*(34/21+s*(1.6+s*(-12686/2835)))),i*=s,this.cgb[3]=i*(4279/630+s*(-332/35+s*(-399572/14175))),this.cbg[3]=i*(1237/630+s*(s*(-24832/14175)-2.4)),i*=s,this.cgb[4]=i*(4174/315+s*(-144838/6237)),this.cbg[4]=i*(-734/315+s*(109598/31185)),i*=s,this.cgb[5]=i*(601676/22275),this.cbg[5]=i*(444337/155925),i=Math.pow(s,2),this.Qn=this.k0/(1+s)*(1+i*(.25+i*(1/64+i/256))),this.utg[0]=s*(s*(2/3+s*(-37/96+s*(1/360+s*(81/512+s*(-96199/604800)))))-.5),this.gtu[0]=s*(.5+s*(-2/3+s*(5/16+s*(41/180+s*(-127/288+s*(7891/37800)))))),this.utg[1]=i*(-1/48+s*(-1/15+s*(437/1440+s*(-46/105+s*(1118711/3870720))))),this.gtu[1]=i*(13/48+s*(s*(557/1440+s*(281/630+s*(-1983433/1935360)))-.6)),i*=s,this.utg[2]=i*(-17/480+s*(37/840+s*(209/4480+s*(-5569/90720)))),this.gtu[2]=i*(61/240+s*(-103/140+s*(15061/26880+s*(167603/181440)))),i*=s,this.utg[3]=i*(-4397/161280+s*(11/504+s*(830251/7257600))),this.gtu[3]=i*(49561/161280+s*(-179/168+s*(6601661/7257600))),i*=s,this.utg[4]=i*(-4583/161280+s*(108847/3991680)),this.gtu[4]=i*(34729/80640+s*(-3418889/1995840)),i*=s,this.utg[5]=-.03233083094085698*i,this.gtu[5]=.6650675310896665*i;var a=Ms(this.cbg,this.lat0);this.Zb=-this.Qn*(a+cs(this.gtu,2*a))},forward:function(t){var s=qt(t.x-this.long0),i=t.y;i=Ms(this.cbg,i);var a=Math.sin(i),h=Math.cos(i),e=Math.sin(s),n=Math.cos(s);i=Math.atan2(a,n*h),s=Math.atan2(e*h,rs(a,h*n)),s=ls(Math.tan(s));var r=fs(this.gtu,2*i,2*s);i+=r[0],s+=r[1];var o,l;return Math.abs(s)<=2.623395162778?(o=this.a*(this.Qn*s)+this.x0,l=this.a*(this.Qn*i+this.Zb)+this.y0):(o=1/0,l=1/0),t.x=o,t.y=l,t},inverse:function(t){var s=(t.x-this.x0)*(1/this.a),i=(t.y-this.y0)*(1/this.a);i=(i-this.Zb)/this.Qn,s/=this.Qn;var a,h;if(Math.abs(s)<=2.623395162778){var e=fs(this.utg,2*i,2*s);i+=e[0],s+=e[1],s=Math.atan(ns(s));var n=Math.sin(i),r=Math.cos(i),o=Math.sin(s),l=Math.cos(s);i=Math.atan2(n*l,rs(o,l*r)),s=Math.atan2(o,l*r),a=qt(s+this.long0),h=Ms(this.cgb,i)}else a=1/0,h=1/0;return t.x=a,t.y=h,t},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc"]},ps=function(t,s){if(void 0===t){if((t=Math.floor(30*(qt(s)+Math.PI)/Math.PI)+1)<0)return 0;if(t>60)return 60}return t},ds={init:function(){var t=ps(this.zone,this.long0);if(void 0===t)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*lt,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,ms.init.apply(this),this.forward=ms.forward,this.inverse=ms.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"},ys=function(t,s){return Math.pow((1-t)/(1+t),s)},_s=20,xs={init:function(){var t=Math.sin(this.lat0),s=Math.cos(this.lat0);s*=s,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*s*s/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+ct)/(Math.pow(Math.tan(.5*this.lat0+ct),this.C)*ys(this.e*t,this.ratexp))},forward:function(t){var s=t.x,i=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*i+ct),this.C)*ys(this.e*Math.sin(i),this.ratexp))-ht,t.x=this.C*s,t},inverse:function(t){for(var s=t.x/this.C,i=t.y,a=Math.pow(Math.tan(.5*i+ct)/this.K,1/this.C),h=_s;h>0&&(i=2*Math.atan(a*ys(this.e*Math.sin(t.y),-.5*this.e))-ht,!(Math.abs(i-t.y)<1e-14));--h)t.y=i;return h?(t.x=s,t.y=i,t):null},names:["gauss"]},vs={init:function(){xs.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))},forward:function(t){var s,i,a,h;return t.x=qt(t.x-this.long0),xs.forward.apply(this,[t]),s=Math.sin(t.y),i=Math.cos(t.y),a=Math.cos(t.x),h=this.k0*this.R2/(1+this.sinc0*s+this.cosc0*i*a),t.x=h*i*Math.sin(t.x),t.y=h*(this.cosc0*s-this.sinc0*i*a),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){var s,i,a,h,e;if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,e=Math.sqrt(t.x*t.x+t.y*t.y)){var n=2*Math.atan2(e,this.R2);s=Math.sin(n),i=Math.cos(n),h=Math.asin(i*this.sinc0+t.y*s*this.cosc0/e),a=Math.atan2(t.x*s,e*this.cosc0*i-t.y*this.sinc0*s)}else h=this.phic0,a=0;return t.x=a,t.y=h,xs.inverse.apply(this,[t]),t.x=qt(t.x+this.long0),t},names:["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","
316sterea","Oblique Stereographic Alternative","Double_Stereographic"]},gs={init:function(){this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=ot&&(this.k0=.5*(1+kt(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=ot&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=ot&&(this.k0=.5*this.cons*St(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/It(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=St(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-ht,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(t){var s,i,a,h,e,n,r=t.x,o=t.y,l=Math.sin(o),M=Math.cos(o),c=qt(r-this.long0);return Math.abs(Math.abs(r-this.long0)-Math.PI)<=ot&&Math.abs(o+this.lat0)<=ot?(t.x=NaN,t.y=NaN,t):this.sphere?(s=2*this.k0/(1+this.sinlat0*l+this.coslat0*M*Math.cos(c)),t.x=this.a*s*M*Math.sin(c)+this.x0,t.y=this.a*s*(this.coslat0*l-this.sinlat0*M*Math.cos(c))+this.y0,t):(i=2*Math.atan(this.ssfn_(o,l,this.e))-ht,h=Math.cos(i),a=Math.sin(i),Math.abs(this.coslat0)<=ot?(e=It(this.e,o*this.con,this.con*l),n=2*this.a*this.k0*e/this.cons,t.x=this.x0+n*Math.sin(r-this.long0),t.y=this.y0-this.con*n*Math.cos(r-this.long0),t):(Math.abs(this.sinlat0)<ot?(s=2*this.a*this.k0/(1+h*Math.cos(c)),t.y=s*a):(s=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*a+this.cosX0*h*Math.cos(c))),t.y=s*(this.cosX0*a-this.sinX0*h*Math.cos(c))+this.y0),t.x=s*h*Math.sin(c)+this.x0,t))},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var s,i,a,h,e,n=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var r=2*Math.atan(n/(2*this.a*this.k0));return s=this.long0,i=this.lat0,n<=ot?(t.x=s,t.y=i,t):(i=Math.asin(Math.cos(r)*this.sinlat0+t.y*Math.sin(r)*this.coslat0/n),s=qt(Math.abs(this.coslat0)<ot?this.lat0>0?this.long0+Math.atan2(t.x,-1*t.y):this.long0+Math.atan2(t.x,t.y):this.long0+Math.atan2(t.x*Math.sin(r),n*this.coslat0*Math.cos(r)-t.y*this.sinlat0*Math.sin(r))),t.x=s,t.y=i,t)}if(Math.abs(this.coslat0)<=ot){if(n<=ot)return i=this.lat0,s=this.long0,t.x=s,t.y=i,t;t.x*=this.con,t.y*=this.con,a=n*this.cons/(2*this.a*this.k0),i=this.con*Ot(this.e,a),s=this.con*qt(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else h=2*Math.atan(n*this.cosX0/(2*this.a*this.k0*this.ms1)),s=this.long0,n<=ot?e=this.X0:(e=Math.asin(Math.cos(h)*this.sinX0+t.y*Math.sin(h)*this.cosX0/n),s=qt(this.long0+Math.atan2(t.x*Math.sin(h),n*this.cosX0*Math.cos(h)-t.y*this.sinX0*Math.sin(h)))),i=-1*Ot(this.e,Math.tan(.5*(ht+e)));return t.x=s,t.y=i,t},names:["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"],ssfn_:function(t,s,i){return s*=i,Math.tan(.5*(ht+t))*Math.pow((1-s)/(1+s),.5*i)}},bs={init:function(){var t=this.lat0;this.lambda0=this.long0;var s=Math.sin(t),i=this.a,a=1/this.rf,h=2*a-Math.pow(a,2),e=this.e=Math.sqrt(h);this.R=this.k0*i*Math.sqrt(1-h)/(1-h*Math.pow(s,2)),this.alpha=Math.sqrt(1+h/(1-h)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(s/this.alpha);var n=Math.log(Math.tan(Math.PI/4+this.b0/2)),r=Math.log(Math.tan(Math.PI/4+t/2)),o=Math.log((1+e*s)/(1-e*s));this.K=n-this.alpha*r+this.alpha*e/2*o},forward:function(t){var s=Math.log(Math.tan(Math.PI/4-t.y/2)),i=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),a=-this.alpha*(s+i)+this.K,h=2*(Math.atan(Math.exp(a))-Math.PI/4),e=this.alpha*(t.x-this.lambda0),n=Math.atan(Math.sin(e)/(Math.sin(this.b0)*Math.tan(h)+Math.cos(this.b0)*Math.cos(e))),r=Math.asin(Math.cos(this.b0)*Math.sin(h)-Math.sin(this.b0)*Math.cos(h)*Math.cos(e));return t.y=this.R/2*Math.log((1+Math.sin(r))/(1-Math.sin(r)))+this.y0,t.x=this.R*n+this.x0,t},inverse:function(t){for(var s=t.x-this.x0,i=t.y-this.y0,a=s/this.R,h=2*(Math.atan(Math.exp(i/this.R))-Math.PI/4),e=Math.asin(Math.cos(this.b0)*Math.sin(h)+Math.sin(this.b0)*Math.cos(h)*Math.cos(a)),n=Math.atan(Math.sin(a)/(Math.cos(this.b0)*Math.cos(a)-Math.sin(this.b0)*Math.tan(h))),r=this.lambda0+n/this.alpha,o=0,l=e,M=-1e3,c=0;Math.abs(l-M)>1e-7;){if(++c>20)return;o=1/this.alpha*(Math.log(Math.tan(Math.PI/4+e/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(l))/2)),M=l,l=2*Math.atan(Math.exp(o))-Math.PI/2}return t.x=r,t.y=l,t},names:["somerc"]},ws={init:function(){this.no_off=this.no_off||!1,this.no_rot=this.no_rot||!1,isNaN(this.k0)&&(this.k0=1);var t=Math.sin(this.lat0),s=Math.cos(this.lat0),i=this.e*t;this.bl=Math.sqrt(1+this.es/(1-this.es)*Math.pow(s,4)),this.al=this.a*this.bl*this.k0*Math.sqrt(1-this.es)/(1-i*i);var a=It(this.e,this.lat0,t),h=this.bl/s*Math.sqrt((1-this.es)/(1-i*i));h*h<1&&(h=1);var e,n;if(isNaN(this.longc)){var r=It(this.e,this.lat1,Math.sin(this.lat1)),o=It(this.e,this.lat2,Math.sin(this.lat2));this.lat0>=0?this.el=(h+Math.sqrt(h*h-1))*Math.pow(a,this.bl):this.el=(h-Math.sqrt(h*h-1))*Math.pow(a,this.bl);var l=Math.pow(r,this.bl),M=Math.pow(o,this.bl);n=.5*((e=this.el/l)-1/e);var c=(this.el*this.el-M*l)/(this.el*this.el+M*l),u=(M-l)/(M+l),f=qt(this.long1-this.long2);this.long0=.5*(this.long1+this.long2)-Math.atan(c*Math.tan(.5*this.bl*f)/u)/this.bl,this.long0=qt(this.long0);var m=qt(this.long1-this.long0);this.gamma0=Math.atan(Math.sin(this.bl*m)/n),this.alpha=Math.asin(h*Math.sin(this.gamma0))}else e=this.lat0>=0?h+Math.sqrt(h*h-1):h-Math.sqrt(h*h-1),this.el=e*Math.pow(a,this.bl),n=.5*(e-1/e),this.gamma0=Math.asin(Math.sin(this.alpha)/h),this.long0=this.longc-Math.asin(n*Math.tan(this.gamma0))/this.bl;this.no_off?this.uc=0:this.lat0>=0?this.uc=this.al/this.bl*Math.atan2(Math.sqrt(h*h-1),Math.cos(this.alpha)):this.uc=-1*this.al/this.bl*Math.atan2(Math.sqrt(h*h-1),Math.cos(this.alpha))},forward:function(t){var s,i,a,h=t.x,e=t.y,n=qt(h-this.long0);if(Math.abs(Math.abs(e)-ht)<=ot)a=e>0?-1:1,i=this.al/this.bl*Math.log(Math.tan(ct+a*this.gamma0*.5)),s=-1*a*ht*this.al/this.bl;else{var r=It(this.e,e,Math.sin(e)),o=this.el/Math.pow(r,this.bl),l=.5*(o-1/o),M=.5*(o+1/o),c=Math.sin(this.bl*n),u=(l*Math.sin(this.gamma0)-c*Math.cos(this.gamma0))/M;i=Math.abs(Math.abs(u)-1)<=ot?Number.POSITIVE_INFINITY:.5*this.al*Math.log((1-u)/(1+u))/this.bl,s=Math.abs(Math.cos(this.bl*n))<=ot?this.al*this.bl*n:this.al*Math.atan2(l*Math.cos(this.gamma0)+c*Math.sin(this.gamma0),Math.cos(this.bl*n))/this.bl}return this.no_rot?(t.x=this.x0+s,t.y=this.y0+i):(s-=this.uc,t.x=this.x0+i*Math.cos(this.alpha)+s*Math.sin(this.alpha),t.y=this.y0+s*Math.cos(this.alpha)-i*Math.sin(this.alpha)),t},inverse:function(t){var s,i;this.no_rot?(i=t.y-this.y0,s=t.x-this.x0):(i=(t.x-this.x0)*Math.cos(this.alpha)-(t.y-this.y0)*Math.sin(this.alpha),s=(t.y-this.y0)*Math.cos(this.alpha)+(t.x-this.x0)*Math.sin(this.alpha),s+=this.uc);var a=Math.exp(-1*this.bl*i/this.al),h=.5*(a-1/a),e=.5*(a+1/a),n=Math.sin(this.bl*s/this.al),r=(n*Math.cos(this.gamma0)+h*Math.sin(this.gamma0))/e,o=Math.pow(this.el/Math.sqrt((1+r)/(1-r)),1/this.bl);return Math.abs(r-1)<ot?(t.x=this.long0,t.y=ht):Math.abs(r+1)<ot?(t.x=this.long0,t.y=-1*ht):(t.y=Ot(this.e,o),t.x=qt(this.long0-Math.atan2(h*Math.cos(this.gamma0)-n*Math.sin(this.gamma0),Math.cos(this.bl*s/this.al))/this.bl)),t},names:["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","omerc"]},As={init:function(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<ot)){var t=this.b/this.a;this.e=Math.sqrt(1-t*t);var s=Math.sin(this.lat1),i=Math.cos(this.lat1),a=St(this.e,s,i),h=It(this.e,this.lat1,s),e=Math.sin(this.lat2),n=Math.cos(this.lat2),r=St(this.e,e,n),o=It(this.e,this.lat2,e),l=It(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>ot?this.ns=Math.log(a/r)/Math.log(h/o):this.ns=s,isNaN(this.ns)&&(this.ns=s),this.f0=a/(this.ns*Math.pow(h,this.ns)),this.rh=this.a*this.f0*Math.pow(l,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(t){var s=t.x,i=t.y;Math.abs(2*Math.abs(i)-Math.PI)<=ot&&(i=kt(i)*(ht-2*ot));var a,h,e=Math.abs(Math.abs(i)-ht);if(e>ot)a=It(this.e,i,Math.sin(i)),h=this.a*this.f0*Math.pow(a,this.ns);else{if((e=i*this.ns)<=0)return null;h=0}var n=this.ns*qt(s-this.long0);return t.x=this.k0*(h*Math.sin(n))+this.x0,t.y=this.k0*(this.rh-h*Math.cos(n))+this.y0,t},inverse:function(t){var s,i,a,h,e,n=(t.x-this.x0)/this.k0,r=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(s=Math.sqrt(n*n+r*r),i=1):(s=-Math.sqrt(n*n+r*r),i=-1);var o=0;if(0!==s&&(o=Math.atan2(i*n,i*r)),0!==s||this.ns>
vendor: 5,490 bytes, line 316
3160){if(i=1/this.ns,a=Math.pow(s/(this.a*this.f0),i),-9999===(h=Ot(this.e,a)))return null}else h=-ht;return e=qt(o/this.ns+this.long0),t.x=e,t.y=h,t},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_2SP","lcc"]},Cs={init:function(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq},forward:function(t){var s,i,a,h,e,n,r,o=t.x,l=t.y,M=qt(o-this.long0);return s=Math.pow((1+this.e*Math.sin(l))/(1-this.e*Math.sin(l)),this.alfa*this.e/2),i=2*(Math.atan(this.k*Math.pow(Math.tan(l/2+this.s45),this.alfa)/s)-this.s45),a=-M*this.alfa,h=Math.asin(Math.cos(this.ad)*Math.sin(i)+Math.sin(this.ad)*Math.cos(i)*Math.cos(a)),e=Math.asin(Math.cos(i)*Math.sin(a)/Math.cos(h)),n=this.n*e,r=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(h/2+this.s45),this.n),t.y=r*Math.cos(n)/1,t.x=r*Math.sin(n)/1,this.czech||(t.y*=-1,t.x*=-1),t},inverse:function(t){var s,i,a,h,e,n,r,o=t.x;t.x=t.y,t.y=o,this.czech||(t.y*=-1,t.x*=-1),e=Math.sqrt(t.x*t.x+t.y*t.y),h=Math.atan2(t.y,t.x)/Math.sin(this.s0),a=2*(Math.atan(Math.pow(this.ro0/e,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),s=Math.asin(Math.cos(this.ad)*Math.sin(a)-Math.sin(this.ad)*Math.cos(a)*Math.cos(h)),i=Math.asin(Math.cos(a)*Math.sin(h)/Math.cos(s)),t.x=this.long0-i/this.alfa,n=s,r=0;var l=0;do{t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(s/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(n))/(1-this.e*Math.sin(n)),this.e/2))-this.s45),Math.abs(n-t.y)<1e-10&&(r=1),n=t.y,l+=1}while(0===r&&l<15);return l>=15?null:t},names:["Krovak","krovak"]},Es=function(t,s,i,a,h){return t*h-s*Math.sin(2*h)+i*Math.sin(4*h)-a*Math.sin(6*h)},Ps=function(t){return 1-.25*t*(1+t/16*(3+1.25*t))},Ns=function(t){return.375*t*(1+.25*t*(1+.46875*t))},Ss=function(t){return.05859375*t*t*(1+.75*t)},ks=function(t){return t*t*t*(35/3072)},qs=function(t,s,i){var a=s*i;return t/Math.sqrt(1-a*a)},Is=function(t){return Math.abs(t)<ht?t:t-kt(t)*Math.PI},Os=function(t,s,i,a,h){var e,n;e=t/s;for(var r=0;r<15;r++)if(n=(t-(s*e-i*Math.sin(2*e)+a*Math.sin(4*e)-h*Math.sin(6*e)))/(s-2*i*Math.cos(2*e)+4*a*Math.cos(4*e)-6*h*Math.cos(6*e)),e+=n,Math.abs(n)<=1e-10)return e;return NaN},Rs={init:function(){this.sphere||(this.e0=Ps(this.es),this.e1=Ns(this.es),this.e2=Ss(this.es),this.e3=ks(this.es),this.ml0=this.a*Es(this.e0,this.e1,this.e2,this.e3,this.lat0))},forward:function(t){var s,i,a=t.x,h=t.y;if(a=qt(a-this.long0),this.sphere)s=this.a*Math.asin(Math.cos(h)*Math.sin(a)),i=this.a*(Math.atan2(Math.tan(h),Math.cos(a))-this.lat0);else{var e=Math.sin(h),n=Math.cos(h),r=qs(this.a,this.e,e),o=Math.tan(h)*Math.tan(h),l=a*Math.cos(h),M=l*l,c=this.es*n*n/(1-this.es);s=r*l*(1-M*o*(1/6-(8-o+8*c)*M/120)),i=this.a*Es(this.e0,this.e1,this.e2,this.e3,h)-this.ml0+r*e/n*M*(.5+(5-o+6*c)*M/24)}return t.x=s+this.x0,t.y=i+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var s,i,a=t.x/this.a,h=t.y/this.a;if(this.sphere){var e=h+this.lat0;s=Math.asin(Math.sin(e)*Math.cos(a)),i=Math.atan2(Math.tan(a),Math.cos(e))}else{var n=this.ml0/this.a+h,r=Os(n,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(r)-ht)<=ot)return t.x=this.long0,t.y=ht,h<0&&(t.y*=-1),t;var o=qs(this.a,this.e,Math.sin(r)),l=o*o*o/this.a/this.a*(1-this.es),M=Math.pow(Math.tan(r),2),c=a*this.a/o,u=c*c;s=r-o*Math.tan(r)/l*c*c*(.5-(1+3*M)*c*c/24),i=c*(1-u*(M/3+(1+3*M)*M*u/15))/Math.cos(r)}return t.x=qt(i+this.long0),t.y=Is(s),t},names:["Cassini","Cassini_Soldner","cass"]},Gs=function(t,s){var i;return t>1e-7?(i=t*s,(1-t*t)*(s/(1-i*i)-.5/t*Math.log((1-i)/(1+i)))):2*s},Ts=.3333333333333333,js=.17222222222222222,zs=.10257936507936508,Ls=.06388888888888888,Ds=.0664021164021164,Bs=.016415012942191543,Us={init:function(){var t=Math.abs(this.lat0);if(Math.abs(t-ht)<ot?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(t)<ot?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0){var s;switch(this.qp=Gs(this.e,1),this.mmf=.5/(1-this.es),this.apa=X(this.es),this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),s=Math.sin(this.lat0),this.sinb1=Gs(this.e,s)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*s*s)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))},forward:function(t){var s,i,a,h,e,n,r,o,l,M,c=t.x,u=t.y;if(c=qt(c-this.long0),this.sphere){if(e=Math.sin(u),M=Math.cos(u),a=Math.cos(c),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((i=this.mode===this.EQUIT?1+M
vendor: 13,828 bytes, line 316
316*a:1+this.sinph0*e+this.cosph0*M*a)<=ot)return null;s=(i=Math.sqrt(2/i))*M*Math.sin(c),i*=this.mode===this.EQUIT?e:this.cosph0*e-this.sinph0*M*a}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(a=-a),Math.abs(u+this.phi0)<ot)return null;i=ct-.5*u,s=(i=2*(this.mode===this.S_POLE?Math.cos(i):Math.sin(i)))*Math.sin(c),i*=a}}else{switch(r=0,o=0,l=0,a=Math.cos(c),h=Math.sin(c),e=Math.sin(u),n=Gs(this.e,e),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(r=n/this.qp,o=Math.sqrt(1-r*r)),this.mode){case this.OBLIQ:l=1+this.sinb1*r+this.cosb1*o*a;break;case this.EQUIT:l=1+o*a;break;case this.N_POLE:l=ht+u,n=this.qp-n;break;case this.S_POLE:l=u-ht,n=this.qp+n}if(Math.abs(l)<ot)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:l=Math.sqrt(2/l),i=this.mode===this.OBLIQ?this.ymf*l*(this.cosb1*r-this.sinb1*o*a):(l=Math.sqrt(2/(1+o*a)))*r*this.ymf,s=this.xmf*l*o*h;break;case this.N_POLE:case this.S_POLE:n>=0?(s=(l=Math.sqrt(n))*h,i=a*(this.mode===this.S_POLE?l:-l)):s=i=0}}return t.x=this.a*s+this.x0,t.y=this.a*i+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var s,i,a,h,e,n,r,o=t.x/this.a,l=t.y/this.a;if(this.sphere){var M,c=0,u=0;if(M=Math.sqrt(o*o+l*l),(i=.5*M)>1)return null;switch(i=2*Math.asin(i),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(u=Math.sin(i),c=Math.cos(i)),this.mode){case this.EQUIT:i=Math.abs(M)<=ot?0:Math.asin(l*u/M),o*=u,l=c*M;break;case this.OBLIQ:i=Math.abs(M)<=ot?this.phi0:Math.asin(c*this.sinph0+l*u*this.cosph0/M),o*=u*this.cosph0,l=(c-Math.sin(i)*this.sinph0)*M;break;case this.N_POLE:l=-l,i=ht-i;break;case this.S_POLE:i-=ht}s=0!==l||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(o,l):0}else{if(r=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(o/=this.dd,l*=this.dd,(n=Math.sqrt(o*o+l*l))<ot)return t.x=0,t.y=this.phi0,t;h=2*Math.asin(.5*n/this.rq),a=Math.cos(h),o*=h=Math.sin(h),this.mode===this.OBLIQ?(r=a*this.sinb1+l*h*this.cosb1/n,e=this.qp*r,l=n*this.cosb1*a-l*this.sinb1*h):(r=l*h/n,e=this.qp*r,l=n*a)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(l=-l),!(e=o*o+l*l))return t.x=0,t.y=this.phi0,t;r=1-e/this.qp,this.mode===this.S_POLE&&(r=-r)}s=Math.atan2(o,l),i=J(Math.asin(r),this.apa)}return t.x=qt(this.long0+s),t.y=i,t},names:["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4},Fs=function(t){return Math.abs(t)>1&&(t=t>1?1:-1),Math.asin(t)},Qs={init:function(){Math.abs(this.lat1+this.lat2)<ot||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=St(this.e3,this.sin_po,this.cos_po),this.qs1=Gs(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=St(this.e3,this.sin_po,this.cos_po),this.qs2=Gs(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=Gs(this.e3,this.sin_po,this.cos_po),Math.abs(this.lat1-this.lat2)>ot?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)},forward:function(t){var s=t.x,i=t.y;this.sin_phi=Math.sin(i),this.cos_phi=Math.cos(i);var a=Gs(this.e3,this.sin_phi,this.cos_phi),h=this.a*Math.sqrt(this.c-this.ns0*a)/this.ns0,e=this.ns0*qt(s-this.long0),n=h*Math.sin(e)+this.x0,r=this.rh-h*Math.cos(e)+this.y0;return t.x=n,t.y=r,t},inverse:function(t){var s,i,a,h,e,n;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(s=Math.sqrt(t.x*t.x+t.y*t.y),a=1):(s=-Math.sqrt(t.x*t.x+t.y*t.y),a=-1),h=0,0!==s&&(h=Math.atan2(a*t.x,a*t.y)),a=s*this.ns0/this.a,this.sphere?n=Math.asin((this.c-a*a)/(2*this.ns0)):(i=(this.c-a*a)/this.ns0,n=this.phi1z(this.e3,i)),e=qt(h/this.ns0+this.long0),t.x=e,t.y=n,t},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(t,s){var i,a,h,e,n,r=Fs(.5*s);if(t<ot)return r;for(var o=t*t,l=1;l<=25;l++)if(i=Math.sin(r),a=Math.cos(r),h=t*i,e=1-h*h,n=.5*e*e/a*(s/(1-o)-i/e+.5/t*Math.log((1-h)/(1+h))),r+=n,Math.abs(n)<=1e-7)return r;return null}},Ws={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1},forward:function(t){var s,i,a,h,e,n,r,o=t.x,l=t.y;return a=qt(o-this.long0),s=Math.sin(l),i=Math.cos(l),h=Math.cos(a),(e=this.sin_p14*s+this.cos_p14*i*h)>0||Math.abs(e)<=ot?(n=this.x0+1*this.a*i*Math.sin(a)/e,r=this.y0+1*this.a*(this.cos_p14*s-this.sin_p14*i*h)/e):(n=this.x0+this.infinity_dist*i*Math.sin(a),r=this.y0+this.infinity_dist*(this.cos_p14*s-this.sin_p14*i*h)),t.x=n,t.y=r,t},inverse:function(t){var s,i,a,h,e,n;return t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,(s=Math.sqrt(t.x*t.x+t.y*t.y))?(h=Math.atan2(s,this.rc),i=Math.sin(h),a=Math.cos(h),n=Fs(a*this.sin_p14+t.y*i*this.cos_p14/s),e=Math.atan2(t.x*i,s*this.cos_p14*a-t.y*this.sin_p14*i),e=qt(this.long0+e)):(n=this.phic0,e=0),t.x=e,t.y=n,t},names:["gnom"]},Hs=function(t,s){var i=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(s)-i)<1e-6)return s<0?-1*ht:ht;for(var a,h,e,n,r=Math.asin(.5*s),o=0;o<30;o++)if(h=Math.sin(r),e=Math.cos(r),n=t*h,a=Math.pow(1-n*n,2)/(2*e)*(s/(1-t*t)-h/(1-n*n)+.5/t*Math.log((1-n)/(1+n))),r+=a,Math.abs(a)<=1e-10)return r;return NaN},Ks={init:function(){this.sphere||(this.k0=St(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(t){var s,i,a=t.x,h=t.y,e=qt(a-this.long0);if(this.sphere)s=this.x0+this.a*e*Math.cos(this.lat_ts),i=this.y0+this.a*Math.sin(h)/Math.cos(this.lat_ts);else{var n=Gs(this.e,Math.sin(h));s=this.x0+this.a*this.k0*e,i=this.y0+this.a*n*.5/this.k0}return t.x=s,t.y=i,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var s,i;return this.sphere?(s=qt(this.long0+t.x/this.a/Math.cos(this.lat_ts)),i=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(i=Hs(this.e,2*t.y*this.k0/this.a),s=qt(this.long0+t.x/(this.a*this.k0))),t.x=s,t.y=i,t},names:["cea"]},Xs={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)},forward:function(t){var s=t.x,i=t.y,a=qt(s-this.long0),h=Is(i-this.lat0);return t.x=this.x0+this.a*a*this.rc,t.y=this.y0+this.a*h,t},inverse:function(t){var s=t.x,i=t.y;return t.x=qt(this.long0+(s-this.x0)/(this.a*this.rc)),t.y=Is(this.lat0+(i-this.y0)/this.a),t},names:["Equirectangular","Equidistant_Cylindrical","eqc"]},Js=20,Vs={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Ps(this.es),this.e1=Ns(this.es),this.e2=Ss(this.es),this.e3=ks(this.es),this.ml0=this.a*Es(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(t){var s,i,a,h=t.x,e=t.y,n=qt(h-this.long0);if(a=n*Math.sin(e),this.sphere)Math.abs(e)<=ot?(s=this.a*n,i=-1*this.a*this.lat0):(s=this.a*Math.sin(a)/Math.tan(e),i=this.a*(Is(e-this.lat0)+(1-Math.cos(a))/Math.tan(e)));else if(Math.abs(e)<=ot)s=this.a*n,i=-1*this.ml0;else{var r=qs(this.a,this.e,Math.sin(e))/Math.tan(e);s=r*Math.sin(a),i=this.a*Es(this.e0,this.e1,this.e2,this.e3,e)-this.ml0+r*(1-Math.cos(a))}return t.x=s+this.x0,t.y=i+this.y0,t},inverse:function(t){var s,i,a,h,e,n,r,o,l;if(a=t.x-this.x0,h=t.y-this.y0,this.sphere)if(Math.abs(h+this.a*this.lat0)<=ot)s=qt(a/this.a+this.long0),i=0;else{n=this.lat0+h/this.a,r=a*a/this.a/this.a+n*n,o=n;var M;for(e=Js;e;--e)if(M=Math.tan(o),l=-1*(n*(o*M+1)-o-.5*(o*o+r)*M)/((o-n)/M-1),o+=l,Math.abs(l)<=ot){i=o;break}s=qt(this.long0+Math.asin(a*Math.tan(o)/this.a)/Math.sin(i))}else if(Math.abs(h+this.ml0)<=ot)i=0,s=qt(this.long0+a/this.a);else{n=(this.ml0+h)/this.a,r=a*a/this.a/this.a+n*n,o=n;var c,u,f,m,p;for(e=Js;e;--e)if(p=this.e*Math.sin(o),c=Math.sqrt(1-p*p)*Math.tan(o),u=this.a*Es(this.e0,this.e1,this.e2,this.e3,o),f=this.e0-2*this.e1*Math.cos(2*o)+4*this.e2*Math.cos(4*o)-6*this.e3*Math.cos(6*o),m=u/this.a,l=(n*(c*m+1)-m-.5*c*(m*m+r))/(this.es*Math.sin(2*o)*(m*m+r-2*n*m)/(4*c)+(n-m)*(c*f-2/Math.sin(2*o))-f),o-=l,Math.abs(l)<=ot){i=o;break}c=Math.sqrt(1-this.es*Math.pow(Math.sin(i),2))*Math.tan(i),s=qt(this.long0+Math.asin(a*c/this.a)/Math.sin(i))}return t.x=s,t.y=i,t},names:["Polyconic","poly"]},Zs={init:function(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013},forward:function(t){var s,i=t.x,a=t.y-this.lat0,h=i-this.long0,e=a/at*1e-5,n=h,r=1,o=0;for(s=1;s<=10;s++)r*=e,o+=this.A[s]*r;var l,M=o,c=n,u=1,f=0,m=0,p=0;for(s=1;s<=6;s++)l=f*M+u*c,u=u*M-f*c,f=l,m=m+this.B_re[s]*u-this.B_im[s]*f,p=p+this.B_im[s]*u+this.B_re[s]*f;return t.x=p*this.a+this.x0,t.y=m*this.a+this.y0,t},inverse:function(t){var s,i,a=t.x,h=t.y,e=a-this.x0,n=(h-this.y0)/this.a,r=e/this.a,o=1,l=0,M=0,c=0;for(s=1;s<=6;s++)i=l*n+o*r,o=o*n-l*r,l=i,M=M+this.C_re[s]*o-this.C_im[s]*l,c=c+this.C_im[s]*o+this.C_re[s]*l;for(var u=0;u<this.iterations;u++){var f,m=M,p=c,d=n,y=r;for(s=2;s<=6;s++)f=p*M+m*c,m=m*M-p*c,p=f,d+=(s-1)*(this.B_re[s]*m-this.B_im[s]*p),y+=(s-1)*(this.B_im[s]*m+this.B_re[s]*p);m=1,p=0;var _=this.B_re[1],x=this.B_im[1];for(s=2;s<=6;s++)f=p*M+m*c,m=m*M-p*c,p=f,_+=s*(this.B_re[s]*m-this.B_im[s]*p),x+=s*(this.B_im[s]*m+this.B_re[s]*p);var v=_*_+x*x;M=(d*_+y*x)/v,c=(y*_-d*x)/v}var g=M,b=c,w=1,A=0;for(s=1;s<=9;s++)w*=g,A+=this.D[s]*w;var C=this.lat0+A*at*1e5,E=this.long0+b;return t.x=E,t.y=C,t},names:["New_Zealand_Map_Grid","nzmg"]},Ys={init:function(){},forward:function(t){var s=t.x,i=t.y,a=qt(s-this.long0),h=this.x0+this.a*a,e=this.y0+this.a*Math.log(Math.tan(Math.PI/4+i/2.5))*1.25;return t.x=h,t.y=e,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var s=qt(this.long0+t.x/this.a),i=2.5*(Math.atan(Math.exp(.8*t.y/this.a))-Math.PI/4);return t.x=s,t.y=i,t},names:["Miller_Cylindrical","mill"]},$s=20,ti={init:function(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=is(this.es)},forward:function(t){var s,i,a=t.x,h=t.y;if(a=qt(a-this.long0),this.sphere){if(this.m)for(var e=this.n*Math.sin(h),n=$s;n;--n){var r=(this.m*h+Math.sin(h)-e)/(this.m+Math.cos(h));if(h-=r,Math.abs(r)<ot)break}else h=1!==this.n?Math.asin(this.n*Math.sin(h)):h;s=this.a*this.C_x*a*(this.m+Math.cos(h)),i=this.a*this.C_y*h}else{var o=Math.sin(h),l=Math.cos(h);i=this.a*as(h,o,l,this.en),s=this.a*a*l/Math.sqrt(1-this.es*o*o)}return t.x=s,t.y=i,t},inverse:function(t){var s,i,a,h;return t.x-=this.x0,a=t.x/this.a,t.y-=this.y0,s=t.y/this.a,this.sphere?(s/=this.C_y,a/=this.C_x*(this.m+Math.cos(s)),this.m?s=Fs((this.m*s+Math.sin(s))/this.n):1!==this.n&&(s=Fs(Math.sin(s)/this.n)),a=qt(a+this.long0),s=Is(s)):(s=hs(t.y/this.a,this.es,this.en),(h=Math.abs(s))<ht?(h=Math.sin(s),i=this.long0+t.x*Math.sqrt(1-this.es*h*h)/(this.a*Math.cos(s)),a=qt(i)):h-ot<ht&&(a=this.long0)),t.x=a,t.y=s,t},names:["Sinusoidal","sinu"]},si={init:function(){},forward:function(t){for(var s=t.x,i=t.y,a=qt(s-this.long0),h=i,e=Math.PI*Math.sin(i);;){var n=-(h+Math.sin(h)-e)/(1+Math.cos(h));if(h+=n,Math.abs(n)<ot)break}h/=2,Math.PI/2-Math.abs(i)<ot&&(a=0);var r=.900316316158*this.a*a*Math.cos(h)+this.x0,o=1.4142135623731*this.a*Math.sin(h)+this.y0;return t.x=r,t.y=o,t},inverse:function(t){var s,i;t.x-=this.x0,t.y-=this.y0,i=t.y/(1.4142135623731*this.a),Math.abs(i)>.999999999999&&(i=.999999999999),s=Math.asin(i);var a=qt(this.long0+t.x/(.900316316158*this.a*Math.cos(s)));a<-Math.PI&&(a=-Math.PI),a>Math.PI&&(a=Math.PI),i=(2*s+Math.sin(2*s))/Math.PI,Math.abs(i)>1&&(i=1);var h=Math.asin(i);return t.x=a,t.y=h,t},names:["Mollweide","moll"]},ii={init:function(){Math.abs(this.lat1+this.lat2)<ot||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Ps(this.es),this.e1=Ns(this.es),this.e2=Ss(this.es),this.e3=ks(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=St(this.e,this.sinphi,this.cosphi),this.ml1=Es(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<ot?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=St(this.e,this.sinphi,this.cosphi),this.ml2=Es(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=Es(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))},forward:function(t){var s,i=t.x,a=t.y;if(this.sphere)s=this.a*(this.g-a);else{var h=Es(this.e0,this.e1,this.e2,this.e3,a);s=this.a*(this.g-h)}var e=this.ns*qt(i-this.long0),n=this.x0+s*Math.sin(e),r=this.y0+this.rh-s*Math.cos(e);return t.x=n,t.y=r,t},inverse:function(t){t.x-=this.x0,t.y=this.rh-t.y+this.y0;var s,i,a,h;this.ns>=0?(i=Math.sqrt(t.x*t.x+t.y*t.y),s=1):(i=-Math.sqrt(t.x*t.x+t.y*t.y),s=-1);var e=0;
vendor: 9,514 bytes, line 316
316if(0!==i&&(e=Math.atan2(s*t.x,s*t.y)),this.sphere)return h=qt(this.long0+e/this.ns),a=Is(this.g-i/this.a),t.x=h,t.y=a,t;var n=this.g-i/this.a;return a=Os(n,this.e0,this.e1,this.e2,this.e3),h=qt(this.long0+e/this.ns),t.x=h,t.y=a,t},names:["Equidistant_Conic","eqdc"]},ai={init:function(){this.R=this.a},forward:function(t){var s,i,a=t.x,h=t.y,e=qt(a-this.long0);Math.abs(h)<=ot&&(s=this.x0+this.R*e,i=this.y0);var n=Fs(2*Math.abs(h/Math.PI));(Math.abs(e)<=ot||Math.abs(Math.abs(h)-ht)<=ot)&&(s=this.x0,i=h>=0?this.y0+Math.PI*this.R*Math.tan(.5*n):this.y0+Math.PI*this.R*-Math.tan(.5*n));var r=.5*Math.abs(Math.PI/e-e/Math.PI),o=r*r,l=Math.sin(n),M=Math.cos(n),c=M/(l+M-1),u=c*c,f=c*(2/l-1),m=f*f,p=Math.PI*this.R*(r*(c-m)+Math.sqrt(o*(c-m)*(c-m)-(m+o)*(u-m)))/(m+o);e<0&&(p=-p),s=this.x0+p;var d=o+c;return p=Math.PI*this.R*(f*d-r*Math.sqrt((m+o)*(o+1)-d*d))/(m+o),i=h>=0?this.y0+p:this.y0-p,t.x=s,t.y=i,t},inverse:function(t){var s,i,a,h,e,n,r,o,l,M,c,u,f;return t.x-=this.x0,t.y-=this.y0,c=Math.PI*this.R,a=t.x/c,h=t.y/c,e=a*a+h*h,n=-Math.abs(h)*(1+e),r=n-2*h*h+a*a,o=-2*n+1+2*h*h+e*e,f=h*h/o+(2*r*r*r/o/o/o-9*n*r/o/o)/27,l=(n-r*r/3/o)/o,M=2*Math.sqrt(-l/3),c=3*f/l/M,Math.abs(c)>1&&(c=c>=0?1:-1),u=Math.acos(c)/3,i=t.y>=0?(-M*Math.cos(u+Math.PI/3)-r/3/o)*Math.PI:-(-M*Math.cos(u+Math.PI/3)-r/3/o)*Math.PI,s=Math.abs(a)<ot?this.long0:qt(this.long0+Math.PI*(e-1+Math.sqrt(1+2*(a*a-h*h)+e*e))/2/a),t.x=s,t.y=i,t},names:["Van_der_Grinten_I","VanDerGrinten","vandg"]},hi={init:function(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)},forward:function(t){var s,i,a,h,e,n,r,o,l,M,c,u,f,m,p,d,y,_,x,v,g,b,w,A=t.x,C=t.y,E=Math.sin(t.y),P=Math.cos(t.y),N=qt(A-this.long0);return this.sphere?Math.abs(this.sin_p12-1)<=ot?(t.x=this.x0+this.a*(ht-C)*Math.sin(N),t.y=this.y0-this.a*(ht-C)*Math.cos(N),t):Math.abs(this.sin_p12+1)<=ot?(t.x=this.x0+this.a*(ht+C)*Math.sin(N),t.y=this.y0+this.a*(ht+C)*Math.cos(N),t):(_=this.sin_p12*E+this.cos_p12*P*Math.cos(N),d=Math.acos(_),y=d/Math.sin(d),t.x=this.x0+this.a*y*P*Math.sin(N),t.y=this.y0+this.a*y*(this.cos_p12*E-this.sin_p12*P*Math.cos(N)),t):(s=Ps(this.es),i=Ns(this.es),a=Ss(this.es),h=ks(this.es),Math.abs(this.sin_p12-1)<=ot?(e=this.a*Es(s,i,a,h,ht),n=this.a*Es(s,i,a,h,C),t.x=this.x0+(e-n)*Math.sin(N),t.y=this.y0-(e-n)*Math.cos(N),t):Math.abs(this.sin_p12+1)<=ot?(e=this.a*Es(s,i,a,h,ht),n=this.a*Es(s,i,a,h,C),t.x=this.x0+(e+n)*Math.sin(N),t.y=this.y0+(e+n)*Math.cos(N),t):(r=E/P,o=qs(this.a,this.e,this.sin_p12),l=qs(this.a,this.e,E),M=Math.atan((1-this.es)*r+this.es*o*this.sin_p12/(l*P)),c=Math.atan2(Math.sin(N),this.cos_p12*Math.tan(M)-this.sin_p12*Math.cos(N)),x=0===c?Math.asin(this.cos_p12*Math.sin(M)-this.sin_p12*Math.cos(M)):Math.abs(Math.abs(c)-Math.PI)<=ot?-Math.asin(this.cos_p12*Math.sin(M)-this.sin_p12*Math.cos(M)):Math.asin(Math.sin(N)*Math.cos(M)/Math.sin(c)),u=this.e*this.sin_p12/Math.sqrt(1-this.es),f=this.e*this.cos_p12*Math.cos(c)/Math.sqrt(1-this.es),m=u*f,p=f*f,v=x*x,g=v*x,b=g*x,w=b*x,d=o*x*(1-v*p*(1-p)/6+g/8*m*(1-2*p)+b/120*(p*(4-7*p)-3*u*u*(1-7*p))-w/48*m),t.x=this.x0+d*Math.sin(c),t.y=this.y0+d*Math.cos(c),t))},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var s,i,a,h,e,n,r,o,l,M,c,u,f,m,p,d,y,_,x,v,g,b,w;if(this.sphere){if((s=Math.sqrt(t.x*t.x+t.y*t.y))>2*ht*this.a)return;return i=s/this.a,a=Math.sin(i),h=Math.cos(i),e=this.long0,Math.abs(s)<=ot?n=this.lat0:(n=Fs(h*this.sin_p12+t.y*a*this.cos_p12/s),r=Math.abs(this.lat0)-ht,e=qt(Math.abs(r)<=ot?this.lat0>=0?this.long0+Math.atan2(t.x,-t.y):this.long0-Math.atan2(-t.x,t.y):this.long0+Math.atan2(t.x*a,s*this.cos_p12*h-t.y*this.sin_p12*a))),t.x=e,t.y=n,t}return o=Ps(this.es),l=Ns(this.es),M=Ss(this.es),c=ks(this.es),Math.abs(this.sin_p12-1)<=ot?(u=this.a*Es(o,l,M,c,ht),s=Math.sqrt(t.x*t.x+t.y*t.y),f=u-s,n=Os(f/this.a,o,l,M,c),e=qt(this.long0+Math.atan2(t.x,-1*t.y)),t.x=e,t.y=n,t):Math.abs(this.sin_p12+1)<=ot?(u=this.a*Es(o,l,M,c,ht),s=Math.sqrt(t.x*t.x+t.y*t.y),f=s-u,n=Os(f/this.a,o,l,M,c),e=qt(this.long0+Math.atan2(t.x,t.y)),t.x=e,t.y=n,t):(s=Math.sqrt(t.x*t.x+t.y*t.y),d=Math.atan2(t.x,t.y),m=qs(this.a,this.e,this.sin_p12),y=Math.cos(d),_=this.e*this.cos_p12*y,x=-_*_/(1-this.es),v=3*this.es*(1-x)*this.sin_p12*this.cos_p12*y/(1-this.es),g=s/m,b=g-x*(1+x)*Math.pow(g,3)/6-v*(1+3*x)*Math.pow(g,4)/24,w=1-x*b*b/2-g*b*b*b/6,p=Math.asin(this.sin_p12*Math.cos(b)+this.cos_p12*Math.sin(b)*y),e=qt(this.long0+Math.asin(Math.sin(d)*Math.sin(b)/Math.cos(p))),n=Math.atan((1-this.es*w*this.sin_p12/Math.sin(p))*Math.tan(p)/(1-this.es)),t.x=e,t.y=n,t)},names:["Azimuthal_Equidistant","aeqd"]},ei={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(t){var s,i,a,h,e,n,r,o=t.x,l=t.y;return a=qt(o-this.long0),s=Math.sin(l),i=Math.cos(l),h=Math.cos(a),((e=this.sin_p14*s+this.cos_p14*i*h)>0||Math.abs(e)<=ot)&&(n=1*this.a*i*Math.sin(a),r=this.y0+1*this.a*(this.cos_p14*s-this.sin_p14*i*h)),t.x=n,t.y=r,t},inverse:function(t){var s,i,a,h,e,n,r;return t.x-=this.x0,t.y-=this.y0,s=Math.sqrt(t.x*t.x+t.y*t.y),i=Fs(s/this.a),a=Math.sin(i),h=Math.cos(i),n=this.long0,Math.abs(s)<=ot?(r=this.lat0,t.x=n,t.y=r,t):(r=Fs(h*this.sin_p14+t.y*a*this.cos_p14/s),e=Math.abs(this.lat0)-ht,Math.abs(e)<=ot?(n=qt(this.lat0>=0?this.long0+Math.atan2(t.x,-t.y):this.long0-Math.atan2(-t.x,t.y)),t.x=n,t.y=r,t):(n=qt(this.long0+Math.atan2(t.x*a,s*this.cos_p14*h-t.y*this.sin_p14*a)),t.x=n,t.y=r,t))},names:["ortho"]},ni={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},ri={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4},oi={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=ht-ct/2?this.face=ni.TOP:this.lat0<=-(ht-ct/2)?this.face=ni.BOTTOM:Math.abs(this.long0)<=ct?this.face=ni.FRONT:Math.abs(this.long0)<=ht+ct?this.face=this.long0>0?ni.RIGHT:ni.LEFT:this.face=ni.BACK,0!==this.es&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)},forward:function(t){var s,i,a,h,e,n,r={x:0,y:0},o={value:0};if(t.x-=this.long0,s=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(t.y)):t.y,i=t.x,this.face===ni.TOP)h=ht-s,i>=ct&&i<=ht+ct?(o.value=ri.AREA_0,a=i-ht):i>ht+ct||i<=-(ht+ct)?(o.value=ri.AREA_1,a=i>0?i-ft:i+ft):i>-(ht+ct)&&i<=-ct?(o.value=ri.AREA_2,a=i+ht):(o.value=ri.AREA_3,a=i);else if(this.face===ni.BOTTOM)h=ht+s,i>=ct&&i<=ht+ct?(o.value=ri.AREA_0,a=-i+ht):i<ct&&i>=-ct?(o.value=ri.AREA_1,a=-i):i<-ct&&i>=-(ht+ct)?(o.value=ri.AREA_2,a=-i-ht):(o.value=ri.AREA_3,a=i>0?-i+ft:-i-ft);else{var l,M,c,u,f,m;this.face===ni.RIGHT?i=Z(i,+ht):this.face===ni.BACK?i=Z(i,+ft):this.face===ni.LEFT&&(i=Z(i,-ht)),u=Math.sin(s),f=Math.cos(s),m=Math.sin(i),l=f*Math.cos(i),M=f*m,c=u,this.face===ni.FRONT?a=V(h=Math.acos(l),c,M,o):this.face===ni.RIGHT?a=V(h=Math.acos(M),c,-l,o):this.face===ni.BACK?a=V(h=Math.acos(-l),c,-M,o):this.face===ni.LEFT?a=V(h=Math.acos(-M),c,l,o):(h=a=0,o.value=ri.AREA_0)}return n=Math.atan(12/ft*(a+Math.acos(Math.sin(a)*Math.cos(ct))-ht)),e=Math.sqrt((1-Math.cos(h))/(Math.cos(n)*Math.cos(n))/(1-Math.cos(Math.atan(1/Math.cos(a))))),o.value===ri.AREA_1?n+=ht:o.value===ri.AREA_2?n+=ft:o.value===ri.AREA_3&&(n+=1.5*ft),r.x=e*Math.cos(n),r.y=e*Math.sin(n),r.x=r.x*this.a+this.x0,r.y=r.y*this.a+this.y0,t.x=r.x,t.y=r.y,t},inverse:function(t){var s,i,a,h,e,n,r,o,l,M={lam:0,phi:0},c={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,i=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),s=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?c.value=ri.AREA_0:t.y>=0&&t.y>=Math.abs(t.x)?(c.value=ri.AREA_1,s-=ht):t.x<0&&-t.x>=Math.abs(t.y)?(c.value=ri.AREA_2,s=s<0?s+ft:s-ft):(c.value=ri.AREA_3,s+=ht),l=ft/12*Math.tan(s),e=Math.sin(l)/(Math.cos(l)-1/Math.sqrt(2)),n=Math.atan(e),a=Math.cos(s),h=Math.tan(i),(r=1-a*a*h*h*(1-Math.cos(Math.atan(1/Math.cos(n)))))<-1?r=-1:r>1&&(r=1),this.face===ni.TOP)o=Math.acos(r),M.phi=ht-o,c.value===ri.AREA_0?M.lam=n+ht:c.value===ri.AREA_1?M.lam=n<0?n+ft:n-ft:c.value===ri.AREA_2?M.lam=n-ht:M.lam=n;else if(this.face===ni.BOTTOM)o=Math.acos(r),M.phi=o-ht,c.value===ri.AREA_0?M.lam=-n+ht:c.value===ri.AREA_1?M.lam=-n:c.value===ri.AREA_2?M.lam=-n-ht:M.lam=n<0?-n-ft:-n+ft;else{var u,f,m;l=(u=r)*u,f=(l+=(m=l>=1?0:Math.sqrt(1-l)*Math.sin(n))*m)>=1?0:Math.sqrt(1-l),c.value===ri.AREA_1?(l=f,f=-m,m=l):c.value===ri.AREA_2?(f=-f,m=-m):c.value===ri.AREA_3&&(l=f,f=m,m=-l),this.face===ni.RIGHT?(l=u,u=-f,f=l):this.face===ni.BACK?(u=-u,f=-f):this.face===ni.LEFT&&(l=u,u=f,f=-l),M.phi=Math.acos(-m)-ht,M.lam=Math.atan2(f,u),this.face===ni.RIGHT?M.lam=Z(M.lam,-ht):this.face===ni.BACK?M.lam=Z(M.lam,-ft):this.face===ni.LEFT&&(M.lam=Z(M.lam,+ht))}if(0!==this.es){var p,d,y;p=M.phi<0?1:0,d=Math.tan(M.phi),y=this.b/Math.sqrt(d*d+this.one_minus_f_squared),M.phi=Math.atan(Math.sqrt(this.a*this.a-y*y)/(this.one_minus_f*y)),p&&(M.phi=-M.phi)}return M.lam+=this.long0,t.x=M.lam,t.y=M.phi,t},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]},li=[[1,2.2199e-17,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.7597,-.00
316798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],Mi=[[-5.20417e-18,.0124,1.21431e-18,-8.45284e-11],[.062,.0124,-1.26793e-9,4.22642e-10],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],ci=.8487,ui=1.3523,fi=Mt/5,mi=1/fi,pi=18,di=function(t,s){return t[0]+s*(t[1]+s*(t[2]+s*t[3]))},yi=function(t,s){return t[1]+s*(2*t[2]+3*s*t[3])},_i={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"},forward:function(t){var s=qt(t.x-this.long0),i=Math.abs(t.y),a=Math.floor(i*fi);a<0?a=0:a>=pi&&(a=pi-1),i=Mt*(i-mi*a);var h={x:di(li[a],i)*s,y:di(Mi[a],i)};return t.y<0&&(h.y=-h.y),h.x=h.x*this.a*ci+this.x0,h.y=h.y*this.a*ui+this.y0,h},inverse:function(t){var s={x:(t.x-this.x0)/(this.a*ci),y:Math.abs(t.y-this.y0)/(this.a*ui)};if(s.y>=1)s.x/=li[pi][0],s.y=t.y<0?-ht:ht;else{var i=Math.floor(s.y*pi);for(i<0?i=0:i>=pi&&(i=pi-1);;)if(Mi[i][0]>s.y)--i;else{if(!(Mi[i+1][0]<=s.y))break;++i}var a=Mi[i],h=5*(s.y-a[0])/(Mi[i+1][0]-a[0]);h=Y(function(t){return(di(a,t)-s.y)/yi(a,t)},h,ot,100),s.x/=di(li[i],h),s.y=(5*i+h)*lt,t.y<0&&(s.y=-s.y)}return s.x=qt(s.x+this.long0),s},names:["Robinson","robin"]},xi={init:function(){this.name="geocent"},forward:function(t){return b(t,this.es,this.a)},inverse:function(t){return w(t,this.es,this.a,this.b)},names:["Geocentric","geocentric","geocent","Geocent"]};return I.defaultDatum="WGS84",I.Proj=Projection,I.WGS84=new I.Proj("WGS84"),I.Point=Point,I.toPoint=Ft,I.defs=o,I.transform=S,I.mgrs=ts,I.version="2.6.0",function(proj4){proj4.Proj.projections.add(es),proj4.Proj.projections.add(ms),proj4.Proj.projections.add(ds),proj4.Proj.projections.add(vs),proj4.Proj.projections.add(gs),proj4.Proj.projections.add(bs),proj4.Proj.projections.add(ws),proj4.Proj.projections.add(As),proj4.Proj.projections.add(Cs),proj4.Proj.projections.add(Rs),proj4.Proj.projections.add(Us),proj4.Proj.projections.add(Qs),proj4.Proj.projections.add(Ws),proj4.Proj.projections.add(Ks),proj4.Proj.projections.add(Xs),proj4.Proj.projections.add(Vs),proj4.Proj.projections.add(Zs),proj4.Proj.projections.add(Ys),proj4.Proj.projections.add(ti),proj4.Proj.projections.add(si),proj4.Proj.projections.add(ii),proj4.Proj.projections.add(ai),proj4.Proj.projections.add(hi),proj4.Proj.projections.add(ei),proj4.Proj.projections.add(oi),proj4.Proj.projections.add(_i),proj4.Proj.projections.add(xi)}(I),I});
317$(document).ready(function (){
318    const openstreetmaps = $('.osmap');
319
320	if(openstreetmaps.length > 0) {
321		openstreetmaps.each(function() {
322            const poiUid = $( this ).attr( 'data-poi-uid' );
323			const contentUid = $( this ).attr( 'data-map-uid' );
324			const map = initMap(contentUid ?? poiUid);
325            const bodyIdTag = $('body').attr('id');
326            const pageUid = parseInt(bodyIdTag.replace('page-', ""));
327			const url = document.location.protocol + '//' + document.location.hostname + '/index.php?id='+pageUid+'&type=45001';
328
329            // Set pois to map
330			$.ajax({
331				url: url,
332			 	data: {tx_pluswerkopenstreetmap_ajax: {mapContentElementUid: contentUid, poiUid: poiUid}},
333
334			 	success: function(resultData) {
335                    const features = new Array();
336			 		$.each(resultData, function (key, poi) {
337			 		    features.push(createFeature(map, poi));
338			 		});
339
340			 		// add features to map
341                    const source = new ol.source.Vector({
342                        features: features
343                    });
344                    const vectorLayer = new ol.layer.Vector({
345                        source: source
346                    });
347                    map.addLayer(vectorLayer);
348
349                    // zoom to features
350                    const layerExtent = vectorLayer.getSource().getExtent();
351                    if (layerExtent && features.length > 1) {
352                        map.getView().fit(layerExtent);
353                        map.getView().setZoom(Math.floor(map.getView().getZoom()));
354                    } else {
355                        map.getView().fit(layerExtent);
356                        map.getView().setZoom(14);
357                    }
358			 	},
359                error: console.error
360			});
361		});
362	}
363
364    const openstreetmapswithonepoi = $('.osmap-with-one-poi');
365
366    if(openstreetmapswithonepoi.length > 0) {
367        openstreetmapswithonepoi.each(function() {
368
369            const poiLat = $( this ).attr( 'data-poi-lat' );
370            const poiLng = $( this ).attr( 'data-poi-lng' );
371            const poiTitle = $( this ).attr( 'data-poi-title' );
372            const poiUid = $( this ).attr( 'data-poi-uid' );
373            const map = initMap(poiUid);
374
375            const features = new Array();
376            const poi = {
377                lat: poiLat,
378                lng: poiLng,
379                title: poiTitle,
380                description: $( this ).attr( 'data-poi-description' ),
381                link: '',
382                iconName: 'pin',
383                iconColor: 'petrol',
384                imageUrl: ''
385            }
386            features.push(createFeature(map, poi));
387
388            // add features to map
389            const source = new ol.source.Vector({
390                features: features
391            });
392            const vectorLayer = new ol.layer.Vector({
393                source: source
394            });
395            map.addLayer(vectorLayer);
396
397            // zoom to features
398            const layerExtent = vectorLayer.getSource().getExtent();
399            if (layerExtent && features.length > 1) {
400                map.getView().fit(layerExtent);
401                map.getView().setZoom(Math.floor(map.getView().getZoom()));
402            } else {
403                map.getView().fit(layerExtent);
404                map.getView().setZoom(14);
405            }
406        });
407    }
408});
409
410function initMap(mapUid){
411	map = new ol.Map({
412        target: 'openStreetMap-' + mapUid,
413        layers: [
414            new ol.layer.Image({
415                source: new ol.source.ImageWMS({
416                    url: 'https://geodaten.metropoleruhr.de/spw2/spw2?',
417                    params: {'LAYERS': 'spw2_light', 'TILED': false},
418                    ratio: 1
419                })
420            })
421        ],
422        view: new ol.View({
423            center: ol.proj.fromLonLat([ 7.0115552,51.4556432]),
424            zoom: 9
425        })
426	});
427
428    const element = document.getElementById("openStreetMap-popup-" + mapUid);
429    const overlay = new ol.Overlay({
430        element: element,
431        autoPan: true,
432        positioning: 'bottom-center',
433        offset: [0, -30],
434        autoPanAnimation: {
435            duration: 250
436        }
437    });
438    map.addOverlay(overlay);
439
440    // set click event
441    map.on('singleclick', function(evt) {
442        const feature = map.forEachFeatureAtPixel(evt.pixel,
443            function(feature) {
444                return feature;
445            });
446
447        if (feature) {
448            $(element.getElementsByClassName("content")).hide();
449            if(document.getElementById("popupContent-" + feature.ol_uid)) {
450                $(document.getElementById("popupContent-" + feature.ol_uid)).show();
451            } else {
452                $(element.getElementsByClassName("content")[0]).after( '<div class="content" id="popupContent-' + feature.ol_uid + '">'+feature.get("popupContent")+'</div>' );
453            }
454            overlay.setPosition(feature.get("coordinates"));
455        }
456    });
457
458    // close popup
459    document.getElementById("pop_close").onclick = function() {
460        overlay.setPosition(undefined);
461        return false;
462    };
463
464    // set cursor to pointer
465    map.on("pointermove", function (evt) {
466        const hit = this.forEachFeatureAtPixel(evt.pixel, function(feature, layer) {
467            return true;
468        });
469        if (hit) {
470            this.getTargetElement().style.cursor = 'pointer';
471        } else {
472            this.getTargetElement().style.cursor = '';
473        }
474    });
475
476	return map;
477}
478
479function createFeature(map, poi) {
480    const iconFeature = new ol.Feature({
481        geometry: new ol.geom.Point(ol.proj.fromLonLat([poi.lng, poi.lat])),
482        popupContent: addPopupContent(poi, map),
483        coordinates: ol.proj.fromLonLat([poi.lng, poi.lat])
484    });
485
486    // create popup in DOM
487    if(poi.imageUrl !== '') {
488        let popupContentPlaceholder = document.getElementById(map.get('target').replace("openStreetMap-", "openStreetMap-popup-")).getElementsByClassName("content")[0];
489        $(popupContentPlaceholder).after( '<div class="content" id="popupContent-' + iconFeature.ol_uid + '">'+iconFeature.get("popupContent")+'</div>' );
490    }
491
492    const iconStyle = new ol.style.Style({
493        image: new ol.style.Icon({
494            scale: 1.4,
495            anchor: [9.2, 24],
496            anchorXUnits: 'pixels',
497            anchorYUnits: 'pixels',
498            src: '/_assets/b0959721e79190cef245a5c58970de12/Images/ol/'+poi.iconName+'-'+poi.iconColor+'.png'
499        })
500    });
501    iconFeature.setStyle(iconStyle);
502
503    return iconFeature;
504}
505
506function addPopupContent(poi, map) {
507 	const theLanguage = $('html').attr('lang');
508 	let linkText = '...Mehr';
509 	let popupContent = '';
510 	if(poi.imageUrl !== '') {
511 		popupContent = popupContent + '<div class="osmap__popup-image"><img src="'+poi.imageUrl+'" alt="'+poi.title+'" /></div>';
512 	}
513
514 	popupContent = popupContent + '<div class="osmap__popup-text">' +
515 			'<h4>' + poi.title + '</h4>' +
516 			'<p>' + poi.description;
517
518 	if(poi.link !== '') {
519 		if(theLanguage === 'de') linkText = '...Mehr';
520 		if(theLanguage === 'en') linkText = '...More';
521 		popupContent = popupContent + '<br /><a class="link link--int" target="_blank" href="'+ poi.link +'">' + linkText + '</a>';
522 	}
523
524    popupContent + '</p></div>';
525
526 	return popupContent;
527}
vendor: 11,618 bytes, lines 528-529
528(function(a){if(typeof define==="function"&&define.amd&&define.amd.jQuery){define(["jquery"],a)}else{a(jQuery)}}(function(f){var y="1.6.9",p="left",o="right",e="up",x="down",c="in",A="out",m="none",s="auto",l="swipe",t="pinch",B="tap",j="doubletap",b="longtap",z="hold",E="horizontal",u="vertical",i="all",r=10,g="start",k="move",h="end",q="cancel",a="ontouchstart" in window,v=window.navigator.msPointerEnabled&&!window.navigator.pointerEnabled,d=window.navigator.pointerEnabled||window.navigator.msPointerEnabled,C="TouchSwipe";var n={fingers:1,threshold:75,cancelThreshold:null,pinchThreshold:20,maxTimeThreshold:null,fingerReleaseThreshold:250,longTapThreshold:500,doubleTapThreshold:200,swipe:null,swipeLeft:null,swipeRight:null,swipeUp:null,swipeDown:null,swipeStatus:null,pinchIn:null,pinchOut:null,pinchStatus:null,click:null,tap:null,doubleTap:null,longTap:null,hold:null,triggerOnTouchEnd:true,triggerOnTouchLeave:false,allowPageScroll:"auto",fallbackToMouseEvents:true,excludedElements:"label, button, input, select, textarea, a, .noSwipe",preventDefaultEvents:true};f.fn.swipe=function(H){var G=f(this),F=G.data(C);if(F&&typeof H==="string"){if(F[H]){return F[H].apply(this,Array.prototype.slice.call(arguments,1))}else{f.error("Method "+H+" does not exist on jQuery.swipe")}}else{if(!F&&(typeof H==="object"||!H)){return w.apply(this,arguments)}}return G};f.fn.swipe.version=y;f.fn.swipe.defaults=n;f.fn.swipe.phases={PHASE_START:g,PHASE_MOVE:k,PHASE_END:h,PHASE_CANCEL:q};f.fn.swipe.directions={LEFT:p,RIGHT:o,UP:e,DOWN:x,IN:c,OUT:A};f.fn.swipe.pageScroll={NONE:m,HORIZONTAL:E,VERTICAL:u,AUTO:s};f.fn.swipe.fingers={ONE:1,TWO:2,THREE:3,ALL:i};function w(F){if(F&&(F.allowPageScroll===undefined&&(F.swipe!==undefined||F.swipeStatus!==undefined))){F.allowPageScroll=m}if(F.click!==undefined&&F.tap===undefined){F.tap=F.click}if(!F){F={}}F=f.extend({},f.fn.swipe.defaults,F);return this.each(function(){var H=f(this);var G=H.data(C);if(!G){G=new D(this,F);H.data(C,G)}})}function D(a5,aw){var aA=(a||d||!aw.fallbackToMouseEvents),K=aA?(d?(v?"MSPointerDown":"pointerdown"):"touchstart"):"mousedown",az=aA?(d?(v?"MSPointerMove":"pointermove"):"touchmove"):"mousemove",V=aA?(d?(v?"MSPointerUp":"pointerup"):"touchend"):"mouseup",T=aA?null:"mouseleave",aE=(d?(v?"MSPointerCancel":"pointercancel"):"touchcancel");var ah=0,aQ=null,ac=0,a2=0,a0=0,H=1,ar=0,aK=0,N=null;var aS=f(a5);var aa="start";var X=0;var aR=null;var U=0,a3=0,a6=0,ae=0,O=0;var aX=null,ag=null;try{aS.bind(K,aO);aS.bind(aE,ba)}catch(al){f.error("events not supported "+K+","+aE+" on jQuery.swipe")}this.enable=function(){aS.bind(K,aO);aS.bind(aE,ba);return aS};this.disable=function(){aL();return aS};this.destroy=function(){aL();aS.data(C,null);aS=null};this.option=function(bd,bc){if(aw[bd]!==undefined){if(bc===undefined){return aw[bd]}else{aw[bd]=bc}}else{f.error("Option "+bd+" does not exist on jQuery.swipe.options")}return null};function aO(be){if(aC()){return}if(f(be.target).closest(aw.excludedElements,aS).length>0){return}var bf=be.originalEvent?be.originalEvent:be;var bd,bg=bf.touches,bc=bg?bg[0]:bf;aa=g;if(bg){X=bg.length}else{be.preventDefault()}ah=0;aQ=null;aK=null;ac=0;a2=0;a0=0;H=1;ar=0;aR=ak();N=ab();S();if(!bg||(X===aw.fingers||aw.fingers===i)||aY()){aj(0,bc);U=au();if(X==2){aj(1,bg[1]);a2=a0=av(aR[0].start,aR[1].start)}if(aw.swipeStatus||aw.pinchStatus){bd=P(bf,aa)}}else{bd=false}if(bd===false){aa=q;P(bf,aa);return bd}else{if(aw.hold){ag=setTimeout(f.proxy(function(){aS.trigger("hold",[bf.target]);if(aw.hold){bd=aw.hold.call(aS,bf,bf.target)}},this),aw.longTapThreshold)}ap(true)}return null}function a4(bf){var bi=bf.originalEvent?bf.originalEvent:bf;if(aa===h||aa===q||an()){return}var be,bj=bi.touches,bd=bj?bj[0]:bi;var bg=aI(bd);a3=au();if(bj){X=bj.length}if(aw.hold){clearTimeout(ag)}aa=k;if(X==2){if(a2==0){aj(1,bj[1]);a2=a0=av(aR[0].start,aR[1].start)}else{aI(bj[1]);a0=av(aR[0].end,aR[1].end);aK=at(aR[0].end,aR[1].end)}H=a8(a2,a0);ar=Math.abs(a2-a0)}if((X===aw.fingers||aw.fingers===i)||!bj||aY()){aQ=aM(bg.start,bg.end);am(bf,aQ);ah=aT(bg.start,bg.end);ac=aN();aJ(aQ,ah);if(aw.swipeStatus||aw.pinchStatus){be=P(bi,aa)}if(!aw.triggerOnTouchEnd||aw.triggerOnTouchLeave){var bc=true;if(aw.triggerOnTouchLeave){var bh=aZ(this);bc=F(bg.end,bh)}if(!aw.triggerOnTouchEnd&&bc){aa=aD(k)}else{if(aw.triggerOnTouchLeave&&!bc){aa=aD(h)}}if(aa==q||aa==h){P(bi,aa)}}}else{aa=q;P(bi,aa)}if(be===false){aa=q;P(bi,aa)}}function M(bc){var bd=bc.originalEvent?bc.originalEvent:bc,be=bd.touches;if(be){if(be.length){G();return true}}if(an()){X=ae}a3=au();ac=aN();if(bb()||!ao()){aa=q;P(bd,aa)}else{if(aw.triggerOnTouchEnd||(aw.triggerOnTouchEnd==false&&aa===k)){bc.preventDefault();aa=h;P(bd,aa)}else{if(!aw.triggerOnTouchEnd&&a7()){aa=h;aG(bd,aa,B)}else{if(aa===k){aa=q;P(bd,aa)}}}}ap(false);return null}function ba(){X=0;a3=0;U=0;a2=0;a0=0;H=1;S();ap(false)}function L(bc){var bd=bc.originalEvent?bc.originalEvent:bc;if(aw.triggerOnTouchLeave){aa=aD(h);P(bd,aa)}}function aL(){aS.unbind(K,aO);aS.unbind(aE,ba);aS.unbind(az,a4);aS.unbind(V,M);if(T){aS.unbind(T,L)}ap(false)}function aD(bg){var bf=bg;var be=aB();var bd=ao();var bc=bb();if(!be||bc){bf=q}else{if(bd&&bg==k&&(!aw.triggerOnTouchEnd||aw.triggerOnTouchLeave)){bf=h}else{if(!bd&&bg==h&&aw.triggerOnTouchLeave){bf=q}}}return bf}function P(be,bc){var bd,bf=be.touches;if((J()||W())||(Q()||aY())){if(J()||W()){bd=aG(be,bc,l)}if((Q()||aY())&&bd!==false){bd=aG(be,bc,t)}}else{if(aH()&&bd!==false){bd=aG(be,bc,j)}else{if(aq()&&bd!==false){bd=aG(be,bc,b)}else{if(ai()&&bd!==false){bd=aG(be,bc,B)}}}}if(bc===q){ba(be)}if(bc===h){if(bf){if(!bf.length){ba(be)}}else{ba(be)}}return bd}function aG(bf,bc,be){var bd;if(be==l){aS.trigger("swipeStatus",[bc,aQ||null,ah||0,ac||0,X,aR]);if(aw.swipeStatus){bd=aw.swipeStatus.call(aS,bf,bc,aQ||null,ah||0,ac||0,X,aR);if(bd===false){return false}}if(bc==h&&aW()){aS.trigger("swipe",[aQ,ah,ac,X,aR]);if(aw.swipe){bd=aw.swipe.call(aS,bf,aQ,ah,ac,X,aR);if(bd===false){return false}}switch(aQ){case p:aS.trigger("swipeLeft",[aQ,ah,ac,X,aR]);if(aw.swipeLeft){bd=aw.swipeLeft.call(aS,bf,aQ,ah,ac,X,aR)}break;case o:aS.trigger("swipeRight",[aQ,ah,ac,X,aR]);if(aw.swipeRight){bd=aw.swipeRight.call(aS,bf,aQ,ah,ac,X,aR)}break;case e:aS.trigger("swipeUp",[aQ,ah,ac,X,aR]);if(aw.swipeUp){bd=aw.swipeUp.call(aS,bf,aQ,ah,ac,X,aR)}break;case x:aS.trigger("swipeDown",[aQ,ah,ac,X,aR]);if(aw.swipeDown){bd=aw.swipeDown.call(aS,bf,aQ,ah,ac,X,aR)}break}}}if(be==t){aS.trigger("pinchStatus",[bc,aK||null,ar||0,ac||0,X,H,aR]);if(aw.pinchStatus){bd=aw.pinchStatus.call(aS,bf,bc,aK||null,ar||0,ac||0,X,H,aR);if(bd===false){return false}}if(bc==h&&a9()){switch(aK){case c:aS.trigger("pinchIn",[aK||null,ar||0,ac||0,X,H,aR]);if(aw.pinchIn){bd=aw.pinchIn.call(aS,bf,aK||null,ar||0,ac||0,X,H,aR)}break;case A:aS.trigger("pinchOut",[aK||null,ar||0,ac||0,X,H,aR]);if(aw.pinchOut){bd=aw.pinchOut.call(aS,bf,aK||null,ar||0,ac||0,X,H,aR)}break}}}if(be==B){if(bc===q||bc===h){clearTimeout(aX);clearTimeout(ag);if(Z()&&!I()){O=au();aX=setTimeout(f.proxy(function(){O=null;aS.trigger("tap",[bf.target]);if(aw.tap){bd=aw.tap.call(aS,bf,bf.target)}},this),aw.doubleTapThreshold)}else{O=null;aS.trigger("tap",[bf.target]);if(aw.tap){bd=aw.tap.call(aS,bf,bf.target)}}}}else{if(be==j){if(bc===q||bc===h){clearTimeout(aX);O=null;aS.trigger("doubletap",[bf.target]);if(aw.doubleTap){bd=aw.doubleTap.call(aS,bf,bf.target)}}}else{if(be==b){if(bc===q||bc===h){clearTimeout(aX);O=null;aS.trigger("longtap",[bf.target]);if(aw.longTap){bd=aw.longTap.call(aS,bf,bf.target)}}}}}return bd}function ao(){var bc=true;if(aw.threshold!==null){bc=ah>=aw.threshold}return bc}function bb(){var bc=false;if(aw.cancelThreshold!==null&&aQ!==null){bc=(aU(aQ)-ah)>=aw.cancelThreshold}return bc}function af(){if(aw.pinchThreshold!==null){return ar>=aw.pinchThreshold}return true}function aB(){var bc;if(aw.maxTimeThreshold){if(ac>=aw.maxTimeThreshold){bc=false}else{bc=true}}else{bc=true}return bc}function am(bc,bd){if(aw.preventDefaultEvents===false){return}if(aw.allowPageScroll===m){bc.preventDefault()}else{var be=aw.allowPageScroll===s;switch(bd){case p:if((aw.swipeLeft&&be)||(!be&&aw.allowPageScroll!=E)){bc.preventDefault()}break;case o:if((aw.swipeRight&&be)||(!be&&aw.allowPageScroll!=E)){bc.preventDefault()}break;case e:if((aw.swipeUp&&be)||(!be&&aw.allowPageScroll!=u)){bc.preventDefault()}break;case x:if((aw.swipeDown&&be)||(!be&&aw.allowPageScroll!=u)){bc.preventDefault()}break}}}function a9(){var bd=aP();var bc=Y();var be=af();return bd&&bc&&be}function aY(){return !!(aw.pinchStatus||aw.pinchIn||aw.pinchOut)}function Q(){return !!(a9()&&aY())}function aW(){var bf=aB();var bh=ao();var be=aP();var bc=Y();var bd=bb();var bg=!bd&&bc&&be&&bh&&bf;return bg}function W(){return !!(aw.swipe||aw.swipeStatus||aw.swipeLeft||aw.swipeRight||aw.swipeUp||aw.swipeDown)}function J(){return !!(aW()&&W())}function aP(){return((X===aw.fingers||aw.fingers===i)||!a)}function Y(){return aR[0].end.x!==0}function a7(){return !!(aw.tap)}function Z(){return !!(aw.doubleTap)}function aV(){return !!(aw.longTap)}function R(){if(O==null){return false}var bc=au();return(Z()&&((bc-O)<=aw.doubleTapThreshold))}function I(){return R()}function ay(){return((X===1||!a)&&(isNaN(ah)||ah<aw.threshold))}function a1(){return((ac>aw.longTapThreshold)&&(ah<r))}function ai(){return !!(ay()&&a7())}function aH(){return !!(R()&&Z())}function aq(){return !!(a1()&&aV())}function G(){a6=au();ae=event.touches.length+1}function S(){a6=0;ae=0}function an(){var bc=false;if(a6){var bd=au()-a6;if(bd<=aw.fingerReleaseThreshold){bc=true}}return bc}function aC(){return !!(aS.data(C+"_intouch")===true)}function ap(bc){if(bc===true){aS.bind(az,a4);aS.bind(V,M);if(T){aS.bind(T,L)}}else{aS.unbind(az,a4,false);aS.unbind(V,M,false);if(T){aS.unbind(T,L,false)}}aS.data(C+"_intouch",bc===true)}function aj(bd,bc){var be=bc.identifier!==undefined?bc.identifier:0;aR[bd].identifier=be;aR[bd].start.x=aR[bd].end.x=bc.pageX||bc.clientX;aR[bd].start.y=aR[bd].end.y=bc.pageY||bc.clientY;return aR[bd]}function aI(bc){var be=bc.identifier!==undefined?bc.identifier:0;var bd=ad(be);bd.end.x=bc.pageX||bc.clientX;bd.end.y=bc.pageY||bc.clientY;return bd}function ad(bd){for(var bc=0;bc<aR.length;bc++){if(aR[bc].identifier==bd){return aR[bc]}}}function ak(){var bc=[];for(var bd=0;bd<=5;bd++){bc.push({start:{x:0,y:0},end:{x:0,y:0},identifier:0})}return bc}function aJ(bc,bd){bd=Math.max(bd,aU(bc));N[bc].distance=bd}function aU(bc){if(N[bc]){return N[bc].distance}return undefined}function ab(){var bc={};bc[p]=ax(p);bc[o]=ax(o);bc[e]=ax(e);bc[x]=ax(x);return bc}function ax(bc){return{direction:bc,distance:0}}function aN(){return a3-U}function av(bf,be){var bd=Math.abs(bf.x-be.x);var bc=Math.abs(bf.y-be.y);return Math.round(Math.sqrt(bd*bd+bc*bc))}function a8(bc,bd){var be=(bd/bc)*1;return be.toFixed(2)}function at(){if(H<1){return A}else{return c}}function aT(bd,bc){return Math.round(Math.sqrt(Math.pow(bc.x-bd.x,2)+Math.pow(bc.y-bd.y,2)))}function aF(bf,bd){var bc=bf.x-bd.x;var bh=bd.y-bf.y;var be=Math.atan2(bh,bc);var bg=Math.round(be*180/Math.PI);if(bg<0){bg=360-Math.abs(bg)}return bg}function aM(bd,bc){var be=aF(bd,bc);if((be<=45)&&(be>=0)){return p}else{if((be<=360)&&(be>=315)){return p}else{if((be>=135)&&(be<=225)){return o}else{if((be>45)&&(be<135)){return x}else{return e}}}}}function au(){var bc=new Date();return bc.getTime()}function aZ(bc){bc=f(bc);var be=bc.offset();var bd={left:be.left,right:be.left+bc.outerWidth(),top:be.top,bottom:be.top+bc.outerHeight()};return bd}function F(bc,bd){return(bc.x>bd.left&&bc.x<bd.right&&bc.y>bd.top&&bc.y<bd.bottom)}}}));
529/*! Magnific Popup - v1.1.0 - 2016-02-20
vendor: 52,207 bytes, lines 530-2150
530 * http://dimsemenov.com/plugins/magnific-popup/
531 * Copyright (c) 2016 Dmitry Semenov; */
532;(function (factory) {
533    if (typeof define === 'function' && define.amd) {
534        // AMD. Register as an anonymous module.
535        define(['jquery'], factory);
536    } else if (typeof exports === 'object') {
537        // Node/CommonJS
538        factory(require('jquery'));
539    } else {
540        // Browser globals
541        factory(window.jQuery || window.Zepto);
542    }
543}(function($) {
544
545    /*>>core*/
546    /**
547     *
548     * Magnific Popup Core JS file
549     *
550     */
551
552
553    /**
554     * Private static constants
555     */
556    var CLOSE_EVENT = 'Close',
557        BEFORE_CLOSE_EVENT = 'BeforeClose',
558        AFTER_CLOSE_EVENT = 'AfterClose',
559        BEFORE_APPEND_EVENT = 'BeforeAppend',
560        MARKUP_PARSE_EVENT = 'MarkupParse',
561        OPEN_EVENT = 'Open',
562        CHANGE_EVENT = 'Change',
563        NS = 'mfp',
564        EVENT_NS = '.' + NS,
565        READY_CLASS = 'mfp-ready',
566        REMOVING_CLASS = 'mfp-removing',
567        PREVENT_CLOSE_CLASS = 'mfp-prevent-close';
568
569
570    /**
571     * Private vars
572     */
573    /*jshint -W079 */
574    var mfp, // As we have only one instance of MagnificPopup object, we define it locally to not to use 'this'
575        MagnificPopup = function(){},
576        _isJQ = !!(window.jQuery),
577        _prevStatus,
578        _window = $(window),
579        _document,
580        _prevContentType,
581        _wrapClasses,
582        _currPopupType;
583
584
585    /**
586     * Private functions
587     */
588    var _mfpOn = function(name, f) {
589            mfp.ev.on(NS + name + EVENT_NS, f);
590        },
591        _getEl = function(className, appendTo, html, raw) {
592            var el = document.createElement('div');
593            el.className = 'mfp-'+className;
594            if(html) {
595                el.innerHTML = html;
596            }
597            if(!raw) {
598                el = $(el);
599                if(appendTo) {
600                    el.appendTo(appendTo);
601                }
602            } else if(appendTo) {
603                appendTo.appendChild(el);
604            }
605            return el;
606        },
607        _mfpTrigger = function(e, data) {
608            mfp.ev.triggerHandler(NS + e, data);
609
610            if(mfp.st.callbacks) {
611                // converts "mfpEventName" to "eventName" callback and triggers it if it's present
612                e = e.charAt(0).toLowerCase() + e.slice(1);
613                if(mfp.st.callbacks[e]) {
614                    mfp.st.callbacks[e].apply(mfp, $.isArray(data) ? data : [data]);
615                }
616            }
617        },
618        _getCloseBtn = function(type) {
619            if(type !== _currPopupType || !mfp.currTemplate.closeBtn) {
620                mfp.currTemplate.closeBtn = $( mfp.st.closeMarkup.replace('%title%', mfp.st.tClose ) );
621                _currPopupType = type;
622            }
623            return mfp.currTemplate.closeBtn;
624        },
625    // Initialize Magnific Popup only when called at least once
626        _checkInstance = function() {
627            if(!$.magnificPopup.instance) {
628                /*jshint -W020 */
629                mfp = new MagnificPopup();
630                mfp.init();
631                $.magnificPopup.instance = mfp;
632            }
633        },
634    // CSS transition detection, http://stackoverflow.com/questions/7264899/detect-css-transitions-using-javascript-and-without-modernizr
635        supportsTransitions = function() {
636            var s = document.createElement('p').style, // 's' for style. better to create an element if body yet to exist
637                v = ['ms','O','Moz','Webkit']; // 'v' for vendor
638
639            if( s['transition'] !== undefined ) {
640                return true;
641            }
642
643            while( v.length ) {
644                if( v.pop() + 'Transition' in s ) {
645                    return true;
646                }
647            }
648
649            return false;
650        };
651
652
653
654    /**
655     * Public functions
656     */
657    MagnificPopup.prototype = {
658
659        constructor: MagnificPopup,
660
661        /**
662         * Initializes Magnific Popup plugin.
663         * This function is triggered only once when $.fn.magnificPopup or $.magnificPopup is executed
664         */
665        init: function() {
666            var appVersion = navigator.appVersion;
667            mfp.isLowIE = mfp.isIE8 = document.all && !document.addEventListener;
668            mfp.isAndroid = (/android/gi).test(appVersion);
669            mfp.isIOS = (/iphone|ipad|ipod/gi).test(appVersion);
670            mfp.supportsTransition = supportsTransitions();
671
672            // We disable fixed positioned lightbox on devices that don't handle it nicely.
673            // If you know a better way of detecting this - let me know.
674            mfp.probablyMobile = (mfp.isAndroid || mfp.isIOS || /(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent) );
675            _document = $(document);
676
677            mfp.popupsCache = {};
678        },
679
680        /**
681         * Opens popup
682         * @param  data [description]
683         */
684        open: function(data) {
685
686            var i;
687
688            if(data.isObj === false) {
689                // convert jQuery collection to array to avoid conflicts later
690                mfp.items = data.items.toArray();
691
692                mfp.index = 0;
693                var items = data.items,
694                    item;
695                for(i = 0; i < items.length; i++) {
696                    item = items[i];
697                    if(item.parsed) {
698                        item = item.el[0];
699                    }
700                    if(item === data.el[0]) {
701                        mfp.index = i;
702                        break;
703                    }
704                }
705            } else {
706                mfp.items = $.isArray(data.items) ? data.items : [data.items];
707                mfp.index = data.index || 0;
708            }
709
710            // if popup is already opened - we just update the content
711            if(mfp.isOpen) {
712                mfp.updateItemHTML();
713                return;
714            }
715
716            mfp.types = [];
717            _wrapClasses = '';
718            if(data.mainEl && data.mainEl.length) {
719                mfp.ev = data.mainEl.eq(0);
720            } else {
721                mfp.ev = _document;
722            }
723
724            if(data.key) {
725                if(!mfp.popupsCache[data.key]) {
726                    mfp.popupsCache[data.key] = {};
727                }
728                mfp.currTemplate = mfp.popupsCache[data.key];
729            } else {
730                mfp.currTemplate = {};
731            }
732
733
734
735            mfp.st = $.extend(true, {}, $.magnificPopup.defaults, data );
736            mfp.fixedContentPos = mfp.st.fixedContentPos === 'auto' ? !mfp.probablyMobile : mfp.st.fixedContentPos;
737
738            if(mfp.st.modal) {
739                mfp.st.closeOnContentClick = false;
740                mfp.st.closeOnBgClick = false;
741                mfp.st.showCloseBtn = false;
742                mfp.st.enableEscapeKey = false;
743            }
744
745
746            // Building markup
747            // main containers are created only once
748            if(!mfp.bgOverlay) {
749
750                // Dark overlay
751                mfp.bgOverlay = _getEl('bg').on('click'+EVENT_NS, function() {
752                    mfp.close();
753                });
754
755                mfp.wrap = _getEl('wrap').attr('tabindex', -1).on('click'+EVENT_NS, function(e) {
756                    if(mfp._checkIfClose(e.target)) {
757                        mfp.close();
758                    }
759                });
760
761                mfp.container = _getEl('container', mfp.wrap);
762            }
763
764            mfp.contentContainer = _getEl('content');
765            if(mfp.st.preloader) {
766                mfp.preloader = _getEl('preloader', mfp.container, mfp.st.tLoading);
767            }
768
769
770            // Initializing modules
771            var modules = $.magnificPopup.modules;
772            for(i = 0; i < modules.length; i++) {
773                var n = modules[i];
774                n = n.charAt(0).toUpperCase() + n.slice(1);
775                mfp['init'+n].call(mfp);
776            }
777            _mfpTrigger('BeforeOpen');
778
779
780            if(mfp.st.showCloseBtn) {
781                // Close button
782                if(!mfp.st.closeBtnInside) {
783                    mfp.wrap.append( _getCloseBtn() );
784                } else {
785                    _mfpOn(MARKUP_PARSE_EVENT, function(e, template, values, item) {
786                        values.close_replaceWith = _getCloseBtn(item.type);
787                    });
788                    _wrapClasses += ' mfp-close-btn-in';
789                }
790            }
791
792            if(mfp.st.alignTop) {
793                _wrapClasses += ' mfp-align-top';
794            }
795
796
797
798            if(mfp.fixedContentPos) {
799                mfp.wrap.css({
800                    overflow: mfp.st.overflowY,
801                    overflowX: 'hidden',
802                    overflowY: mfp.st.overflowY
803                });
804            } else {
805                mfp.wrap.css({
806                    top: _window.scrollTop(),
807                    position: 'absolute'
808                });
809            }
810            if( mfp.st.fixedBgPos === false || (mfp.st.fixedBgPos === 'auto' && !mfp.fixedContentPos) ) {
811                mfp.bgOverlay.css({
812                    height: _document.height(),
813                    position: 'absolute'
814                });
815            }
816
817
818
819            if(mfp.st.enableEscapeKey) {
820                // Close on ESC key
821                _document.on('keyup' + EVENT_NS, function(e) {
822                    if(e.keyCode === 27) {
823                        mfp.close();
824                    }
825                });
826            }
827
828            _window.on('resize' + EVENT_NS, function() {
829                mfp.updateSize();
830            });
831
832
833            if(!mfp.st.closeOnContentClick) {
834                _wrapClasses += ' mfp-auto-cursor';
835            }
836
837            if(_wrapClasses)
838                mfp.wrap.addClass(_wrapClasses);
839
840
841            // this triggers recalculation of layout, so we get it once to not to trigger twice
842            var windowHeight = mfp.wH = _window.height();
843
844
845            var windowStyles = {};
846
847            if( mfp.fixedContentPos ) {
848                if(mfp._hasScrollBar(windowHeight)){
849                    var s = mfp._getScrollbarSize();
850                    if(s) {
851                        windowStyles.marginRight = s;
852                    }
853                }
854            }
855
856            if(mfp.fixedContentPos) {
857                if(!mfp.isIE7) {
858                    windowStyles.overflow = 'hidden';
859                } else {
860                    // ie7 double-scroll bug
861                    $('body, html').css('overflow', 'hidden');
862                }
863            }
864
865
866
867            var classesToadd = mfp.st.mainClass;
868            if(mfp.isIE7) {
869                classesToadd += ' mfp-ie7';
870            }
871            if(classesToadd) {
872                mfp._addClassToMFP( classesToadd );
873            }
874
875            // add content
876            mfp.updateItemHTML();
877
878            _mfpTrigger('BuildControls');
879
880            // remove scrollbar, add margin e.t.c
881            $('html').css(windowStyles);
882
883            // add everything to DOM
884            mfp.bgOverlay.add(mfp.wrap).prependTo( mfp.st.prependTo || $(document.body) );
885
886            // Save last focused element
887            mfp._lastFocusedEl = document.activeElement;
888
889            // Wait for next cycle to allow CSS transition
890            setTimeout(function() {
891
892                if(mfp.content) {
893                    mfp._addClassToMFP(READY_CLASS);
894                    mfp._setFocus();
895                } else {
896                    // if content is not defined (not loaded e.t.c) we add class only for BG
897                    mfp.bgOverlay.addClass(READY_CLASS);
898                }
899
900                // Trap the focus in popup
901                _document.on('focusin' + EVENT_NS, mfp._onFocusIn);
902
903            }, 16);
904
905            mfp.isOpen = true;
906            mfp.updateSize(windowHeight);
907            _mfpTrigger(OPEN_EVENT);
908
909            return data;
910        },
911
912        /**
913         * Closes the popup
914         */
915        close: function() {
916            if(!mfp.isOpen) return;
917            _mfpTrigger(BEFORE_CLOSE_EVENT);
918
919            mfp.isOpen = false;
920            // for CSS3 animation
921            if(mfp.st.removalDelay && !mfp.isLowIE && mfp.supportsTransition )  {
922                mfp._addClassToMFP(REMOVING_CLASS);
923                setTimeout(function() {
924                    mfp._close();
925                }, mfp.st.removalDelay);
926            } else {
927                mfp._close();
928            }
929        },
930
931        /**
932         * Helper for close() function
933         */
934        _close: function() {
935            _mfpTrigger(CLOSE_EVENT);
936
937            var classesToRemove = REMOVING_CLASS + ' ' + READY_CLASS + ' ';
938
939            mfp.bgOverlay.detach();
940            mfp.wrap.detach();
941            mfp.container.empty();
942
943            if(mfp.st.mainClass) {
944                classesToRemove += mfp.st.mainClass + ' ';
945            }
946
947            mfp._removeClassFromMFP(classesToRemove);
948
949            if(mfp.fixedContentPos) {
950                var windowStyles = {marginRight: ''};
951                if(mfp.isIE7) {
952                    $('body, html').css('overflow', '');
953                } else {
954                    windowStyles.overflow = '';
955                }
956                $('html').css(windowStyles);
957            }
958
959            _document.off('keyup' + EVENT_NS + ' focusin' + EVENT_NS);
960            mfp.ev.off(EVENT_NS);
961
962            // clean up DOM elements that aren't removed
963            mfp.wrap.attr('class', 'mfp-wrap').removeAttr('style');
964            mfp.bgOverlay.attr('class', 'mfp-bg');
965            mfp.container.attr('class', 'mfp-container');
966
967            // remove close button from target element
968            if(mfp.st.showCloseBtn &&
969                (!mfp.st.closeBtnInside || mfp.currTemplate[mfp.currItem.type] === true)) {
970                if(mfp.currTemplate.closeBtn)
971                    mfp.currTemplate.closeBtn.detach();
972            }
973
974
975            if(mfp.st.autoFocusLast && mfp._lastFocusedEl) {
976                $(mfp._lastFocusedEl).focus(); // put tab focus back
977            }
978            mfp.currItem = null;
979            mfp.content = null;
980            mfp.currTemplate = null;
981            mfp.prevHeight = 0;
982
983            _mfpTrigger(AFTER_CLOSE_EVENT);
984        },
985
986        updateSize: function(winHeight) {
987
988            if(mfp.isIOS) {
989                // fixes iOS nav bars https://github.com/dimsemenov/Magnific-Popup/issues/2
990                var zoomLevel = document.documentElement.clientWidth / window.innerWidth;
991                var height = window.innerHeight * zoomLevel;
992                mfp.wrap.css('height', height);
993                mfp.wH = height;
994            } else {
995                mfp.wH = winHeight || _window.height();
996            }
997            // Fixes #84: popup incorrectly positioned with position:relative on body
998            if(!mfp.fixedContentPos) {
999                mfp.wrap.css('height', mfp.wH);
1000            }
1001
1002            _mfpTrigger('Resize');
1003
1004        },
1005
1006        /**
1007         * Set content of popup based on current index
1008         */
1009        updateItemHTML: function() {
1010            var item = mfp.items[mfp.index];
1011
1012            // Detach and perform modifications
1013            mfp.contentContainer.detach();
1014
1015            if(mfp.content)
1016                mfp.content.detach();
1017
1018            if(!item.parsed) {
1019                item = mfp.parseEl( mfp.index );
1020            }
1021
1022            var type = item.type;
1023
1024            _mfpTrigger('BeforeChange', [mfp.currItem ? mfp.currItem.type : '', type]);
1025            // BeforeChange event works like so:
1026            // _mfpOn('BeforeChange', function(e, prevType, newType) { });
1027
1028            mfp.currItem = item;
1029
1030            if(!mfp.currTemplate[type]) {
1031                var markup = mfp.st[type] ? mfp.st[type].markup : false;
1032
1033                // allows to modify markup
1034                _mfpTrigger('FirstMarkupParse', markup);
1035
1036                if(markup) {
1037                    mfp.currTemplate[type] = $(markup);
1038                } else {
1039                    // if there is no markup found we just define that template is parsed
1040                    mfp.currTemplate[type] = true;
1041                }
1042            }
1043
1044            if(_prevContentType && _prevContentType !== item.type) {
1045                mfp.container.removeClass('mfp-'+_prevContentType+'-holder');
1046            }
1047
1048            var newContent = mfp['get' + type.charAt(0).toUpperCase() + type.slice(1)](item, mfp.currTemplate[type]);
1049            mfp.appendContent(newContent, type);
1050
1051            item.preloaded = true;
1052
1053            _mfpTrigger(CHANGE_EVENT, item);
1054            _prevContentType = item.type;
1055
1056            // Append container back after its content changed
1057            mfp.container.prepend(mfp.contentContainer);
1058
1059            _mfpTrigger('AfterChange');
1060        },
1061
1062
1063        /**
1064         * Set HTML content of popup
1065         */
1066        appendContent: function(newContent, type) {
1067            mfp.content = newContent;
1068
1069            if(newContent) {
1070                if(mfp.st.showCloseBtn && mfp.st.closeBtnInside &&
1071                    mfp.currTemplate[type] === true) {
1072                    // if there is no markup, we just append close button element inside
1073                    if(!mfp.content.find('.mfp-close').length) {
1074                        mfp.content.append(_getCloseBtn());
1075                    }
1076                } else {
1077                    mfp.content = newContent;
1078                }
1079            } else {
1080                mfp.content = '';
1081            }
1082
1083            _mfpTrigger(BEFORE_APPEND_EVENT);
1084            mfp.container.addClass('mfp-'+type+'-holder');
1085
1086            mfp.contentContainer.append(mfp.content);
1087        },
1088
1089
1090        /**
1091         * Creates Magnific Popup data object based on given data
1092         * @param  {int} index Index of item to parse
1093         */
1094        parseEl: function(index) {
1095            var item = mfp.items[index],
1096                type;
1097
1098            if(item.tagName) {
1099                item = { el: $(item) };
1100            } else {
1101                type = item.type;
1102                item = { data: item, src: item.src };
1103            }
1104
1105            if(item.el) {
1106                var types = mfp.types;
1107
1108                // check for 'mfp-TYPE' class
1109                for(var i = 0; i < types.length; i++) {
1110                    if( item.el.hasClass('mfp-'+types[i]) ) {
1111                        type = types[i];
1112                        break;
1113                    }
1114                }
1115
1116                item.src = item.el.attr('data-mfp-src');
1117                if(!item.src) {
1118                    item.src = item.el.attr('href');
1119                }
1120            }
1121
1122            item.type = type || mfp.st.type || 'inline';
1123            item.index = index;
1124            item.parsed = true;
1125            mfp.items[index] = item;
1126            _mfpTrigger('ElementParse', item);
1127
1128            return mfp.items[index];
1129        },
1130
1131
1132        /**
1133         * Initializes single popup or a group of popups
1134         */
1135        addGroup: function(el, options) {
1136            var eHandler = function(e) {
1137                e.mfpEl = this;
1138                mfp._openClick(e, el, options);
1139            };
1140
1141            if(!options) {
1142                options = {};
1143            }
1144
1145            var eName = 'click.magnificPopup';
1146            options.mainEl = el;
1147
1148            if(options.items) {
1149                options.isObj = true;
1150                el.off(eName).on(eName, eHandler);
1151            } else {
1152                options.isObj = false;
1153                if(options.delegate) {
1154                    el.off(eName).on(eName, options.delegate , eHandler);
1155                } else {
1156                    options.items = el;
1157                    el.off(eName).on(eName, eHandler);
1158                }
1159            }
1160        },
1161        _openClick: function(e, el, options) {
1162            var midClick = options.midClick !== undefined ? options.midClick : $.magnificPopup.defaults.midClick;
1163
1164
1165            if(!midClick && ( e.which === 2 || e.ctrlKey || e.metaKey || e.altKey || e.shiftKey ) ) {
1166                return;
1167            }
1168
1169            var disableOn = options.disableOn !== undefined ? options.disableOn : $.magnificPopup.defaults.disableOn;
1170
1171            if(disableOn) {
1172                if($.isFunction(disableOn)) {
1173                    if( !disableOn.call(mfp) ) {
1174                        return true;
1175                    }
1176                } else { // else it's number
1177                    if( _window.width() < disableOn ) {
1178                        return true;
1179                    }
1180                }
1181            }
1182
1183            if(e.type) {
1184                e.preventDefault();
1185
1186                // This will prevent popup from closing if element is inside and popup is already opened
1187                if(mfp.isOpen) {
1188                    e.stopPropagation();
1189                }
1190            }
1191
1192            options.el = $(e.mfpEl);
1193            if(options.delegate) {
1194                options.items = el.find(options.delegate);
1195            }
1196            mfp.open(options);
1197        },
1198
1199
1200        /**
1201         * Updates text on preloader
1202         */
1203        updateStatus: function(status, text) {
1204
1205            if(mfp.preloader) {
1206                if(_prevStatus !== status) {
1207                    mfp.container.removeClass('mfp-s-'+_prevStatus);
1208                }
1209
1210                if(!text && status === 'loading') {
1211                    text = mfp.st.tLoading;
1212                }
1213
1214                var data = {
1215                    status: status,
1216                    text: text
1217                };
1218                // allows to modify status
1219                _mfpTrigger('UpdateStatus', data);
1220
1221                status = data.status;
1222                text = data.text;
1223
1224                mfp.preloader.html(text);
1225
1226                mfp.preloader.find('a').on('click', function(e) {
1227                    e.stopImmediatePropagation();
1228                });
1229
1230                mfp.container.addClass('mfp-s-'+status);
1231                _prevStatus = status;
1232            }
1233        },
1234
1235
1236        /*
1237         "Private" helpers that aren't private at all
1238         */
1239        // Check to close popup or not
1240        // "target" is an element that was clicked
1241        _checkIfClose: function(target) {
1242
1243            if($(target).hasClass(PREVENT_CLOSE_CLASS)) {
1244                return;
1245            }
1246
1247            var closeOnContent = mfp.st.closeOnContentClick;
1248            var closeOnBg = mfp.st.closeOnBgClick;
1249
1250            if(closeOnContent && closeOnBg) {
1251                return true;
1252            } else {
1253
1254                // We close the popup if click is on close button or on preloader. Or if there is no content.
1255                if(!mfp.content || $(target).hasClass('mfp-close') || (mfp.preloader && target === mfp.preloader[0]) ) {
1256                    return true;
1257                }
1258
1259                // if click is outside the content
1260                if(  (target !== mfp.content[0] && !$.contains(mfp.content[0], target))  ) {
1261                    if(closeOnBg) {
1262                        // last check, if the clicked element is in DOM, (in case it's removed onclick)
1263                        if( $.contains(document, target) ) {
1264                            return true;
1265                        }
1266                    }
1267                } else if(closeOnContent) {
1268                    return true;
1269                }
1270
1271            }
1272            return false;
1273        },
1274        _addClassToMFP: function(cName) {
1275            mfp.bgOverlay.addClass(cName);
1276            mfp.wrap.addClass(cName);
1277        },
1278        _removeClassFromMFP: function(cName) {
1279            this.bgOverlay.removeClass(cName);
1280            mfp.wrap.removeClass(cName);
1281        },
1282        _hasScrollBar: function(winHeight) {
1283            return (  (mfp.isIE7 ? _document.height() : document.body.scrollHeight) > (winHeight || _window.height()) );
1284        },
1285        _setFocus: function() {
1286            (mfp.st.focus ? mfp.content.find(mfp.st.focus).eq(0) : mfp.wrap).focus();
1287        },
1288        _onFocusIn: function(e) {
1289            if( e.target !== mfp.wrap[0] && !$.contains(mfp.wrap[0], e.target) ) {
1290                mfp._setFocus();
1291                return false;
1292            }
1293        },
1294        _parseMarkup: function(template, values, item) {
1295            var arr;
1296            if(item.data) {
1297                values = $.extend(item.data, values);
1298            }
1299            _mfpTrigger(MARKUP_PARSE_EVENT, [template, values, item] );
1300
1301            $.each(values, function(key, value) {
1302                if(value === undefined || value === false) {
1303                    return true;
1304                }
1305                arr = key.split('_');
1306                if(arr.length > 1) {
1307                    var el = template.find(EVENT_NS + '-'+arr[0]);
1308
1309                    if(el.length > 0) {
1310                        var attr = arr[1];
1311                        if(attr === 'replaceWith') {
1312                            if(el[0] !== value[0]) {
1313                                el.replaceWith(value);
1314                            }
1315                        } else if(attr === 'img') {
1316                            if(el.is('img')) {
1317                                el.attr('src', value);
1318                            } else {
1319                                el.replaceWith( $('<img>').attr('src', value).attr('class', el.attr('class')) );
1320                            }
1321                        } else {
1322                            el.attr(arr[1], value);
1323                        }
1324                    }
1325
1326                } else {
1327                    template.find(EVENT_NS + '-'+key).html(value);
1328                }
1329            });
1330        },
1331
1332        _getScrollbarSize: function() {
1333            // thx David
1334            if(mfp.scrollbarSize === undefined) {
1335                var scrollDiv = document.createElement("div");
1336                scrollDiv.style.cssText = 'width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;';
1337                document.body.appendChild(scrollDiv);
1338                mfp.scrollbarSize = scrollDiv.offsetWidth - scrollDiv.clientWidth;
1339                document.body.removeChild(scrollDiv);
1340            }
1341            return mfp.scrollbarSize;
1342        }
1343
1344    }; /* MagnificPopup core prototype end */
1345
1346
1347
1348
1349    /**
1350     * Public static functions
1351     */
1352    $.magnificPopup = {
1353        instance: null,
1354        proto: MagnificPopup.prototype,
1355        modules: [],
1356
1357        open: function(options, index) {
1358            _checkInstance();
1359
1360            if(!options) {
1361                options = {};
1362            } else {
1363                options = $.extend(true, {}, options);
1364            }
1365
1366            options.isObj = true;
1367            options.index = index || 0;
1368            return this.instance.open(options);
1369        },
1370
1371        close: function() {
1372            return $.magnificPopup.instance && $.magnificPopup.instance.close();
1373        },
1374
1375        registerModule: function(name, module) {
1376            if(module.options) {
1377                $.magnificPopup.defaults[name] = module.options;
1378            }
1379            $.extend(this.proto, module.proto);
1380            this.modules.push(name);
1381        },
1382
1383        defaults: {
1384
1385            // Info about options is in docs:
1386            // http://dimsemenov.com/plugins/magnific-popup/documentation.html#options
1387
1388            disableOn: 0,
1389
1390            key: null,
1391
1392            midClick: false,
1393
1394            mainClass: '',
1395
1396            preloader: true,
1397
1398            focus: '', // CSS selector of input to focus after popup is opened
1399
1400            closeOnContentClick: false,
1401
1402            closeOnBgClick: true,
1403
1404            closeBtnInside: true,
1405
1406            showCloseBtn: true,
1407
1408            enableEscapeKey: true,
1409
1410            modal: false,
1411
1412            alignTop: false,
1413
1414            removalDelay: 0,
1415
1416            prependTo: null,
1417
1418            fixedContentPos: 'auto',
1419
1420            fixedBgPos: 'auto',
1421
1422            overflowY: 'auto',
1423
1424            closeMarkup: '<button title="%title%" type="button" class="mfp-close">&#215;</button>',
1425
1426            tClose: 'Close (Esc)',
1427
1428            tLoading: 'Loading...',
1429
1430            autoFocusLast: true
1431
1432        }
1433    };
1434
1435
1436
1437    $.fn.magnificPopup = function(options) {
1438        _checkInstance();
1439
1440        var jqEl = $(this);
1441
1442        // We call some API method of first param is a string
1443        if (typeof options === "string" ) {
1444
1445            if(options === 'open') {
1446                var items,
1447                    itemOpts = _isJQ ? jqEl.data('magnificPopup') : jqEl[0].magnificPopup,
1448                    index = parseInt(arguments[1], 10) || 0;
1449
1450                if(itemOpts.items) {
1451                    items = itemOpts.items[index];
1452                } else {
1453                    items = jqEl;
1454                    if(itemOpts.delegate) {
1455                        items = items.find(itemOpts.delegate);
1456                    }
1457                    items = items.eq( index );
1458                }
1459                mfp._openClick({mfpEl:items}, jqEl, itemOpts);
1460            } else {
1461                if(mfp.isOpen)
1462                    mfp[options].apply(mfp, Array.prototype.slice.call(arguments, 1));
1463            }
1464
1465        } else {
1466            // clone options obj
1467            options = $.extend(true, {}, options);
1468
1469            /*
1470             * As Zepto doesn't support .data() method for objects
1471             * and it works only in normal browsers
1472             * we assign "options" object directly to the DOM element. FTW!
1473             */
1474            if(_isJQ) {
1475                jqEl.data('magnificPopup', options);
1476            } else {
1477                jqEl[0].magnificPopup = options;
1478            }
1479
1480            mfp.addGroup(jqEl, options);
1481
1482        }
1483        return jqEl;
1484    };
1485
1486    /*>>core*/
1487
1488    /*>>inline*/
1489
1490    var INLINE_NS = 'inline',
1491        _hiddenClass,
1492        _inlinePlaceholder,
1493        _lastInlineElement,
1494        _putInlineElementsBack = function() {
1495            if(_lastInlineElement) {
1496                _inlinePlaceholder.after( _lastInlineElement.addClass(_hiddenClass) ).detach();
1497                _lastInlineElement = null;
1498            }
1499        };
1500
1501    $.magnificPopup.registerModule(INLINE_NS, {
1502        options: {
1503            hiddenClass: 'hide', // will be appended with `mfp-` prefix
1504            markup: '',
1505            tNotFound: 'Content not found'
1506        },
1507        proto: {
1508
1509            initInline: function() {
1510                mfp.types.push(INLINE_NS);
1511
1512                _mfpOn(CLOSE_EVENT+'.'+INLINE_NS, function() {
1513                    _putInlineElementsBack();
1514                });
1515            },
1516
1517            getInline: function(item, template) {
1518
1519                _putInlineElementsBack();
1520
1521                if(item.src) {
1522                    var inlineSt = mfp.st.inline,
1523                        el = $(item.src);
1524
1525                    if(el.length) {
1526
1527                        // If target element has parent - we replace it with placeholder and put it back after popup is closed
1528                        var parent = el[0].parentNode;
1529                        if(parent && parent.tagName) {
1530                            if(!_inlinePlaceholder) {
1531                                _hiddenClass = inlineSt.hiddenClass;
1532                                _inlinePlaceholder = _getEl(_hiddenClass);
1533                                _hiddenClass = 'mfp-'+_hiddenClass;
1534                            }
1535                            // replace target inline element with placeholder
1536                            _lastInlineElement = el.after(_inlinePlaceholder).detach().removeClass(_hiddenClass);
1537                        }
1538
1539                        mfp.updateStatus('ready');
1540                    } else {
1541                        mfp.updateStatus('error', inlineSt.tNotFound);
1542                        el = $('<div>');
1543                    }
1544
1545                    item.inlineElement = el;
1546                    return el;
1547                }
1548
1549                mfp.updateStatus('ready');
1550                mfp._parseMarkup(template, {}, item);
1551                return template;
1552            }
1553        }
1554    });
1555
1556    /*>>inline*/
1557
1558    /*>>ajax*/
1559    var AJAX_NS = 'ajax',
1560        _ajaxCur,
1561        _removeAjaxCursor = function() {
1562            if(_ajaxCur) {
1563                $(document.body).removeClass(_ajaxCur);
1564            }
1565        },
1566        _destroyAjaxRequest = function() {
1567            _removeAjaxCursor();
1568            if(mfp.req) {
1569                mfp.req.abort();
1570            }
1571        };
1572
1573    $.magnificPopup.registerModule(AJAX_NS, {
1574
1575        options: {
1576            settings: null,
1577            cursor: 'mfp-ajax-cur',
1578            tError: '<a href="%url%">The content</a> could not be loaded.'
1579        },
1580
1581        proto: {
1582            initAjax: function() {
1583                mfp.types.push(AJAX_NS);
1584                _ajaxCur = mfp.st.ajax.cursor;
1585
1586                _mfpOn(CLOSE_EVENT+'.'+AJAX_NS, _destroyAjaxRequest);
1587                _mfpOn('BeforeChange.' + AJAX_NS, _destroyAjaxRequest);
1588            },
1589            getAjax: function(item) {
1590
1591                if(_ajaxCur) {
1592                    $(document.body).addClass(_ajaxCur);
1593                }
1594
1595                mfp.updateStatus('loading');
1596
1597                var opts = $.extend({
1598                    url: item.src,
1599                    success: function(data, textStatus, jqXHR) {
1600                        var temp = {
1601                            data:data,
1602                            xhr:jqXHR
1603                        };
1604
1605                        _mfpTrigger('ParseAjax', temp);
1606
1607                        mfp.appendContent( $(temp.data), AJAX_NS );
1608
1609                        item.finished = true;
1610
1611                        _removeAjaxCursor();
1612
1613                        mfp._setFocus();
1614
1615                        setTimeout(function() {
1616                            mfp.wrap.addClass(READY_CLASS);
1617                        }, 16);
1618
1619                        mfp.updateStatus('ready');
1620
1621                        _mfpTrigger('AjaxContentAdded');
1622                    },
1623                    error: function() {
1624                        _removeAjaxCursor();
1625                        item.finished = item.loadError = true;
1626                        mfp.updateStatus('error', mfp.st.ajax.tError.replace('%url%', item.src));
1627                    }
1628                }, mfp.st.ajax.settings);
1629
1630                mfp.req = $.ajax(opts);
1631
1632                return '';
1633            }
1634        }
1635    });
1636
1637    /*>>ajax*/
1638
1639    /*>>image*/
1640    var _imgInterval,
1641        _getTitle = function(item) {
1642            if(item.data && item.data.title !== undefined)
1643                return item.data.title;
1644
1645            var src = mfp.st.image.titleSrc;
1646
1647            if(src) {
1648                if($.isFunction(src)) {
1649                    return src.call(mfp, item);
1650                } else if(item.el) {
1651                    return item.el.attr(src) || '';
1652                }
1653            }
1654            return '';
1655        };
1656
1657    $.magnificPopup.registerModule('image', {
1658
1659        options: {
1660            markup: '<div class="mfp-figure">'+
1661            '<div class="mfp-close"></div>'+
1662            '<figure>'+
1663            '<div class="mfp-img"></div>'+
1664            '<figcaption>'+
1665            '<div class="mfp-bottom-bar">'+
1666            '<div class="mfp-title"></div>'+
1667            '<div class="mfp-counter"></div>'+
1668            '</div>'+
1669            '</figcaption>'+
1670            '</figure>'+
1671            '</div>',
1672            cursor: 'mfp-zoom-out-cur',
1673            titleSrc: 'title',
1674            verticalFit: true,
1675            tError: '<a href="%url%">The image</a> could not be loaded.'
1676        },
1677
1678        proto: {
1679            initImage: function() {
1680                var imgSt = mfp.st.image,
1681                    ns = '.image';
1682
1683                mfp.types.push('image');
1684
1685                _mfpOn(OPEN_EVENT+ns, function() {
1686                    if(mfp.currItem.type === 'image' && imgSt.cursor) {
1687                        $(document.body).addClass(imgSt.cursor);
1688                    }
1689                });
1690
1691                _mfpOn(CLOSE_EVENT+ns, function() {
1692                    if(imgSt.cursor) {
1693                        $(document.body).removeClass(imgSt.cursor);
1694                    }
1695                    _window.off('resize' + EVENT_NS);
1696                });
1697
1698                _mfpOn('Resize'+ns, mfp.resizeImage);
1699                if(mfp.isLowIE) {
1700                    _mfpOn('AfterChange', mfp.resizeImage);
1701                }
1702            },
1703            resizeImage: function() {
1704                var item = mfp.currItem;
1705                if(!item || !item.img) return;
1706
1707                if(mfp.st.image.verticalFit) {
1708                    var decr = 0;
1709                    // fix box-sizing in ie7/8
1710                    if(mfp.isLowIE) {
1711                        decr = parseInt(item.img.css('padding-top'), 10) + parseInt(item.img.css('padding-bottom'),10);
1712                    }
1713                    item.img.css('max-height', mfp.wH-decr);
1714                }
1715            },
1716            _onImageHasSize: function(item) {
1717                if(item.img) {
1718
1719                    item.hasSize = true;
1720
1721                    if(_imgInterval) {
1722                        clearInterval(_imgInterval);
1723                    }
1724
1725                    item.isCheckingImgSize = false;
1726
1727                    _mfpTrigger('ImageHasSize', item);
1728
1729                    if(item.imgHidden) {
1730                        if(mfp.content)
1731                            mfp.content.removeClass('mfp-loading');
1732
1733                        item.imgHidden = false;
1734                    }
1735
1736                }
1737            },
1738
1739            /**
1740             * Function that loops until the image has size to display elements that rely on it asap
1741             */
1742            findImageSize: function(item) {
1743
1744                var counter = 0,
1745                    img = item.img[0],
1746                    mfpSetInterval = function(delay) {
1747
1748                        if(_imgInterval) {
1749                            clearInterval(_imgInterval);
1750                        }
1751                        // decelerating interval that checks for size of an image
1752                        _imgInterval = setInterval(function() {
1753                            if(img.naturalWidth > 0) {
1754                                mfp._onImageHasSize(item);
1755                                return;
1756                            }
1757
1758                            if(counter > 200) {
1759                                clearInterval(_imgInterval);
1760                            }
1761
1762                            counter++;
1763                            if(counter === 3) {
1764                                mfpSetInterval(10);
1765                            } else if(counter === 40) {
1766                                mfpSetInterval(50);
1767                            } else if(counter === 100) {
1768                                mfpSetInterval(500);
1769                            }
1770                        }, delay);
1771                    };
1772
1773                mfpSetInterval(1);
1774            },
1775
1776            getImage: function(item, template) {
1777
1778                var guard = 0,
1779
1780                // image load complete handler
1781                    onLoadComplete = function() {
1782                        if(item) {
1783                            if (item.img[0].complete) {
1784                                item.img.off('.mfploader');
1785
1786                                if(item === mfp.currItem){
1787                                    mfp._onImageHasSize(item);
1788
1789                                    mfp.updateStatus('ready');
1790                                }
1791
1792                                item.hasSize = true;
1793                                item.loaded = true;
1794
1795                                _mfpTrigger('ImageLoadComplete');
1796
1797                            }
1798                            else {
1799                                // if image complete check fails 200 times (20 sec), we assume that there was an error.
1800                                guard++;
1801                                if(guard < 200) {
1802                                    setTimeout(onLoadComplete,100);
1803                                } else {
1804                                    onLoadError();
1805                                }
1806                            }
1807                        }
1808                    },
1809
1810                // image error handler
1811                    onLoadError = function() {
1812                        if(item) {
1813                            item.img.off('.mfploader');
1814                            if(item === mfp.currItem){
1815                                mfp._onImageHasSize(item);
1816                                mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) );
1817                            }
1818
1819                            item.hasSize = true;
1820                            item.loaded = true;
1821                            item.loadError = true;
1822                        }
1823                    },
1824                    imgSt = mfp.st.image;
1825
1826
1827                var el = template.find('.mfp-img');
1828                if(el.length) {
1829                    var img = document.createElement('img');
1830                    img.className = 'mfp-img';
1831                    if(item.el && item.el.find('img').length) {
1832                        img.alt = item.el.find('img').attr('alt');
1833                    }
1834                    item.img = $(img).on('load.mfploader', onLoadComplete).on('error.mfploader', onLoadError);
1835                    img.src = item.src;
1836
1837                    // without clone() "error" event is not firing when IMG is replaced by new IMG
1838                    // TODO: find a way to avoid such cloning
1839                    if(el.is('img')) {
1840                        item.img = item.img.clone();
1841                    }
1842
1843                    img = item.img[0];
1844                    if(img.naturalWidth > 0) {
1845                        item.hasSize = true;
1846                    } else if(!img.width) {
1847                        item.hasSize = false;
1848                    }
1849                }
1850
1851                mfp._parseMarkup(template, {
1852                    title: _getTitle(item),
1853                    img_replaceWith: item.img
1854                }, item);
1855
1856                mfp.resizeImage();
1857
1858                if(item.hasSize) {
1859                    if(_imgInterval) clearInterval(_imgInterval);
1860
1861                    if(item.loadError) {
1862                        template.addClass('mfp-loading');
1863                        mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) );
1864                    } else {
1865                        template.removeClass('mfp-loading');
1866                        mfp.updateStatus('ready');
1867                    }
1868                    return template;
1869                }
1870
1871                mfp.updateStatus('loading');
1872                item.loading = true;
1873
1874                if(!item.hasSize) {
1875                    item.imgHidden = true;
1876                    template.addClass('mfp-loading');
1877                    mfp.findImageSize(item);
1878                }
1879
1880                return template;
1881            }
1882        }
1883    });
1884
1885    /*>>image*/
1886
1887    /*>>zoom*/
1888    var hasMozTransform,
1889        getHasMozTransform = function() {
1890            if(hasMozTransform === undefined) {
1891                hasMozTransform = document.createElement('p').style.MozTransform !== undefined;
1892            }
1893            return hasMozTransform;
1894        };
1895
1896    $.magnificPopup.registerModule('zoom', {
1897
1898        options: {
1899            enabled: false,
1900            easing: 'ease-in-out',
1901            duration: 300,
1902            opener: function(element) {
1903                return element.is('img') ? element : element.find('img');
1904            }
1905        },
1906
1907        proto: {
1908
1909            initZoom: function() {
1910                var zoomSt = mfp.st.zoom,
1911                    ns = '.zoom',
1912                    image;
1913
1914                if(!zoomSt.enabled || !mfp.supportsTransition) {
1915                    return;
1916                }
1917
1918                var duration = zoomSt.duration,
1919                    getElToAnimate = function(image) {
1920                        var newImg = image.clone().removeAttr('style').removeAttr('class').addClass('mfp-animated-image'),
1921                            transition = 'all '+(zoomSt.duration/1000)+'s ' + zoomSt.easing,
1922                            cssObj = {
1923                                position: 'fixed',
1924                                zIndex: 9999,
1925                                left: 0,
1926                                top: 0,
1927                                '-webkit-backface-visibility': 'hidden'
1928                            },
1929                            t = 'transition';
1930
1931                        cssObj['-webkit-'+t] = cssObj['-moz-'+t] = cssObj['-o-'+t] = cssObj[t] = transition;
1932
1933                        newImg.css(cssObj);
1934                        return newImg;
1935                    },
1936                    showMainContent = function() {
1937                        mfp.content.css('visibility', 'visible');
1938                    },
1939                    openTimeout,
1940                    animatedImg;
1941
1942                _mfpOn('BuildControls'+ns, function() {
1943                    if(mfp._allowZoom()) {
1944
1945                        clearTimeout(openTimeout);
1946                        mfp.content.css('visibility', 'hidden');
1947
1948                        // Basically, all code below does is clones existing image, puts in on top of the current one and animated it
1949
1950                        image = mfp._getItemToZoom();
1951
1952                        if(!image) {
1953                            showMainContent();
1954                            return;
1955                        }
1956
1957                        animatedImg = getElToAnimate(image);
1958
1959                        animatedImg.css( mfp._getOffset() );
1960
1961                        mfp.wrap.append(animatedImg);
1962
1963                        openTimeout = setTimeout(function() {
1964                            animatedImg.css( mfp._getOffset( true ) );
1965                            openTimeout = setTimeout(function() {
1966
1967                                showMainContent();
1968
1969                                setTimeout(function() {
1970                                    animatedImg.remove();
1971                                    image = animatedImg = null;
1972                                    _mfpTrigger('ZoomAnimationEnded');
1973                                }, 16); // avoid blink when switching images
1974
1975                            }, duration); // this timeout equals animation duration
1976
1977                        }, 16); // by adding this timeout we avoid short glitch at the beginning of animation
1978
1979
1980                        // Lots of timeouts...
1981                    }
1982                });
1983                _mfpOn(BEFORE_CLOSE_EVENT+ns, function() {
1984                    if(mfp._allowZoom()) {
1985
1986                        clearTimeout(openTimeout);
1987
1988                        mfp.st.removalDelay = duration;
1989
1990                        if(!image) {
1991                            image = mfp._getItemToZoom();
1992                            if(!image) {
1993                                return;
1994                            }
1995                            animatedImg = getElToAnimate(image);
1996                        }
1997
1998                        animatedImg.css( mfp._getOffset(true) );
1999                        mfp.wrap.append(animatedImg);
2000                        mfp.content.css('visibility', 'hidden');
2001
2002                        setTimeout(function() {
2003                            animatedImg.css( mfp._getOffset() );
2004                        }, 16);
2005                    }
2006
2007                });
2008
2009                _mfpOn(CLOSE_EVENT+ns, function() {
2010                    if(mfp._allowZoom()) {
2011                        showMainContent();
2012                        if(animatedImg) {
2013                            animatedImg.remove();
2014                        }
2015                        image = null;
2016                    }
2017                });
2018            },
2019
2020            _allowZoom: function() {
2021                return mfp.currItem.type === 'image';
2022            },
2023
2024            _getItemToZoom: function() {
2025                if(mfp.currItem.hasSize) {
2026                    return mfp.currItem.img;
2027                } else {
2028                    return false;
2029                }
2030            },
2031
2032            // Get element postion relative to viewport
2033            _getOffset: function(isLarge) {
2034                var el;
2035                if(isLarge) {
2036                    el = mfp.currItem.img;
2037                } else {
2038                    el = mfp.st.zoom.opener(mfp.currItem.el || mfp.currItem);
2039                }
2040
2041                var offset = el.offset();
2042                var paddingTop = parseInt(el.css('padding-top'),10);
2043                var paddingBottom = parseInt(el.css('padding-bottom'),10);
2044                offset.top -= ( $(window).scrollTop() - paddingTop );
2045
2046
2047                /*
2048                 Animating left + top + width/height looks glitchy in Firefox, but perfect in Chrome. And vice-versa.
2049                 */
2050                var obj = {
2051                    width: el.width(),
2052                    // fix Zepto height+padding issue
2053                    height: (_isJQ ? el.innerHeight() : el[0].offsetHeight) - paddingBottom - paddingTop
2054                };
2055
2056                // I hate to do this, but there is no another option
2057                if( getHasMozTransform() ) {
2058                    obj['-moz-transform'] = obj['transform'] = 'translate(' + offset.left + 'px,' + offset.top + 'px)';
2059                } else {
2060                    obj.left = offset.left;
2061                    obj.top = offset.top;
2062                }
2063                return obj;
2064            }
2065
2066        }
2067    });
2068
2069
2070
2071    /*>>zoom*/
2072
2073    /*>>iframe*/
2074
2075    var IFRAME_NS = 'iframe',
2076        _emptyPage = '//about:blank',
2077
2078        _fixIframeBugs = function(isShowing) {
2079            if(mfp.currTemplate[IFRAME_NS]) {
2080                var el = mfp.currTemplate[IFRAME_NS].find('iframe');
2081                if(el.length) {
2082                    // reset src after the popup is closed to avoid "video keeps playing after popup is closed" bug
2083                    if(!isShowing) {
2084                        el[0].src = _emptyPage;
2085                    }
2086
2087                    // IE8 black screen bug fix
2088                    if(mfp.isIE8) {
2089                        el.css('display', isShowing ? 'block' : 'none');
2090                    }
2091                }
2092            }
2093        };
2094
2095    $.magnificPopup.registerModule(IFRAME_NS, {
2096
2097        options: {
2098            markup: '<div class="mfp-iframe-scaler">'+
2099            '<div class="mfp-close"></div>'+
2100            '<iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe>'+
2101            '</div>',
2102
2103            srcAction: 'iframe_src',
2104
2105            // we don't care and support only one default type of URL by default
2106            patterns: {
2107                youtube: {
2108                    index: 'youtube.com',
2109                    id: 'v=',
2110                    src: '//www.youtube.com/embed/%id%?autoplay=1'
2111                },
2112                vimeo: {
2113                    index: 'vimeo.com/',
2114                    id: '/',
2115                    src: '//player.vimeo.com/video/%id%?autoplay=1'
2116                },
2117                gmaps: {
2118                    index: '//maps.google.',
2119                    src: '%id%&output=embed'
2120                }
2121            }
2122        },
2123
2124        proto: {
2125            initIframe: function() {
2126                mfp.types.push(IFRAME_NS);
2127
2128                _mfpOn('BeforeChange', function(e, prevType, newType) {
2129                    if(prevType !== newType) {
2130                        if(prevType === IFRAME_NS) {
2131                            _fixIframeBugs(); // iframe if removed
2132                        } else if(newType === IFRAME_NS) {
2133                            _fixIframeBugs(true); // iframe is showing
2134                        }
2135                    }// else {
2136                    // iframe source is switched, don't do anything
2137                    //}
2138                });
2139
2140                _mfpOn(CLOSE_EVENT + '.' + IFRAME_NS, function() {
2141                    _fixIframeBugs();
2142                });
2143            },
2144
2145            getIframe: function(item, template) {
2146                var embedSrc = item.src;
2147                var iframeSt = mfp.st.iframe;
2148
2149                $.each(iframeSt.patterns, function() {
2150                    if(embedSrc.indexOf( this.index ) > -1) {
2151                        if(this.id) {
2152                            if(typeof this.id === 'string') {
2153                                embedSrc = embedSrc.substr(embedSrc.lastIndexOf(this.id)+this.id.length, embedSrc.length);
2154                            } else {
2155                                embedSrc = this.id.call( this, embedSrc );
2156                            }
2157                        }
2158                        embedSrc = this.src.replace('%id%', embedSrc );
2159                        return false; // break;
2160                    }
2161                });
2162
2163                var dataObj = {};
2164                if(iframeSt.srcAction) {
2165                    dataObj[iframeSt.srcAction] = embedSrc;
2166                }
2167                mfp._parseMarkup(template, dataObj, item);
2168
2169                mfp.updateStatus('ready');
2170
2171                return template;
2172            }
2173        }
2174    });
2175
2176
2177
2178    /*>>iframe*/
2179
2180    /*>>gallery*/
2181    /**
2182     * Get looped index depending on number of slides
2183     */
2184    var _getLoopedId = function(index) {
2185            var numSlides = mfp.items.length;
2186            if(index > numSlides - 1) {
2187                return index - numSlides;
2188            } else  if(index < 0) {
2189                return numSlides + index;
2190            }
2191            return index;
2192        },
2193        _replaceCurrTotal = function(text, curr, total) {
2194            return text.replace(/%curr%/gi, curr + 1).replace(/%total%/gi, total);
2195        };
2196
2197    $.magnificPopup.registerModule('gallery', {
2198
2199        options: {
2200            enabled: false,
2201            arrowMarkup: '<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',
2202            preload: [0,2],
2203            navigateByImgClick: true,
2204            arrows: true,
2205
2206            tPrev: 'Previous (Left arrow key)',
2207            tNext: 'Next (Right arrow key)',
2208            tCounter: '%curr% of %total%'
2209        },
2210
2211        proto: {
2212            initGallery: function() {
2213
2214                var gSt = mfp.st.gallery,
2215                    ns = '.mfp-gallery';
2216
2217                mfp.direction = true; // true - next, false - prev
2218
2219                if(!gSt || !gSt.enabled ) return false;
2220
2221                _wrapClasses += ' mfp-gallery';
2222
2223                _mfpOn(OPEN_EVENT+ns, function() {
2224
2225                    if(gSt.navigateByImgClick) {
2226                        mfp.wrap.on('click'+ns, '.mfp-img', function() {
2227                            if(mfp.items.length > 1) {
2228                                mfp.next();
2229                                return false;
2230                            }
2231                        });
2232                    }
2233
2234                    _document.on('keydown'+ns, function(e) {
2235                        if (e.keyCode === 37) {
2236                            mfp.prev();
2237                        } else if (e.keyCode === 39) {
2238                            mfp.next();
2239                        }
2240                    });
2241                });
2242
2243                _mfpOn('UpdateStatus'+ns, function(e, data) {
2244                    if(data.text) {
2245                        data.text = _replaceCurrTotal(data.text, mfp.currItem.index, mfp.items.length);
2246                    }
2247                });
2248
2249                _mfpOn(MARKUP_PARSE_EVENT+ns, function(e, element, values, item) {
2250                    var l = mfp.items.length;
2251                    values.counter = l > 1 ? _replaceCurrTotal(gSt.tCounter, item.index, l) : '';
2252                });
2253
2254                _mfpOn('BuildControls' + ns, function() {
2255                    if(mfp.items.length > 1 && gSt.arrows && !mfp.arrowLeft) {
2256                        var markup = gSt.arrowMarkup,
2257                            arrowLeft = mfp.arrowLeft = $( markup.replace(/%title%/gi, gSt.tPrev).replace(/%dir%/gi, 'left') ).addClass(PREVENT_CLOSE_CLASS),
2258                            arrowRight = mfp.arrowRight = $( markup.replace(/%title%/gi, gSt.tNext).replace(/%dir%/gi, 'right') ).addClass(PREVENT_CLOSE_CLASS);
2259
2260                        arrowLeft.click(function() {
2261                            mfp.prev();
2262                        });
2263                        arrowRight.click(function() {
2264                            mfp.next();
2265                        });
2266
2267                        mfp.container.append(arrowLeft.add(arrowRight));
2268                    }
2269                });
2270
2271                _mfpOn(CHANGE_EVENT+ns, function() {
2272                    if(mfp._preloadTimeout) clearTimeout(mfp._preloadTimeout);
2273
2274                    mfp._preloadTimeout = setTimeout(function() {
2275                        mfp.preloadNearbyImages();
2276                        mfp._preloadTimeout = null;
2277                    }, 16);
2278                });
2279
2280
2281                _mfpOn(CLOSE_EVENT+ns, function() {
2282                    _document.off(ns);
2283                    mfp.wrap.off('click'+ns);
2284                    mfp.arrowRight = mfp.arrowLeft = null;
2285                });
2286
2287            },
2288            next: function() {
2289                mfp.direction = true;
2290                mfp.index = _getLoopedId(mfp.index + 1);
2291                mfp.updateItemHTML();
2292            },
2293            prev: function() {
2294                mfp.direction = false;
2295                mfp.index = _getLoopedId(mfp.index - 1);
2296                mfp.updateItemHTML();
2297            },
2298            goTo: function(newIndex) {
2299                mfp.direction = (newIndex >= mfp.index);
2300                mfp.index = newIndex;
2301                mfp.updateItemHTML();
2302            },
2303            preloadNearbyImages: function() {
2304                var p = mfp.st.gallery.preload,
2305                    preloadBefore = Math.min(p[0], mfp.items.length),
2306                    preloadAfter = Math.min(p[1], mfp.items.length),
2307                    i;
2308
2309                for(i = 1; i <= (mfp.direction ? preloadAfter : preloadBefore); i++) {
2310                    mfp._preloadItem(mfp.index+i);
2311                }
2312                for(i = 1; i <= (mfp.direction ? preloadBefore : preloadAfter); i++) {
2313                    mfp._preloadItem(mfp.index-i);
2314                }
2315            },
2316            _preloadItem: function(index) {
2317                index = _getLoopedId(index);
2318
2319                if(mfp.items[index].preloaded) {
2320                    return;
2321                }
2322
2323                var item = mfp.items[index];
2324                if(!item.parsed) {
2325                    item = mfp.parseEl( index );
2326                }
2327
2328                _mfpTrigger('LazyLoad', item);
2329
2330                if(item.type === 'image') {
2331                    item.img = $('<img class="mfp-img" />').on('load.mfploader', function() {
2332                        item.hasSize = true;
2333                    }).on('error.mfploader', function() {
2334                        item.hasSize = true;
2335                        item.loadError = true;
2336                        _mfpTrigger('LazyLoadError', item);
2337                    }).attr('src', item.src);
2338                }
2339
2340
2341                item.preloaded = true;
2342            }
2343        }
2344    });
2345
2346    /*>>gallery*/
2347
2348    /*>>retina*/
2349
2350    var RETINA_NS = 'retina';
2351
2352    $.magnificPopup.registerModule(RETINA_NS, {
2353        options: {
2354            replaceSrc: function(item) {
2355                return item.src.replace(/\.\w+$/, function(m) { return '@2x' + m; });
2356            },
2357            ratio: 1 // Function or number.  Set to 1 to disable.
2358        },
2359        proto: {
2360            initRetina: function() {
2361                if(window.devicePixelRatio > 1) {
2362
2363                    var st = mfp.st.retina,
2364                        ratio = st.ratio;
2365
2366                    ratio = !isNaN(ratio) ? ratio : ratio();
2367
2368                    if(ratio > 1) {
2369                        _mfpOn('ImageHasSize' + '.' + RETINA_NS, function(e, item) {
2370                            item.img.css({
2371                                'max-width': item.img[0].naturalWidth / ratio,
2372                                'width': '100%'
2373                            });
2374                        });
2375                        _mfpOn('ElementParse' + '.' + RETINA_NS, function(e, item) {
2376                            item.src = st.replaceSrc(item, ratio);
2377                        });
2378                    }
2379                }
2380
2381            }
2382        }
2383    });
2384
2385    /*>>retina*/
2386    _checkInstance(); }));
2387var ol=function(){"use strict";class t{constructor(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}}function e(t){t.stopPropagation()}var i="propertychange";class n{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}function r(t,e,i){let n,r;i=i||s;let o=0,a=t.length,l=!1;for(;o<a;)n=o+(a-o>>1),r=+i(t[n],e),r<0?o=n+1:(a=n,l=!r);return l?o:~o}function s(t,e){return t>e?1:t<e?-1:0}function o(t,e){return t<e?1:t>e?-1:0}function a(t,e,i){if(t[0]<=e)return 0;const n=t.length;if(e<=t[n-1])return n-1;if("function"==typeof i){for(let r=1;r<n;++r){const n=t[r];if(n===e)return r;if(n<e)return i(e,t[r-1],n)>0?r-1:r}return n-1}if(i>0){for(let i=1;i<n;++i)if(t[i]<e)return i-1;return n-1}if(i<0){for(let i=1;i<n;++i)if(t[i]<=e)return i;return n-1}for(let i=1;i<n;++i){if(t[i]==e)return i;if(t[i]<e)return t[i-1]-e<e-t[i]?i-1:i}return n-1}function l(t,e,i){for(;e<i;){const n=t[e];t[e]=t[i],t[i]=n,++e,--i}}function h(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 c(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 u(t,e,i){const n=e||s;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 d(){return!0}function g(){return!1}function f(){}function p(t){let e,i,n;return function(){const r=Array.prototype.slice.call(arguments);return i&&this===n&&c(r,i)||(n=this,i=r,e=t.apply(this,arguments)),e}}function m(t){return function(){let e;try{e=t()}catch(t){return Promise.reject(t)}return e instanceof Promise?e:Promise.resolve(e)}()}function _(t){for(const e in t)delete t[e]}function y(t){let e;for(e in t)return!1;return!e}class x extends n{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)}
vendor: 43,690 bytes, line 2387
2387dispatchEvent(e){const i="string"==typeof e,n=i?e:e.type,r=this.listeners_&&this.listeners_[n];if(!r)return;const s=i?new t(e):e;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,f);delete o[n]}return l}disposeInternal(){this.listeners_&&_(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){if(!this.listeners_)return;const i=this.listeners_[t];if(!i)return;const n=i.indexOf(e);-1!==n&&(this.pendingRemovals_&&t in this.pendingRemovals_?(i[n]=f,++this.pendingRemovals_[t]):(i.splice(n,1),0===i.length&&delete this.listeners_[t]))}}var v="change",S="error",E="contextmenu",w="click",T="dblclick",C="dragenter",R="dragover",b="drop",P="keydown",I="keypress",L="load",F="touchmove",M="wheel";function A(t,e,i,n,r){if(r){const r=i;i=function(){t.removeEventListener(e,i),r.apply(n??this,arguments)}}else n&&n!==t&&(i=i.bind(n));const s={target:t,type:e,listener:i};return t.addEventListener(e,i),s}function O(t,e,i,n){return A(t,e,i,n,!0)}function D(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),_(t))}class N extends x{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(v)}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]=A(this,t[r],e);return n}return A(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]=O(this,t[r],e)}else i=O(this,t,e);return e.ol_key=i,i}unInternal(t,e){const i=e.ol_key;if(i)k(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 k(t){if(Array.isArray(t))for(let e=0,i=t.length;e<i;++e)D(t[e]);else D(t)}function G(){throw new Error("Unimplemented abstract method.")}N.prototype.on,N.prototype.once,N.prototype.un;let j=0;function U(t){return t.ol_uid||(t.ol_uid=String(++j))}class B extends t{constructor(t,e,i){super(t),this.key=e,this.oldValue=i}}class z extends N{constructor(t){super(),this.on,this.once,this.un,U(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_)||{}}getPropertiesInternal(){return this.values_}hasProperties(){return!!this.values_}notify(t,e){let n;n=`change:${t}`,this.hasListener(n)&&this.dispatchEvent(new B(n,t,e)),n=i,this.hasListener(n)&&this.dispatchEvent(new B(n,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],y(this.values_)&&(this.values_=null),e||this.notify(t,i)}}}var X="add",V="remove";const $="length";class W extends t{constructor(t,e,i){super(t),this.element=e,this.index=i}}class Z extends z{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($)}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 W(X,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 W(V,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 W(V,i,t)),this.dispatchEvent(new W(X,e,t))}updateLength_(){this.set($,this.array_.length)}assertUnique_(t,e){for(let i=0,n=this.array_.length;i<n;++i)if(this.array_[i]===t&&i!==e)throw new Error("Duplicate item added to a unique collection")}}var Y=0,H=1,K=2,q=3,J=4;function Q(t){return Math.pow(t,3)}function tt(t){return 1-Q(1-t)}function et(t){return 3*t*t-2*t*t*t}function it(t){return t}class nt extends x{constructor(t,e,i){super(),i=i||{},this.tileCoord=t,this.state=e,this.key="",this.transition_=void 0===i.transition?250:i.transition,this.transitionStarts_={},this.interpolate=!!i.interpolate}changed(){this.dispatchEvent(v)}release(){this.state===q&&this.setState(J)}getKey(){return this.key+"/"+this.tileCoord}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(){G()}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:Q(n/this.transition_)}inTransition(t){return!!this.transition_&&-1!==this.transitionStarts_[t]}endTransition(t){this.transition_&&(this.transitionStarts_[t]=-1)}disposeInternal(){this.release(),super.disposeInternal()}}const rt="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"",st=rt.includes("firefox"),ot=rt.includes("safari")&&!rt.includes("chrom"),at=ot&&(rt.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(rt)),lt=rt.includes("webkit")&&!rt.includes("edge"),ht=rt.includes("macintosh"),ct="undefined"!=typeof devicePixelRatio?devicePixelRatio:1,ut="undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&self instanceof WorkerGlobalScope,dt="undefined"!=typeof Image&&Image.prototype.decode,gt="function"==typeof createImageBitmap,ft=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}();function pt(t,e,i,n){let r;return r=i&&i.length?i.shift():ut?new OffscreenCanvas(t||300,e||300):document.createElement("canvas"),t&&(r.width=t),e&&(r.height=e),r.getContext("2d",n)}let mt;function _t(){return mt||(mt=pt(1,1)),mt}function yt(t){const e=t.canvas;e.width=1,e.height=1,t.clearRect(0,0,1,1)}function xt(t){let e=t.offsetWidth;const i=getComputedStyle(t);return e+=parseInt(i.marginLeft,10)+parseInt(i.marginRight,10),e}function vt(t){let e=t.offsetHeight;const i=getComputedStyle(t);return e+=parseInt(i.marginTop,10)+parseInt(i.marginBottom,10),e}function St(t,e){const i=e.parentNode;i&&i.replaceChild(t,e)}function Et(t){for(;t.lastChild;)t.lastChild.remove()}function wt(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))}}function Tt(t){return t instanceof Image||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageBitmap?t:null}function Ct(t){return t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Float32Array||t instanceof DataView?t:null}const Rt=new Error("disposed");let bt=null;function Pt(t){bt||(bt=pt(t.width,t.height,void 0,{willReadFrequently:!0}));const e=bt.canvas,i=t.width;e.width!==i&&(e.width=i);const n=t.height;return e.height!==n&&(e.height=n),bt.clearRect(0,0,i,n),bt.drawImage(t,0,0),bt.getImageData(0,0,i,n).data}const It=[256,256];class Lt extends nt{constructor(t){const e=Y;super(t.tileCoord,e,{transition:t.transition,interpolate:t.interpolate}),this.loader_=t.loader,this.data_=null,this.error_=null,this.size_=t.size||null,this.controller_=t.controller||null}getSize(){if(this.size_)return this.size_;const t=Tt(this.data_);return t?[t.width,t.height]:It}getData(){return this.data_}getError(){return this.error_}load(){if(this.state!==Y&&this.state!==q)return;this.state=H,this.changed();const t=this;this.loader_().then((function(e){t.data_=e,t.state=K,t.changed()})).catch((function(e){t.error_=e,t.state=q,t.changed()}))}disposeInternal(){this.controller_&&(this.controller_.abort(Rt),this.controller_=null),super.disposeInternal()}}function Ft(t,e){if(!t)throw new Error(e)}class Mt extends z{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 Mt(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_&&(D(this.geometryChangeKey_),this.geometryChangeKey_=null);const t=this.getGeometry();t&&(this.geometryChangeKey_=A(t,v,this.handleGeometryChange_,this)),this.changed()}setGeometry(t){this.set(this.geometryName_,t)}setStyle(t){this.style_=t,this.styleFunction_=t?At(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 At(t){if("function"==typeof t)return t;let e;if(Array.isArray(t))e=t;else{Ft("function"==typeof t.getZIndex,"Expected an `ol/style/Style` or an array of `ol/style/Style.js`");e=[t]}return function(){return e}}const Ot=new Array(6);function Dt(){return[1,0,0,1,0,0]}function Nt(t){return Gt(t,1,0,0,1,0,0)}function kt(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 Gt(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 jt(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 Ut(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 Bt(t,e){const i=Math.cos(e),n=Math.sin(e);return kt(t,Gt(Ot,i,n,-n,i,0,0))}function zt(t,e,i){return kt(t,Gt(Ot,e,0,0,i,0,0))}function Xt(t,e,i){return kt(t,Gt(Ot,1,0,0,1,e,i))}function Vt(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 $t(t,e){const i=Wt(e);Ft(0!==i,"Transformation matrix cannot be inverted");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 Wt(t){return t[0]*t[3]-t[1]*t[2]}const Zt=[1e6,1e6,1e6,1e6,2,2];function Yt(t){return"matrix("+t.map(((t,e)=>Math.round(t*Zt[e])/Zt[e])).join(", ")+")"}var Ht={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function Kt(t){const e=re();for(let i=0,n=t.length;i<n;++i)de(e,t[i]);return e}function qt(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 Jt(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t.slice()}function Qt(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 te(t,e){return ie(t,e[0],e[1])}function ee(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}function ie(t,e,i){return t[0]<=e&&e<=t[2]&&t[1]<=i&&i<=t[3]}function ne(t,e){const i=t[0],n=t[1],r=t[2],s=t[3],o=e[0],a=e[1];let l=Ht.UNKNOWN;return o<i?l|=Ht.LEFT:o>r&&(l|=Ht.RIGHT),a<n?l|=Ht.BELOW:a>s&&(l|=Ht.ABOVE),l===Ht.UNKNOWN&&(l=Ht.INTERSECTING),l}function re(){return[1/0,1/0,-1/0,-1/0]}function se(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 oe(t){return se(1/0,1/0,-1/0,-1/0,t)}function ae(t,e){const i=t[0],n=t[1];return se(i,n,i,n,e)}function le(t,e,i,n,r){return fe(oe(r),t,e,i,n)}function he(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function ce(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 ue(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 de(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 ge(t,e){for(let i=0,n=e.length;i<n;++i)de(t,e[i]);return t}function fe(t,e,i,n,r){for(;i<n;i+=r)me(t,e[i],e[i+1]);return t}function pe(t,e){for(let i=0,n=e.length;i<n;++i)ge(t,e[i]);return t}function me(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 _e(t,e){let i;return i=e(xe(t)),i||(i=e(ve(t)),i||(i=e(Pe(t)),i||(i=e(be(t)),i||!1)))}function ye(t){let e=0;return Fe(t)||(e=Ie(t)*Ce(t)),e}function xe(t){return[t[0],t[1]]}function ve(t){return[t[2],t[1]]}function Se(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function Ee(t,e){let i;if("bottom-left"===e)i=xe(t);else if("bottom-right"===e)i=ve(t);else if("top-left"===e)i=be(t);else{if("top-right"!==e)throw new Error("Invalid corner");i=Pe(t)}return i}function we(t,e,i,n,r){const[s,o,a,l,h,c,u,d]=Te(t,e,i,n);return se(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 Te(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 Ce(t){return t[3]-t[1]}function Re(t,e,i){const n=i||[1/0,1/0,-1/0,-1/0];return Le(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]):oe(n),n}function be(t){return[t[0],t[3]]}function Pe(t){return[t[2],t[3]]}function Ie(t){return t[2]-t[0]}function Le(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function Fe(t){return t[2]<t[0]||t[3]<t[1]}function Me(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t}function Ae(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 Oe(t,e,i){let n=!1;const r=ne(t,e),s=ne(t,i);if(r===Ht.INTERSECTING||s===Ht.INTERSECTING)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&Ht.ABOVE&&!(r&Ht.ABOVE)&&(p=d-(g-h)/f,n=p>=o&&p<=l),n||!(s&Ht.RIGHT)||r&Ht.RIGHT||(m=g-(d-l)*f,n=m>=a&&m<=h),n||!(s&Ht.BELOW)||r&Ht.BELOW||(p=d-(g-a)/f,n=p>=o&&p<=l),n||!(s&Ht.LEFT)||r&Ht.LEFT||(m=g-(d-o)*f,n=m>=a&&m<=h)}return n}function De(t,e,i,n){if(Fe(t))return oe(i);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 se(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 Ne(t,e){const i=e.getExtent(),n=Se(t);if(e.canWrapX()&&(n[0]<i[0]||n[0]>=i[2])){const e=Ie(i),r=Math.floor((n[0]-i[0])/e)*e;t[0]-=r,t[2]-=r}return t}function ke(t,e,i){if(e.canWrapX()){const n=e.getExtent();if(!isFinite(t[0])||!isFinite(t[2]))return[[n[0],t[1],n[2],t[3]]];Ne(t,e);const r=Ie(n);if(Ie(t)>r&&!i)return[[n[0],t[1],n[2],t[3]]];if(t[0]<n[0])return[[t[0]+r,t[1],n[2],t[3]],[n[0],t[1],t[2],t[3]]];if(t[2]>n[2])return[[t[0],t[1],n[2],t[3]],[n[0],t[1],t[2]-r,t[3]]]}return[t]}const Ge={9001:"m",9002:"ft",9003:"us-ft",9101:"radians",9102:"degrees"};function je(t){return Ge[t]}const Ue={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};class Be{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_||Ue[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 ze=6378137,Xe=Math.PI*ze,Ve=[-Xe,-Xe,Xe,Xe],$e=[-180,-85,180,85],We=ze*Math.log(Math.tan(Math.PI/2));class Ze extends Be{constructor(t){super({code:t,units:"m",extent:Ve,global:!0,worldExtent:$e,getPointResolution:function(t,e){return t/Math.cosh(e[1]/ze)}})}}const Ye=[new Ze("EPSG:3857"),new Ze("EPSG:102100"),new Ze("EPSG:102113"),new Ze("EPSG:900913"),new Ze("http://www.opengis.net/def/crs/EPSG/0/3857"),new Ze("http://www.opengis.net/gml/srs/epsg.xml#3857")];function He(t,e,i,n){const r=t.length;i=i>1?i:2,n=n??i,void 0===e&&(e=i>2?t.slice():new Array(r));for(let i=0;i<r;i+=n){e[i]=Xe*t[i]/180;let n=ze*Math.log(Math.tan(Math.PI*(+t[i+1]+90)/360));n>We?n=We:n<-We&&(n=-We),e[i+1]=n}return e}function Ke(t,e,i,n){const r=t.length;i=i>1?i:2,n=n??i,void 0===e&&(e=i>2?t.slice():new Array(r));for(let i=0;i<r;i+=n)e[i]=180*t[i]/Xe,e[i+1]=360*Math.atan(Math.exp(t[i+1]/ze))/Math.PI-90;return e}const qe=6378137,Je=[-180,-90,180,90],Qe=Math.PI*qe/180;class ti extends Be{constructor(t,e){super({code:t,units:"degrees",extent:Je,axisOrientation:e,global:!0,metersPerUnit:Qe,worldExtent:Je})}}const ei=[new ti("CRS:84"),new ti("EPSG:4326","neu"),new ti("urn:ogc:def:crs:OGC:1.3:CRS84"),new ti("urn:ogc:def:crs:OGC:2:84"),new ti("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new ti("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new ti("http://www.opengis.net/def/crs/EPSG/0/4326","neu")];let ii={};function ni(){ii={}}function ri(t){return ii[t]||ii[t.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}function si(t,e){ii[t]=e}let oi={};function ai(){oi={}}function li(t,e,i){const n=t.getCode(),r=e.getCode();n in oi||(oi[n]={}),oi[n][r]=i}function hi(t,e){let i;return t in oi&&e in oi[t]&&(i=oi[t][e]),i}function ci(t,e,i){return Math.min(Math.max(t,e),i)}function ui(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 di(t,e,i,n)}function di(t,e,i,n){const r=i-t,s=n-e;return r*r+s*s}function gi(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 fi(t){return 180*t/Math.PI}function pi(t){return t*Math.PI/180}function mi(t,e){const i=t%e;return i*e<0?i+e:i}function _i(t,e,i){return t+i*(e-t)}function yi(t,e){const i=Math.pow(10,e);return Math.round(t*i)/i}function xi(t,e){return Math.round(yi(t,e))}function vi(t,e){return Math.floor(yi(t,e))}function Si(t,e){return Math.ceil(yi(t,e))}function Ei(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 wi(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 Ti(t,e){return t[0]+=+e[0],t[1]+=+e[1],t}function Ci(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 Ri(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 bi(t,e,i){const n=mi(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=yi(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+=" "+Ei(a,2)+"′"),0!==l&&(h+=" "+Ei(l,2,s)+"″"),0!==n&&(h+=" "+t.charAt(n<0?1:0)),h}function Pi(t,e,i){return t?e.replace("{x}",t[0].toFixed(i)).replace("{y}",t[1].toFixed(i)):""}function Ii(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 Li(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 Fi(t,e){return t[0]*=e,t[1]*=e,t}function Mi(t,e){const i=t[0]-e[0],n=t[1]-e[1];return i*i+n*n}function Ai(t,e){return Math.sqrt(Mi(t,e))}function Oi(t,e){return Mi(t,Ri(t,e))}function Di(t,e){return Pi(t,"{x}, {y}",e)}function Ni(t,e){if(e.canWrapX()){const i=Ie(e.getExtent()),n=ki(t,e,i);n&&(t[0]-=n*i)}return t}function ki(t,e,i){const n=e.getExtent();let r=0;return e.canWrapX()&&(t[0]<n[0]||t[0]>n[2])&&(i=i||Ie(n),r=Math.floor((t[0]-n[0])/i)),r}const Gi=6371008.8;function ji(t,e,i){i=i||Gi;const n=pi(t[1]),r=pi(e[1]),s=(r-n)/2,o=pi(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 Ui(t,e){let i=0;for(let n=0,r=t.length;n<r-1;++n)i+=ji(t[n],t[n+1],e);return i}function Bi(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+=pi(n-r)*(2+Math.sin(pi(s))+Math.sin(pi(o))),r=n,s=o}return i*e*e/2}function zi(t,e,i,n){n=n||Gi;const r=pi(t[1]),s=pi(t[0]),o=e/n,a=Math.asin(Math.sin(r)*Math.cos(o)+Math.cos(r)*Math.sin(o)*Math.cos(i));return[fi(s+Math.atan2(Math.sin(i)*Math.sin(o)*Math.cos(r),Math.cos(o)-Math.sin(r)*Math.sin(a))),fi(a)]}const Xi={info:1,warn:2,error:3,none:4};let Vi=Xi.info;function $i(...t){Vi>Xi.warn||console.warn(...t)}function Wi(...t){Vi>Xi.error||console.error(...t)}let Zi=!0;function Yi(t){Zi=!(void 0===t||t)}function Hi(t,e){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 Ki(t,e){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 qi(t){si(t.getCode(),t),li(t,t,Hi)}function Ji(t){t.forEach(qi)}function Qi(t){return"string"==typeof t?ri(t):t||null}function tn(t,e,i,n){let r;const s=(t=Qi(t)).getPointResolutionFunc();if(s){if(r=s(e,i),n&&n!==t.getUnits()){const e=t.getMetersPerUnit();e&&(r=r*e/Ue[n])}}else{const s=t.getUnits();if("degrees"==s&&!n||"degrees"==n)r=e;else{const o=hn(t,Qi("EPSG:4326"));if(o===Ki&&"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=(ji(t.slice(0,2),t.slice(2,4))+ji(t.slice(4,6),t.slice(6,8)))/2}const a=n?Ue[n]:t.getMetersPerUnit();void 0!==a&&(r/=a)}}return r}function en(t){Ji(t),t.forEach((function(e){t.forEach((function(t){e!==t&&li(e,t,Hi)}))}))}function nn(t,e,i,n){t.forEach((function(t){e.forEach((function(e){li(t,e,i),li(e,t,n)}))}))}function rn(t,e){return t?"string"==typeof t?Qi(t):t:Qi(e)}function sn(t){return function(e,i,n,r){const s=e.length;n=void 0!==n?n:2,r=r??n,i=void 0!==i?i:new Array(s);for(let o=0;o<s;o+=r){const s=t(e.slice(o,o+n)),a=s.length;for(let t=0,n=r;t<n;++t)i[o+t]=t>=a?e[o+t]:s[t]}return i}}function on(t,e,i,n){const r=Qi(t),s=Qi(e);li(r,s,sn(i)),li(s,r,sn(n))}function an(t,e){const i=un(t,void 0!==e?e:"EPSG:3857","EPSG:4326"),n=i[0];return(n<-180||n>180)&&(i[0]=mi(n+180,360)-180),i}function ln(t,e){if(t===e)return!0;const i=t.getUnits()===e.getUnits();if(t.getCode()===e.getCode())return i;return hn(t,e)===Hi&&i}function hn(t,e){let i=hi(t.getCode(),e.getCode());return i||(i=Ki),i}function cn(t,e){return hn(Qi(t),Qi(e))}function un(t,e,i){return cn(e,i)(t,void 0,t.length)}function dn(t,e,i,n){return De(t,cn(e,i),void 0,n)}let gn=null;function fn(t){gn=Qi(t)}function pn(){return gn}function mn(t,e){return gn?un(t,e,gn):t}function _n(t,e){return gn?un(t,gn,e):(Zi&&!Ii(t,[0,0])&&t[0]>=-180&&t[0]<=180&&t[1]>=-90&&t[1]<=90&&(Zi=!1,$i("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),t)}function yn(t,e){return gn?dn(t,e,gn):t}function xn(t,e){return gn?dn(t,gn,e):t}function vn(t,e){if(!gn)return t;const i=Qi(e).getMetersPerUnit(),n=gn.getMetersPerUnit();return i&&n?t*i/n:t}function Sn(t,e){if(!gn)return t;const i=Qi(e).getMetersPerUnit(),n=gn.getMetersPerUnit();return i&&n?t*n/i:t}function En(t,e,i){return function(n){let r,s;if(t.canWrapX()){const e=t.getExtent(),o=Ie(e);s=ki(n=n.slice(0),t,o),s&&(n[0]=n[0]-s*o),n[0]=ci(n[0],e[0],e[2]),n[1]=ci(n[1],e[1],e[3]),r=i(n)}else r=i(n);return s&&e.canWrapX()&&(r[0]+=s*Ie(e.getExtent())),r}}function wn(){en(Ye),en(ei),nn(ei,Ye,He,Ke)}function Tn(t,e,i,n,r,s,o){s=s||[],o=o||2;let a=0;for(let l=e;l<i;l+=n){const e=t[l],i=t[l+1];s[a++]=r[0]*e+r[2]*i+r[4],s[a++]=r[1]*e+r[3]*i+r[5];for(let e=2;e<o;e++)s[a++]=t[l+e]}return s&&s.length!=a&&(s.length=a),s}function Cn(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 Rn(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 bn(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}wn();const Pn=[1,0,0,1,0,0];class In extends z{constructor(){super(),this.extent_=[1/0,1/0,-1/0,-1/0],this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=p(((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 G()}closestPointXY(t,e,i,n){return G()}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 G()}getExtent(t){if(this.extentRevision_!=this.getRevision()){const t=this.computeExtent(this.extent_);(isNaN(t[0])||isNaN(t[1]))&&oe(t),this.extentRevision_=this.getRevision()}return Me(this.extent_,t)}rotate(t,e){G()}scale(t,e,i){G()}simplify(t){return this.getSimplifiedGeometry(t*t)}getSimplifiedGeometry(t){return G()}getType(){return G()}applyTransform(t){G()}intersectsExtent(t){return G()}translate(t,e){G()}transform(t,e){const i=Qi(t),n="tile-pixels"==i.getUnits()?function(t,n,r){const s=i.getExtent(),o=i.getWorldExtent(),a=Ce(o)/Ce(s);return Vt(Pn,o[0],o[3],a,-a,0,0,0),Tn(t,0,t.length,r,Pn,n),cn(i,e)(t,n,r)}:cn(i,e);return this.applyTransform(n),this}}class Ln extends In{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates}computeExtent(t){return le(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinates(){return G()}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=Mn(t),this.layout=t,this.flatCoordinates=e}setCoordinates(t,e){G()}setLayout(t,e,i){let n;if(t)n=Mn(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=Fn(n)}this.layout=t,this.stride=n}applyTransform(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.layout.startsWith("XYZ")?3:2,this.stride),this.changed())}rotate(t,e){const i=this.getFlatCoordinates();if(i){const n=this.getStride();Cn(i,0,i.length,n,t,e,i),this.changed()}}scale(t,e,i){void 0===e&&(e=t),i||(i=Se(this.getExtent()));const n=this.getFlatCoordinates();if(n){const r=this.getStride();Rn(n,0,n.length,r,t,e,i,n),this.changed()}}translate(t,e){const i=this.getFlatCoordinates();if(i){const n=this.getStride();bn(i,0,i.length,n,t,e,i),this.changed()}}}function Fn(t){let e;return 2==t?e="XY":3==t?e="XYZ":4==t&&(e="XYZM"),e}function Mn(t){let e;return"XY"==t?e=2:"XYZ"==t||"XYM"==t?e=3:"XYZM"==t&&(e=4),e}function An(t,e,i){const n=t.getFlatCoordinates();if(!n)return null;const r=t.getStride();return Tn(n,0,n.length,r,e,i)}function On(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]=_i(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 Dn(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=di(s,o,i,n);a>r&&(r=a),s=i,o=n}return r}function Nn(t,e,i,n,r){for(let s=0,o=i.length;s<o;++s){const o=i[s];r=Dn(t,e,o,n,r),e=o}return r}function kn(t,e,i,n,r){for(let s=0,o=i.length;s<o;++s){const o=i[s];r=Nn(t,e,o,n,r),e=o[o.length-1]}return r}function Gn(t,e,i,n,r,s,o,a,l,h,c){if(e==i)return h;let u,d;if(0===r){if(d=di(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(On(t,g-n,g,n,o,a,c),d=di(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&&(On(t,i-n,e,n,o,a,c),d=di(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 jn(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=Gn(t,e,d,n,r,s,o,a,l,h,c),e=d}return h}function Un(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=jn(t,e,d,n,r,s,o,a,l,h,c),e=d[d.length-1]}return h}function Bn(t,e,i,n){for(let n=0,r=i.length;n<r;++n)t[e++]=i[n];return e}function zn(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 Xn(t,e,i,n,r){r=r||[];let s=0;for(let o=0,a=i.length;o<a;++o){const a=zn(t,e,i[o],n);r[s++]=a,e=a}return r.length=s,r}function Vn(t,e,i,n,r){r=r||[];let s=0;for(let o=0,a=i.length;o<a;++o){const a=Xn(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 $n(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=ui(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 Wn(t,e,i,n,r,s,o,a){for(let l=0,h=i.length;l<h;++l){const h=i[l];o=$n(t,e,h,n,r,s,o),a.push(o),e=h}return o}function Zn(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],di(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 Yn(t,e){return e*Math.round(t/e)}function Hn(t,e,i,n,r,s,o){if(e==i)return o;let a,l,h=Yn(t[e],r),c=Yn(t[e+1],r);e+=n,s[o++]=h,s[o++]=c;do{if(a=Yn(t[e],r),l=Yn(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=Yn(t[e],r),u=Yn(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 Kn(t,e,i,n,r,s,o,a){for(let l=0,h=i.length;l<h;++l){const h=i[l];o=Hn(t,e,h,n,r,s,o),a.push(o),e=h}return o}function qn(t,e,i,n,r,s,o,a){for(let l=0,h=i.length;l<h;++l){const h=i[l],c=[];o=Kn(t,e,h,n,r,s,o,c),a.push(c),e=h[h.length-1]}return o}function Jn(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 Qn(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++]=Jn(t,e,a,n,r[s]),e=a}return r.length=s,r}function tr(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?[]:Qn(t,e,a,n,r[s]),e=a[a.length-1]}return r.length=s,r}function er(t,e,i,n){let r=0;const s=t[i-n],o=t[i-n+1];let a=0,l=0;for(;e<i;e+=n){const i=t[e]-s,n=t[e+1]-o;r+=l*i-a*n,a=i,l=n}return r/2}function ir(t,e,i,n){let r=0;for(let s=0,o=i.length;s<o;++s){const o=i[s];r+=er(t,e,o,n),e=o}return r}function nr(t,e,i,n){let r=0;for(let s=0,o=i.length;s<o;++s){const o=i[s];r+=ir(t,e,o,n),e=o[o.length-1]}return r}class rr extends Ln{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 rr(this.flatCoordinates.slice(),this.layout)}closestPointXY(t,e,i,n){return n<Qt(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Dn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Gn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,i,n))}getArea(){return er(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return Jn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(t){const e=[];return e.length=$n(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,0),new rr(e,"XY")}getType(){return"LinearRing"}intersectsExtent(t){return!1}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=zn(this.flatCoordinates,0,t,this.stride),this.changed()}}class sr extends Ln{constructor(t,e){super(),this.setCoordinates(t,e)}clone(){const t=new sr(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,i,n){const r=this.flatCoordinates,s=di(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.slice()}computeExtent(t){return ae(this.flatCoordinates,t)}getType(){return"Point"}intersectsExtent(t){return ie(t,this.flatCoordinates[0],this.flatCoordinates[1])}setCoordinates(t,e){this.setLayout(e,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Bn(this.flatCoordinates,0,t,this.stride),this.changed()}}function or(t,e,i,n,r){return!_e(r,(function(r){return!ar(t,e,i,n,r[0],r[1])}))}function ar(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 lr(t,e,i,n,r,s){if(0===i.length)return!1;if(!ar(t,e,i[0],n,r,s))return!1;for(let e=1,o=i.length;e<o;++e)if(ar(t,i[e-1],i[e],n,r,s))return!1;return!0}function hr(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(lr(t,e,a,n,r,s))return!0;e=a[a.length-1]}return!1}function cr(t,e,i,n,r,o,a){let l,h,c,u,d,g,f;const p=r[o+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(s),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,lr(t,e,i,n,c,p)&&(_=c,y=r)),u=d}return isNaN(_)&&(_=r[o]),a?(a.push(_,p,y),a):[_,p,y]}function ur(t,e,i,n,r){let s=[];for(let o=0,a=i.length;o<a;++o){const a=i[o];s=cr(t,e,a,n,r,2*o,s),e=a[a.length-1]}return s}function dr(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 gr(t,e,i,n,r){const s=fe([1/0,1/0,-1/0,-1/0],t,e,i,n);return!!Le(r,s)&&(!!ee(r,s)||(s[0]>=r[0]&&s[2]<=r[2]||(s[1]>=r[1]&&s[3]<=r[3]||dr(t,e,i,n,(function(t,e){return Oe(r,t,e)})))))}function fr(t,e,i,n,r){for(let s=0,o=i.length;s<o;++s){if(gr(t,e,i[s],n,r))return!0;e=i[s]}return!1}function pr(t,e,i,n,r){return!!gr(t,e,i,n,r)||(!!ar(t,e,i,n,r[0],r[1])||(!!ar(t,e,i,n,r[0],r[3])||(!!ar(t,e,i,n,r[2],r[1])||!!ar(t,e,i,n,r[2],r[3]))))}function mr(t,e,i,n,r){if(!pr(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(or(t,i[e-1],i[e],n,r)&&!gr(t,i[e-1],i[e],n,r))return!1;return!0}function _r(t,e,i,n,r){for(let s=0,o=i.length;s<o;++s){const o=i[s];if(mr(t,e,o,n,r))return!0;e=o[o.length-1]}return!1}function yr(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 xr(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 vr(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=xr(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 Sr(t,e,i,n,r){for(let s=0,o=i.length;s<o;++s){const o=i[s];if(!vr(t,e,o,n,r))return!1;o.length&&(e=o[o.length-1])}return!0}function Er(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=xr(t,e,o,n);(0===s?r&&a||!r&&!a:r&&!a||!r&&a)&&yr(t,e,o,n),e=o}return e}function wr(t,e,i,n,r){for(let s=0,o=i.length;s<o;++s)e=Er(t,e,i[s],n,r);return e}function Tr(t,e){const i=[];let n,r=0,s=0;for(let o=0,a=e.length;o<a;++o){const a=e[o],l=xr(t,r,a,2);if(void 0===n&&(n=l),l===n)i.push(e.slice(s,o+1));else{if(0===i.length)continue;i[i.length-1].push(e[s])}s=o+1,r=a}return i}class Cr extends Ln{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?h(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const t=new Cr(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(t,e,i,n){return n<Qt(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Nn(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),jn(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,i,n))}containsXY(t,e){return lr(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)}getArea(){return ir(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)}getCoordinates(t){let e;return void 0!==t?(e=this.getOrientedFlatCoordinates().slice(),Er(e,0,this.ends_,this.stride,t)):e=this.flatCoordinates,Qn(e,0,this.ends_,this.stride)}getEnds(){return this.ends_}getFlatInteriorPoint(){if(this.flatInteriorPointRevision_!=this.getRevision()){const t=Se(this.getExtent());this.flatInteriorPoint_=cr(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_}getInteriorPoint(){return new sr(this.getFlatInteriorPoint(),"XYM")}getLinearRingCount(){return this.ends_.length}getLinearRing(t){return t<0||this.ends_.length<=t?null:new rr(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 rr(e.slice(r,o),t);n.push(a),r=o}return n}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const t=this.flatCoordinates;vr(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=Er(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){const e=[],i=[];return e.length=Kn(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),e,0,i),new Cr(e,"XY",i)}getType(){return"Polygon"}intersectsExtent(t){return mr(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);const i=Xn(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()}}function Rr(t,e,i,n){i=i||32;const r=[];for(let s=0;s<i;++s)h(r,zi(t,e,2*Math.PI*s/i,n));return r.push(r[0],r[1]),new Cr(r,"XY",[r.length])}function br(t){if(Fe(t))throw new Error("Cannot create polygon from empty extent");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 Cr(s,"XY",[s.length])}function Pr(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 Cr(a,r,l);return Ir(h,s,t.getRadius(),i),h}function Ir(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*mi(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 Lr="accuracy",Fr="accuracyGeometry",Mr="altitude",Ar="altitudeAccuracy",Or="heading",Dr="position",Nr="projection",kr="speed",Gr="tracking",jr="trackingOptions",Ur="error";
2387class Br extends t{constructor(t){super(Ur),this.code=t.code,this.message=t.message}}var zr={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};class Xr extends x{constructor(t,e,i,n){super(),this.extent=t,this.pixelRatio_=i,this.resolution=e,this.state="function"==typeof n?zr.IDLE:n,this.image_=null,this.loader="function"==typeof n?n:null}changed(){this.dispatchEvent(v)}getExtent(){return this.extent}getImage(){return this.image_}getPixelRatio(){return this.pixelRatio_}getResolution(){return this.resolution}getState(){return this.state}load(){if(this.state==zr.IDLE&&this.loader){this.state=zr.LOADING,this.changed();const t=this.getResolution(),e=Array.isArray(t)?t[0]:t;m((()=>this.loader(this.getExtent(),e,this.getPixelRatio()))).then((t=>{"image"in t&&(this.image_=t.image),"extent"in t&&(this.extent=t.extent),"resolution"in t&&(this.resolution=t.resolution),"pixelRatio"in t&&(this.pixelRatio_=t.pixelRatio),(t instanceof HTMLImageElement||t instanceof ImageBitmap||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement)&&(this.image_=t),this.state=zr.LOADED})).catch((t=>{this.state=zr.ERROR,console.error(t)})).finally((()=>this.changed()))}}setImage(t){this.image_=t}setResolution(t){this.resolution=t}}function Vr(t,e,i){const n=t;let r=!0,s=!1,o=!1;const a=[O(n,L,(function(){o=!0,s||e()}))];return n.src&&dt?(s=!0,n.decode().then((function(){r&&e()})).catch((function(t){r&&(o?e():i())}))):a.push(O(n,S,i)),function(){r=!1,a.forEach(D)}}function $r(t,e){return new Promise(((i,n)=>{function r(){o(),i(t)}function s(){o(),n(new Error("Image load error"))}function o(){t.removeEventListener("load",r),t.removeEventListener("error",s)}t.addEventListener("load",r),t.addEventListener("error",s),e&&(t.src=e)}))}function Wr(t,e){return e&&(t.src=e),t.src&&dt?new Promise(((e,i)=>t.decode().then((()=>e(t))).catch((n=>t.complete&&t.width?e(t):i(n))))):$r(t)}function Zr(t,e){return e&&(t.src=e),t.src&&dt&&gt?t.decode().then((()=>createImageBitmap(t))).catch((e=>{if(t.complete&&t.width)return t;throw e})):Wr(t)}class Yr extends Xr{constructor(t,e,i,n,r){super(t,e,i,void 0!==r?zr.IDLE:zr.LOADED),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=zr.ERROR):this.state=zr.LOADED,this.changed()}load(){this.state==zr.IDLE&&(this.state=zr.LOADING,this.changed(),this.loader_(this.handleLoad_.bind(this)))}getImage(){return this.canvas_}}class Hr extends nt{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=K,this.unlistenImage_(),this.changed()}handleImageError_(){this.state=q,this.unlistenImage_(),this.image_=function(){const t=pt(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=K:this.state=J,this.unlistenImage_(),this.changed()}load(){this.state==q&&(this.state=Y,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==Y&&(this.state=H,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Vr(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))}unlistenImage_(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}disposeInternal(){this.unlistenImage_(),this.image_=null,super.disposeInternal()}}class Kr{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_}}
vendor: 24,392 bytes, line 2387
2387var qr="opacity",Jr="visible",Qr="extent",ts="zIndex",es="maxResolution",is="minResolution",ns="maxZoom",rs="minZoom",ss="source",os="map";class as extends z{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[qr]=void 0!==t.opacity?t.opacity:1,Ft("number"==typeof e[qr],"Layer opacity must be a number"),e[Jr]=void 0===t.visible||t.visible,e[ts]=t.zIndex,e[es]=void 0!==t.maxResolution?t.maxResolution:1/0,e[is]=void 0!==t.minResolution?t.minResolution:0,e[rs]=void 0!==t.minZoom?t.minZoom:-1/0,e[ns]=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=ci(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 G()}getLayerStatesArray(t){return G()}getExtent(){return this.get(Qr)}getMaxResolution(){return this.get(es)}getMinResolution(){return this.get(is)}getMinZoom(){return this.get(rs)}getMaxZoom(){return this.get(ns)}getOpacity(){return this.get(qr)}getSourceState(){return G()}getVisible(){return this.get(Jr)}getZIndex(){return this.get(ts)}setBackground(t){this.background_=t,this.changed()}setExtent(t){this.set(Qr,t)}setMaxResolution(t){this.set(es,t)}setMinResolution(t){this.set(is,t)}setMaxZoom(t){this.set(ns,t)}setMinZoom(t){this.set(rs,t)}setOpacity(t){Ft("number"==typeof t,"Layer opacity must be a number"),this.set(qr,t)}setVisible(t){this.set(Jr,t)}setZIndex(t){this.set(ts,t)}disposeInternal(){this.state_&&(this.state_.layer=null,this.state_=null),super.disposeInternal()}}var ls="prerender",hs="postrender",cs="precompose",us="postcompose",ds="rendercomplete",gs=0,fs=1,ps={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};const ms=42,_s=256;function ys(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=ci(n[0],d,g),_=ci(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 xs(t){return t}function vs(t,e,i,n){const r=Ie(e)/i[0],s=Ce(e)/i[1];return n?Math.min(t,Math.max(r,s)):Math.min(t,Math.min(r,s))}function Ss(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),ci(n,i/2,2*e)}function Es(t,e,i,n){return e=void 0===e||e,function(r,s,o,l){if(void 0!==r){const h=t[0],c=t[t.length-1],u=i?vs(h,i,o,n):h;if(l)return e?Ss(r,u,c):ci(r,c,u);const d=Math.min(u,r),g=Math.floor(a(t,d,s));return t[g]>u&&g<t.length-1?t[g+1]:t[g]}}}function ws(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?vs(e,r,l,s):e;if(h)return n?Ss(o,c,i):ci(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 ci(e/Math.pow(t,m),i,c)}}}function Ts(t,e,i,n,r){return i=void 0===i||i,function(s,o,a,l){if(void 0!==s){const o=n?vs(t,n,a,r):t;return i&&l?Ss(s,o,e):ci(s,e,o)}}}function Cs(t){if(void 0!==t)return 0}function Rs(t){if(void 0!==t)return t}function bs(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 Ps(t){const e=void 0===t?pi(5):t;return function(t,i){return i||void 0===t?t:Math.abs(t)<=e?0:t}}class Is extends z{constructor(t){super(),this.on,this.once,this.un,t=Object.assign({},t),this.hints_=[0,0],this.animations_=[],this.updateAnimationKey_,this.projection_=rn(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&&Yi(),t.center&&(t.center=_n(t.center,this.projection_)),t.extent&&(t.extent=xn(t.extent,this.projection_)),this.applyOptions_(t)}applyOptions_(t){const e=Object.assign({},t);for(const t in ps)delete e[t];this.setProperties(e,!0);const i=Ms(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=Fs(t),r=i.constraint,s=As(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.getCenterInternal();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=_n(i.center,this.getProjection())),i.anchor&&(i=Object.assign({},i),i.anchor=_n(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&&Ls(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||et,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=mi(t.rotation-a+Math.PI,2*Math.PI)-Math.PI;i.targetRotation=a+e,a=i.targetRotation}Os(i)?i.complete=!0:r+=i.duration,l.push(i)}this.animations_.push(l),this.setHint(gs,1),this.updateAnimations_()}getAnimating(){return this.hints_[gs]>0}getInteracting(){return this.hints_[fs]>0}cancelAnimations(){let t;this.setHint(gs,-this.hints_[gs]);for(let e=0,i=this.animations_.length;e<i;++e){const i=this.animations_[e];if(i[0].callback&&Ls(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?mi(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(gs,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;const t=n[0].callback;t&&Ls(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]],Li(i,t-this.getRotation()),Ti(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?mn(t,this.getProjection()):t}getCenterInternal(){return this.get(ps.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 yn(this.calculateExtentInternal(t),this.getProjection())}calculateExtentInternal(t){t=t||this.getViewportSizeMinusPadding_();const e=this.getCenterInternal();Ft(e,"The view center is not defined");const i=this.getResolution();Ft(void 0!==i,"The view resolution is not defined");const n=this.getRotation();return Ft(void 0!==n,"The view rotation is not defined"),we(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(ps.RESOLUTION)}getResolutions(){return this.resolutions_}getResolutionForExtent(t,e){return this.getResolutionForExtentInternal(xn(t,this.getProjection()),e)}getResolutionForExtentInternal(t,e){e=e||this.getViewportSizeMinusPadding_();const i=Ie(t)/e[0],n=Ce(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(ps.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=Ds(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()}}getViewStateAndExtent(){return{viewState:this.getState(),extent:this.calculateExtent()}}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=a(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_?.length){if(1===this.resolutions_.length)return this.resolutions_[0];const e=ci(Math.floor(t),0,this.resolutions_.length-2),i=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(i,ci(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)}fit(t,e){let i;if(Ft(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,"Invalid extent or geometry provided as `geometry`"),Array.isArray(t)){Ft(!Fe(t),"Cannot fit empty extent provided as `geometry`");i=br(xn(t,this.getProjection()))}else if("Circle"===t.getType()){const e=xn(t.getExtent(),this.getProjection());i=br(e),i.rotate(this.getRotation(),Se(e))}else{const e=pn();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=Se(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,p=this.getConstrainedCenter([d,g],a),m=e.callback?e.callback:f;void 0!==e.duration?this.animateInternal({resolution:a,center:p,duration:e.duration,easing:e.easing},m):(this.targetResolution_=a,this.targetCenter_=p,this.applyTargetState_(!1,!0),Ls(m,!0))}centerOn(t,e,i){this.centerOnInternal(_n(t,this.getProjection()),e,i)}centerOnInternal(t,e,i){this.setCenterInternal(Ds(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=Ds(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=mn(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&&_n(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=_n(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?_n(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(ps.ROTATION)!==n&&this.set(ps.ROTATION,n),this.get(ps.RESOLUTION)!==s&&(this.set(ps.RESOLUTION,s),this.set("zoom",this.getZoom(),!0)),o&&this.get(ps.CENTER)&&Ii(this.get(ps.CENTER),o)||this.set(ps.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()&&Ii(this.getCenterInternal(),a)||(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:r,center:a,resolution:o,duration:t,easing:tt,anchor:i}))}beginInteraction(){this.resolveConstraints(0),this.setHint(fs,1)}endInteraction(t,e,i){i=i&&_n(i,this.getProjection()),this.endInteractionInternal(t,e,i)}endInteractionInternal(t,e,i){this.getInteracting()&&(this.setHint(fs,-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 Ls(t,e){setTimeout((function(){t(e)}),0)}function Fs(t){if(void 0!==t.extent){const e=void 0===t.smoothExtentConstraint||t.smoothExtentConstraint;return ys(t.extent,t.constrainOnlyCenter,e)}const e=rn(t.projection,"EPSG:3857");if(!0!==t.multiWorld&&e.isGlobal()){const t=e.getExtent().slice();return t[0]=-1/0,t[2]=1/0,ys(t,!1,!1)}return xs}function Ms(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=rn(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?Es(o,l,!d&&g,h):Ts(i,n,l,!d&&g,h)}else{const a=(u?Math.max(Ie(u),Ce(u)):360*Ue.degrees/c.getMetersPerUnit())/_s/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?ws(o,i,n,l,!d&&g,h):Ts(i,n,l,!d&&g,h)}return{constraint:e,maxResolution:i,minResolution:n,minZoom:r,zoomFactor:o}}function As(t){if(void 0===t.enableRotation||t.enableRotation){const e=t.constrainRotation;return void 0===e||!0===e?Ps():!1===e?Rs:"number"==typeof e?bs(e):Rs}return Cs}function Os(t){return!(t.sourceCenter&&t.targetCenter&&!Ii(t.sourceCenter,t.targetCenter))&&(t.sourceResolution===t.targetResolution&&t.sourceRotation===t.targetRotation)}function Ds(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 Ns extends as{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.sourceReady_=!1,this.rendered=!1,t.render&&(this.render=t.render),t.map&&this.setMap(t.map),this.addChangeListener(ss,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(ss)||null}getRenderSource(){return this.getSource()}getSourceState(){const t=this.getSource();return t?t.getState():"undefined"}handleSourceChange_(){this.changed(),this.sourceReady_||"ready"!==this.getSource().getState()||(this.sourceReady_=!0,this.dispatchEvent("sourceready"))}handleSourcePropertyChange_(){this.sourceChangeKey_&&(D(this.sourceChangeKey_),this.sourceChangeKey_=null),this.sourceReady_=!1;const t=this.getSource();t&&(this.sourceChangeKey_=A(t,v,this.handleSourceChange_,this),"ready"===t.getState()&&(this.sourceReady_=!0,setTimeout((()=>{this.dispatchEvent("sourceready")}),0))),this.changed()}getFeatures(t){return this.renderer_?this.renderer_.getFeatures(t):Promise.resolve([])}getData(t){return this.renderer_&&this.rendered?this.renderer_.getData(t):null}isVisible(t){let e;const i=this.getMapInternal();let n;!t&&i&&(t=i.getView()),e=t instanceof Is?{viewState:t.getState(),extent:t.calculateExtent()}:t,!e.layerStatesArray&&i&&(e.layerStatesArray=i.getLayerGroup().getLayerStatesArray()),n=e.layerStatesArray?e.layerStatesArray.find((t=>t.layer===this)):this.getLayerState();const r=this.getExtent();return ks(n,e.viewState)&&(!r||Le(r,e.extent))}getAttributions(t){if(!this.isVisible(t))return[];const e=this.getSource()?.getAttributions();if(!e)return[];let i=e(t instanceof Is?t.getViewStateAndExtent():t);return Array.isArray(i)||(i=[i]),i}render(t,e){const i=this.getRenderer();return i.prepareFrame(t)?(this.rendered=!0,i.renderFrame(t,e)):null}unrender(){this.rendered=!1}getDeclutter(){}renderDeclutter(t,e){}renderDeferred(t){const e=this.getRenderer();e&&e.renderDeferred(t)}setMapInternal(t){t||this.unrender(),this.set(os,t)}getMapInternal(){return this.get(os)}setMap(t){this.mapPrecomposeKey_&&(D(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(D(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=A(t,cs,this.handlePrecompose_,this),this.mapRenderKey_=A(this,v,t.render,t),this.changed())}handlePrecompose_(t){const e=t.frameState.layerStatesArray,i=this.getLayerState(!1);Ft(!e.some((t=>t.layer===i.layer)),"A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both."),e.push(i)}setSource(t){this.set(ss,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 ks(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}function Gs(t,e,i=0,n=t.length-1,r=Us){for(;n>i;){if(n-i>600){const 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);Gs(t,e,Math.max(i,Math.floor(e-o*l/s+h)),Math.min(n,Math.floor(e+(s-o)*l/s+h)),r)}const s=t[e];let o=i,a=n;for(js(t,i,e),r(t[n],s)>0&&js(t,i,n);o<a;){for(js(t,o,a),o++,a--;r(t[o],s)<0;)o++;for(;r(t[a],s)>0;)a--}0===r(t[i],s)?js(t,i,a):(a++,js(t,a,n)),a<=e&&(i=a+1),e<=a&&(n=a-1)}}
vendor: 4,707 bytes, line 2387
2387function js(t,e,i){const n=t[e];t[e]=t[i],t[i]=n}function Us(t,e){return t<e?-1:t>e?1:0}let Bs=class{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(!Js(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;Js(t,a)&&(e.leaf?i.push(o):qs(t,a)?this._all(o,i):r.push(o))}e=r.pop()}return i}collides(t){let e=this.data;if(!Js(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(Js(t,s)){if(e.leaf||qs(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=Qs([]),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=zs(t,i.children,e);if(-1!==n)return i.children.splice(n,1),r.push(i),this._condense(r),this}l||i.leaf||!qs(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=Qs(t.slice(e,i+1)),Xs(s,this.toBBox),s;n||(n=Math.ceil(Math.log(r)/Math.log(o)),o=Math.ceil(r/Math.pow(o,n-1))),s=Qs([]),s.leaf=!1,s.height=n;const a=Math.ceil(r/o),l=a*Math.ceil(Math.sqrt(o));to(t,e,i,l,this.compareMinX);for(let r=e;r<=i;r+=l){const e=Math.min(r+l-1,i);to(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 Xs(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=Ys(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),$s(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=Qs(i.children.splice(s,i.children.length-s));o.height=i.height,o.leaf=i.leaf,Xs(i,this.toBBox),Xs(o,this.toBBox),e?t[e-1].children.push(o):this._splitRoot(i,o)}_splitRoot(t,e){this.data=Qs([t,e]),this.data.height=t.height+1,this.data.leaf=!1,Xs(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=Vs(t,0,o,this.toBBox),a=Vs(t,o,i,this.toBBox),l=Ks(e,a),h=Ys(e)+Ys(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:Ws,r=t.leaf?this.compareMinY:Zs;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=Vs(t,0,e,r),o=Vs(t,i-e,i,r);let a=Hs(s)+Hs(o);for(let n=e;n<i-e;n++){const e=t.children[n];$s(s,t.leaf?r(e):e),a+=Hs(s)}for(let n=i-e-1;n>=e;n--){const e=t.children[n];$s(o,t.leaf?r(e):e),a+=Hs(o)}return a}_adjustParentBBoxes(t,e,i){for(let n=i;n>=0;n--)$s(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():Xs(t[i],this.toBBox)}};function zs(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 Xs(t,e){Vs(t,0,t.children.length,e,t)}function Vs(t,e,i,n,r){r||(r=Qs(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];$s(r,t.leaf?n(e):e)}return r}function $s(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 Ws(t,e){return t.minX-e.minX}function Zs(t,e){return t.minY-e.minY}
2387function Ys(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function Hs(t){return t.maxX-t.minX+(t.maxY-t.minY)}function Ks(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 qs(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function Js(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function Qs(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function to(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;Gs(t,o,e,i,r),s.push(e,o,o,i)}}function eo(t){return t[0]>0&&t[1]>0}function io(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 no(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:(e[0]=t,e[1]=t),e)}class ro{constructor(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=no(t.scale),this.displacement_=t.displacement,this.declutterMode_=t.declutterMode}clone(){const t=this.getScale();return new ro({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 G()}getImage(t){return G()}getHitDetectionImage(){return G()}getPixelRatio(t){return 1}getImageState(){return G()}getImageSize(){return G()}getOrigin(){return G()}getSize(){return G()}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_=no(t)}listenImageChange(t){G()}load(){G()}unlistenImageChange(t){G()}ready(){return Promise.resolve()}}var so={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]},oo={name:"xyz",min:[0,0,0],channel:["X","Y","Z"],alias:["XYZ","ciexyz","cie1931"],whitepoint:{2:{A:[109.85,100,35.585],C:[98.074,100,118.232],D50:[96.422,100,82.521],D55:[95.682,100,92.149],D65:[95.045592705167,100,108.9057750759878],D75:[94.972,100,122.638],F2:[99.187,100,67.395],F7:[95.044,100,108.755],F11:[100.966,100,64.37],E:[100,100,100]},10:{A:[111.144,100,35.2],C:[97.285,100,116.145],D50:[96.72,100,81.427],D55:[95.799,100,90.926],D65:[94.811,100,107.304],D75:[94.416,100,120.641],F2:[103.28,100,69.026],F7:[95.792,100,107.687],F11:[103.866,100,65.627],E:[100,100,100]}}};oo.max=oo.whitepoint[2].D65,oo.rgb=function(t,e){e=e||oo.whitepoint[2].E;var i,n,r,s=t[0]/e[0],o=t[1]/e[1],a=t[2]/e[2];return n=-.96924363628087*s+1.87596750150772*o+.041555057407175*a,r=.055630079696993*s+-.20397695888897*o+1.056971514242878*a,i=(i=3.240969941904521*s+-1.537383177570093*o+-.498610760293*a)>.0031308?1.055*Math.pow(i,1/2.4)-.055:i*=12.92,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:n*=12.92,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:r*=12.92,[255*(i=Math.min(Math.max(0,i),1)),255*(n=Math.min(Math.max(0,n),1)),255*(r=Math.min(Math.max(0,r),1))]},so.xyz=function(t,e){var i=t[0]/255,n=t[1]/255,r=t[2]/255,s=.21263900587151*(i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92)+.71516867876775*(n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92)+.072192315360733*(r=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92),o=.019330818715591*i+.11919477979462*n+.95053215224966*r;return[(.41239079926595*i+.35758433938387*n+.18048078840183*r)*(e=e||oo.whitepoint[2].E)[0],s*e[1],o*e[2]]};var ao={name:"luv",min:[0,-134,-140],max:[100,224,122],channel:["lightness","u","v"],alias:["LUV","cieluv","cie1976"],xyz:function(t,e,i){var n,r,s,o,a,l,h,c,u;if(s=t[0],o=t[1],a=t[2],0===s)return[0,0,0];return e=e||"D65",i=i||2,n=o/(13*s)+4*(h=oo.whitepoint[i][e][0])/(h+15*(c=oo.whitepoint[i][e][1])+3*(u
2387=oo.whitepoint[i][e][2]))||0,r=a/(13*s)+9*c/(h+15*c+3*u)||0,[9*(l=s>8?c*Math.pow((s+16)/116,3):c*s*.0011070564598794539)*n/(4*r)||0,l,l*(12-3*n-20*r)/(4*r)||0]}};oo.luv=function(t,e,i){var n,r,s,o,a,l,h,c,u,d,g;e=e||"D65",i=i||2,d=4*(h=oo.whitepoint[i][e][0])/(h+15*(c=oo.whitepoint[i][e][1])+3*(u=oo.whitepoint[i][e][2])),g=9*c/(h+15*c+3*u),n=4*(o=t[0])/(o+15*(a=t[1])+3*(l=t[2]))||0,r=9*a/(o+15*a+3*l)||0;var f=a/c;return[s=f<=.008856451679035631?903.2962962962961*f:116*Math.pow(f,1/3)-16,13*s*(n-d),13*s*(r-g)]};var lo={name:"lchuv",channel:["lightness","chroma","hue"],alias:["LCHuv","cielchuv"],min:[0,0,0],max:[100,100,360],luv:function(t){var e,i=t[0],n=t[1];return e=t[2]/360*2*Math.PI,[i,n*Math.cos(e),n*Math.sin(e)]},xyz:function(t){return ao.xyz(lo.luv(t))}};function ho(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}ao.lchuv=function(t){var e=t[0],i=t[1],n=t[2],r=Math.sqrt(i*i+n*n),s=360*Math.atan2(n,i)/2/Math.PI;return s<0&&(s+=360),[e,r,s]},oo.lchuv=function(t){return ao.lchuv(oo.luv(t))};var co=ho({aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}),uo={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};var go={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(t){var e,i,n,r,s,o=t[0]/360,a=t[1]/100,l=t[2]/100,h=0;if(0===a)return[s=255*l,s,s];for(e=2*l-(i=l<.5?l*(1+a):l+a-l*a),r=[0,0,0];h<3;)(n=o+1/3*-(h-1))<0?n++:n>1&&n--,s=6*n<1?e+6*(i-e)*n:2*n<1?i:3*n<2?e+(i-e)*(2/3-n)*6:e,r[h++]=255*s;return r}};function fo(t){var e;Array.isArray(t)&&t.raw&&(t=String.raw(...arguments)),t instanceof Number&&(t=+t);var i=function(t){var e,i,n=[],r=1;
2387if("number"==typeof t)return{space:"rgb",values:[t>>>16,(65280&t)>>>8,255&t],alpha:1};if("number"==typeof t)return{space:"rgb",values:[t>>>16,(65280&t)>>>8,255&t],alpha:1};if(t=String(t).toLowerCase(),co[t])n=co[t].slice(),i="rgb";else if("transparent"===t)r=0,i="rgb",n=[0,0,0];else if("#"===t[0]){var s=t.slice(1),o=s.length;r=1,o<=4?(n=[parseInt(s[0]+s[0],16),parseInt(s[1]+s[1],16),parseInt(s[2]+s[2],16)],4===o&&(r=parseInt(s[3]+s[3],16)/255)):(n=[parseInt(s[0]+s[1],16),parseInt(s[2]+s[3],16),parseInt(s[4]+s[5],16)],8===o&&(r=parseInt(s[6]+s[7],16)/255)),n[0]||(n[0]=0),n[1]||(n[1]=0),n[2]||(n[2]=0),i="rgb"}else if(e=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(t)){var a=e[1],l="cmyk"===(i=a.replace(/a$/,""))?4:"gray"===i?1:3;n=e[2].trim().split(/\s*[,\/]\s*|\s+/),"color"===i&&(i=n.shift()),r=(n=n.map((function(t,e){if("%"===t[t.length-1])return t=parseFloat(t)/100,3===e?t:"rgb"===i?255*t:"h"===i[0]?100*t:"l"!==i[0]||e?"lab"===i?125*t:"lch"===i?e<2?150*t:360*t:"o"!==i[0]||e?"oklab"===i?.4*t:"oklch"===i?e<2?.4*t:360*t:t:t:100*t;if("h"===i[e]||2===e&&"h"===i[i.length-1]){if(void 0!==uo[t])return uo[t];if(t.endsWith("deg"))return parseFloat(t);if(t.endsWith("turn"))return 360*parseFloat(t);if(t.endsWith("grad"))return 360*parseFloat(t)/400;if(t.endsWith("rad"))return 180*parseFloat(t)/Math.PI}return"none"===t?0:parseFloat(t)}))).length>l?n.pop():1}else/[0-9](?:\s|\/|,)/.test(t)&&(n=t.match(/([0-9]+)/g).map((function(t){return parseFloat(t)})),i=t.match(/([a-z])/gi)?.join("")?.toLowerCase()||"rgb");return{space:i,values:n,alpha:r}}(t);if(!i.space)return[];const n="h"===i.space[0]?go.min:so.min,r="h"===i.space[0]?go.max:so.max;return(e=Array(3))[0]=Math.min(Math.max(i.values[0],n[0]),r[0]),e[1]=Math.min(Math.max(i.values[1],n[1]),r[1]),e[2]=Math.min(Math.max(i.values[2],n[2]),r[2]),"h"===i.space[0]&&(e=go.rgb(e)),e.push(Math.min(Math.max(i.alpha,0),1)),e}so.hsl=function(t){var e,i,n=t[0]/255,r=t[1]/255,s=t[2]/255,o=Math.min(n,r,s),a=Math.max(n,r,s),l=a-o;return a===o?e=0:n===a?e=(r-s)/l:r===a?e=2+(s-n)/l:s===a&&(e=4+(n-r)/l),(e=Math.min(60*e,360))<0&&(e+=360),i=(o+a)/2,[e,100*(a===o?0:i<=.5?l/(a+o):l/(2-a-o)),100*i]};const po=[NaN,NaN,NaN,0];function mo(t){return"string"==typeof t?t:Ro(t)}const _o=1024,yo={};let xo=0;function vo(t){if(4===t.length)return t;const e=t.slice();return e[3]=1,e}function So(t){const e=oo.lchuv(so.xyz(t));return e[3]=t[3],e}function Eo(t){const e=oo.rgb(lo.xyz(t));return e[3]=t[3],e}function wo(t){if("none"===t)return po;if(yo.hasOwnProperty(t))return yo[t];if(xo>=_o){let t=0;for(const e in yo)0==(3&t++)&&(delete yo[e],--xo)}const e=fo(t);if(4!==e.length)throw new Error('failed to parse "'+t+'" as color');for(const i of e)if(isNaN(i))throw new Error('failed to parse "'+t+'" as color');return Co(e),yo[t]=e,++xo,e}function To(t){return Array.isArray(t)?t:wo(t)}function Co(t){return t[0]=ci(t[0]+.5|0,0,255),t[1]=ci(t[1]+.5|0,0,255),t[2]=ci(t[2]+.5|0,0,255),t[3]=ci(t[3],0,1),t}function Ro(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(1e3*t[3])/1e3)+")"}class bo{constructor(){this.cache_={},this.patternCache_={},this.cacheSize_=0,this.maxCacheSize_=32}clear(){this.cache_={},this.patternCache_={},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],delete this.patternCache_[e],--this.cacheSize_)}}}get(t,e,i){const n=Po(t,e,i);return n in this.cache_?this.cache_[n]:null}getPattern(t,e,i){const n=Po(t,e,i);return n in this.patternCache_?this.patternCache_[n]:null}set(t,e,i,n,r){const s=Po(t,e,i),o=s in this.cache_;this.cache_[s]=n,r&&(n.getImageState()===zr.IDLE&&n.load(),n.getImageState()===zr.LOADING?n.ready().then((()=>{this.patternCache_[s]=_t().createPattern(n.getImage(1),"repeat")})):this.patternCache_[s]=_t().createPattern(n.getImage(1),"repeat")),o||++this.cacheSize_}setSize(t){this.maxCacheSize_=t,this.expire()}}function Po(t,e,i){return e+":"+t+":"+(i?To(i):"null")}const Io=new bo;let Lo=null;class Fo extends x{constructor(t,e,i,n,r){super(),this.hitDetectionImage_=null,this.image_=t,this.crossOrigin_=i,this.canvas_={},this.color_=r,this.imageState_=void 0===n?zr.IDLE:n,this.size_=t&&t.width&&t.height?[t.width,t.height]:null,this.src_=e,this.tainted_,this.ready_=null}initializeImage_(){this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)}isTainted_(){if(void 0===this.tainted_&&this.imageState_===zr.LOADED){Lo||(Lo=pt(1,1,void 0,{willReadFrequently:!0}
2387)),Lo.drawImage(this.image_,0,0);try{Lo.getImageData(0,0,1,1),this.tainted_=!1}catch(t){Lo=null,this.tainted_=!0}}return!0===this.tainted_}dispatchChangeEvent_(){this.dispatchEvent(v)}handleImageError_(){this.imageState_=zr.ERROR,this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=zr.LOADED,this.size_=[this.image_.width,this.image_.height],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=pt(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_===zr.IDLE){this.image_||this.initializeImage_(),this.imageState_=zr.LOADING;try{void 0!==this.src_&&(this.image_.src=this.src_)}catch(t){this.handleImageError_()}this.image_ instanceof HTMLImageElement&&Wr(this.image_,this.src_).then((t=>{this.image_=t,this.handleImageLoad_()})).catch(this.handleImageError_.bind(this))}}replaceColor_(t){if(!this.color_||this.canvas_[t]||this.imageState_!==zr.LOADED)return;const e=this.image_,i=pt(Math.ceil(e.width*t),Math.ceil(e.height*t)),n=i.canvas;i.scale(t,t),i.drawImage(e,0,0),i.globalCompositeOperation="multiply",i.fillStyle=mo(this.color_),i.fillRect(0,0,n.width/t,n.height/t),i.globalCompositeOperation="destination-in",i.drawImage(e,0,0),this.canvas_[t]=n}ready(){return this.ready_||(this.ready_=new Promise((t=>{if(this.imageState_===zr.LOADED||this.imageState_===zr.ERROR)t();else{const e=()=>{this.imageState_!==zr.LOADED&&this.imageState_!==zr.ERROR||(this.removeEventListener(v,e),t())};this.addEventListener(v,e)}}))),this.ready_}}function Mo(t,e,i,n,r,s){let o=void 0===e?void 0:Io.get(e,i,r);return o||(o=new Fo(t,t&&"src"in t?t.src||void 0:e,i,n,r),Io.set(e,i,r,o,s)),s&&o&&!Io.getPattern(e,i,r)&&Io.set(e,i,r,o,s),o}function Ao(t){return t?Array.isArray(t)?Ro(t):"object"==typeof t&&"src"in t?function(t){if(!t.offset||!t.size)return Io.getPattern(t.src,"anonymous",t.color);const e=t.src+":"+t.offset,i=Io.getPattern(e,void 0,t.color);if(i)return i;const n=Io.get(t.src,"anonymous",null);if(n.getImageState()!==zr.LOADED)return null;const r=pt(t.size[0],t.size[1]);return r.drawImage(n.getImage(1),t.offset[0],t.offset[1],t.size[0],t.size[1],0,0,t.size[0],t.size[1]),Mo(r.canvas,e,void 0,zr.LOADED,t.color,!0),Io.getPattern(e,void 0,t.color)}(t):t:null}const Oo="ol-hidden",Do="ol-selectable",No="ol-unselectable",ko="ol-unsupported",Go="ol-control",jo="ol-collapsed",Uo=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"),Bo=["style","variant","weight","size","lineHeight","family"],zo=function(t){const e=t.match(Uo);if(!e)return null;const i={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"};for(let t=0,n=Bo.length;t<n;++t){const n=e[t+1];void 0!==n&&(i[Bo[t]]=n)}return i.families=i.family.split(/,\s?/),i},Xo="10px sans-serif",Vo="#000",$o="round",Wo=[],Zo="round",Yo=10,Ho="#000",Ko="center",qo="middle",Jo=[0,0,0,0],Qo=new z;let ta,ea=null;const ia={},na=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=oa(r+" "+o+" "+t+i,n),a!=i){const e=oa(r+" "+o+" "+t+a+","+i,n);l=l&&e!=s}}return!!l}function a(){let t=!0;const e=Qo.getKeys();for(let i=0,n=e.length;i<n;++i){const n=e[i];if(Qo.get(n)<100){const[e,i,r]=n.split("\n");o(e,i,r)?(_(ia),ea=null,ta=void 0,Qo.set(n,100)):(Qo.set(n,Qo.get(n)+1,!0),t=!1)}}t&&(clearInterval(r),r=void 0)}return function(t){const e=zo(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===Qo.get(s)&&(Qo.set(s,100,!0),o(e.style,e.weight,n)||(Qo.set(s,0,!0),void 0===r&&(r=setInterval(a,32))))}}}(),ra=function(){let t;return function(e){let i=ia[e];if(null==i){if(ut){const t=zo(e),n=sa(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);ia[e]=i}return i}}();function sa(t,e){return ea||(ea=pt(1,1)),t!=ta&&(ea.font=t,ta=ea.font),ea.measureText(e)}function oa(t,e){return sa(t,e).width}function aa(t,e,i){if(e in i)return i[e];const n=e.split("\n").reduce(((e,i)=>Math.max(e,oa(t,i))),0);return i[e]=n,n}function la(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,l=0;continue}const d=e[h+1]||t.font,g=oa(d,u);i.push(g),o+=g;const f=ra(d);n.push(f),l=Math.max(l,f)}return{width:s,height:a,widths:i,heights:n,lineWidths:r}}function ha(t,e,i,n,r,s,o,a,l,h,c){t.save(),1!==i&&(void 0===t.globalAlpha?t.globalAlpha=t=>t.globalAlpha*=i:t.globalAlpha*=i),e&&t.transform.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(
vendor: 20,078 bytes, line 2387
2387)}class ca extends ro{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.canvases_,this.hitDetectionCanvas_=null,this.fill_=void 0!==t.fill?t.fill:null,this.origin_=[0,0],this.points_=t.points,this.radius=t.radius,this.radius2_=t.radius2,this.angle_=void 0!==t.angle?t.angle:0,this.stroke_=void 0!==t.stroke?t.stroke:null,this.size_,this.renderOptions_,this.imageState_=this.fill_&&this.fill_.loading()?zr.LOADING:zr.LOADED,this.imageState_===zr.LOADING&&this.ready().then((()=>this.imageState_=zr.LOADED)),this.render()}clone(){const t=this.getScale(),e=new ca({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_,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.hitDetectionCanvas_=this.createHitDetectionCanvas_(this.renderOptions_)),this.hitDetectionCanvas_}getImage(t){let e=this.canvases_[t];if(!e){const i=this.renderOptions_,n=pt(i.size*t,i.size*t);this.draw_(i,n,t),e=n.canvas,this.canvases_[t]=e}return e}getPixelRatio(t){return t}getImageSize(){return this.size_}getImageState(){return this.imageState_}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=$o,i=Zo,n=0,r=null,s=0,o=0;this.stroke_&&(t=Ao(this.stroke_.getColor()??Ho),o=this.stroke_.getWidth()??1,r=this.stroke_.getLineDash(),s=this.stroke_.getLineDashOffset()??0,i=this.stroke_.getLineJoin()??Zo,e=this.stroke_.getLineCap()??$o,n=this.stroke_.getMiterLimit()??Yo);const a=this.calculateLineJoinSize_(i,o,n),l=Math.max(this.radius,this.radius2_||0);return{strokeStyle:t,strokeWidth:o,size:Math.ceil(2*l+a),lineCap:e,lineDash:r,lineDashOffset:s,lineJoin:i,miterLimit:n}}render(){this.renderOptions_=this.createRenderOptions();const t=this.renderOptions_.size;this.canvases_={},this.hitDetectionCanvas_=null,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=Vo),e.fillStyle=Ao(t),e.fill()}t.strokeStyle&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineCap=t.lineCap,e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())}createHitDetectionCanvas_(t){let e;if(this.fill_){let i=this.fill_.getColor(),n=0;"string"==typeof i&&(i=To(i)),null===i?n=1:Array.isArray(i)&&(n=4===i.length?i[3]:1),0===n&&(e=pt(t.size,t.size),this.drawHitDetectionCanvas_(t,e))}return e?e.canvas: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=Vo,e.fill(),t.strokeStyle&&(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())}ready(){return this.fill_?this.fill_.ready():Promise.resolve()}}class ua extends ca{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 ua({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 da{constructor(t){t=t||{},this.patternImage_=null,this.color_=null,void 0!==t.color&&this.setColor(t.color)}clone(){const t=this.getColor();return new da({color:Array.isArray(t)?t.slice():t||void 0})}getColor(){return this.color_}setColor(t){if(null!==t&&"object"==typeof t&&"src"in t){const e=Mo(null,t.src,"anonymous",void 0,t.offset?null:t.color?t.color:null,!(t.offset&&t.size));e.ready().then((()=>{this.patternImage_=null})),e.getImageState()===zr.IDLE&&e.load(),e.getImageState()===zr.LOADING&&(this.patternImage_=e)}this.color_=t}loading(){return!!this.patternImage_}ready(){return this.patternImage_?this.patternImage_.ready():Promise.resolve()}}class ga{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 ga({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 fa{constructor(t){t=t||{},this.geometry_=null,this.geometryFunction_=xa,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 fa({geometry:t??void 0,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer()??void 0,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_=xa,this.geometry_=t}setZIndex(t){this.zIndex_=t}}function pa(t){let e;if("function"==typeof t)e=t;else{let i;if(Array.isArray(t))i=t;else{Ft("function"==typeof t.getZIndex,"Expected an `Style` or an array of `Style`");i=[t]}e=function(){return i}}return e}let ma=null;function _a(t,e){if(!ma){const t=new da({color:"rgba(255,255,255,0.4)"}),e=new ga({color:"#3399CC",width:1.25});ma=[new fa({image:new ua({fill:t,stroke:e,radius:5}),fill:t,stroke:e})]}return ma}function ya(){const t={},e=[255,255,255,1],i=[0,153,255,1];return t.Polygon=[new fa({fill:new da({color:[255,255,255,.5]})})],t.MultiPolygon=t.Polygon,t.LineString=[new fa({stroke:new ga({color:e,width:5})}),new fa({stroke:new ga({color:i,width:3})})],t.MultiLineString=t.LineString,t.Circle=t.Polygon.concat(t.LineString),t.Point=[new fa({image:new ua({radius:6,fill:new da({color:i}),stroke:new ga({color:e,width:1.5})}),zIndex:1/0})],t.MultiPoint=t.Point,t.GeometryCollection=t.Polygon.concat(t.LineString,t.Point),t}function xa(t){return t.getGeometry()}function va(t,e,i,n){return void 0!==i&&void 0!==n?[i/t,n/e]:void 0!==i?i/t:void 0!==n?n/e:1}class Sa extends ro{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;let o,a=t.src;if(Ft(!(void 0!==a&&s),"`image` and `src` cannot be provided at the same time"),void 0!==a&&0!==a.length||!s||(a=s.src||U(s)),Ft(void 0!==a&&a.length>0,"A defined and non-empty `src` or `image` must be provided"),Ft(!((void 0!==t.width||void 0!==t.height)&&void 0!==t.scale),"`width` or `height` cannot be provided together with `scale`"),void 0!==t.src?o=zr.IDLE:void 0!==s&&(o="complete"in s?s.complete?s.src?zr.LOADED:zr.IDLE:zr.LOADING:zr.LOADED),this.color_=void 0!==t.color?To(t.color):null,this.iconImage_=Mo(s,a,this.crossOrigin_,o,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,this.initialOptions_,void 0!==t.width||void 0!==t.height){let e,i;if(t.size)[e,i]=t.size;else{const n=this.getImage(1);if(n.width&&n.height)e=n.width,i=n.height;else if(n instanceof HTMLImageElement){this.initialOptions_=t;const e=()=>{if(this.unlistenImageChange(e),!this.initialOptions_)return;const i=this.iconImage_.getSize();this.setScale(va(i[0],i[1],t.width,t.height))};return void this.listenImageChange(e)}}void 0!==e&&this.setScale(va(e,i,t.width,t.height))}}clone(){let t,e,i;return this.initialOptions_?(e=this.initialOptions_.width,i=this.initialOptions_.height):(t=this.getScale(),t=Array.isArray(t)?t.slice():t),new Sa({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_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:t,width:e,height:i,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()}getWidth(){const t=this.getScaleArray();return this.size_?this.size_[0]*t[0]:this.iconImage_.getImageState()==zr.LOADED?this.iconImage_.getSize()[0]*t[0]:void 0}getHeight(){const t=this.getScaleArray();return this.size_?this.size_[1]*t[1]:this.iconImage_.getImageState()==zr.LOADED?this.iconImage_.getSize()[1]*t[1]:void 0}setScale(t){delete this.initialOptions_,super.setScale(t)}listenImageChange(t){this.iconImage_.addEventListener(v,t)}load(){this.iconImage_.load()}unlistenImageChange(t){this.iconImage_.removeEventListener(v,t)}ready(){return this.iconImage_.ready()}}class Ea{constructor(t){t=t||{},this.font_=t.font,this.rotation_=t.rotation,this.rotateWithView_=t.rotateWithView,this.scale_=t.scale,this.scaleArray_=no(void 0!==t.scale?t.scale:1),this.text_=t.text,this.textAlign_=t.textAlign,this.justify_=t.justify,this.repeat_=t.repeat,this.textBaseline_=t.textBaseline,this.fill_=void 0!==t.fill?t.fill:new da({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,this.declutterMode_=t.declutterMode}clone(){const t=this.getScale();return new Ea({font:this.getFont(),placement:this.getPlacement(),repeat:this.getRepeat(),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,declutterMode:this.getDeclutterMode()})}getOverflow(){return this.overflow_}getFont(){return this.font_}getMaxAngle(){return this.maxAngle_}getPlacement(){return this.placement_}getRepeat(){return this.repeat_}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_}getDeclutterMode(){return this.declutterMode_}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}setRepeat(t){this.repeat_=t}setRotateWithView(t){this.rotateWithView_=t}setFill(t){this.fill_=t}setRotation(t){this.rotation_=t}setScale(t){this.scale_=t,this.scaleArray_=no(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}}let wa=0;const Ta=1<<wa++,Ca=1<<wa++,Ra=1<<wa++,ba=1<<wa++,Pa=1<<wa++,Ia=1<<wa++,La=Math.pow(2,6)-1,Fa={[Ta]:"boolean",[Ca]:"number",[Ra]:"string",[ba]:"color",[Pa]:"number[]",[Ia]:"size"},Ma=Object.keys(Fa).map(Number).sort(s);function Aa(t){const e=[];for(const i of Ma)Oa(t,i)&&e.push(Fa[i]);return 0===e.length?"untyped":e.length<3?e.join(" or "):e.slice(0,-1).join(", ")+", or "+e[e.length-1]}function Oa(t,e){return(t&e)===e}function Da(t,e){return t===e}class Na{constructor(t,e){if(!function(t){return t in Fa}(t))throw new Error(`literal expressions must have a specific type, got ${Aa(t)}`);this.type=t,this.value=e}}class ka{constructor(t,e,...i){this.type=t,this.operator=e,this.args=i}}function Ga(){return{variables:new Set,properties:new Set,featureId:!1,geometryType:!1}}function ja(t,e,i){switch(typeof t){case"boolean":if(Da(e,Ra))return new Na(Ra,t?"true":"false");if(!Oa(e,Ta))throw new Error(`got a boolean, but expected ${Aa(e)}`);return new Na(Ta,t);case"number":if(Da(e,Ia))return new Na(Ia,no(t));if(Da(e,Ta))return new Na(Ta,!!t);if(Da(e,Ra))return new Na(Ra,t.toString());if(!Oa(e,Ca))throw new Error(`got a number, but expected ${Aa(e)}`);return new Na(Ca,t);case"string":if(Da(e,ba))return new Na(ba,wo(t));if(Da(e,Ta))return new Na(Ta,!!t);if(!Oa(e,Ra))throw new Error(`got a string, but expected ${Aa(e)}`);return new Na(Ra,t)}if(!Array.isArray(t))throw new Error("expression must be an array or a primitive value");if(0===t.length)throw new Error("empty expression");if("string"==typeof t[0])return function(t,e,i){const n=t[0],r=Ba[n];if(!r)throw new Error(`unknown operator: ${n}`);return r(t,e,i)}(t,e,i);for(const e of t)if("number"!=typeof e)throw new Error("expected an array of numbers");if(Da(e,Ia)){if(2!==t.length)throw new Error(`expected an array of two values for a size, got ${t.length}`);return new Na(Ia,t)}if(Da(e,ba)){if(3===t.length)return new Na(ba,[...t,1]);if(4===t.length)return new Na(ba,t);throw new Error(`expected an array of 3 or 4 values for a color, got ${t.length}`)}if(!Oa(e,Pa))throw new Error(`got an array of numbers, but expected ${Aa(e)}`);return new Na(Pa,t)}const Ua={Get:"get",Var:"var",Concat:"concat",GeometryType:"geometry-type",LineMetric:"line-metric",Any:"any",All:"all",Not:"!",Resolution:"resolution",Zoom:"zoom",Time:"time",Equal:"==",NotEqual:"!=",GreaterThan:">",GreaterThanOrEqualTo:">
2387=",LessThan:"<",LessThanOrEqualTo:"<=",Multiply:"*",Divide:"/",Add:"+",Subtract:"-",Clamp:"clamp",Mod:"%",Pow:"^",Abs:"abs",Floor:"floor",Ceil:"ceil",Round:"round",Sin:"sin",Cos:"cos",Atan:"atan",Sqrt:"sqrt",Match:"match",Between:"between",Interpolate:"interpolate",Coalesce:"coalesce",Case:"case",In:"in",Number:"number",String:"string",Array:"array",Color:"color",Id:"id",Band:"band",Palette:"palette",ToString:"to-string",Has:"has"},Ba={[Ua.Get]:Ya(Va(1,1/0),za),[Ua.Var]:Ya(Va(1,1),(function(t,e,i){const n=t[1];if("string"!=typeof n)throw new Error("expected a string argument for var operation");return i.variables.add(n),[new Na(Ra,n)]})),[Ua.Has]:Ya(Va(1,1/0),za),[Ua.Id]:Ya((function(t,e,i){i.featureId=!0}),Xa),[Ua.Concat]:Ya(Va(2,1/0),Wa(Ra)),[Ua.GeometryType]:Ya((function(t,e,i){i.geometryType=!0}),Xa),[Ua.LineMetric]:Ya(Xa),[Ua.Resolution]:Ya(Xa),[Ua.Zoom]:Ya(Xa),[Ua.Time]:Ya(Xa),[Ua.Any]:Ya(Va(2,1/0),Wa(Ta)),[Ua.All]:Ya(Va(2,1/0),Wa(Ta)),[Ua.Not]:Ya(Va(1,1),Wa(Ta)),[Ua.Equal]:Ya(Va(2,2),Wa(La)),[Ua.NotEqual]:Ya(Va(2,2),Wa(La)),[Ua.GreaterThan]:Ya(Va(2,2),Wa(Ca)),[Ua.GreaterThanOrEqualTo]:Ya(Va(2,2),Wa(Ca)),[Ua.LessThan]:Ya(Va(2,2),Wa(Ca)),[Ua.LessThanOrEqualTo]:Ya(Va(2,2),Wa(Ca)),[Ua.Multiply]:Ya(Va(2,1/0),$a),[Ua.Coalesce]:Ya(Va(2,1/0),$a),[Ua.Divide]:Ya(Va(2,2),Wa(Ca)),[Ua.Add]:Ya(Va(2,1/0),Wa(Ca)),[Ua.Subtract]:Ya(Va(2,2),Wa(Ca)),[Ua.Clamp]:Ya(Va(3,3),Wa(Ca)),[Ua.Mod]:Ya(Va(2,2),Wa(Ca)),[Ua.Pow]:Ya(Va(2,2),Wa(Ca)),[Ua.Abs]:Ya(Va(1,1),Wa(Ca)),[Ua.Floor]:Ya(Va(1,1),Wa(Ca)),[Ua.Ceil]:Ya(Va(1,1),Wa(Ca)),[Ua.Round]:Ya(Va(1,1),Wa(Ca)),[Ua.Sin]:Ya(Va(1,1),Wa(Ca)),[Ua.Cos]:Ya(Va(1,1),Wa(Ca)),[Ua.Atan]:Ya(Va(1,2),Wa(Ca)),[Ua.Sqrt]:Ya(Va(1,1),Wa(Ca)),[Ua.Match]:Ya(Va(4,1/0),Za,(function(t,e,i){const n=t.length-1,r=Ra|Ca|Ta,s=ja(t[1],r,i),o=ja(t[t.length-1],e,i),a=new Array(n-2);for(let e=0;e<n-2;e+=2){try{const n=ja(t[e+2],s.type,i);a[e]=n}catch(t){throw new Error(`failed to parse argument ${e+1} of match expression: ${t.message}`)}try{const n=ja(t[e+3],o.type,i);a[e+1]=n}catch(t){throw new Error(`failed to parse argument ${e+2} of match expression: ${t.message}`)}}return[s,...a,o]})),[Ua.Between]:Ya(Va(3,3),Wa(Ca)),[Ua.Interpolate]:Ya(Va(6,1/0),Za,(function(t,e,i){const n=t[1];let r;switch(n[0]){case"linear":r=1;break;case"exponential":const t=n[1];if("number"!=typeof t||t<=0)throw new Error(`expected a number base for exponential interpolation, got ${JSON.stringify(t)} instead`);r=t;break;default:throw new Error(`invalid interpolation type: ${JSON.stringify(n)}`)}const s=new Na(Ca,r);let o;try{o=ja(t[2],Ca,i)}catch(t){throw new Error(`failed to parse argument 1 in interpolate expression: ${t.message}`)}const a=new Array(t.length-3);for(let n=0;n<a.length;n+=2){try{const e=ja(t[n+3],Ca,i);a[n]=e}catch(t){throw new Error(`failed to parse argument ${n+2} for interpolate expression: ${t.message}`)}try{const r=ja(t[n+4],e,i);a[n+1]=r}catch(t){throw new Error(`failed to parse argument ${n+3} for interpolate expression: ${t.message}`)}}return[s,o,...a]})),[Ua.Case]:Ya(Va(3,1/0),(function(t,e,i){const n=t[0],r=t.length-1;if(r%2==0)throw new Error(`expected an odd number of arguments for ${n}, got ${r} instead`)}),(function(t,e,i){const n=ja(t[t.length-1],e,i),r=new Array(t.length-1);for(let e=0;e<r.length-1;e+=2){try{const n=ja(t[e+1],Ta,i);r[e]=n}catch(t){throw new Error(`failed to parse argument ${e} of case expression: ${t.message}`)}try{const s=ja(t[e+2],n.type,i);r[e+1]=s}catch(t){throw new Error(`failed to parse argument ${e+1} of case expression: ${t.message}`)}}return r[r.length-1]=n,r})),[Ua.In]:Ya(Va(2,2),(function(t,e,i){let n,r=t[2];if(!Array.isArray(r))throw new Error('the second argument for the "in" operator must be an array');if("string"==typeof r[0]){if("literal"!==r[0])throw new Error('for the "in" operator, a string array should be wrapped in a "literal" operator to disambiguate from expressions');if(!Array.isArray(r[1]))throw new Error('failed to parse "in" expression: the literal operator must be followed by an array');r=r[1],n=Ra}else n=Ca;const s=new Array(r.length);for(let t=0;t<s.length;t++)try{const e=ja(r[t],n,i);s[t]=e}catch(e){throw new Error(`failed to parse haystack item ${t} for "in" expression: ${e.message}`)}return[ja(t[1],n,i),...s]}
vendor: 20,567 bytes, line 2387
2387)),[Ua.Number]:Ya(Va(1,1/0),Wa(La)),[Ua.String]:Ya(Va(1,1/0),Wa(La)),[Ua.Array]:Ya(Va(1,1/0),Wa(Ca)),[Ua.Color]:Ya(Va(1,4),Wa(Ca)),[Ua.Band]:Ya(Va(1,3),Wa(Ca)),[Ua.Palette]:Ya(Va(2,2),(function(t,e,i){let n;try{n=ja(t[1],Ca,i)}catch(t){throw new Error(`failed to parse first argument in palette expression: ${t.message}`)}const r=t[2];if(!Array.isArray(r))throw new Error("the second argument of palette must be an array");const s=new Array(r.length);for(let t=0;t<s.length;t++){let e;try{e=ja(r[t],ba,i)}catch(e){throw new Error(`failed to parse color at index ${t} in palette expression: ${e.message}`)}if(!(e instanceof Na))throw new Error(`the palette color at index ${t} must be a literal value`);s[t]=e}return[n,...s]})),[Ua.ToString]:Ya(Va(1,1),Wa(Ta|Ca|Ra|ba))};function za(t,e,i){const n=t.length-1,r=new Array(n);for(let e=0;e<n;++e){const n=t[e+1];switch(typeof n){case"number":r[e]=new Na(Ca,n);break;case"string":r[e]=new Na(Ra,n);break;default:throw new Error(`expected a string key or numeric array index for a get operation, got ${n}`)}0===e&&i.properties.add(String(n))}return r}function Xa(t,e,i){const n=t[0];if(1!==t.length)throw new Error(`expected no arguments for ${n} operation`);return[]}function Va(t,e){return function(i,n,r){const s=i[0],o=i.length-1;if(t===e){if(o!==t){throw new Error(`expected ${t} argument${1===t?"":"s"} for ${s}, got ${o}`)}}else if(o<t||o>e){throw new Error(`expected ${e===1/0?`${t} or more`:`${t} to ${e}`} arguments for ${s}, got ${o}`)}}}function $a(t,e,i){const n=t.length-1,r=new Array(n);for(let s=0;s<n;++s){const n=ja(t[s+1],e,i);r[s]=n}return r}function Wa(t){return function(e,i,n){const r=e.length-1,s=new Array(r);for(let i=0;i<r;++i){const r=ja(e[i+1],t,n);s[i]=r}return s}}function Za(t,e,i){const n=t[0],r=t.length-1;if(r%2==1)throw new Error(`expected an even number of arguments for operation ${n}, got ${r} instead`)}function Ya(...t){return function(e,i,n){const r=e[0];let s;for(let r=0;r<t.length;r++){const o=t[r](e,i,n);if(r==t.length-1){if(!o)throw new Error("expected last argument validator to return the parsed args");s=o}}return new ka(i,r,...s)}}function Ha(t){if(!t)return"";const e=t.getType();switch(e){case"Point":case"LineString":case"Polygon":return e;case"MultiPoint":case"MultiLineString":case"MultiPolygon":return e.substring(5);case"Circle":return"Polygon";case"GeometryCollection":return Ha(t.getGeometries()[0]);default:return""}}function Ka(){return{variables:{},properties:{},resolution:NaN,featureId:null,geometryType:""}}function qa(t,e,i){return Ja(ja(t,e,i))}function Ja(t,e){if(t instanceof Na){if(t.type===ba&&"string"==typeof t.value){const e=wo(t.value);return function(){return e}}return function(){return t.value}}const i=t.operator;switch(i){case Ua.Number:case Ua.String:case Ua.Coalesce:return function(t,e){const i=t.operator,n=t.args.length,r=new Array(n);for(let e=0;e<n;++e)r[e]=Ja(t.args[e]);switch(i){case Ua.Coalesce:return t=>{for(let e=0;e<n;++e){const i=r[e](t);if(null!=i)return i}throw new Error("Expected one of the values to be non-null")};case Ua.Number:case Ua.String:return t=>{for(let e=0;e<n;++e){const n=r[e](t);if(typeof n===i)return n}throw new Error(`Expected one of the values to be a ${i}`)};default:throw new Error(`Unsupported assertion operator ${i}`)}}(t);case Ua.Get:case Ua.Var:case Ua.Has:return function(t,e){const i=t.args[0],n=i.value;switch(t.operator){case Ua.Get:return e=>{const i=t.args;let r=e.properties[n];for(let t=1,e=i.length;t<e;++t){r=r[i[t].value]}return r};case Ua.Var:return t=>t.variables[n];case Ua.Has:return e=>{const i=t.args;if(!(n in e.properties))return!1;let r=e.properties[n];for(let t=1,e=i.length;t<e;++t){const e=i[t].value;if(!r||!Object.hasOwn(r,e))return!1;r=r[e]}return!0};default:throw new Error(`Unsupported accessor operator ${t.operator}`)}}(t);case Ua.Id:return t=>t.featureId;case Ua.GeometryType:return t=>t.geometryType;case Ua.Concat:{const e=t.args.map((t=>Ja(t)));return t=>"".concat(...e.map((e=>e(t).toString())))}case Ua.Resolution:return t=>t.resolution;case Ua.Any:case Ua.All:case Ua.Between:case Ua.In:case Ua.Not:return function(t,e){const i=t.operator,n=t.args.length,r=new Array(n);for(let e=0;e<n;++e)r[e]=Ja(t.args[e]);switch(i){case Ua.Any:return t=>{for(let e=0;e<n;++e)if(r[e](t))return!0;return!1};case Ua.All:return t=>{for(let e=0;e<n;++e)if(!r[e](t))return!1;return!0};case Ua.Between:return t=>{const e=r[0](t),i=r[1](t),n=r[2](t);return e>=i&&e<=n};case Ua.In:return t=>{const e=r[0](t);for(let i=1;i<n;++i)if(e===r[i](t))return!0;return!1};case Ua.Not:return t=>!r[0](t);default:throw new Error(`Unsupported logical operator ${i}`)}}(t);case Ua.Equal:case Ua.NotEqual:case Ua.LessThan:case Ua.LessThanOrEqualTo:case Ua.GreaterThan:case Ua.GreaterThanOrEqualTo:return function(t,e){const i=t.operator,n=Ja(t.args[0]),r=Ja(t.args[1]);switch(i){case Ua.Equal:return t=>n(t)===r(t);case Ua.NotEqual:return t=>n(t)!==r(t);case Ua.LessThan:return t=>n(t)<r(t);case Ua.LessThanOrEqualTo:return t=>n(t)<=r(t);case Ua.GreaterThan:return t=>n(t)>r(t);case Ua.GreaterThanOrEqualTo:return t=>n(t)>=r(t);default:throw new Error(`Unsupported comparison operator ${i}`)}}(t);case Ua.Multiply:case Ua.Divide:case Ua.Add:case Ua.Subtract:case Ua.Clamp:case Ua.Mod:case Ua.Pow:case Ua.Abs:case Ua.Floor:case Ua.Ceil:case Ua.Round:case Ua.Sin:case Ua.Cos:case Ua.Atan:case Ua.Sqrt:return function(t,e){const i=t.operator,n=t.args.length,r=new Array(n);for(let e=0;e<n;++e)r[e]=Ja(t.args[e]);switch(i){case Ua.Multiply:return t=>{let e=1;for(let i=0;i<n;++i)e*=r[i](t);return e};case Ua.Divide:return t=>r[0](t)/r[1](t);case Ua.Add:return t=>{let e=0;for(let i=0;i<n;++i)e+=r[i](t);return e};case Ua.Subtract:return t=>r[0](t)-r[1](t);case Ua.Clamp:return t=>{const e=r[0](t),i=r[1](t);if(e<i)return i;const n=r[2](t);return e>n?n:e};case Ua.Mod:return t=>r[0](t)%r[1](t);case Ua.Pow:return t=>Math.pow(r[0](t),r[1](t));case Ua.Abs:return t=>Math.abs(r[0](t));case Ua.Floor:return t=>Math.floor(r[0](t));case Ua.Ceil:return t=>Math.ceil(r[0](t));case Ua.Round:return t=>Math.round(r[0](t));case Ua.Sin:return t=>Math.sin(r[0](t));case Ua.Cos:return t=>Math.cos(r[0](t));case Ua.Atan:return 2===n?t=>Math.atan2(r[0](t),r[1](t)):t=>Math.atan(r[0](t));case Ua.Sqrt:return t=>Math.sqrt(r[0](t));default:throw new Error(`Unsupported numeric operator ${i}`)}}(t);case Ua.Case:return function(t,e){const i=t.args.length,n=new Array(i);for(let e=0;e<i;++e)n[e]=Ja(t.args[e]);return t=>{for(let e=0;e<i-1;e+=2){if(n[e](t))return n[e+1](t)}return n[i-1](t)}}(t);case Ua.Match:return function(t,e){const i=t.args.length,n=new Array(i);for(let e=0;e<i;++e)n[e]=Ja(t.args[e]);return t=>{const e=n[0](t);for(let r=1;r<i;r+=2)if(e===n[r](t))return n[r+1](t);return n[i-1](t)}}(t);case Ua.Interpolate:return function(t,e){const i=t.args.length,n=new Array(i);for(let e=0;e<i;++e)n[e]=Ja(t.args[e]);return t=>{const e=n[0](t),r=n[1](t);let s,o;for(let a=2;a<i;a+=2){const i=n[a](t);let l=n[a+1](t);const h=Array.isArray(l);if(h&&(l=vo(l)),i>=r)return 2===a?l:h?tl(e,r,s,o,i,l):Qa(e,r,s,o,i,l);s=i,o=l}return o}}(t);case Ua.ToString:return function(t,e){const i=t.operator,n=t.args.length,r=new Array(n);for(let e=0;e<n;++e)r[e]=Ja(t.args[e]);if(i===Ua.ToString)return e=>{const i=r[0](e);return t.args[0].type===ba?Ro(i):i.toString()};throw new Error(`Unsupported convert operator ${i}`)}(t);default:throw new Error(`Unsupported operator ${i}`)}}function Qa(t,e,i,n,r,s){const o=r-i;if(0===o)return n;const a=e-i;return n+(1===t?a/o:(Math.pow(t,a)-1)/(Math.pow(t,o)-1))*(s-n)}function tl(t,e,i,n,r,s){if(0===r-i)return n;const o=So(n),a=So(s);let l=a[2]-o[2];l>180?l-=360:l<-180&&(l+=360);return Co(Eo([Qa(t,e,i,o[0],r,a[0]),Qa(t,e,i,o[1],r,a[1]),o[2]+Qa(t,e,i,0,r,l),Qa(t,e,i,n[3],r,s[3])]))}function el(t){return!0}function il(t){const e=Ga(),i=rl(t,e),n={variables:{},properties:{},resolution:NaN,featureId:null,geometryType:""};return function(t,r){if(n.properties=t.getPropertiesInternal(),n.resolution=r,e.featureId){const e=t.getId();n.featureId=void 0!==e?e:null}return e.geometryType&&(n.geometryType=Ha(t.getGeometry())),i(n)}}function nl(t){const e=Ga(),i=t.length,n=new Array(i);for(let r=0;r<i;++r)n[r]=sl(t[r],e);const r={variables:{},properties:{},resolution:NaN,featureId:null,geometryType:""},s=new Array(i);return function(t,o){if(r.properties=t.getPropertiesInternal(),r.resolution=o,e.featureId){const e=t.getId();r.featureId=void 0!==e?e:null}let a=0;for(let t=0;t<i;++t){const e=n[t](r);e&&(s[a]=e,a+=1)}return s.length=a,s}}function rl(t,e){const i=t.length,n=new Array(i);for(let r=0;r<i;++r){const i=t[r],s="filter"in i?qa(i.filter,Ta,e):el;let o;if(Array.isArray(i.style)){const t=i.style.length;o=new Array(t);for(let n=0;n<t;++n)o[n]=sl(i.style[n],e)}else o=[sl(i.style,e)];n[r]={filter:s,styles:o}}return function(e){const r=[];let s=!1;for(let o=0;o<i;++o){if((0,n[o].filter)(e)&&(!t[o].else||!s)){s=!0;for(const t of n[o].styles){const i=t(e);i&&r.push(i)}}}return r}}function sl(t,e){const i=ol(t,"",e),n=al(t,"",e),r=function(t,e){const i="text-",n=hl(t,i+"value",e);if(!n)return null;const r=ol(t,i,e),s=ol(t,i+"background-",e),o=al(t,i,e),a=al(t,i+"background-",e),l=hl(t,i+"font",e),h=ll(t,i+"max-angle",e),c=ll(t,i+"offset-x",e),u=ll(t,i+"offset-y",e),d=cl(t,i+"overflow",e),g=hl(t,i+"placement",e),f=ll(t,i+"repeat",e),p=pl(t,i+"scale",e),m=cl(t,i+"rotate-with-view",e),_=ll(t,i+"rotation",e),y=hl(t,i+"align",e),x=hl(t,i+"justify",e),v=hl(t,i+"baseline",e),S=dl(t,i+"padding",e),E=xl(t,i+"declutter-mode"),w=new Ea({declutterMode:E});return function(t){if(w.setText(n(t)),r&&w.setFill(r(t)),s&&w.setBackgroundFill(s(t)),o&&w.setStroke(o(t)),a&&w.setBackgroundStroke(a(t)),l&&w.setFont(l(t)),h&&w.setMaxAngle(h(t)),c&&w.setOffsetX(c(t)),u&&w.setOffsetY(u(t)),d&&w.setOverflow(d(t)),g){const e=g(t);if("point"!==e&&"line"!==e)throw new Error("Expected point or line for text-placement");w.setPlacement(e)}if(f&&w.setRepeat(f(t)),p&&w.setScale(p(t)),m&&w.setRotateWithView(m(t)),_&&w.setRotation(_(t)),y){const e=y(t);if("left"!==e&&"center"!==e&&"right"!==e&&"end"!==e&&"start"!==e)throw new Error("Expected left, right, center, start, or end for text-align");w.setTextAlign(e)}if(x){const e=x(t);if("left"!==e&&"right"!==e&&"center"!==e)throw new Error("Expected left, right, or center for text-justify");w.setJustify(e)}if(v){const e=v(t);if("bottom"!==e&&"top"!==e&&"middle"!==e&&"alphabetic"!==e&&"hanging"!==e)throw new Error("Expected bottom, top, middle, alphabetic, or hanging for text-baseline");w.setTextBaseline(e)}return S&&w.setPadding(S(t)),w}}(t,e),s=function(t,e){if("icon-src"in t)return function(t,e){const i="icon-",n=i+"src",r=Sl(t[n],n),s=gl(t,i+"anchor",e),o=pl(t,i+"scale",e),a=ll(t,i+"opacity",e),l=gl(t,i+"displacement",e),h=ll(t,i+"rotation",e),c=cl(t,i+"rotate-with-view",e),u=_l(t,i+"anchor-origin"),d=yl(t,i+"anchor-x-units"),g=yl(t,i+"anchor-y-units"),f=function(t,e){const i=t[e];if(void 0===i)return;return wl(i,e)}(t,i+"color"),p=function(t,e){const i=t[e];if(void 0===i)return;if("string"!=typeof i)throw new Error(`Expected a string for ${e}`);return i}(t,i+"cross-origin"),m=function(t,e){const i=t[e];if(void 0===i)return;return vl(i,e)}(t,i+"offset"),_=_l(t,i+"offset-origin"),y=ml(t,i+"width"),x=ml(t,i+"height"),v=function(t,e){const i=t[e];if(void 0===i)return;if("number"==typeof i)return no(i);if(!Array.isArray(i))throw new Error(`Expected a number or size array for ${e}`);if(2!==i.length||"number"!=typeof i[0]||"number"!=typeof i[1])throw new Error(`Expected a number or size array for ${e}`);return i}(t,i+"size"),S=xl(t,i+"declutter-mode"),E=new Sa({src:r,anchorOrigin:u,anchorXUnits:d,anchorYUnits:g,color:f,crossOrigin:p,offset:m,offsetOrigin:_,height:x,width:y,size:v,declutterMode:S});return function(t){return a&&E.setOpacity(a(t)),l&&E.setDisplacement(l(t)),h&&E.setRotation(h(t)),c&&E.setRotateWithView(c(t)),o&&E.setScale(o(t)),s&&E.setAnchor(s(t)),E}}(t,e);if("shape-points"in t)return function(t,e){const i="shape-",n=i+"points",r=i+"radius",s=El(t[n],n),o=El(t[r],r),a=ol(t,i,e),l=al(t,i,e),h=pl(t,i+"scale",e),c=gl(t,i+"displacement",e),u=ll(t,i+"rotation",e),d=cl(t,i+"rotate-with-view",e),g=ml(t,i+"radius2"),f=ml(t,i+"angle"),p=xl(t,i+"declutter-mode"),m=new ca({points:s,radius:o,radius2:g,angle:f,declutterMode:p});return function(t){return a&&m.setFill(a(t)),l&&m.setStroke(l(t)),c&&m.setDisplacement(c(t)),u&&m.setRotation(u(t)),d&&m.setRotateWithView(d(t)),h&&m.setScale(h(t)),m}}(t,e);if("circle-radius"in t)return function(t,e){const i="circle-",n=ol(t,i,e),r=al(t,i,e),s=ll(t,i+"radius",e),o=pl(t,i+"scale",e),a=gl(t,i+"displacement",e),l=ll(t,i+"rotation",e),h=cl(t,i+"rotate-with-view",e),c=xl(t,i+"declutter-mode"),u=new ua({radius:5,declutterMode:c});return function(t){return s&&u.setRadius(s(t)),n&&u.setFill(n(t)),r&&u.setStroke(r(t)),a&&u.setDisplacement(a(t)),l&&u.setRotation(l(t)),h&&u.setRotateWithView(h(t)),o&&u.setScale(o(t)),u}}(t,e);return null}(t,e),o=ll(t,"z-index",e);if(!(i||n||r||s||y(t)))throw new Error("No fill, stroke, point, or text symbolizer properties in style: "+JSON.stringify(t));const a=new fa;return function(t){let e=!0;if(i){const n=i(t);n&&(e=!1),a.setFill(n)}if(n){const i=n(t);i&&(e=!1),a.setStroke(i)}if(r){const i=r(t);i&&(e=!1),a.setText(i)}if(s){const i=s(t);i&&(e=!1),a.setImage(i)}return o&&a.setZIndex(o(t)),e?null:a}}function ol(t,e,i){let n;if(e+"fill-pattern-src"in t)n=function(t,e,i){const n=hl(t,e+"pattern-src",i),r=fl(t,e+"pattern-offset",i),s=fl(t,e+"pattern-size",i),o=ul(t,e+"color",i);return function(t){return{src:n(t),offset:r&&r(t),size:s&&s(t),color:o&&o(t)}}}(t,e+"fill-",i);else{if("none"===t[e+"fill-color"])return t=>null;n=ul(t,e+"fill-color",i)}if(!n)return null;const r=new da;return function(t){const e=n(t);return e===po?null:(r.setColor(e),r)}}function al(t,e,i){const n=ll(t,e+"stroke-width",i),r=ul(t,e+"stroke-color",i);if(!n&&!r)return null;const s=hl(t,e+"stroke-line-cap",i),o=hl(t,e+"stroke-line-join",i),a=dl(t,e+"stroke-line-dash",i),l=ll(t,e+"stroke-line-dash-offset",i),h=ll(t,e+"stroke-miter-limit",i),c=new ga;return function(t){if(r){const e=r(t);if(e===po)return null;c.setColor(e)}if(n&&c.setWidth(n(t)),s){const e=s(t);if("butt"!==e&&"round"!==e&&"square"!==e)throw new Error("Expected butt, round, or square line cap");c.setLineCap(e)}if(o){const e=o(t);if("bevel"!==e&&"round"!==e&&"miter"!==e)throw new Error("Expected bevel, round, or miter line join");c.setLineJoin(e)}return a&&c.setLineDash(a(t)),l&&c.setLineDashOffset(l(t)),h&&c.setMiterLimit(h(t)),c}}function ll(t,e,i){if(!(e in t))return;const n=qa(t[e],Ca,i);return function(t){return El(n(t),e)}}function hl(t,e,i){if(!(e in t))return null;const n=qa(t[e],Ra,i);return function(t){return Sl(n(t),e)}}function cl(t,e,i){if(!(e in t))return null;const n=qa(t[e],Ta,i);return function(t){const i=n(t);if("boolean"!=typeof i)throw new Error(`Expected a boolean for ${e}`);return i}}function ul(t,e,i){if(!(e in t))return null;const n=qa(t[e],ba,i);return function(t){return wl(n(t),e)}}function dl(t,e,i){if(!(e in t))return null;const n=qa(t[e],Pa,i);return function(t){return vl(n(t),e)}}function gl(t,e,i){if(!(e in t))return null;const n=qa(t[e],Pa,i);return function(t){const i=vl(n(t),e);if(2!==i.length)throw new Error(`Expected two numbers for ${e}`);return i}}function fl(t,e,i){if(!(e in t))return null;const n=qa(t[e],Pa,i);return function(t){return Tl(n(t),e)}}function pl(t,e,i){if(!(e in t))return null;const n=qa(t[e],Pa|Ca,i);return function(t){return function(t,e){if("number"==typeof t)return t;return Tl(t,e)}(n(t),e)}}function ml(t,e){const i=t[e];if(void 0!==i){if("number"!=typeof i)throw new Error(`Expected a number for ${e}`);return i}}function _l(t,e){const i=t[e];if(void 0!==i){if("bottom-left"!==i&&"bottom-right"!==i&&"top-left"!==i&&"top-right"!==i)throw new Error(`Expected bottom-left, bottom-right, top-left, or top-right for ${e}`);return i}}function yl(t,e){const i=t[e];if(void 0!==i){if("pixels"!==i&&"fraction"!==i)throw new Error(`Expected pixels or fraction for ${e}`);return i}}function xl(t,e){const i=t[e];if(void 0!==i){if("string"!=typeof i)throw new Error(`Expected a string for ${e}`);if("declutter"!==i&&"obstacle"!==i&&"none"!==i)throw new Error(`Expected declutter, obstacle, or none for ${e}`);return i}}function vl(t,e){if(!Array.isArray(t))throw new Error(`Expected an array for ${e}`);const i=t.length;for(let n=0;n<i;++n)if("number"!=typeof t[n])throw new Error(`Expected an array of numbers for ${e}`);return t}function Sl(t,e){if("string"!=typeof t)throw new Error(`Expected a string for ${e}`);return t}function El(t,e){if("number"!=typeof t)throw new Error(`Expected a number for ${e}`);return t}function wl(t,e){if("string"==typeof t)return t;const i=vl(t,e),n=i.length;if(n<3||n>4)throw new Error(`Expected a color with 3 or 4 values for ${e}`);return i}function Tl(t,e){const i=vl(t,e);if(2!==i.length)throw new Error(`Expected an array of two numbers for ${e}`);return i}const Cl="renderOrder";class Rl extends Ns{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_=t.declutter?String(t.declutter):void 0,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(Cl)}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}getUpdateWhileAnimating(){return this.updateWhileAnimating_}getUpdateWhileInteracting(){return this.updateWhileInteracting_}renderDeclutter(t,e){const i=this.getDeclutter();i in t.declutter==!1&&(t.declutter[i]=new Bs(9)),this.getRenderer().renderDeclutter(t,e)}setRenderOrder(t){this.set(Cl,t)}setStyle(t){this.style_=void 0===t?_a:t;const e=function(t){if(void 0===t)return _a;if(!t)return null;if("function"==typeof t)return t;if(t instanceof fa)return t;if(!Array.isArray(t))return nl([t]);if(0===t.length)return[];const e=t.length,i=t[0];if(i instanceof fa){const i=new Array(e);for(let n=0;n<e;++n){const e=t[n];if(!(e instanceof fa))throw new Error("Expected a list of style instances");i[n]=e}return i}if("style"in i){const i=new Array(e);for(let n=0;n<e;++n){const e=t[n];if(!("style"in e))throw new Error("Expected a list of rules with a style property");i[n]=e}return il(i)}const n=t;return nl(n)}(t);this.styleFunction_=null===t?void 0:pa(e),this.changed()}}class bl extends n{constructor(t){super(),this.map_=t}dispatchRenderEvent(t,e){G()}calculateMatrices2D(t){const e=t.viewState,i=t.coordinateToPixelTransform,n=t.pixelToCoordinateTransform;Vt(i,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),$t(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=Ni(t.slice(),u),g=[[0,0]];if(u.canWrapX()&&n){const t=Ie(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()&&ks(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,d,this,r,s)}getMap(){return this.map_}renderFrame(t){G()}scheduleExpireIconCache(t){Io.canExpireCache()&&t.postRenderFunctions.push(Pl)}}function Pl(t,e){Io.expire()}class Il extends t{constructor(t,e,i,n){super(t),this.inversePixelTransform=e,this.frameState=i,this.context=n}}class Ll extends bl{constructor(t){super(t),this.fontChangeListenerKey_=A(Qo,i,t.redrawText,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=No+" ol-layers";const n=t.getViewport();n.insertBefore(this.element_,n.firstChild||null),this.children_=[],this.renderedVisible_=!0}
2387dispatchRenderEvent(t,e){const i=this.getMap();if(i.hasListener(t)){const n=new Il(t,void 0,e);i.dispatchEvent(n)}}disposeInternal(){D(this.fontChangeListenerKey_),this.element_.remove(),super.disposeInternal()}renderFrame(t){if(!t)return void(this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1));this.calculateMatrices2D(t),this.dispatchRenderEvent(cs,t);const e=t.layerStatesArray.sort(((t,e)=>t.zIndex-e.zIndex));e.some((t=>t.layer instanceof Rl&&t.layer.getDeclutter()))&&(t.declutter={});const 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(!ks(o,i)||"ready"!=l&&"undefined"!=l){a.unrender();continue}const h=a.render(t,r);h&&(h!==r&&(this.children_.push(h),r=h),n.push(o))}this.declutter(t,n),wt(this.element_,this.children_),this.dispatchRenderEvent(us,t),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(t)}declutter(t,e){if(t.declutter){for(let i=e.length-1;i>=0;--i){const n=e[i],r=n.layer;r.getDeclutter()&&r.renderDeclutter(t,n)}e.forEach((e=>e.layer.renderDeferred(t)))}}}class Fl extends t{constructor(t,e){super(t),this.layer=e}}const Ml="layers";class Al extends as{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(Ml,this.handleLayersChanged_),i?Array.isArray(i)?i=new Z(i.slice(),{unique:!0}):Ft("function"==typeof i.getArray,"Expected `layers` to be an array or a `Collection`"):i=new Z(void 0,{unique:!0}),this.setLayers(i)}handleLayerChange_(){this.changed()}handleLayersChanged_(){this.layersListenerKeys_.forEach(D),this.layersListenerKeys_.length=0;const t=this.getLayers();this.layersListenerKeys_.push(A(t,X,this.handleLayersAdd_,this),A(t,V,this.handleLayersRemove_,this));for(const t in this.listenerKeys_)this.listenerKeys_[t].forEach(D);_(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 Fl("addlayer",i))}this.changed()}registerLayerListeners_(t){const e=[A(t,i,this.handleLayerChange_,this),A(t,v,this.handleLayerChange_,this)];t instanceof Al&&e.push(A(t,"addlayer",this.handleLayerGroupAdd_,this),A(t,"removelayer",this.handleLayerGroupRemove_,this)),this.listenerKeys_[U(t)]=e}handleLayerGroupAdd_(t){this.dispatchEvent(new Fl("addlayer",t.layer))}handleLayerGroupRemove_(t){this.dispatchEvent(new Fl("removelayer",t.layer))}handleLayersAdd_(t){const e=t.element;this.registerLayerListeners_(e),this.dispatchEvent(new Fl("addlayer",e)),this.changed()}handleLayersRemove_(t){const e=t.element,i=U(e);this.listenerKeys_[i].forEach(D),delete this.listenerKeys_[i],this.dispatchEvent(new Fl("removelayer",e)),this.changed()}getLayers(){return this.get(Ml)}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 Fl("removelayer",t[e]))}this.set(Ml,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=Re(i.extent,n.extent):i.extent=n.extent),void 0===i.zIndex&&(i.zIndex=r)}return e}getSourceState(){return"ready"}}class Ol extends t{constructor(t,e,i){super(t),this.map=e,this.frameState=void 0!==i?i:null}}class Dl extends Ol{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}
vendor: 119,626 bytes, line 2387
2387get 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 Nl={SINGLECLICK:"singleclick",CLICK:w,DBLCLICK:T,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},kl="pointermove",Gl="pointerdown",jl="pointerup",Ul="pointerout";class Bl extends x{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_=A(i,Gl,this.handlePointerDown_,this),this.originalPointerMoveEvent_,this.relayedListenerKey_=A(i,kl,this.relayMoveEvent_,this),this.boundHandleTouchMove_=this.handleTouchMove_.bind(this),this.element_.addEventListener(F,this.boundHandleTouchMove_,!!ft&&{passive:!1})}emulateClick_(t){let e=new Dl(Nl.CLICK,this.map_,t);this.dispatchEvent(e),void 0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new Dl(Nl.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout((()=>{this.clickTimeoutId_=void 0;const e=new Dl(Nl.SINGLECLICK,this.map_,t);this.dispatchEvent(e)}),250)}updateActivePointers_(t){const e=t,i=e.pointerId;if(e.type==Nl.POINTERUP||e.type==Nl.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!=Nl.POINTERDOWN&&e.type!=Nl.POINTERMOVE||(this.trackedTouches_[i]=e);this.activePointers_=Object.values(this.trackedTouches_)}handlePointerUp_(t){this.updateActivePointers_(t);const e=new Dl(Nl.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(D),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 Dl(Nl.POINTERDOWN,this.map_,t,void 0,void 0,this.activePointers_);if(this.dispatchEvent(e),this.down_=new PointerEvent(t.type,t),Object.defineProperty(this.down_,"target",{writable:!1,value:t.target}),0===this.dragListenerKeys_.length){const t=this.map_.getOwnerDocument();this.dragListenerKeys_.push(A(t,Nl.POINTERMOVE,this.handlePointerMove_,this),A(t,Nl.POINTERUP,this.handlePointerUp_,this),A(this.element_,Nl.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==t&&this.dragListenerKeys_.push(A(this.element_.getRootNode(),Nl.POINTERUP,this.handlePointerUp_,this))}}handlePointerMove_(t){if(this.isMoving_(t)){this.updateActivePointers_(t),this.dragging_=!0;const e=new Dl(Nl.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 Dl(Nl.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_&&(D(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(F,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(D(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(D),this.dragListenerKeys_.length=0,this.element_=null,super.disposeInternal()}}var zl="postrender",Xl="movestart",Vl="moveend",$l="loadstart",Wl="loadend",Zl="layergroup",Yl="size",Hl="target",Kl="view";const ql=1/0;class Jl{constructor(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}}clear(){this.elements_.length=0,this.priorities_.length=0,_(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){Ft(!(this.keyFunction_(t)in this.queuedElements_),"Tried to enqueue an `element` that was already added to the queue");const e=this.priorityFunction_(t);return e!=ql&&(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==ql?delete this.queuedElements_[this.keyFunction_(s)]:(i[n]=a,e[n++]=s);e.length=n,i.length=n,this.heapify_()}}class Ql extends Jl{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(v,this.boundHandleTileChange_)}return e}getTilesLoading(){return this.tilesLoading_}handleTileChange(t){const e=t.target,i=e.getState();if(i===K||i===q||i===J){i!==q&&e.removeEventListener(v,this.boundHandleTileChange_);const t=e.getKey();t in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[t],--this.tilesLoading_),this.tileChangeCallback_()}}loadMoreTiles(t,e){let i=0;for(;this.tilesLoading_<t&&i<e&&this.getCount()>0;){const t=this.dequeue()[0],e=t.getKey();t.getState()!==Y||e in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[e]=!0,++this.tilesLoading_,++i,t.load())}}}function th(t,e,i,n,r){if(!t||!(i in t.wantedTiles))return ql;if(!t.wantedTiles[i][e.getKey()])return ql;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}class eh extends z{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(){this.element?.remove(),super.disposeInternal()}getMap(){return this.map_}setMap(t){this.map_&&this.element?.remove();for(let t=0,e=this.listenerKeys.length;t<e;++t)D(this.listenerKeys[t]);if(this.listenerKeys.length=0,this.map_=t,t){(this.target_??t.getOverlayContainerStopEvent()).appendChild(this.element),this.render!==f&&this.listenerKeys.push(A(t,zl,this.render,this)),t.render()}}render(t){}setTarget(t){this.target_="string"==typeof t?document.getElementById(t):t}}class ih extends eh{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),this.attributions_=t.attributions;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(w,this.handleClick_.bind(this),!1);const l=e+" "+No+" "+Go+(this.collapsed_&&this.collapsible_?" "+jo:"")+(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=this.getMap().getAllLayers(),i=new Set(e.flatMap((e=>e.getAttributions(t))));if(void 0!==this.attributions_&&(Array.isArray(this.attributions_)?this.attributions_.forEach((t=>i.add(t))):i.add(this.attributions_)),!this.overrideCollapsible_){const t=!e.some((t=>!1===t.getSource()?.getAttributionsCollapsible()));this.setCollapsible(t)}return Array.from(i)}async updateElement_(t){if(!t)return void(this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1));const e=await Promise.all(this.collectSourceAttributions_(t).map((t=>m((()=>t))))),i=e.length>0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!c(e,this.renderedAttributions_)){Et(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(jo),this.collapsed_?St(this.collapseLabel_,this.label_):St(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 nh extends eh{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(w,this.handleClick_.bind(this),!1);const o=e+" "+No+" "+Go,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(Oo)}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:tt}):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(Oo);t||0!==i?t&&0!==i&&this.element.classList.remove(Oo):this.element.classList.add(Oo)}this.label_.style.transform=t}this.rotation_=i}}class rh extends eh{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(w,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(w,this.handleClick_.bind(this,-i),!1);const u=e+" "+No+" "+Go,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:tt})):e.setZoom(n)}}}function sh(t){t=t||{};const e=new Z;(void 0===t.zoom||t.zoom)&&e.push(new rh(t.zoomOptions));(void 0===t.rotate||t.rotate)&&e.push(new nh(t.rotateOptions));return(void 0===t.attribution||t.attribution)&&e.push(new ih(t.attributionOptions)),e}var oh="active";class ah extends z{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(oh)}getMap(){return this.map_}handleEvent(t){return!0}setActive(t){this.set(oh,t)}setMap(t){this.map_=t}}function lh(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:it,center:t.getConstrainedCenter(r)})}}function hh(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:tt})}class ch extends ah{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==Nl.DBLCLICK){const i=t.originalEvent,n=t.map,r=t.coordinate,s=i.shiftKey?-this.delta_:this.delta_;hh(n.getView(),s,r,this.duration_),i.preventDefault(),e=!0}return!e}}class uh extends ah{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==Nl.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==Nl.POINTERUP){const e=this.handleUpEvent(t);this.handlingDownUpSequence=e&&this.targetPointers.length>0}}else if(t.type==Nl.POINTERDOWN){const i=this.handleDownEvent(t);this.handlingDownUpSequence=i,e=this.stopDown(i)}else t.type==Nl.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 dh(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{clientX:i/e,clientY:n/e}}function gh(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 fh=function(t){const e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},ph=function(t){const e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},mh=function(t){const e=t.map.getTargetElement(),i=e.getRootNode(),n=t.map.getOwnerDocument().activeElement;return i instanceof ShadowRoot?i.host.contains(n):e.contains(n)},_h=function(t){const e=t.map.getTargetElement(),i=e.getRootNode();return!(i instanceof ShadowRoot?i.host:e).hasAttribute("tabindex")||mh(t)},yh=d,xh=function(t){const e=t.originalEvent;return 0==e.button&&!(lt&&ht&&e.ctrlKey)},vh=g,Sh=function(t){return t.type==Nl.SINGLECLICK},Eh=function(t){const e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},wh=function(t){const e=t.originalEvent;return ht?e.metaKey:e.ctrlKey},Th=function(t){const e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},Ch=function(t){const e=t.originalEvent,i=e.target.tagName;return"INPUT"!==i&&"SELECT"!==i&&"TEXTAREA"!==i&&!e.target.isContentEditable},Rh=function(t){const e=t.originalEvent;return Ft(void 0!==e,"mapBrowserEvent must originate from a pointer event"),"mouse"==e.pointerType},bh=function(t){const e=t.originalEvent;return Ft(void 0!==e,"mapBrowserEvent must originate from a pointer event"),e.isPrimary&&0===e.button};class Ph extends uh{constructor(t){super({stopDown:g}),t=t||{},this.kinetic_=t.kinetic,this.lastCentroid=null,this.lastPointersCount_,this.panning_=!1;const e=t.condition?t.condition:gh(Eh,bh);this.condition_=t.onFocusOnly?gh(_h,e):e,this.noKinetic_=!1}handleDragEvent(t){const e=t.map;this.panning_||(this.panning_=!0,e.getView().beginInteraction());const i=this.targetPointers,n=e.getEventPixel(dh(i));if(i.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(n[0],n[1]),this.lastCentroid){const e=[this.lastCentroid[0]-n[0],n[1]-this.lastCentroid[1]],i=t.map.getView();Fi(e,i.getResolution()),Li(e,i.getRotation()),i.adjustCenterInternal(e)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=n,this.lastPointersCount_=i.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:tt})}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 Ih extends uh{constructor(t){t=t||{},super({stopDown:g}),this.condition_=t.condition?t.condition:ph,this.lastAngle_=void 0,this.duration_=void 0!==t.duration?t.duration:250}handleDragEvent(t){if(!Rh(t))return;const e=t.map,i=e.getView();if(i.getConstraints().rotation===Cs)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(!Rh(t))return!0;return t.map.getView().endInteraction(this.duration_),!1}handleDownEvent(t){if(!Rh(t))return!1;if(xh(t)&&this.condition_(t)){return t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0}return!1}}class Lh extends n{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(){if(!this.map_)return;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 Cr([i])}getGeometry(){return this.geometry_}}const Fh="boxstart",Mh="boxdrag",Ah="boxend",Oh="boxcancel";class Dh extends t{constructor(t,e,i){super(t),this.coordinate=e,this.mapBrowserEvent=i}}class Nh extends uh{constructor(t){super(),this.on,this.once,this.un,t=t??{},this.box_=new Lh(t.className||"ol-dragbox"),this.minArea_=t.minArea??64,t.onBoxEnd&&(this.onBoxEnd=t.onBoxEnd),this.startPixel_=null,this.condition_=t.condition??xh,this.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.startPixel_&&(this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new Dh(Mh,t.coordinate,t)))}handleUpEvent(t){if(!this.startPixel_)return!1;const e=this.boxEndCondition_(t,this.startPixel_,t.pixel);return e&&this.onBoxEnd(t),this.dispatchEvent(new Dh(e?Ah:Oh,t.coordinate,t)),this.box_.setMap(null),this.startPixel_=null,!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 Dh(Fh,t.coordinate,t)),!0)}onBoxEnd(t){}setActive(t){t||(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new Dh(Oh,this.startPixel_,null)),this.startPixel_=null)),super.setActive(t)}setMap(t){this.getMap()&&(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new Dh(Oh,this.startPixel_,null)),this.startPixel_=null)),super.setMap(t)}}class kh extends Nh{constructor(t){super({condition:(t=t||{}).condition?t.condition:Th,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:tt})}}var Gh="ArrowLeft",jh="ArrowUp",Uh="ArrowRight",Bh="ArrowDown";class zh extends ah{constructor(t){super(),t=t||{},this.defaultCondition_=function(t){return Eh(t)&&Ch(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==P){const i=t.originalEvent,n=i.key;if(this.condition_(t)&&(n==Bh||n==Gh||n==Uh||n==jh)){const r=t.map.getView(),s=r.getResolution()*this.pixelDelta_;let o=0,a=0;n==Bh?a=-s:n==Gh?o=-s:n==Uh?o=s:a=s;const l=[o,a];Li(l,r.getRotation()),lh(r,l,this.duration_),i.preventDefault(),e=!0}}return!e}}class Xh extends ah{constructor(t){super(),t=t||{},this.condition_=t.condition?t.condition:function(t){return!wh(t)&&Ch(t)},this.delta_=t.delta?t.delta:1,this.duration_=void 0!==t.duration?t.duration:100}handleEvent(t){let e=!1;if(t.type==P||t.type==I){const i=t.originalEvent,n=i.key;if(this.condition_(t)&&("+"===n||"-"===n)){const r=t.map,s="+"===n?this.delta_:-this.delta_;hh(r.getView(),s,void 0,this.duration_),i.preventDefault(),e=!0}}return!e}}class Vh extends ah{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:yh;this.condition_=t.onFocusOnly?gh(_h,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_?t.getCoordinateFromPixel(this.lastAnchor_):null)}handleEvent(t){if(!this.condition_(t))return!0;if(t.type!==M)return!0;const e=t.map,i=t.originalEvent;let n;if(i.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.pixel),t.type==M&&(n=i.deltaY,st&&i.deltaMode===WheelEvent.DOM_DELTA_PIXEL&&(n/=ct),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_?e.getCoordinateFromPixel(this.lastAnchor_):null),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=-ci(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),hh(e,i,this.lastAnchor_?t.getCoordinateFromPixel(this.lastAnchor_):null,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 $h extends uh{constructor(t){const e=t=t||{};e.stopDown||(e.stopDown=g),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();o.getConstraints().rotation!==Cs&&(this.anchor_=s.getCoordinateFromPixelInternal(s.getEventPixel(dh(this.targetPointers))),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 Wh extends uh{constructor(t){const e=t=t||{};e.stopDown||(e.stopDown=g),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),this.anchor_=a.getCoordinateFromPixelInternal(a.getEventPixel(dh(this.targetPointers))),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 Zh(t){t=t||{};const e=new Z,i=new Kr(-.005,.05,100);(void 0===t.altShiftDragRotate||t.altShiftDragRotate)&&e.push(new Ih);(void 0===t.doubleClickZoom||t.doubleClickZoom)&&e.push(new ch({delta:t.zoomDelta,duration:t.zoomDuration}));(void 0===t.dragPan||t.dragPan)&&e.push(new Ph({onFocusOnly:t.onFocusOnly,kinetic:i}));(void 0===t.pinchRotate||t.pinchRotate)&&e.push(new $h);(void 0===t.pinchZoom||t.pinchZoom)&&e.push(new Wh({duration:t.zoomDuration}));(void 0===t.keyboard||t.keyboard)&&(e.push(new zh),e.push(new Xh({delta:t.zoomDelta,duration:t.zoomDuration})));(void 0===t.mouseWheelZoom||t.mouseWheelZoom)&&e.push(new Vh({onFocusOnly:t.onFocusOnly,duration:t.zoomDuration}));return(void 0===t.shiftDragZoom||t.shiftDragZoom)&&e.push(new kh({duration:t.zoomDuration})),e}function Yh(t){t instanceof Ns?t.setMapInternal(null):t instanceof Al&&t.getLayers().forEach(Yh)}function Hh(t,e){if(t instanceof Ns)t.setMapInternal(e);else if(t instanceof Al){const i=t.getLayers().getArray();for(let t=0,n=i.length;t<n;++t)Hh(i[t],e)}}let Kh=class extends z{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 Al({layers:t.layers});let r,s,o;i[Zl]=n,i[Hl]=t.target,i[Kl]=t.view instanceof Is?t.view:new Is,void 0!==t.controls&&(Array.isArray(t.controls)?r=new Z(t.controls.slice()):(Ft("function"==typeof t.controls.getArray,"Expected `controls` to be an array or an `ol/Collection.js`"),r=t.controls));void 0!==t.interactions&&(Array.isArray(t.interactions)?s=new Z(t.interactions.slice()):(Ft("function"==typeof t.interactions.getArray,"Expected `interactions` to be an array or an `ol/Collection.js`"),s=t.interactions));void 0!==t.overlays?Array.isArray(t.overlays)?o=new Z(t.overlays.slice()):(Ft("function"==typeof t.overlays.getArray,"Expected `overlays` to be an array or an `ol/Collection.js`"),o=t.overlays):o=new Z;return{controls:r,interactions:s,keyboardEventTarget:e,overlays:o,values:i}}(t);this.renderComplete_=!1,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:ct,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.targetElement_=null,this.resizeObserver_=new ResizeObserver((()=>this.updateSize())),this.controls=e.controls||sh(),this.interactions=e.interactions||Zh({onFocusOnly:!0}),this.overlays_=e.overlays,this.overlayIdIndex_={},this.renderer_=null,this.postRenderFunctions_=[],this.tileQueue_=new Ql(this.getTilePriority.bind(this),this.handleTileChange_.bind(this)),this.addChangeListener(Zl,this.handleLayerGroupChanged_),this.addChangeListener(Kl,this.handleViewChanged_),this.addChangeListener(Yl,this.handleSizeChanged_),this.addChangeListener(Hl,this.handleTargetChanged_),this.setProperties(e.values);const i=this;!t.view||t.view instanceof Is||t.view.then((function(t){i.setView(new Is(t))})),this.controls.addEventListener(X,(t=>{t.element.setMap(this)})),this.controls.addEventListener(V,(t=>{t.element.setMap(null)})),this.interactions.addEventListener(X,(t=>{t.element.setMap(this)})),this.interactions.addEventListener(V,(t=>{t.element.setMap(null)})),this.overlays_.addEventListener(X,(t=>{this.addOverlayInternal_(t.element)})),this.overlays_.addEventListener(V,(t=>{const e=t.element.getId();void 0!==e&&delete this.overlayIdIndex_[e.toString()],t.element.setMap(null)})),this.controls.forEach((t=>{t.setMap(this)})),this.interactions.forEach((t=>{t.setMap(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){Hh(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.resizeObserver_.disconnect(),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:d,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 Al?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:d,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=this.getSize(),n=e.width/i[0],r=e.height/i[1],s="changedTouches"in t?t.changedTouches[0]:t;return[(s.clientX-e.left)/n,(s.clientY-e.top)/r]}getTarget(){return this.get(Hl)}getTargetElement(){return this.targetElement_}getCoordinateFromPixel(t){return mn(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())}getCoordinateFromPixelInternal(t){const e=this.frameState_;return e?Ut(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(Zl)}setLayers(t){const e=this.getLayerGroup();if(t instanceof Z)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=_n(t,this.getView().getProjection());return this.getPixelFromCoordinateInternal(e)}getPixelFromCoordinateInternal(t){const e=this.frameState_;return e?Ut(e.coordinateToPixelTransform,t.slice(0,2)):null}getRenderer(){return this.renderer_}getSize(){return this.get(Yl)}getView(){return this.get(Kl)}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 th(this.frameState_,t,e,i,n)}handleBrowserEvent(t,e){e=e||t.type;const i=new Dl(e,this,t);this.handleMapBrowserEvent(i)}handleMapBrowserEvent(t){if(!this.frameState_)return;const e=t.originalEvent,i=e.type;if(i===Gl||i===M||i===P){const t=this.getOwnerDocument(),i=this.viewport_.getRootNode?this.viewport_.getRootNode():t,n=e.target,r=i instanceof ShadowRoot?i.host===n?i.host.ownerDocument:i:i===t?t.documentElement:i;if(this.overlayContainerStopEvent_.contains(n)||!r.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[gs]||e[fs]){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&&(this.renderComplete_?(this.hasListener(ds)&&this.renderer_.dispatchRenderEvent(ds,t),!1===this.loaded_&&(this.loaded_=!0,this.dispatchEvent(new Ol(Wl,this,t)))):!0===this.loaded_&&(this.loaded_=!1,this.dispatchEvent(new Ol($l,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)D(this.targetChangeHandlerKeys_[t]);this.targetChangeHandlerKeys_=null,this.viewport_.removeEventListener(E,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(M,this.boundHandleBrowserEvent_),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,this.viewport_.remove()}if(this.targetElement_){this.resizeObserver_.unobserve(this.targetElement_);const t=this.targetElement_.getRootNode();t instanceof ShadowRoot&&this.resizeObserver_.unobserve(t.host),this.setSize(void 0)}const t=this.getTarget(),e="string"==typeof t?document.getElementById(t):t;if(this.targetElement_=e,e){e.appendChild(this.viewport_),this.renderer_||(this.renderer_=new Ll(this)),this.mapBrowserEventHandler_=new Bl(this,this.moveTolerance_);for(const t in Nl)this.mapBrowserEventHandler_.addEventListener(Nl[t],this.handleMapBrowserEvent.bind(this));let t;if(this.viewport_.addEventListener(E,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(M,this.boundHandleBrowserEvent_,!!ft&&{passive:!1}),this.keyboardEventTarget_)t=this.keyboardEventTarget_;else{const i=e.getRootNode();t=i instanceof ShadowRoot?i.host:e}this.targetChangeHandlerKeys_=[A(t,P,this.handleBrowserEvent,this),A(t,I,this.handleBrowserEvent,this)];const i=e.getRootNode();i instanceof ShadowRoot&&this.resizeObserver_.observe(i.host),this.resizeObserver_.observe(e)}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_&&(D(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(D(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);const t=this.getView();t&&(this.updateViewportSize_(this.getSize()),this.viewPropertyListenerKey_=A(t,i,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=A(t,v,this.handleViewPropertyChanged_,this),t.resolveConstraints(0)),this.render()}handleLayerGroupChanged_(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(D),this.layerGroupPropertyListenerKeys_=null);const t=this.getLayerGroup();t&&(this.handleLayerAdd_(new Fl("addlayer",t)),this.layerGroupPropertyListenerKeys_=[A(t,i,this.render,this),A(t,v,this.render,this),A(t,"addlayer",this.handleLayerAdd_,this),A(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){Yh(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&&eo(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_,declutter:null,extent:we(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:U(this),renderTargets:{}},s.nextCenter&&s.nextResolution){const t=isNaN(s.nextRotation)?s.rotation:s.nextRotation;r.nextExtent=we(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_||!Fe(this.previousExtent_)&&!he(r.extent,this.previousExtent_))&&(this.dispatchEvent(new Ol(Xl,this,n)),this.previousExtent_=oe(this.previousExtent_))}this.previousExtent_&&!r.viewHints[gs]&&!r.viewHints[fs]&&!he(r.extent,this.previousExtent_)&&(this.dispatchEvent(new Ol(Vl,this,r)),Jt(r.extent,this.previousExtent_))}this.dispatchEvent(new Ol(zl,this,r)),this.renderComplete_=(this.hasListener($l)||this.hasListener(Wl)||this.hasListener(ds))&&!this.tileQueue_.getTilesLoading()&&!this.tileQueue_.getCount()&&!this.getLoadingOrNotReady(),this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout((()=>{this.postRenderTimeoutHandle_=void 0,this.handlePostRender()}),0))}setLayerGroup(t){const e=this.getLayerGroup();e&&this.handleLayerRemove_(new Fl("removelayer",e)),this.set(Zl,t)}setSize(t){this.set(Yl,t)}setTarget(t){this.set(Hl,t)}setView(t){if(!t||t instanceof Is)return void this.set(Kl,t);this.set(Kl,new Is);const e=this;t.then((function(t){e.setView(new Is(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=[Math.max(0,n),Math.max(0,r)],!eo(e)&&(t.offsetWidth||t.offsetHeight||t.getClientRects().length)&&$i("No map visible because the map container's width or height are 0."))}const i=this.getSize();!e||i&&c(e,i)||(this.setSize(e),this.updateViewportSize_(e))}updateViewportSize_(t){const e=this.getView();e&&e.setViewportSize(t)}};const qh="element",Jh="map",Qh="offset",tc="position",ec="positioning";class ic extends z{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 "+Do,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(qh,this.handleElementChanged),this.addChangeListener(Jh,this.handleMapChanged),this.addChangeListener(Qh,this.handleOffsetChanged),this.addChangeListener(tc,this.handlePositionChanged),this.addChangeListener(ec,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(qh)}getId(){return this.id}getMap(){return this.get(Jh)||null}getOffset(){return this.get(Qh)}getPosition(){return this.get(tc)}getPositioning(){return this.get(ec)}handleElementChanged(){Et(this.element);const t=this.getElement();t&&this.element.appendChild(t)}handleMapChanged(){this.mapPostrenderListenerKey&&(this.element?.remove(),D(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);const t=this.getMap();if(t){this.mapPostrenderListenerKey=A(t,zl,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(qh,t)}setMap(t){this.set(Jh,t)}setOffset(t){this.set(Qh,t)}setPosition(t){this.set(tc,t)}performAutoPan(){this.autoPan&&this.panIntoView(this.autoPan)}panIntoView(t){const e=this.getMap();if(!e||!e.getTargetElement()||!this.get(tc))return;const i=this.getRect(e.getTargetElement(),e.getSize()),n=this.getElement(),r=this.getRect(n,[xt(n),vt(n)]),s=void 0===(t=t||{}).margin?20:t.margin;if(!ee(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(ec,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 nc{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();){const t=this.pop();t instanceof n&&t.dispose()}}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 Ft(void 0!==i,"Tried to get a value for a key that does not exist in the cache"),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 Ft(void 0!==e,"Tried to get a value for a key that does not exist in the cache"),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){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){Ft(!(t in this.entries_),"Tried to set a value for a key that is used already");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 rc(t,e,i,n){return void 0!==n?(n[0]=t,n[1]=e,n[2]=i,n):[t,e,i]}function sc(t,e,i){return t+"/"+e+"/"+i}function oc(t){return sc(t[0],t[1],t[2])}function ac(t){return t.split("/").map(Number)}function lc(t){return hc(t[0],t[1],t[2])}function hc(t,e,i){return(e<<t)+i}function cc(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 uc{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 dc(t,e,i,n,r){return void 0!==r?(r.minX=t,r.maxX=e,r.minY=i,r.maxY=n,r):new uc(t,e,i,n)}const gc=[];class fc extends nt{constructor(t,e,i,n,r){super(t,e,{transition:0}),this.context_=null,this.executorGroups=[],this.loadingSourceTiles=0,this.hitDetectionImageData={},this.replayState_={},this.sourceTiles=[],this.errorTileKeys={},this.wantedResolution,this.getSourceTiles=n.bind(void 0,this),this.removeSourceTiles_=r,this.wrappedTileCoord=i}getContext(){return this.context_||(this.context_=pt(1,1,gc)),this.context_}hasContext(){return!!this.context_}getImage(){return this.hasContext()?this.getContext().canvas:null}getReplayState(t){const e=U(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(){this.context_&&(yt(this.context_),gc.push(this.context_.canvas),this.context_=null),this.removeSourceTiles_(this),this.sourceTiles.length=0,super.release()}}let pc,mc=class extends nt{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}getTileUrl(){return this.url_}getFormat(){return this.format_}getFeatures(){return this.features_}load(){this.state==Y&&(this.setState(H),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(K)}setLoader(t){this.loader_=t}},_c=!1;function yc(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=_c,a.onload=function(t){if(!a.status||a.status>=200&&a.status<300){const t=e.getType();try{let n;"text"==t||"json"==t?n=a.responseText:"xml"==t?n=a.responseXML||a.responseText:"arraybuffer"==t&&(n=a.response),n?s(e.readFeatures(n,{extent:i,featureProjection:r}),e.readProjection(n)):o()}catch{o()}}else o()},a.onerror=o,a.send()}function xc(t,e){return function(i,n,r,s,o){const a=this;yc(t,e,i,n,r,(function(t,e){a.addFeatures(t),void 0!==s&&s(t)}),o||f)}}function vc(t,e){return[[-1/0,-1/0,1/0,1/0]]}function Sc(t,e,i,n){const r=document.createElement("script"),s="olc_"+U(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 Ec extends Error{constructor(t){super("Unexpected response status: "+t.status),this.name="ResponseError",this.response=t}}class wc extends Error{constructor(t){super("Failed to issue request"),this.name="ClientError",this.client=t}}function Tc(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 Ec(n))})),n.addEventListener("error",(function(t){i(new wc(t.target))})),n.open("GET",t),n.setRequestHeader("Accept","application/json"),n.send()}))}function Cc(t,e){return e.includes("://")?e:new URL(e,t).href}class Rc{drawCustom(t,e,i,n,r){}drawGeometry(t){}setStyle(t){}drawCircle(t,e,i){}drawFeature(t,e,i){}drawGeometryCollection(t,e,i){}drawLineString(t,e,i){}drawMultiLineString(t,e,i){}drawMultiPoint(t,e,i){}drawMultiPolygon(t,e,i){}drawPoint(t,e,i){}drawPolygon(t,e,i){}drawText(t,e,i){}setFillStrokeStyle(t,e){}setImageStyle(t,e){}setTextStyle(t,e){}}class bc extends Rc{constructor(t,e,i,n,r,s,o){super(),this.context_=t,this.pixelRatio_=e,this.extent_=i,this.transform_=n,this.transformRotation_=n?yi(Math.atan2(n[1],n[0]),10):0,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=Tn(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_;0===this.transformRotation_&&(l-=this.viewRotation_),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_;Vt(o,t,n,1,1,l,-t,-n),s.save(),s.transform.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.restore()}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=Tn(t,e,i,n,this.transform_,this.pixelCoordinates_),s=this.context_;let o=this.textRotation_;for(0===this.transformRotation_&&(o-=this.viewRotation_),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.save(),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.restore()):(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=Tn(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(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Le(this.extent_,t.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const e=An(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&&(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_)),Le(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(Le(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_)),Le(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_)),Le(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),c(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:Ko;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:Ao(e||Vo)}}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||Wo;this.strokeState_={lineCap:void 0!==i?i:$o,lineDash:1===this.pixelRatio_?l:l.map((t=>t*this.pixelRatio_)),lineDashOffset:(r||0)*this.pixelRatio_,lineJoin:void 0!==s?s:Zo,lineWidth:(void 0!==o?o:1)*this.pixelRatio_,miterLimit:void 0!==a?a:Yo,strokeStyle:Ao(t||Ho)}}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:Ao(t||Vo)}}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:$o,lineDash:n||Wo,lineDashOffset:r||0,lineJoin:void 0!==s?s:Zo,lineWidth:void 0!==o?o:1,miterLimit:void 0!==a?a:Yo,strokeStyle:Ao(t||Ho)}}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:Xo,textAlign:void 0!==c?c:Ko,textBaseline:void 0!==u?u:qo},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 Pc=.5,Ic={Point:function(t,e,i,n,r,s){const o=i.getImage(),a=i.getText(),l=a&&a.getText(),h=s&&o&&l?{}:void 0;if(o){if(o.getImageState()!=zr.LOADED)return;const s=t.getBuilder(i.getZIndex(),"Image");s.setImageStyle(o,h),s.drawPoint(e,n,r)}if(l){const s=t.getBuilder(i.getZIndex(),"Text");s.setTextStyle(a,h),s.drawText(e,n,r)}},LineString:function(t,e,i,n,r){const s=i.getStroke();if(s){const o=t.getBuilder(i.getZIndex(),"LineString");o.setFillStrokeStyle(null,s),o.drawLineString(e,n,r)}const o=i.getText();if(o&&o.getText()){const s=t.getBuilder(i.getZIndex(),"Text");s.setTextStyle(o),s.drawText(e,n,r)}},Polygon:function(t,e,i,n,r){const s=i.getFill(),o=i.getStroke();if(s||o){const a=t.getBuilder(i.getZIndex(),"Polygon");a.setFillStrokeStyle(s,o),a.drawPolygon(e,n,r)}const a=i.getText();if(a&&a.getText()){const s=t.getBuilder(i.getZIndex(),"Text");s.setTextStyle(a),s.drawText(e,n,r)}},MultiPoint:function(t,e,i,n,r,s){const o=i.getImage(),a=o&&0!==o.getOpacity(),l=i.getText(),h=l&&l.getText(),c=s&&a&&h?{}:void 0;if(a){if(o.getImageState()!=zr.LOADED)return;const s=t.getBuilder(i.getZIndex(),"Image");s.setImageStyle(o,c),s.drawMultiPoint(e,n,r)}if(h){const s=t.getBuilder(i.getZIndex(),"Text");s.setTextStyle(l,c),s.drawText(e,n,r)}},MultiLineString:function(t,e,i,n,r){const s=i.getStroke();if(s){const o=t.getBuilder(i.getZIndex(),"LineString");o.setFillStrokeStyle(null,s),o.drawMultiLineString(e,n,r)}const o=i.getText();if(o&&o.getText()){const s=t.getBuilder(i.getZIndex(),"Text");s.setTextStyle(o),s.drawText(e,n,r)}},MultiPolygon:function(t,e,i,n,r){const s=i.getFill(),o=i.getStroke();if(o||s){const a=t.getBuilder(i.getZIndex(),"Polygon");a.setFillStrokeStyle(s,o),a.drawMultiPolygon(e,n,r)}const a=i.getText();if(a&&a.getText()){const s=t.getBuilder(i.getZIndex(),"Text");s.setTextStyle(a),s.drawText(e,n,r)}},GeometryCollection:function(t,e,i,n,r,s){const o=e.getGeometriesArray();let a,l;for(a=0,l=o.length;a<l;++a){(0,Ic[o[a].getType()])(t,o[a],i,n,r,s)}},Circle:function(t,e,i,n,r){const s=i.getFill(),o=i.getStroke();if(s||o){const a=t.getBuilder(i.getZIndex(),"Circle");a.setFillStrokeStyle(s,o),a.drawCircle(e,n,r)}const a=i.getText();if(a&&a.getText()){const r=t.getBuilder(i.getZIndex(),"Text");r.setTextStyle(a),r.drawText(e,n)}}};function Lc(t,e){return parseInt(U(t),10)-parseInt(U(e),10)}function Fc(t,e){const i=Mc(t,e);return i*i}function Mc(t,e){return Pc*t/e}function Ac(t,e,i,n,r,s,o,a){const l=[],h=i.getImage();if(h){let t=!0;const e=h.getImageState();e==zr.LOADED||e==zr.ERROR?t=!1:e==zr.IDLE&&h.load(),t&&l.push(h.ready())}const c=i.getFill();c&&c.loading()&&l.push(c.ready());const u=l.length>0;return u&&Promise.all(l).then((()=>r(null))),function(t,e,i,n,r,s,o){const a=i.getGeometryFunction()(e);if(!a)return;const l=a.simplifyTransformed(n,r),h=i.getRenderer();if(h)Oc(t,l,i,e,o);else{(0,Ic[l.getType()])(t,l,i,e,o,s)}}(t,e,i,n,s,o,a),u}function Oc(t,e,i,n,r){if("GeometryCollection"==e.getType()){const s=e.getGeometries();for(let e=0,o=s.length;e<o;++e)Oc(t,s[e],i,n,r);return}t.getBuilder(i.getZIndex(),"Default").drawCustom(e,n,i.getRenderer(),i.getHitDetectionRenderer(),r)}function Dc(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.inversePixelTransform[1],n=Math.sqrt(e*e+i*i),r=t.frameState,s=kt(t.inversePixelTransform.slice(),r.coordinateToPixelTransform),o=Fc(r.viewState.resolution,n);let a;const l=pn();return l&&(a=hn(l,r.viewState.projection)),new bc(t.context,n,r.extent,s,r.viewState.rotation,o,a)}let Nc;const kc=[];function Gc(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 jc(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function Uc(t,e,i,n){const r=un(i,e,t);let s=tn(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||te(l,r)){const e=tn(t,s,r)/s;isFinite(e)&&e>0&&(s/=e)}return s}function Bc(t,e,i,n){const r=Se(i);let s=Uc(t,e,r,n);return(!isFinite(s)||s<=0)&&_e(i,(function(i){return s=Uc(t,e,i,n),isFinite(s)&&s>0})),s}function zc(t,e,i,n,r,s,o,a,l,h,c,u,d,g){const f=pt(Math.round(i*t),Math.round(i*e),kc);if(u||(f.imageSmoothingEnabled=!1),0===l.length)return f.canvas;function p(t){return Math.round(t*i)/i}f.scale(i,i),f.globalCompositeOperation="lighter";const m=[1/0,1/0,-1/0,-1/0];let _;l.forEach((function(t,e,i){ue(m,t.extent)}));const y=i/n,x=(u?1:1+Math.pow(2,-24))/y;if(!d||1!==l.length||0!==h){if(_=pt(Math.round(Ie(m)*y),Math.round(Ce(m)*y),kc),u||(_.imageSmoothingEnabled=!1),r&&g){const t=(r[0]-m[0])*y,e=-(r[3]-m[3])*y,i=Ie(r)*y,n=Ce(r)*y;_.rect(t,e,i,n),_.clip()}l.forEach((function(t,e,i){if(t.image.width>0&&t.image.height>0){if(t.clipExtent){_.save();const e=(t.clipExtent[0]-m[0])*y,i=-(t.clipExtent[3]-m[3])*y,n=Ie(t.clipExtent)*y,r=Ce(t.clipExtent)*y;_.rect(u?e:Math.round(e),u?i:Math.round(i),u?n:Math.round(e+n)-Math.round(e),u?r:Math.round(i+r)-Math.round(i)),_.clip()}const e=(t.extent[0]-m[0])*y,i=-(t.extent[3]-m[3])*y,n=Ie(t.extent)*y,r=Ce(t.extent)*y;_.drawImage(t.image,h,h,t.image.width-2*h,t.image.height-2*h,u?e:Math.round(e),u?i:Math.round(i),u?n:Math.round(e+n)-Math.round(e),u?r:Math.round(i+r)-Math.round(i)),t.clipExtent&&_.restore()}}))}const v=be(o);return a.getTriangles().forEach((function(t,e,i){const n=t.source,r=t.target;let o=n[0][0],a=n[0][1],h=n[1][0],c=n[1][1],d=n[2][0],g=n[2][1];const y=p((r[0][0]-v[0])/s),S=p(-(r[0][1]-v[1])/s),E=p((r[1][0]-v[0])/s),w=p(-(r[1][1]-v[1])/s),T=p((r[2][0]-v[0])/s),C=p(-(r[2][1]-v[1])/s),R=o,b=a;o=0,a=0,h-=R,c-=b,d-=R,g-=b;const P=gi([[h,c,0,0,E-y],[d,g,0,0,T-y],[0,0,h,c,w-S],[0,0,d,g,C-S]]);if(!P)return;if(f.save(),f.beginPath(),function(){if(void 0===Nc){const t=pt(6,6,kc);t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",Gc(t,4,5,4,0),Gc(t,4,5,0,5);const e=t.getImageData(0,0,3,3).data;Nc=jc(e,0)||jc(e,4)||jc(e,8),yt(t),kc.push(t.canvas)}return Nc}()||!u){f.moveTo(E,w);const t=4,e=y-E,i=S-w;for(let n=0;n<t;n++)f.lineTo(E+p((n+1)*e/t),w+p(n*i/(t-1))),n!=t-1&&f.lineTo(E+p((n+1)*e/t),w+p((n+1)*i/(t-1)));f.lineTo(T,C)}else f.moveTo(E,w),f.lineTo(y,S),f.lineTo(T,C);let I;if(f.clip(),f.transform(P[0],P[2],P[1],P[3],y,S),f.translate(m[0]-R,m[3]-b),_)I=_.canvas,f.scale(x,-x);else{const t=l[0],e=t.extent;I=t.image,f.scale(Ie(e)/I.width,-Ce(e)/I.height)}f.drawImage(I,0,0),f.restore()})),_&&(yt(_),kc.push(_.canvas)),c&&(f.save(),f.globalCompositeOperation="source-over",f.strokeStyle="black",f.lineWidth=1,a.getTriangles().forEach((function(t,e,i){const n=t.target,r=(n[0][0]-v[0])/s,o=-(n[0][1]-v[1])/s,a=(n[1][0]-v[0])/s,l=-(n[1][1]-v[1])/s,h=(n[2][0]-v[0])/s,c=-(n[2][1]-v[1])/s;f.beginPath(),f.moveTo(a,l),f.lineTo(r,o),f.lineTo(h,c),f.closePath(),f.stroke()})),f.restore()),f.canvas}function Xc(t){return Array.isArray(t)?Math.min(...t):t}const Vc=.5;class $c{constructor(t,e,i,n,r,s){this.sourceProj_=t,this.targetProj_=e;let o={};const a=cn(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()&&Ie(n)>=Ie(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?Ie(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?Ie(this.targetProj_.getExtent()):null;const l=be(i),h=Pe(i),c=ve(i),u=xe(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(ye(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((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)}}))}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=Kt([r,s,o,a]),c=this.sourceWorldWidth_?Ie(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=Ie(Kt([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])&&!Le(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=(mi(r[0],u)+mi(o[0],u))/2-mi(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;de(t,r[0]),de(t,r[1]),de(t,r[2])})),t}getTriangles(){return this.triangles_}}class Wc extends nt{constructor(t,e,i,n,r,s,o,a,l,h,c,u){super(r,Y,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,this.clipExtent_=t.canWrapX()?t.getExtent():void 0;const d=n.getTileCoordExtent(this.wrappedTileCoord_),g=this.targetTileGrid_.getExtent();let f=this.sourceTileGrid_.getExtent();const p=g?Re(d,g):d;if(0===ye(p))return void(this.state=J);const m=t.getExtent();m&&(f=f?Re(f,m):m);const _=n.getResolution(this.wrappedTileCoord_[0]),y=Bc(t,i,p,_);if(!isFinite(y)||y<=0)return void(this.state=J);const x=void 0!==h?h:Vc;if(this.triangulation_=new $c(t,i,p,f,y*x,_),0===this.triangulation_.getTriangles().length)return void(this.state=J);this.sourceZ_=e.getZForResolution(y);let v=this.triangulation_.calculateSourceExtent();if(f&&(t.canWrapX()?(v[1]=ci(v[1],f[1],f[3]),v[3]=ci(v[3],f[1],f[3])):v=Re(v,f)),ye(v)){let i=0,n=0;t.canWrapX()&&(i=Ie(m),n=Math.floor((v[0]-m[0])/i));ke(v.slice(),t,!0).forEach((t=>{const r=e.getTileRangeForExtentAndZ(t,this.sourceZ_);for(let t=r.minX;t<=r.maxX;t++)for(let e=r.minY;e<=r.maxY;e++){const r=l(this.sourceZ_,t,e,o);if(r){const t=n*i;this.sourceTiles_.push({tile:r,offset:t})}}++n})),0===this.sourceTiles_.length&&(this.state=J)}else this.state=J}getImage(){return this.canvas_}reproject_(){const t=[];if(this.sourceTiles_.forEach((e=>{const i=e.tile;if(i&&i.getState()==K){const n=this.sourceTileGrid_.getTileCoordExtent(i.tileCoord);n[0]+=e.offset,n[2]+=e.offset;const r=this.clipExtent_?.slice();r&&(r[0]+=e.offset,r[2]+=e.offset),t.push({extent:n,clipExtent:r,image:i.getImage()})}})),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_=zc(n,r,this.pixelRatio_,o,this.sourceTileGrid_.getExtent(),s,a,this.triangulation_,t,this.gutter_,this.renderEdges_,this.interpolate),this.state=K}this.changed()}load(){if(this.state==Y){this.state=H,this.changed();let t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach((({tile:e})=>{const i=e.getState();if(i==Y||i==H){t++;const i=A(e,v,(n=>{const r=e.getState();r!=K&&r!=q&&r!=J||(D(i),t--,0===t&&(this.unlistenSources_(),this.reproject_()))}));this.sourcesListenerKeys_.push(i)}})),0===t?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach((function({tile:t},e,i){t.getState()==Y&&t.load()}))}}unlistenSources_(){this.sourcesListenerKeys_.forEach(D),this.sourcesListenerKeys_=null}release(){this.canvas_&&(yt(this.canvas_.getContext("2d")),kc.push(this.canvas_),this.canvas_=null),super.release()}}var Zc="tileloadstart",Yc="tileloadend",Hc="tileloaderror";class Kc extends z{constructor(t){super(),this.projection=Qi(t.projection),this.attributions_=qc(t.attributions),this.attributionsCollapsible_=t.attributionsCollapsible??!0,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(t){return null}getView(){return this.viewPromise_}getState(){return this.state_}getWrapX(){return this.wrapX_}getInterpolate(){return this.interpolate_}refresh(){this.changed()}setAttributions(t){this.attributions_=qc(t),this.changed()}setState(t){this.state_=t,this.changed()}}function qc(t){return t?"function"==typeof t?t:(Array.isArray(t)||(t=[t]),e=>t):null}const Jc=[0,0,0];class Qc{constructor(t){let e;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,Ft(u(this.resolutions_,((t,e)=>e-t),!0),"`resolutions` must be sorted in descending order"),!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,Ft(this.origins_.length==this.resolutions_.length,"Number of `origins` and `resolutions` must be equal"));const i=t.extent;void 0===i||this.origin_||this.origins_||(this.origin_=be(i)),Ft(!this.origin_&&this.origins_||this.origin_&&!this.origins_,"Either `origin` or `origins` must be configured, never both"),this.tileSizes_=null,void 0!==t.tileSizes&&(this.tileSizes_=t.tileSizes,Ft(this.tileSizes_.length==this.resolutions_.length,"Number of `tileSizes` and `resolutions` must be equal")),this.tileSize_=void 0!==t.tileSize?t.tileSize:this.tileSizes_?null:_s,Ft(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,"Either `tileSize` or `tileSizes` must be configured, never both"),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(((t,e)=>{const n=new uc(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})):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(void 0!==s&&void 0!==o?(s=Math.floor(s/2),o=Math.floor(o/2),r=dc(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 dc(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 dc(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 dc(o,o,a,a,i);return dc(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)}getTileRangeForExtentAndZ(t,e,i){this.getTileCoordForXYAndZ_(t[0],t[3],e,!1,Jc);const n=Jc[1],r=Jc[2];this.getTileCoordForXYAndZ_(t[2],t[1],e,!0,Jc);return dc(n,Jc[1],r,Jc[2],i)}getTileCoordCenter(t){const e=this.getOrigin(t[0]),i=this.getResolution(t[0]),n=no(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=no(this.getTileSize(t[0]),this.tmpSize_),s=i[0]+t[1]*r[0]*n,o=i[1]-(t[2]+1)*r[1]*n;return se(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=no(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=Si(h,5)-1,c=Si(c,5)-1):(h=vi(h,5),c=vi(c,5)),rc(s,h,c,r)}getTileCoordForXYAndZ_(t,e,i,n,r){const s=this.getOrigin(i),o=this.getResolution(i),a=no(this.getTileSize(i),this.tmpSize_);let l=(t-s[0])/o/a[0],h=(s[1]-e)/o/a[1];return n?(l=Si(l,5)-1,h=Si(h,5)-1):(l=vi(l,5),h=vi(h,5)),rc(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 ci(a(this.resolutions_,t,e||0),this.minZoom,this.maxZoom)}tileCoordIntersectsViewport(t,e){return pr(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}}class tu extends Qc{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 eu(t,e,i){const n=[],r=[],s=[],o=[],a=[];i=void 0!==i?i:[];const l="TileMatrix",h="Identifier",c="ScaleDenominator",u="TopLeftCorner",d=Qi(t.SupportedCRS),g=d.getMetersPerUnit(),f=d.getAxisOrientation().startsWith("ne");return t[l].sort((function(t,e){return e[c]-t[c]})),t[l].forEach((function(e){let d;if(d=!(i.length>0)||i.find((function(i){return e[h]==i[l]||!e[h].includes(":")&&t[h]+":"+e[h]===i[l]})),d){r.push(e[h]);const t=28e-5*e[c]/g,i=e.TileWidth,l=e.TileHeight;f?s.push([e[u][1],e[u][0]]):s.push(e[u]),n.push(t),o.push(i==l?i:[i,l]),a.push([e.MatrixWidth,e.MatrixHeight])}})),new tu({extent:e,origins:s,resolutions:n,matrixIds:r,tileSizes:o,sizes:a})}function iu(t){let e=t.getDefaultTileGrid();return e||(e=au(t),t.setDefaultTileGrid(e)),e}function nu(t,e,i){const n=e[0],r=t.getTileCoordCenter(e),s=lu(i);if(!te(s,r)){const e=Ie(s),i=Math.ceil((s[0]-r[0])/e);return r[0]+=e*i,t.getTileCoordForCoordAndZ(r,n)}return e}function ru(t,e,i,n){n=void 0!==n?n:"top-left";const r=ou(t,e,i);return new Qc({extent:t,origin:Ee(t,n),resolutions:r,tileSize:i})}function su(t){const e=t||{},i=e.extent||Qi("EPSG:3857").getExtent(),n={extent:i,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:ou(i,e.maxZoom,e.tileSize,e.maxResolution)};return new Qc(n)}function ou(t,e,i,n){e=void 0!==e?e:ms,i=no(void 0!==i?i:_s);const r=Ce(t),s=Ie(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 au(t,e,i,n){return ru(lu(t),e,i,n)}function lu(t){let e=(t=Qi(t)).getExtent();if(!e){const i=180*Ue.degrees/t.getMetersPerUnit();e=se(-i,-i,i,i)}return e}class hu extends Kc{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.tilePixelRatio_=void 0!==t.tilePixelRatio?t.tilePixelRatio:1,this.tileGrid=void 0!==t.tileGrid?t.tileGrid:null;const e=[256,256];this.tileGrid&&no(this.tileGrid.getTileSize(this.tileGrid.getMinZoom()),e),this.tmpSize=[0,0],this.key_=t.key||U(this),this.tileOptions={transition:t.transition,interpolate:t.interpolate},this.zDirection=t.zDirection?t.zDirection:0}getGutterForProjection(t){return 0}getKey(){return this.key_}setKey(t){this.key_!==t&&(this.key_=t,this.changed())}getResolutions(t){const e=t?this.getTileGridForProjection(t):this.tileGrid;return e?e.getResolutions():null}getTile(t,e,i,n,r){return G()}getTileGrid(){return this.tileGrid}getTileGridForProjection(t){return this.tileGrid?this.tileGrid:iu(t)}getTilePixelRatio(t){return this.tilePixelRatio_}getTilePixelSize(t,e,i){const n=this.getTileGridForProjection(i),r=this.getTilePixelRatio(e),s=no(n.getTileSize(t),this.tmpSize);return 1==r?s:io(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=nu(i,t,e)),cc(t,i)?t:null}clear(){}refresh(){this.clear(),super.refresh()}}class cu extends t{constructor(t,e){super(t),this.tile=e}}function uu(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 du=/\{z\}/g,gu=/\{x\}/g,fu=/\{y\}/g,pu=/\{-y\}/g;function mu(t,e,i,n,r){return t.replace(du,e.toString()).replace(gu,i.toString()).replace(fu,n.toString()).replace(pu,(function(){if(void 0===r)throw new Error("If the URL template has a {-y} placeholder, the grid extent must be known");return(r-n).toString()}))}function _u(t,e,i,n){return t[mi(hc(e,i,n),t.length)]}function yu(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}function xu(t,e){return function(i,n,r){if(!i)return;let s;const o=i[0];if(e){const t=e.getFullTileRange(o);t&&(s=t.getHeight()-1)}return mu(t,o,i[1],i[2],s)}}function vu(t,e){const i=t.length,n=new Array(i);for(let r=0;r<i;++r)n[r]=xu(t[r],e);return Su(n)}function Su(t){return 1===t.length?t[0]:function(e,i,n){if(!e)return;const r=mi(lc(e),t.length);return t[r](e,i,n)}}function Eu(t,e,i){}class wu extends hu{constructor(t){super({attributions:t.attributions,cacheSize:t.cacheSize,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===wu.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=U(e),n=e.getState();let r;n==H?(this.tileLoadingKeys_[i]=!0,r=Zc):i in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[i],r=n==q?Hc:n==K?Yc:void 0),null!=r&&this.dispatchEvent(new cu(r,e))}setTileLoadFunction(t){this.tileLoadFunction=t,this.changed()}setTileUrlFunction(t,e){this.tileUrlFunction=t,void 0!==e?this.setKey(e):this.changed()}setUrl(t){const e=yu(t);this.urls=e,this.setUrls(e)}setUrls(t){this.urls=t;const e=t.join("\n");this.generateTileUrlFunction_?this.setTileUrlFunction(vu(t,this.tileGrid),e):this.setKey(e)}tileUrlFunction(t,e,i){}}class Tu extends wu{constructor(t){super({attributions:t.attributions,cacheSize:t.cacheSize,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction?t.tileLoadFunction:Cu,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:Hr,this.tileGridForProjection={},this.reprojectionErrorThreshold_=t.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}getGutterForProjection(t){return this.getProjection()&&t&&!ln(this.getProjection(),t)?0:this.getGutter()}getGutter(){return 0}getKey(){let t=super.getKey();return this.getInterpolate()||(t+=":disable-interpolation"),t}getTileGridForProjection(t){const e=this.getProjection();if(this.tileGrid&&(!e||ln(e,t)))return this.tileGrid;const i=U(t);return i in this.tileGridForProjection||(this.tileGridForProjection[i]=iu(t)),this.tileGridForProjection[i]}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?Y:J,void 0!==l?l:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return h.key=s,h.addEventListener(v,this.handleTileChange.bind(this)),h}getTile(t,e,i,n,r){const s=this.getProjection();if(!s||!r||ln(s,r))return this.getTileInternal(t,e,i,n,s||r);const o=[t,e,i],a=this.getKey(),l=this.getTileGridForProjection(s),h=this.getTileGridForProjection(r),c=this.getTileCoordForTileUrlFunction(o,r),u=new Wc(s,l,r,h,o,c,this.getTilePixelRatio(n),this.getGutter(),((t,e,i,n)=>this.getTileInternal(t,e,i,n,s)),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.tileOptions);return u.key=a,u}getTileInternal(t,e,i,n,r){const s=this.getKey();return this.createTile_(t,e,i,n,r,s)}setRenderReprojectionEdges(t){this.renderReprojectionEdges_!=t&&(this.renderReprojectionEdges_=t,this.changed())}setTileGridForProjection(t,e){const i=Qi(t);if(i){const t=U(i);t in this.tileGridForProjection||(this.tileGridForProjection[t]=e)}}}function Cu(t,e){t.getImage().src=e}function Ru(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 bu extends Tu{constructor(t){const e=void 0!==(t=t||{}).projection?t.projection:"EPSG:3857",i=void 0!==t.tileGrid?t.tileGrid:su({extent:lu(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,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_}}class Pu{constructor(t){this.rbush_=new Bs(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_[U(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_[U(s)]=o}this.rbush_.load(i)}remove(t){const e=U(t),i=this.items_[e];return delete this.items_[e],null!==this.rbush_.remove(i)}update(t,e){const i=this.items_[U(e)];he([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 y(this.items_)}clear(){this.rbush_.clear(),this.items_={}}getExtent(t){const e=this.rbush_.toJSON();return se(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]}}class Iu extends Ln{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 Iu(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 se(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(Le(t,this.getExtent())){const e=this.getCenter();return t[0]<=e[0]&&t[2]>=e[0]||(t[1]<=e[1]&&t[3]>=e[1]||_e(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=Bn(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(Cn(i,0,i.length,n,t,e,i)),this.changed()}}Iu.prototype.transform;class Lu extends In{constructor(t){super(),this.geometries_=t,this.changeEventsKeys_=[],this.listenGeometriesChange_()}unlistenGeometriesChange_(){this.changeEventsKeys_.forEach(D),this.changeEventsKeys_.length=0}listenGeometriesChange_(){const t=this.geometries_;for(let e=0,i=t.length;e<i;++e)this.changeEventsKeys_.push(A(t[e],v,this.changed,this))}clone(){const t=new Lu(Fu(this.geometries_));return t.applyProperties(this),t}closestPointXY(t,e,i,n){if(n<Qt(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){oe(t);const e=this.geometries_;for(let i=0,n=e.length;i<n;++i)ue(t,e[i].getExtent());return t}getGeometries(){return Fu(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){return new Lu(e)}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=Se(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(Fu(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 Fu(t){return t.map((t=>t.clone()))}function Mu(t,e,i,n,s,o,a){let l,h;const c=(i-e)/n;if(1===c)l=e;else if(2===c)l=e,h=s;else if(0!==c){let o=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-o)*(e-o)+(i-a)*(i-a)),u.push(c),o=e,a=i}const d=s*c,g=r(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,o=o||new Array(a);for(let e=0;e<a;++e)o[e]=void 0===l?NaN:void 0===h?t[l+e]:_i(t[l+e],t[l+n+e],h);return o}function Au(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(_i(t[(a-1)*n+e],t[a*n+e],c));return o.push(r),o}function Ou(t,e,i,n,r,s,o){if(o)return Au(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 Au(t,e,o,n,r,!1);e=o}}return null}function Du(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}class Nu extends Ln{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){h(this.flatCoordinates,t),this.changed()}clone(){const t=new Nu(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,i,n){return n<Qt(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Dn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Gn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,i,n))}forEachSegment(t){return dr(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,Au(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e))}getCoordinates(){return Jn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinateAt(t,e){return Mu(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,this.stride)}getLength(){return Du(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getFlatMidpoint(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_??void 0),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_}getSimplifiedGeometryInternal(t){const e=[];return e.length=$n(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,0),new Nu(e,"XY")}getType(){return"LineString"}intersectsExtent(t){return gr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=zn(this.flatCoordinates,0,t,this.stride),this.changed()}}class ku extends Ln{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{const e=t,i=[],n=[];for(let t=0,r=e.length;t<r;++t){h(i,e[t].getFlatCoordinates()),n.push(i.length)}const r=0===e.length?this.getLayout():e[0].getLayout();this.setFlatCoordinates(r,i),this.ends_=n}}appendLineString(t){h(this.flatCoordinates,t.getFlatCoordinates().slice()),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const t=new ku(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(t,e,i,n){return n<Qt(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Nn(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),jn(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,Ou(this.flatCoordinates,0,this.ends_,this.stride,t,e,i))}getCoordinates(){return Qn(this.flatCoordinates,0,this.ends_,this.stride)}getEnds(){return this.ends_}getLineString(t){return t<0||this.ends_.length<=t?null:new Nu(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 Nu(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];h(t,Mu(e,i,o,r,.5)),i=o}return t}getSimplifiedGeometryInternal(t){const e=[],i=[];return e.length=Wn(this.flatCoordinates,0,this.ends_,this.stride,t,e,0,i),new ku(e,"XY",i)}getType(){return"MultiLineString"}intersectsExtent(t){return fr(this.flatCoordinates,0,this.ends_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);const i=Xn(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()}}class Gu extends Ln{constructor(t,e){super(),e&&!Array.isArray(t[0])?this.setFlatCoordinates(e,t):this.setCoordinates(t,e)}appendPoint(t){h(this.flatCoordinates,t.getFlatCoordinates()),this.changed()}clone(){const t=new Gu(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,i,n){if(n<Qt(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=di(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 Jn(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getPoint(t){const e=this.flatCoordinates.length/this.stride;return t<0||e<=t?null:new sr(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 sr(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(ie(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=zn(this.flatCoordinates,0,t,this.stride),this.changed()}}function ju(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=le(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 Uu extends Ln{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])){const n=t,r=[],s=[];for(let t=0,e=n.length;t<e;++t){const e=n[t],i=r.length,o=e.getEnds();for(let t=0,e=o.length;t<e;++t)o[t]+=i;h(r,e.getFlatCoordinates()),s.push(o)}e=0===n.length?this.getLayout():n[0].getLayout(),t=r,i=s}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;h(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 Uu(this.flatCoordinates.slice(),this.layout,e);return i.applyProperties(this),i}closestPointXY(t,e,i,n){return n<Qt(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(kn(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Un(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,t,e,i,n))}containsXY(t,e){return hr(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t,e)}getArea(){return nr(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)}getCoordinates(t){let e;return void 0!==t?(e=this.getOrientedFlatCoordinates().slice(),wr(e,0,this.endss_,this.stride,t)):e=this.flatCoordinates,tr(e,0,this.endss_,this.stride)}getEndss(){return this.endss_}getFlatInteriorPoints(){if(this.flatInteriorPointsRevision_!=this.getRevision()){const t=ju(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=ur(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_}getInteriorPoints(){return new Gu(this.getFlatInteriorPoints().slice(),"XYM")}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const t=this.flatCoordinates;Sr(t,0,this.endss_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=wr(this.orientedFlatCoordinates_,0,this.endss_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){const e=[],i=[];return e.length=qn(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),e,0,i),new Uu(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 Cr(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 Cr(e.slice(r,a),t,o);n.push(l),r=a}return n}getType(){return"MultiPolygon"}intersectsExtent(t){return _r(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,3),this.flatCoordinates||(this.flatCoordinates=[]);const i=Vn(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 Bu=[1,0,0,1,0,0];class zu{constructor(t,e,i,n,r,s){this.styleFunction,this.extent_,this.id_=s,this.type_=t,this.flatCoordinates_=e,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=i||null,this.properties_=r,this.squaredTolerance_,this.stride_=n,this.simplifiedGeometry_}get(t){return this.properties_[t]}getExtent(){return this.extent_||(this.extent_="Point"===this.type_?ae(this.flatCoordinates_):le(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_}getFlatInteriorPoint(){if(!this.flatInteriorPoints_){const t=Se(this.getExtent());this.flatInteriorPoints_=cr(this.flatCoordinates_,0,this.ends_,2,t,0)}return this.flatInteriorPoints_}getFlatInteriorPoints(){if(!this.flatInteriorPoints_){const t=Tr(this.flatCoordinates_,this.ends_),e=ju(this.flatCoordinates_,0,t,2);this.flatInteriorPoints_=ur(this.flatCoordinates_,0,t,2,e)}return this.flatInteriorPoints_}getFlatMidpoint(){return this.flatMidpoints_||(this.flatMidpoints_=Mu(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=Mu(t,e,r,2,.5);h(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_}getPropertiesInternal(){return this.properties_}getStride(){return this.stride_}getStyleFunction(){return this.styleFunction}getType(){return this.type_}transform(t){const e=(t=Qi(t)).getExtent(),i=t.getWorldExtent();if(e&&i){const t=Ce(i)/Ce(e);Vt(Bu,i[0],i[3],t,-t,0,0,0),Tn(this.flatCoordinates_,0,this.flatCoordinates_.length,2,Bu,this.flatCoordinates_)}}applyTransform(t){t(this.flatCoordinates_,this.flatCoordinates_,this.stride_)}clone(){return new zu(this.type_,this.flatCoordinates_.slice(),this.ends_?.slice(),this.stride_,Object.assign({},this.properties_),this.id_)}getEnds(){return this.ends_}enableSimplifyTransformed(){return this.simplifyTransformed=p(((t,e)=>{if(t===this.squaredTolerance_)return this.simplifiedGeometry_;this.simplifiedGeometry_=this.clone(),e&&this.simplifiedGeometry_.applyTransform(e);const i=this.simplifiedGeometry_.getFlatCoordinates();let n;switch(this.type_){case"LineString":i.length=$n(i,0,this.simplifiedGeometry_.flatCoordinates_.length,this.simplifiedGeometry_.stride_,t,i,0),n=[i.length];break;case"MultiLineString":n=[],i.length=Wn(i,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,t,i,0,n);break;case"Polygon":n=[],i.length=Kn(i,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,Math.sqrt(t),i,0,n)}return n&&(this.simplifiedGeometry_=new zu(this.type_,i,n,2,this.properties_,this.id_)),this.squaredTolerance_=t,this.simplifiedGeometry_})),this}}function Xu(t){const e=t.getType();switch(e){case"Point":return new sr(t.getFlatCoordinates());case"MultiPoint":return new Gu(t.getFlatCoordinates(),"XY");case"LineString":return new Nu(t.getFlatCoordinates(),"XY");case"MultiLineString":return new ku(t.getFlatCoordinates(),"XY",t.getEnds());case"Polygon":const i=t.getFlatCoordinates(),n=t.getEnds(),r=Tr(i,n);return r.length>1?new Uu(i,"XY",r):new Cr(i,"XY",n);default:throw new Error("Invalid geometry type:"+e)}}zu.prototype.getFlatCoordinates=zu.prototype.getOrientedFlatCoordinates;var Vu="addfeature",$u="changefeature",Wu="clear",Zu="removefeature",Yu="featuresloadstart",Hu="featuresloadend",Ku="featuresloaderror";class qu extends t{constructor(t,e,i){super(t),this.feature=e,this.features=i}}class Ju extends Kc{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_=f,this.format_=t.format||null,this.overlaps_=void 0===t.overlaps||t.overlaps,this.url_=t.url,void 0!==t.loader?this.loader_=t.loader:void 0!==this.url_&&(Ft(this.format_,"`format` must be set when `url` is set"),this.loader_=xc(this.url_,this.format_)),this.strategy_=void 0!==t.strategy?t.strategy:vc;const e=void 0===t.useSpatialIndex||t.useSpatialIndex;let i,n;this.featuresRtree_=e?new Pu:null,this.loadedExtentsRtree_=new Pu,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 Z(n)),void 0!==n&&this.addFeaturesInternal(n),void 0!==i&&this.bindFeaturesCollection_(i)}addFeature(t){this.addFeatureInternal(t),this.changed()}addFeatureInternal(t){const e=U(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 qu(Vu,t))}setupChangeEvents_(t,e){e instanceof zu||(this.featureChangeKeys_[t]=[A(e,v,this.handleFeatureChange_,this),A(e,i,this.handleFeatureChange_,this)])}addToIndex_(t,e){let i=!0;if(void 0!==e.getId()){const t=String(e.getId());if(t in this.idIndex_)if(e instanceof zu){const n=this.idIndex_[t];n instanceof zu?Array.isArray(n)?n.push(e):this.idIndex_[t]=[n,e]:i=!1}else i=!1;else this.idIndex_[t]=e}return i&&(Ft(!(t in this.uidIndex_),"The passed `feature` was already added to the source"),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=U(n);this.addToIndex_(r,n)&&i.push(n)}for(let t=0,r=i.length;t<r;t++){const r=i[t],s=U(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(Vu))for(let t=0,e=i.length;t<e;t++)this.dispatchEvent(new qu(Vu,i[t]))}bindFeaturesCollection_(t){let e=!1;this.addEventListener(Vu,(function(i){e||(e=!0,t.push(i.feature),e=!1)})),this.addEventListener(Zu,(function(i){e||(e=!0,t.remove(i.feature),e=!1)})),t.addEventListener(X,(t=>{e||(e=!0,this.addFeature(t.element),e=!1)})),t.addEventListener(V,(t=>
2387{e||(e=!0,this.removeFeature(t.element),e=!1)})),this.featuresCollection_=t}clear(t){if(t){for(const t in this.featureChangeKeys_){this.featureChangeKeys_[t].forEach(D)}this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){const t=t=>{this.removeFeatureInternal(t)};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 qu(Wu);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){const n=i.getGeometry();if(n instanceof zu||n.intersectsCoordinate(t))return e(i)}))}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){const n=i.getGeometry();if(n instanceof zu||n.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(),y(this.nullGeometryFeatures_)||h(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=ke(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||d,this.featuresRtree_.forEachInExtent(a,(function(t){if(e(t)){const e=t.getGeometry(),l=o;if(o=e instanceof zu?0: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=U(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 qu($u,e))}hasFeature(t){const e=t.getId();return void 0!==e?e in this.idIndex_:U(t)in this.uidIndex_}isEmpty(){return this.featuresRtree_?this.featuresRtree_.isEmpty()&&y(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 ee(t.extent,s)}))||(++this.loadingExtentsCount_,this.dispatchEvent(new qu(Yu)),this.loader_.call(this,s,e,i,(t=>{--this.loadingExtentsCount_,this.dispatchEvent(new qu(Hu,void 0,t))}),(()=>{--this.loadingExtentsCount_,this.dispatchEvent(new qu(Ku))})),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(he(e.extent,t))return i=e,!0})),i&&e.remove(i)}removeFeatures(t){let e=!1;for(let i=0,n=t.length;i<n;++i)e=this.removeFeatureInternal(t[i])||e;e&&this.changed()}
2387removeFeature(t){if(!t)return;this.removeFeatureInternal(t)&&this.changed()}removeFeatureInternal(t){const e=U(t);if(!(e in this.uidIndex_))return!1;e in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[e]:this.featuresRtree_&&this.featuresRtree_.remove(t);const i=this.featureChangeKeys_[e];i?.forEach(D),delete this.featureChangeKeys_[e];const n=t.getId();if(void 0!==n){const e=n.toString(),i=this.idIndex_[e];i===t?delete this.idIndex_[e]:Array.isArray(i)&&(i.splice(i.indexOf(t),1),1===i.length&&(this.idIndex_[e]=i[0]))}return delete this.uidIndex_[e],this.hasListener(Zu)&&this.dispatchEvent(new qu(Zu,t)),!0}removeFromIdIndex_(t){for(const e in this.idIndex_)if(this.idIndex_[e]===t){delete this.idIndex_[e];break}}setLoader(t){this.loader_=t}setUrl(t){Ft(this.format_,"`format` must be set when `url` is set"),this.url_=t,this.setLoader(xc(t,this.format_))}}class Qu extends Lt{constructor(t){super({tileCoord:t.tileCoord,loader:()=>Promise.resolve(new Uint8ClampedArray(4)),interpolate:t.interpolate,transition:t.transition}),this.pixelRatio_=t.pixelRatio,this.gutter_=t.gutter,this.reprojData_=null,this.reprojError_=null,this.reprojSize_=void 0,this.sourceTileGrid_=t.sourceTileGrid,this.targetTileGrid_=t.targetTileGrid,this.wrappedTileCoord_=t.wrappedTileCoord||t.tileCoord,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0;const e=t.sourceProj,i=e.getExtent(),n=t.sourceTileGrid.getExtent();this.clipExtent_=e.canWrapX()?n?Re(i,n):i:n;const r=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_),s=this.targetTileGrid_.getExtent();let o=this.sourceTileGrid_.getExtent();const a=s?Re(r,s):r;if(0===ye(a))return void(this.state=J);i&&(o=o?Re(o,i):i);const l=this.targetTileGrid_.getResolution(this.wrappedTileCoord_[0]),h=t.targetProj,c=Bc(e,h,a,l);if(!isFinite(c)||c<=0)return void(this.state=J);const u=void 0!==t.errorThreshold?t.errorThreshold:Vc;if(this.triangulation_=new $c(e,h,a,o,c*u,l),0===this.triangulation_.getTriangles().length)return void(this.state=J);this.sourceZ_=this.sourceTileGrid_.getZForResolution(c);let d=this.triangulation_.calculateSourceExtent();if(o&&(e.canWrapX()?(d[1]=ci(d[1],o[1],o[3]),d[3]=ci(d[3],o[1],o[3])):d=Re(d,o)),ye(d)){let n=0,r=0;e.canWrapX()&&(n=Ie(i),r=Math.floor((d[0]-i[0])/n));ke(d.slice(),e,!0).forEach((e=>{const i=this.sourceTileGrid_.getTileRangeForExtentAndZ(e,this.sourceZ_),s=t.getTileFunction;for(let t=i.minX;t<=i.maxX;t++)for(let e=i.minY;e<=i.maxY;e++){const i=s(this.sourceZ_,t,e,this.pixelRatio_);if(i){const t=r*n;this.sourceTiles_.push({tile:i,offset:t})}}++r})),0===this.sourceTiles_.length&&(this.state=J)}else this.state=J}getSize(){return this.reprojSize_}getData(){return this.reprojData_}getError(){return this.reprojError_}reproject_(){const t=[];let e=!1;if(this.sourceTiles_.forEach((i=>{const n=i.tile;if(!n||n.getState()!==K)return;const r=n.getSize(),s=this.gutter_;let o;const a=Ct(n.getData());a?o=a:(e=!0,o=Pt(Tt(n.getData())));const l=[r[0]+2*s,r[1]+2*s],h=o instanceof Float32Array,c=l[0]*l[1],u=h?Float32Array:Uint8ClampedArray,d=new u(o.buffer),g=u.BYTES_PER_ELEMENT,f=g*d.length/c,p=d.byteLength/l[1],m=Math.floor(p/g/l[0]),_=c*m;let y=d;if(d.length!==_){y=new u(_);let t=0,e=0;const i=l[0]*m;for(let n=0;n<l[1];++n){for(let n=0;n<i;++n)y[t++]=d[e+n];e+=p/g}}const x=this.sourceTileGrid_.getTileCoordExtent(n.tileCoord);x[0]+=i.offset,x[2]+=i.offset;const v=this.clipExtent_?.slice();v&&(v[0]+=i.offset,v[2]+=i.offset),t.push({extent:x,clipExtent:v,data:new Uint8ClampedArray(y.buffer),dataType:u,bytesPerPixel:f,pixelSize:l})})),this.sourceTiles_.length=0,0===t.length)return this.state=q,void this.changed();const i=this.wrappedTileCoord_[0],n=this.targetTileGrid_.getTileSize(i),r="number"==typeof n?n:n[0],s="number"==typeof n?n:n[1],o=this.targetTileGrid_.getResolution(i),a=this.sourceTileGrid_.getResolution(this.sourceZ_),l=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);let h,c;const u=t[0].bytesPerPixel;for(let e=Math.ceil(u/3)-1;e>=0;--e){const i=[];for(let n=0,r=t.length;n<r;++n){const r=t[n],s=r.data,o=r.pixelSize,a=o[0],l=o[1],h=pt(a,l,kc),c=h.createImageData(a,l),d=c.data;let g=3*e;for(let t=0,e=d.length;t<e;t+=4)d[t]=s[g],d[t+1]=s[g+1],d[t+2]=s[g+2],d[t+3]=255,g+=u;h.putImageData(c,0,0),i.push({extent:r.extent,clipExtent:r.clipExtent,image:h.canvas})}const n=zc(r,s,this.pixelRatio_,a,this.sourceTileGrid_.getExtent(),o,l,this.triangulation_,i,this.gutter_,!1,!1,!1);for(let t=0,e=i.length;t<e;++t){const e=i[t].image.getContext("2d");yt(e),kc.push(e.canvas)}const d=n.getContext("2d"),g=d.getImageData(0,0,n.width,n.height);yt(d),kc.push(n),h||(c=new Uint8ClampedArray(u*g.width*g.height),h=new t[0].dataType(c.buffer));const f=g.data;let p=3*e;for(let t=0,e=f.length;t<e;
2387t+=4)255===f[t+3]?(c[p]=f[t],c[p+1]=f[t+1],c[p+2]=f[t+2]):(c[p]=0,c[p+1]=0,c[p+2]=0),p+=u}if(e){const t=pt(r,s),e=new ImageData(h,r);t.putImageData(e,0,0),this.reprojData_=t.canvas}else this.reprojData_=h;this.reprojSize_=[Math.round(r*this.pixelRatio_),Math.round(s*this.pixelRatio_)],this.state=K,this.changed()}load(){if(this.state!==Y&&this.state!==q)return;this.state=H,this.changed();let t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach((({tile:e})=>{const i=e.getState();if(i!==Y&&i!==H)return;t++;const n=A(e,v,(()=>{const i=e.getState();i!=K&&i!=q&&i!=J||(D(n),t--,0===t&&(this.unlistenSources_(),this.reproject_()))}));this.sourcesListenerKeys_.push(n)})),0===t?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach((function({tile:t}){t.getState()==Y&&t.load()}))}unlistenSources_(){this.sourcesListenerKeys_.forEach(D),this.sourcesListenerKeys_=null}}class td extends hu{constructor(t){const e=void 0===t.projection?"EPSG:3857":t.projection;let i=t.tileGrid;void 0===i&&e&&(i=su({extent:lu(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,state:t.state,wrapX:t.wrapX,transition:t.transition,interpolate:t.interpolate,key:t.key}),this.gutter_=void 0!==t.gutter?t.gutter:0,this.tileSize_=t.tileSize?no(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,this.tileGridForProjection_={},this.crossOrigin_=t.crossOrigin||"anonymous"}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?no(e.getTileSize(t)):[256,256]}getGutterForProjection(t){const e=this.getProjection();return!e||ln(e,t)?this.gutter_:0}setLoader(t){this.loader_=t}getReprojTile_(t,e,i,n,r){const s=this.getTileGrid(),o=Math.max.apply(null,s.getResolutions().map(((t,e)=>{const i=no(s.getTileSize(e)),n=this.getTileSize(e);return Math.max(n[0]/i[0],n[1]/i[1])}))),a=this.getTileGridForProjection(r),l=this.getTileGridForProjection(n),h=[t,e,i],c=this.getTileCoordForTileUrlFunction(h,n),u=Object.assign({sourceProj:r,sourceTileGrid:a,targetProj:n,targetTileGrid:l,tileCoord:h,wrappedTileCoord:c,pixelRatio:o,gutter:this.getGutterForProjection(r),getTileFunction:(t,e,i,n)=>this.getTile(t,e,i,n,r)},this.tileOptions),d=new Qu(u);return d.key=this.getKey(),d}getTile(t,e,i,n,r){const s=this.getProjection();if(s&&r&&!ln(s,r))return this.getReprojTile_(t,e,i,r,s);const o=this.getTileSize(t),a=this.loader_,l=new AbortController,h={signal:l.signal,crossOrigin:this.crossOrigin_},c=this.getTileCoordForTileUrlFunction([t,e,i]);if(!c)return null;const u=c[0],d=c[1],g=c[2];const f=Object.assign({tileCoord:[t,e,i],loader:function(){return m((function(){return a(u,d,g,h)}))},size:o,controller:l},this.tileOptions),p=new Lt(f);return p.key=this.getKey(),p.addEventListener(v,this.handleTileChange_),p}handleTileChange_(t){const e=t.target,i=U(e),n=e.getState();let r;n==H?(this.tileLoadingKeys_[i]=!0,r=Zc):i in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[i],r=n==q?Hc:n==K?Yc:void 0),r&&this.dispatchEvent(new cu(r,e))}getTileGridForProjection(t){const e=this.getProjection();if(this.tileGrid&&(!e||ln(e,t)))return this.tileGrid;const i=U(t);return i in this.tileGridForProjection_||(this.tileGridForProjection_[i]=iu(t)),this.tileGridForProjection_[i]}setTileGridForProjection(t,e){const i=Qi(t);if(i){const t=U(i);t in this.tileGridForProjection_||(this.tileGridForProjection_[t]=e)}}}function ed(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 id="STATISTICS_MAXIMUM",nd="STATISTICS_MINIMUM";let rd;function sd(t){try{return t.getBoundingBox()}catch(e){return[0,0,t.getWidth(),t.getHeight()]}}function od(t){try{return t.getOrigin().slice(0,2)}catch(e){return[0,t.getHeight()]}}function ad(t,e){try{return t.getResolution(e)}
2387catch(i){return[e.getWidth()/t.getWidth(),e.getHeight()/t.getHeight()]}}function ld(t){const e=t.geoKeys;if(!e)return null;if(e.ProjectedCSTypeGeoKey&&32767!==e.ProjectedCSTypeGeoKey){const t="EPSG:"+e.ProjectedCSTypeGeoKey;let i=Qi(t);if(!i){const n=je(e.ProjLinearUnitsGeoKey);n&&(i=new Be({code:t,units:n}))}return i}if(e.GeographicTypeGeoKey&&32767!==e.GeographicTypeGeoKey){const t="EPSG:"+e.GeographicTypeGeoKey;let i=Qi(t);if(!i){const n=je(e.GeogAngularUnitsGeoKey);n&&(i=new Be({code:t,units:n}))}return i}return null}function hd(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 cd(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(hd)}function ud(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)ud(t[o],e[o],i,n,r)}else if(Math.abs(t-e)>i*t)throw new Error(n)}function dd(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 gd extends td{constructor(t){super({state:"loading",tileGrid:null,projection:t.projection||null,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]=cd(this.sourceInfo_[t],this.sourceOptions_);Promise.all(n).then((function(t){i.configure_(t)})).catch((function(t){Wi(t),i.error_=t,i.setState("error")}))}getError(){return this.error_}determineProjection(t){const e=t[0];for(let t=e.length-1;t>=0;--t){const i=ld(e[t]);if(i){this.projection=i;break}}}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=sd(e)),p||(p=od(e));const s=ad(e,c[0]);y[r]=s[0];const h=[e.getTileWidth(),e.getTileHeight()];h[0]!==h[1]&&h[1]<256&&(h[0]=256,h[1]=256),m[r]=h;const d=s[0]/Math.abs(s[1]);_[r]=[h[0],h[1]/d]}if(e?Re(e,f,e):e=f,i){ud(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}]`;ud(s.slice(h,s.length),e,.02,i,this.viewRejector)}else s=y,this.resolutionFactors_[u]=1;n?ud(n.slice(h,n.length),_,.01,`Tile size mismatch for source ${u}`,this.viewRejector):n=_,r?ud(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)}this.getProjection()||this.determineProjection(t),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 Qc({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");2===s.length?s=[s[0],s[1],s[1]/2]:1===s.length&&(s=[2*s[0],s[0],s[0]/2]),this.viewResolver({showFullExtent:!0,projection:this.projection,resolutions:s,center:mn(Se(e),this.projection),extent:yn(e,this.projection),zoom:1})}loadTile_(t,e,i,n){const r=this.getTileSize(t),s=this.sourceImagery_.length,o=new Array(2*s),a=this.nodataValues_,l=this.sourceInfo_,h=(rd||(rd=new GeoTIFF.Pool),rd);for(let c=0;c<s;++c){const u=l[c],d=this.resolutionFactors_[c],g=[Math.round(e*(r[0]*
2387d)),Math.round(i*(r[1]*d)),Math.round((e+1)*(r[0]*d)),Math.round((i+1)*(r[1]*d))],f=this.sourceImagery_[c][t];let p,m;u.bands&&(p=u.bands.map((function(t){return t-1}))),m="nodata"in u&&null!==u.nodata?u.nodata:p?p.map((function(t){return a[c][t]})):a[c];const _={window:g,width:r[0],height:r[1],samples:p,fillValue:m,pool:h,interleave:!1,signal:n.signal};ed(this.convertToRGB_,f)?o[c]=f.readRGB(_):o[c]=f.readRasters(_);const y=s+c,x=this.sourceMasks_[c][t];x?o[y]=x.readRasters({window:g,width:r[0],height:r[1],samples:[0],pool:h,interleave:!1}):o[y]=Promise.resolve(null)}return Promise.all(o).then(this.composeTile_.bind(this,r)).catch((function(t){throw Wi(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&&nd in t?parseFloat(t[nd]):(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&&id in t?parseFloat(t[id]):dd(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?ci(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}}gd.prototype.getView;let fd=class extends Hr{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==K){const e=this.tileSize_;if(t.width==e[0]&&t.height==e[1])return this.zoomifyImage_=t,t;const i=pt(e[0],e[1]);return i.drawImage(t,0,0),this.zoomifyImage_=i.canvas,i.canvas}return t}};const pd="version1",md="version2",_d="version3",yd={};yd[pd]={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"]}},yd[md]={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"]}},yd[_d]={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"]}},yd.none={none:{supports:[],formats:[],qualities:[]}};const xd=/^https?:\/\/library\.stanford\.edu\/iiif\/image-api\/(?:1\.1\/)?compliance\.html#level[0-2]$/,vd=/^https?:\/\/iiif\.io\/api\/image\/2\/level[0-2](?:\.json)?$/,Sd=/(^https?:\/\/iiif\.io\/api\/image\/3\/level[0-2](?:\.json)?$)|(^level[0-2]$)/;const Ed={};Ed[pd]=function(t){let e=t.getComplianceLevelSupportedFeatures();return void 0===e&&(e=yd[pd].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}},Ed[md]=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}
2387))[0],supports:[...e.supports,...n],formats:[...e.formats,...r],qualities:[...e.qualities,...s]}},Ed[_d]=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 wd(t){return t.toLocaleString("en",{maximumFractionDigits:10})}class Td extends Xr{constructor(t,e,i,n,r,s,o){let a=t.getExtent();a&&t.canWrapX()&&(a=a.slice(),a[0]=-1/0,a[2]=1/0);let l=e.getExtent();l&&e.canWrapX()&&(l=l.slice(),l[0]=-1/0,l[2]=1/0);const h=l?Re(i,l):i,c=Uc(t,e,Se(h),n),u=new $c(t,e,h,a,.5*c,n),d=u.calculateSourceExtent(),g=Fe(d)?null:s(d,c,r),f=g?zr.IDLE:zr.EMPTY,p=g?g.getPixelRatio():1;super(i,n,p,f),this.targetProj_=e,this.maxSourceExtent_=a,this.triangulation_=u,this.targetResolution_=n,this.targetExtent_=i,this.sourceImage_=g,this.sourcePixelRatio_=p,this.interpolate_=o,this.canvas_=null,this.sourceListenerKey_=null}disposeInternal(){this.state==zr.LOADING&&this.unlistenSource_(),super.disposeInternal()}getImage(){return this.canvas_}getProjection(){return this.targetProj_}reproject_(){const t=this.sourceImage_.getState();if(t==zr.LOADED){const t=Ie(this.targetExtent_)/this.targetResolution_,e=Ce(this.targetExtent_)/this.targetResolution_;this.canvas_=zc(t,e,this.sourcePixelRatio_,Xc(this.sourceImage_.getResolution()),this.maxSourceExtent_,this.targetResolution_,this.targetExtent_,this.triangulation_,[{extent:this.sourceImage_.getExtent(),image:this.sourceImage_.getImage()}],0,void 0,this.interpolate_,!0)}this.state=t,this.changed()}load(){if(this.state==zr.IDLE){this.state=zr.LOADING,this.changed();const t=this.sourceImage_.getState();t==zr.LOADED||t==zr.ERROR?this.reproject_():(this.sourceListenerKey_=A(this.sourceImage_,v,(t=>{const e=this.sourceImage_.getState();e!=zr.LOADED&&e!=zr.ERROR||(this.unlistenSource_(),this.reproject_())})),this.sourceImage_.load())}}unlistenSource_(){D(this.sourceListenerKey_),this.sourceListenerKey_=null}}const Cd=4,Rd="imageloadstart",bd="imageloadend",Pd="imageloaderror";class Id extends t{constructor(t,e){super(t),this.image=e}}class Ld extends Kc{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.loader=t.loader||null,this.resolutions_=void 0!==t.resolutions?t.resolutions:null,this.reprojectedImage_=null,this.reprojectedRevision_=0,this.image=null,this.wantedExtent_,this.wantedResolution_,this.static_=!!t.loader&&0===t.loader.length,this.wantedProjection_=null}getResolutions(){return this.resolutions_}setResolutions(t){this.resolutions_=t}findNearestResolution(t){const e=this.getResolutions();if(e){t=e[a(e,t,0)]}return t}getImage(t,e,i,n){const r=this.getProjection();if(!r||!n||ln(r,n))return r&&(n=r),this.getImageInternal(t,e,i,n);if(this.reprojectedImage_){if(this.reprojectedRevision_==this.getRevision()&&ln(this.reprojectedImage_.getProjection(),n)&&this.reprojectedImage_.getResolution()==e&&he(this.reprojectedImage_.getExtent(),t))return this.reprojectedImage_;this.reprojectedImage_.dispose(),this.reprojectedImage_=null}return this.reprojectedImage_=new Td(r,n,t,e,i,((t,e,i)=>this.getImageInternal(t,e,i,r)),this.getInterpolate()),this.reprojectedRevision_=this.getRevision(),this.reprojectedImage_}getImageInternal(t,e,i,n){if(this.loader){const r=Md(t,e,i,1),s=this.findNearestResolution(e);if(this.image&&(this.static_||this.wantedProjection_===n&&(this.wantedExtent_&&ee(this.wantedExtent_,r)||ee(this.image.getExtent(),r))&&(this.wantedResolution_&&Xc(this.wantedResolution_)===s||Xc(this.image.getResolution())===s)))return this.image;this.wantedProjection_=n,this.wantedExtent_=r,this.wantedResolution_=s,this.image=new Xr(r,s,i,this.loader),this.image.addEventListener(v,this.handleImageChange.bind(this))}return this.image}handleImageChange(t){const e=t.target;let i;switch(e.getState()){case zr.LOADING:this.loading=!0,i=Rd;break;case zr.LOADED:this.loading=!1,i=bd;break;case zr.ERROR:this.loading=!1,i=Pd;break;default:return}this.hasListener(i)&&this.dispatchEvent(new Id(i,e))}}function Fd(t,e){t.getImage().src=e}function Md(t,e,i,n){const r=e/i,s=Se(t),o=Si(Ie(t)/r,Cd),a=Si(Ce(t)/r,Cd);return we(s,r,0,[o+2*Si((n-1)*o/2,Cd),a+2*Si((n-1)*a/2,Cd)])}
vendor: 7,790 bytes, line 2387
2387function Ad(t,e,i,n,r,s){const o=r.getCode().split(/:(?=\d+$)/).pop(),a=i/n,l=[xi(Ie(e)/a,Cd),xi(Ce(e)/a,Cd)];s.SIZE=l[0]+","+l[1],s.BBOX=e.join(","),s.BBOXSR=o,s.IMAGESR=o,s.DPI=Math.round(s.DPI?s.DPI*n:90*n);return uu(t.replace(/MapServer\/?$/,"MapServer/export").replace(/ImageServer\/?$/,"ImageServer/exportImage"),s)}function Od(t){const e=t.load?t.load:Zr,i=Qi(t.projection||"EPSG:3857"),n=t.ratio??1.5,r=t.crossOrigin??null;return function(s,o,a){a=t.hidpi?a:1;const l={F:"image",FORMAT:"PNG32",TRANSPARENT:!0};Object.assign(l,t.params),s=Md(s,o,a,n);const h=Ad(t.url,s,o,a,i,l),c=new Image;return c.crossOrigin=r,e(c,h).then((t=>{const e=Ie(s)/t.width*a;return{image:t,extent:s,resolution:e,pixelRatio:a}}))}}function Dd(t,e,i,n,r,s,o){const a=function(t,e,i,n){const r=Ie(t),s=Ce(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,s,o),l=Se(i),h={OPERATION:r?"GETDYNAMICMAPOVERLAYIMAGE":"GETMAPIMAGE",VERSION:"2.0.0",LOCALE:"en",CLIENTAGENT:"ol/source/ImageMapGuide source",CLIP:"1",SETDISPLAYDPI:o,SETDISPLAYWIDTH:Math.round(n[0]),SETDISPLAYHEIGHT:Math.round(n[1]),SETVIEWSCALE:a,SETVIEWCENTERX:l[0],SETVIEWCENTERY:l[1]};return Object.assign(h,e),uu(t,h)}function Nd(t){const e=t.load||Zr,i=t.useOverlay??!1,n=t.metersPerUnit||1,r=t.displayDpi||96,s=t.ratio??1,o=t.crossOrigin??null;return function(a,l,h){const c=new Image;c.crossOrigin=o;const u=Ie(a=Md(a,l,h,s))/l,d=Ce(a)/l,g=[u*h,d*h],f=Dd(t.url,t.params,a,g,i,n,r);return e(c,f).then((t=>({image:t,extent:a,pixelRatio:h})))}}function kd(t){const e=t.load||Zr,i=t.imageExtent,n=t.crossOrigin??null;return()=>{const r=new Image;return r.crossOrigin=n,e(r,t.url).then((t=>{const e=Ie(i)/t.width,n=Ce(i)/t.height;return{image:t,extent:i,resolution:e!==n?[e,n]:n,pixelRatio:1}}))}}const Gd=new Error("Image failed to load");function jd(t,e,i,n,r){return new Promise(((s,o)=>{const a=new Image;a.crossOrigin=r.crossOrigin??null,a.addEventListener("load",(()=>s(a))),a.addEventListener("error",(()=>o(Gd))),a.src=mu(t,e,i,n,r.maxY)}))}function Ud(t){return function(e,i,n,r){return jd(_u(t,e,i,n),e,i,n,r)}}function Bd(t){let e;if(Array.isArray(t))e=Ud(t);else if("string"==typeof t){e=Ud(yu(t))}else{if("function"!=typeof t)throw new Error("The url option must be a single template, an array of templates, or a function for getting a URL");i=t,e=function(t,e,n,r){return jd(i(t,e,n,r),t,e,n,r)}}var i;return e}let zd=0;function Xd(t){return Array.isArray(t)?t.join("\n"):"string"==typeof t?t:(++zd,"url-function-key-"+zd)}const Vd="1.3.0",$d=[101,101];function Wd(t,e,i,n,r){r.WIDTH=i[0],r.HEIGHT=i[1];const s=n.getAxisOrientation(),o=wi(r.VERSION,"1.3")>=0;r[o?"CRS":"SRS"]=n.getCode();const a=o&&s.startsWith("ne")?[e[1],e[0],e[3],e[2]]:e;return r.BBOX=a.join(","),uu(t,r)}function Zd(t,e,i,n,r,s,o){s=Object.assign({REQUEST:"GetMap"},s);const a=e/i,l=[xi(Ie(t)/a,Cd),xi(Ce(t)/a,Cd)];if(1!=i)switch(o){case"geoserver":const t=90*i+.5|0;"FORMAT_OPTIONS"in s?s.FORMAT_OPTIONS+=";dpi:"+t:s.FORMAT_OPTIONS="dpi:"+t;break;case"mapserver":s.MAP_RESOLUTION=90*i;break;case"carmentaserver":case"qgis":s.DPI=90*i;break;default:throw new Error("Unknown `serverType` configured")}return Wd(r,t,l,n,s)}function Yd(t,e){return Object.assign({REQUEST:e,SERVICE:"WMS",VERSION:Vd,FORMAT:"image/png",STYLES:"",TRANSPARENT:!0},t)}function Hd(t){const e=void 0===t.hidpi||t.hidpi,i=Qi(t.projection||"EPSG:3857"),n=t.ratio||1.5,r=t.load||Zr,s=t.crossOrigin??null;return(o,a,l)=>{o=Md(o,a,l,n),1==l||e&&void 0!==t.serverType||(l=1);const h=Zd(o,a,l,i,t.url,Yd(t.params,"GetMap"),t.serverType),c=new Image;return c.crossOrigin=s,r(c,h).then((t=>({image:t,extent:o,pixelRatio:l})))}}function Kd(t,e,i){if(void 0===t.url)return;const n=Qi(t.projection||"EPSG:3857"),r=we(e,i,0,$d),s={QUERY_LAYERS:t.params.LAYERS,INFO_FORMAT:"application/json"};Object.assign(s,Yd(t.params,"GetFeatureInfo"),t.params);const o=vi((e[0]-r[0])/i,Cd),a=vi((r[3]-e[1])/i,Cd),l=wi(s.VERSION,"1.3")>=0;return s[l?"I":"X"]=o,s[l?"J":"Y"]=a,Wd(t.url,r,$d,n,s)}function qd(t,e){if(void 0===t.url)return;const i={SERVICE:"WMS",VERSION:Vd,REQUEST:"GetLegendGraphic",FORMAT:"image/png"};if(void 0!==e){const n=Qi(t.projection||"EPSG:3857").getMetersPerUnit()||1,r=28e-5;i.SCALE=e*n/r}if(Object.assign(i,t.params),void 0!==t.params&&void 0===i.LAYER){const t=i.LAYERS;if(!(!Array.isArray(t)||1!==t.length))return;i.LAYER=t}return uu(t.url,i)}const Jd={"image/png":!0,"image/jpeg":!0,"image/gif":!0,"image/webp":!0},Qd={"application/vnd.mapbox-vector-tile":!0,"application/geo+json":!0};function tg(t,e){if(!e.length)return t;const i=new URL(t,"file:/");if(i.pathname.split("/").includes("collections"))return Wi('The "collections" query parameter cannot be added to collection endpoints'),t;const n=e.map((t=>encodeURIComponent(t))).join(",");i.searchParams.append("collections",n);return`${t.split("?")[0]}?${decodeURIComponent(i.searchParams.toString())}`}function eg(t,e,i){let n,r;for(let i=0;i<t.length;++i){const s=t[i];if("item"===s.rel){if(s.type===e){n=s.href;break}(Jd[s.type]||!r&&s.type.startsWith("image/"))&&(r=s.href)}}if(!n){if(!r)throw new Error('Could not find "item" link');n=r}return i&&(n=tg(n,i)),n}function ig(t,e,i,n){let r,s;const o={};for(let i=0;i<t.length;++i){const n=t[i];if(o[n.type]=n.href,"item"===n.rel){if(n.type===e){r=n.href;break}Qd[n.type]&&(s=n.href)}}if(!r&&i)for(let t=0;t<i.length;++t){const e=i[t];if(o[e]){r=o[e];break}}if(!r){if(!s)throw new Error('Could not find "item" link');r=s}return n&&(r=tg(r,n)),r}function ng(t,e,i,n){let r=t.projection;if(!r&&(r=Qi(e.crs),!r))throw new Error(`Unsupported CRS: ${e.crs}`);const s=e.orderedAxes,o=!(s?s.slice(0,2).map((t=>t.replace(/E|X|Lon/i,"e").replace(/N|Y|Lat/i,"n"))).join(""):r.getAxisOrientation()).startsWith("en"),a=e.tileMatrices,l={};for(let t=0;t<a.length;++t){const e=a[t];l[e.id]=e}const h={},c=[];if(n)for(let t=0;t<n.length;++t){const e=n[t],i=e.tileMatrix;c.push(i),h[i]=e}else for(let t=0;t<a.length;++t){const e=a[t].id;c.push(e)}const u=c.length,d=new Array(u),g=new Array(u),f=new Array(u),p=new Array(u),m=[-1/0,-1/0,1/0,1/0];for(let t=0;t<u;++t){const e=c[t],i=l[e],n=i.pointOfOrigin;d[t]=o?[n[1],n[0]]:n,g[t]=i.cellSize,f[t]=[i.matrixWidth,i.matrixHeight],p[t]=[i.tileWidth,i.tileHeight];const r=h[e];if(r){const e=i.cellSize*i.tileWidth,n=d[t][0]+r.minTileCol*e,s=d[t][0]+(r.maxTileCol+1)*e,o=i.cellSize*i.tileHeight;let a,l;"bottomLeft"===i.cornerOfOrigin?(a=d[t][1]+r.minTileRow*o,l=d[t][1]+(r.maxTileRow+1)*o):(a=d[t][1]-(r.maxTileRow+1)*o,l=d[t][1]-r.minTileRow*o),Re(m,[n,a,s,l],m)}}const _=new Qc({origins:d,resolutions:g,sizes:f,tileSizes:p,extent:n?m:void 0}),y=t.context,x=t.url;return{grid:_,urlTemplate:i,urlFunction:function(t,e,r){if(!t)return;const s=c[t[0]],o=l[s],a="bottomLeft"===o.cornerOfOrigin,u={tileMatrix:s,tileCol:t[1],tileRow:a?-t[2]-1:t[2]};if(n){const t=h[o.id];if(u.tileCol<t.minTileCol||u.tileCol>t.maxTileCol||u.tileRow<t.minTileRow||u.tileRow>t.maxTileRow)return}Object.assign(u,y);const d=i.replace(/\{(\w+?)\}/g,(function(t,e){return u[e]}));return Cc(x,d)}}}function rg(t){return Tc(t.url).then((function(e){return function(t,e){const i=e.tileMatrixSetLimits;let n;if("map"===e.dataType)n=eg(e.links,t.mediaType,t.collections);else{if("vector"!==e.dataType)throw new Error('Expected tileset data type to be "map" or "vector"');n=ig(e.links,t.mediaType,t.supportedMediaTypes,t.collections)}if(e.tileMatrixSet)return ng(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 Tc(Cc(t.url,s)).then((function(e){return ng(t,e,n,i)}))}(t,e)}))}class sg extends wu{constructor(t){const e=t.projection||"EPSG:3857",i=t.extent||lu(e),n=t.t
2387ileGrid||su({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,projection:e,state:t.state,tileGrid:n,tileLoadFunction:t.tileLoadFunction?t.tileLoadFunction:og,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.tileKeysBySourceTileUrl_={},this.sourceTiles_={},this.overlaps_=null==t.overlaps||t.overlaps,this.tileClass=t.tileClass?t.tileClass:mc,this.tileGrids_={}}getOverlaps(){return this.overlaps_}getSourceTiles(t,e,i){if(i.getState()===Y){i.setState(H);const n=i.wrappedTileCoord,r=this.getTileGridForProjection(e),s=r.getTileCoordExtent(n),o=n[0],a=r.getResolution(o);qt(s,-a,s);const l=this.tileGrid,h=l.getExtent();h&&Re(s,h,s);const c=l.getZForResolution(a,this.zDirection);l.forEachTileCoord(s,c,(n=>{const r=this.tileUrlFunction(n,t,e);this.sourceTiles_[r]||(this.sourceTiles_[r]=new this.tileClass(n,r?Y:J,r,this.format_,this.tileLoadFunction));const s=this.sourceTiles_[r];i.sourceTiles.push(s),this.tileKeysBySourceTileUrl_[r]||(this.tileKeysBySourceTileUrl_[r]=[]),this.tileKeysBySourceTileUrl_[r].push(i.getKey());const o=s.getState();if(o<K){const t=e=>{this.handleTileChange(e);const n=s.getState();if(n===K||n===q){const e=s.getKey();e in i.errorTileKeys?s.getState()===K&&delete i.errorTileKeys[e]:i.loadingSourceTiles--,n===q?i.errorTileKeys[e]=!0:s.removeEventListener(v,t),0===i.loadingSourceTiles&&i.setState(y(i.errorTileKeys)?K:q)}};s.addEventListener(v,t),i.loadingSourceTiles++}o===Y&&(s.extent=l.getTileCoordExtent(n),s.projection=e,s.resolution=l.getResolution(n[0]),s.load())})),i.loadingSourceTiles||i.setState(i.sourceTiles.some((t=>t.getState()===q))?q:K)}return i.sourceTiles}removeSourceTiles(t){const e=t.sourceTiles;for(let t=0,i=e.length;t<i;++t){const i=e[t].getTileUrl(),n=this.getKey();if(!this.tileKeysBySourceTileUrl_[i])return;const r=this.tileKeysBySourceTileUrl_[i][n];-1!==r&&(this.tileKeysBySourceTileUrl_[i].splice(r,1),0===this.tileKeysBySourceTileUrl_[i].length&&(delete this.tileKeysBySourceTileUrl_[i],delete this.sourceTiles_[i]))}}getTile(t,e,i,n,r){const s=[t,e,i];let o=this.getTileCoordForTileUrlFunction(s,r);const a=this.getTileGrid().getExtent(),l=this.getTileGridForProjection(r);if(o&&a){const e=l.getTileCoordExtent(o);qt(e,-l.getResolution(t),e),Le(a,e)||(o=null)}let h=!0;if(null!==o){const e=this.tileGrid,i=l.getResolution(t),s=e.getZForResolution(i,1),a=l.getTileCoordExtent(o);qt(a,-i,a),e.forEachTileCoord(a,s,(t=>{h=h&&!this.tileUrlFunction(t,n,r)}))}const c=new fc(s,h?J:Y,o,this.getSourceTiles.bind(this,n,r),this.removeSourceTiles.bind(this));return c.key=this.getKey(),c}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=ms+1;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 Qc({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=no(this.getTileGridForProjection(i).getTileSize(t),this.tmpSize);return[Math.round(n[0]*e),Math.round(n[1]*e)]}}function og(t,e){t.setLoader((function(i,n,r){yc(e,t.getFormat(),i,n,r,t.onLoad.bind(t),t.onError.bind(t))}))}const ag='&#169; <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.';class lg extends Ns{constructor(t){super(t=t||{})}}class hg extends N{constructor(t){super(),this.ready=!0,this.boundHandleImageChange_=this.handleImageChange_.bind(this),this.layer_=t,this.staleKeys_=new Array,this.maxStaleKeys=5}getStaleKeys(){return this.staleKeys_}prependStaleKey(t){this.staleKeys_.unshift(t),this.staleKeys_.length>this.maxStaleKeys&&(this.staleKeys_.length=this.maxStaleKeys)}getFeatures(t){return G()}getData(t){return null}prepareFrame(t){return G()}renderFrame(t,e){return G()}forEachFeatureAtCoordinate(t,e,i,n,r){}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(t){const e=t.target;e.getState()!==zr.LOADED&&e.getState()!==zr.ERROR||this.renderIfReadyAndVisible()}loadImage(t){let e=t.getState();return e!=zr.LOADED&&e!=zr.ERROR&&t.addEventListener(v,this.boundHandleImageChange_),e==zr.IDLE&&(t.load(),e=t.getState()),e==zr.LOADED}renderIfReadyAndVisible(){const t=this.getLayer();t&&t.getVisible()&&"ready"===t.getSourceState()&&t.changed()}renderDeferred(t){}disposeInternal(){delete this.layer_,super.disposeInternal()}}class cg{constructor(){this.instructions_=[],this.zIndex=0,this.offset_=0,this.context_=new Proxy(_t(),{get:(t,e)=>{if("function"==typeof _t()[e])return this.instructions_[this.zIndex+this.offset_]||(this.instructions_[this.zIndex+this.offset_]=[]),this.instructions_[this.zIndex+this.offset_].push(e),this.pushMethodArgs_},set:(t,e,i)=>(this.instructions_[this.zIndex+this.offset_]||(this.instructions_[this.zIndex+this.offset_]=[]),this.instructions_[this.zIndex+this.offset_].push(e,i),!0)})}pushMethodArgs_=(...t)=>(this.instructions_[this.zIndex+this.offset_].push(t),this);pushFunction(t){this.instructions_[this.zIndex+this.offset_].push(t)}getContext(){return this.context_}draw(t){this.instructions_.forEach((e=>{for(let i=0,n=e.length;i<n;++i){const n=e[i];if("function"==typeof n){n(t);continue}const r=e[++i];if("function"==typeof t[n])t[n](...r);else{if("function"==typeof r){t[n]=r(t);continue}t[n]=r}}}))}clear(){this.instructions_.length=0,this.zIndex=0,this.offset_=0}offset(){this.offset_=this.instructions_.length,this.zIndex=0}}const ug=[];let dg=null;class gg extends hg{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.deferredContext_=null,this.containerReused=!1,this.frameState=null}
vendor: 10,109 bytes, line 2387
2387getImageData(t,e,i){let n;dg||(dg=pt(1,1,void 0,{willReadFrequently:!0})),dg.clearRect(0,0,1,1);try{dg.drawImage(t,e,i,1,1,0,0,1,1),n=dg.getImageData(0,0,1,1).data}catch(t){return dg=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&&c(To(t.style.backgroundColor),To(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&&(this.container.style.backgroundColor=null),!this.container){r=document.createElement("div"),r.className=n;let t=r.style;t.position="absolute",t.width="100%",t.height="100%",s=pt();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=be(i),r=Pe(i),s=ve(i),o=xe(i);Ut(e.coordinateToPixelTransform,n),Ut(e.coordinateToPixelTransform,r),Ut(e.coordinateToPixelTransform,s),Ut(e.coordinateToPixelTransform,o);const a=this.inversePixelTransform;Ut(a,n),Ut(a,r),Ut(a,s),Ut(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()}prepareContainer(t,e){const i=t.extent,n=t.viewState.resolution,r=t.viewState.rotation,s=t.pixelRatio,o=Math.round(Ie(i)/n*s),a=Math.round(Ce(i)/n*s);Vt(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/s,1/s,r,-o/2,-a/2),$t(this.inversePixelTransform,this.pixelTransform);const l=Yt(this.pixelTransform);if(this.useContainer(e,l,this.getBackground(t)),!this.containerReused){const t=this.context.canvas;t.width!=o||t.height!=a?(t.width=o,t.height=a):this.context.clearRect(0,0,o,a),l!==t.style.transform&&(t.style.transform=l)}}dispatchRenderEvent_(t,e,i){const n=this.getLayer();if(n.hasListener(t)){const r=new Il(t,this.inversePixelTransform,i,e);n.dispatchEvent(r)}}preRender(t,e){this.frameState=e,e.declutter||this.dispatchRenderEvent_(ls,t,e)}postRender(t,e){e.declutter||this.dispatchRenderEvent_(hs,t,e)}renderDeferredInternal(t){}getRenderContext(t){return t.declutter&&!this.deferredContext_&&(this.deferredContext_=new cg),t.declutter?this.deferredContext_.getContext():this.context}renderDeferred(t){t.declutter&&(this.dispatchRenderEvent_(ls,this.context,t),t.declutter&&this.deferredContext_&&(this.deferredContext_.draw(this.context),this.deferredContext_.clear()),this.renderDeferredInternal(t),this.dispatchRenderEvent_(hs,this.context,t))}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 Vt(this.tempTransform,a,l,h,c,-i,u,d)}disposeInternal(){delete this.frameState,super.disposeInternal()}}class fg extends gg{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=Re(a,xn(e.extent,n.projection))),!o[gs]&&!o[fs]&&!Fe(a))if(s){const t=n.projection,e=s.getImage(a,r,i,t);e&&(this.loadImage(e)?this.image=e:e.getState()===zr.EMPTY&&(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=Ut(e.pixelToCoordinateTransform,t.slice()),r=i.getExtent();if(r&&!te(r,n))return null;const s=this.image.getExtent(),o=this.image.getImage(),a=Ie(s),l=Math.floor(o.width*((n[0]-s[0])/a));if(l<0||l>=o.width)return null;const h=Ce(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,o]=Array.isArray(r)?r:[r,r],a=i.getPixelRatio(),l=t.layerStatesArray[t.layerIndex],h=t.pixelRatio,c=t.viewState,u=c.center,d=c.resolution,g=h*s/(d*a),f=h*o/(d*a);this.prepareContainer(t,e);const p=this.context.canvas.width,m=this.context.canvas.height,_=this.getRenderContext(t);let y=!1,x=!0;if(l.extent){const e=xn(l.extent,c.projection);x=Le(e,t.extent),y=x&&!ee(e,t.extent),y&&this.clipUnrotated(_,t,e)}const v=i.getImage(),S=Vt(this.tempTransform,p/2,m/2,g,f,0,a*(n[0]-u[0])/s,a*(u[1]-n[3])/o);this.renderedResolution=o*h/a;const E=v.width*S[0],w=v.height*S[3];if(this.getLayer().getSource().getInterpolate()||(_.imageSmoothingEnabled=!1),this.preRender(_,t),x&&E>=.5&&w>=.5){const t=S[4],e=S[5],i=l.opacity;1!==i&&(_.save(),_.globalAlpha=i),_.drawImage(v,0,0,+v.width,+v.height,t,e,E,w),1!==i&&_.restore()}return this.postRender(this.context,t),y&&_.restore(),_.imageSmoothingEnabled=!0,this.container}}class pg extends lg{constructor(t){super(t)}createRenderer(){return new fg(this)}getData(t){return super.getData(t)}}var mg="preload",_g="useInterimTilesOnError";class yg extends Ns{constructor(t){t=t||{};const e=Object.assign({},t),i=t.cacheSize;delete t.cacheSize,delete e.preload,delete e.useInterimTilesOnError,super(e),this.on,this.once,this.un,this.cacheSize_=i,this.setPreload(void 0!==t.preload?t.preload:0),this.setUseInterimTilesOnError(void 0===t.useInterimTilesOnError||t.useInterimTilesOnError)}getCacheSize(){return this.cacheSize_}getPreload(){return this.get(mg)}setPreload(t){this.set(mg,t)}getUseInterimTilesOnError(){return this.get(_g)}setUseInterimTilesOnError(t){this.set(_g,t)}getData(t){return super.getData(t)}}function xg(t,e,i,n){return`${t},${sc(e,i,n)}`}function vg(t,e,i){if(!(i in t))return t[i]=new Set([e]),!0;const n=t[i],r=n.has(e);return r||n.add(e),!r}function Sg(t,e,i){const n=t[i];return!!n&&n.delete(e)}function Eg(t,e){const i=t.layerStatesArray[t.layerIndex];i.extent&&(e=Re(e,xn(i.extent,t.viewState.projection)));const n=i.layer.getRenderSource();if(!n.getWrapX()){const i=n.getTileGridForProjection(t.viewState.projection).getExtent();i&&(e=Re(e,i))}return e}class wg extends gg{constructor(t,e){super(t),e=e||{},this.extentChanged=!0,this.renderComplete=!1,this.renderedExtent_=null,this.renderedPixelRatio,this.renderedProjection=null,this.renderedRevision,this.renderedTiles=[],this.renderedSourceKey_,this.renderedSourceRevision_,this.tempExtent=[1/0,1/0,-1/0,-1/0],this.tempTileRange_=new uc(0,0,0,0),this.tempTileCoord_=rc(0,0,0);const i=void 0!==e.cacheSize?e.cacheSize:512;this.tileCache_=new nc(i),this.renderedProjection_=void 0,this.maxStaleKeys=.5*i}getTileCache(){return this.tileCache_}getOrCreateTile(t,e,i,n){const r=this.tileCache_,s=this.getLayer().getSource(),o=xg(s.getKey(),t,e,i);let a;if(r.containsKey(o))a=r.get(o);else{if(a=s.getTile(t,e,i,n.pixelRatio,n.viewState.projection),!a)return null;r.set(o,a)}return a}getTile(t,e,i,n){const r=this.getOrCreateTile(t,e,i,n);return r||null}getData(t){const e=this.frameState;if(!e)return null;const i=this.getLayer(),n=Ut(e.pixelToCoordinateTransform,t.slice()),r=i.getExtent();if(r&&!te(r,n))return null;const s=e.viewState,o=i.getRenderSource(),a=o.getTileGridForProjection(s.projection),l=o.getTilePixelRatio(e.pixelRatio);for(let t=a.getZForResolution(s.resolution);t>=a.getMinZoom();--t){const i=a.getTileCoordForCoordAndZ(n,t),r=this.getTile(t,i[1],i[2],e);if(!r||r.getState()!==K)continue;const h=a.getOrigin(t),c=no(a.getTileSize(t)),u=a.getResolution(t);let d;if(r instanceof Hr||r instanceof Wc)d=r.getImage();else{if(!(r instanceof Lt))continue;if(d=Tt(r.getData()),!d)continue}const g=Math.floor(l*((n[0]-h[0])/u-i[1]*c[0])),f=Math.floor(l*((h[1]-n[1])/u-i[2]*c[1])),p=Math.round(l*o.getGutterForProjection(s.projection));return this.getImageData(d,g+p,f+p)}return null}prepareFrame(t){this.renderedProjection_?t.viewState.projection!==this.renderedProjection_&&(this.tileCache_.clear(),this.renderedProjection_=t.viewState.projection):this.renderedProjection_=t.viewState.projection;const e=this.getLayer().getSource();if(!e)return!1;const i=e.getRevision();return this.renderedRevision_?this.renderedRevision_!==i&&(this.renderedRevision_=i,this.renderedSourceKey_===e.getKey()&&this.tileCache_.clear()):this.renderedRevision_=i,!0}enqueueTiles(t,e,i,n,r){const s=t.viewState,o=this.getLayer(),a=o.getRenderSource(),l=a.getTileGridForProjection(s.projection),h=U(a);h in t.wantedTiles||(t.wantedTiles[h]={});const c=t.wantedTiles[h],u=o.getMapInternal(),d=Math.max(i-r,l.getMinZoom(),l.getZForResolution(Math.min(o.getMaxResolution(),u?u.getView().getResolutionForZoom(Math.max(o.getMinZoom(),0)):l.getResolution(0)),a.zDirection));for(let r=i;r>=d;--r){const i=l.getTileRangeForExtentAndZ(e,r,this.tempTileRange_),s=l.getResolution(r);for(let e=i.minX;e<=i.maxX;++e)for(let o=i.minY;o<=i.maxY;++o){const i=this.getTile(r,e,o,t);if(!i)continue;if(!vg(n,i,r))continue;const a=i.getKey();if(c[a]=!0,i.getState()===Y&&!t.tileQueue.isKeyQueued(a)){const n=rc(r,e,o,this.tempTileCoord_);t.tileQueue.enqueue([i,h,l.getTileCoordCenter(n),s])}}}}findStaleTile_(t,e){const i=this.tileCache_,n=t[0],r=t[1],s=t[2],o=this.getStaleKeys();for(let t=0;t<o.length;++t){const a=xg(o[t],n,r,s);if(i.containsKey(a)){const t=i.get(a);if(t.getState()===K)return t.endTransition(U(this)),vg(e,t,n),!0}}return!1}findAltTiles_(t,e,i,n){const r=t.getTileRangeForTileCoordAndZ(e,i,this.tempTileRange_);if(!r)return!1;let s=!0;const o=this.tileCache_,a=this.getLayer().getRenderSource().getKey();for(let t=r.minX;t<=r.maxX;++t)for(let e=r.minY;e<=r.maxY;++e){const r=xg(a,i,t,e);let l=!1;if(o.containsKey(r)){const t=o.get(r);t.getState()===K&&(vg(n,t,i),l=!0)}l||(s=!1)}return s}renderFrame(t,e){this.renderComplete=!0;const i=t.layerStatesArray[t.layerIndex],n=t.viewState,r=n.projection,o=n.resolution,a=n.center,l=t.pixelRatio,h=this.getLayer(),c=h.getSource(),u=c.getRevision(),d=c.getTileGridForProjection(r),g=d.getZForResolution(o,c.zDirection),f=d.getResolution(g),p=c.getKey();
2387this.renderedSourceKey_?this.renderedSourceKey_!==p&&(this.prependStaleKey(this.renderedSourceKey_),this.renderedSourceKey_=p):this.renderedSourceKey_=p;let m=t.extent;const _=c.getTilePixelRatio(l);this.prepareContainer(t,e);const y=this.context.canvas.width,x=this.context.canvas.height,v=i.extent&&xn(i.extent,r);v&&(m=Re(m,xn(i.extent,r)));const S=f*y/2/_,E=f*x/2/_,w=[a[0]-S,a[1]-E,a[0]+S,a[1]+E],T={};this.renderedTiles.length=0;const C=h.getPreload();if(t.nextExtent){const e=d.getZForResolution(n.nextResolution,c.zDirection),i=Eg(t,t.nextExtent);this.enqueueTiles(t,i,e,T,C)}const R=Eg(t,m);if(this.enqueueTiles(t,R,g,T,0),C>0&&setTimeout((()=>{this.enqueueTiles(t,R,g-1,T,C-1)}),0),!(g in T))return this.container;const b=U(this),P=t.time;for(const e of T[g]){const i=e.getState();if((e instanceof Wc||e instanceof Qu)&&i===J)continue;const n=e.tileCoord;if(i===K){if(1===e.getAlpha(b,P)){e.endTransition(b);continue}}this.renderComplete=!1;if(this.findStaleTile_(n,T)){Sg(T,e,g),t.animate=!0;continue}if(this.findAltTiles_(d,n,g+1,T))continue;const r=d.getMinZoom();for(let t=g-1;t>=r;--t){if(this.findAltTiles_(d,n,t,T))break}}const I=f/o*l/_,L=this.getRenderContext(t);Vt(this.tempTransform,y/2,x/2,I,I,0,-y/2,-x/2),i.extent&&this.clipUnrotated(L,t,v),c.getInterpolate()||(L.imageSmoothingEnabled=!1),this.preRender(L,t);const F=Object.keys(T).map(Number);let M;F.sort(s);const A=[],O=[];for(let e=F.length-1;e>=0;--e){const i=F[e],n=c.getTilePixelSize(i,l,r),s=d.getResolution(i)/f,o=n[0]*s*I,a=n[1]*s*I,h=d.getTileCoordForCoordAndZ(be(w),i),u=d.getTileCoordExtent(h),g=Ut(this.tempTransform,[_*(u[0]-w[0])/f,_*(w[3]-u[3])/f]),p=_*c.getGutterForProjection(r);for(const e of T[i]){if(e.getState()!==K)continue;const n=e.tileCoord,r=h[1]-n[1],s=Math.round(g[0]-(r-1)*o),l=h[2]-n[2],u=Math.round(g[1]-(l-1)*a),d=Math.round(g[0]-r*o),f=Math.round(g[1]-l*a),m=s-d,_=u-f,y=1===F.length;let x=!1;M=[d,f,d+m,f,d+m,f+_,d,f+_];for(let t=0,e=A.length;t<e;++t)if(!y&&i<O[t]){const e=A[t];Le([d,f,d+m,f+_],[e[0],e[3],e[4],e[7]])&&(x||(L.save(),x=!0),L.beginPath(),L.moveTo(M[0],M[1]),L.lineTo(M[2],M[3]),L.lineTo(M[4],M[5]),L.lineTo(M[6],M[7]),L.moveTo(e[6],e[7]),L.lineTo(e[4],e[5]),L.lineTo(e[2],e[3]),L.lineTo(e[0],e[1]),L.clip())}A.push(M),O.push(i),this.drawTile(e,t,d,f,m,_,p,y),x&&L.restore(),this.renderedTiles.unshift(e),this.updateUsedTiles(t.usedTiles,c,e)}}this.renderedRevision=u,this.renderedResolution=f,this.extentChanged=!this.renderedExtent_||!he(this.renderedExtent_,w),this.renderedExtent_=w,this.renderedPixelRatio=l,this.renderedProjection=r,this.postRender(this.context,t),i.extent&&L.restore(),L.imageSmoothingEnabled=!0;return t.postRenderFunctions.push(((t,e)=>{const i=U(c),n=e.wantedTiles[i],r=n?Object.keys(n).length:0;this.updateCacheSize(r),this.tileCache_.expireCache()})),this.container}updateCacheSize(t){this.tileCache_.highWaterMark=Math.max(this.tileCache_.highWaterMark,2*t)}drawTile(t,e,i,n,r,s,o,a){let l;if(t instanceof Lt){if(l=Tt(t.getData()),!l)throw new Error("Rendering array data is not yet supported")}else l=this.getTileImage(t);if(!l)return;const h=this.getRenderContext(e),c=U(this),u=e.layerStatesArray[e.layerIndex],d=u.opacity*(a?t.getAlpha(c,e.time):1),g=d!==h.globalAlpha;g&&(h.save(),h.globalAlpha=d),h.drawImage(l,o,o,l.width-2*o,l.height-2*o,i,n,r,s),g&&h.restore(),d!==u.opacity?e.animate=!0:a&&t.endTransition(c)}getImage(){const t=this.context;return t?t.canvas:null}getTileImage(t){return t.getImage()}updateUsedTiles(t,e,i){const n=U(e);n in t||(t[n]={}),t[n][i.getKey()]=!0}}class Tg extends yg{constructor(t){super(t)}createRenderer(){return new wg(this,{cacheSize:this.getCacheSize()})}}function Cg(t){return function(e){const i=e.buffers,n=e.meta,r=e.imageOps,s=e.width,o=e.height,a=i.length,l=i[0].byteLength;if(r){const e=new Array(a);for(let t=0;t<a;++t)e[t]=new ImageData(new Uint8ClampedArray(i[t]),s,o);return t(e,n).data.buffer}const h=new Uint8ClampedArray(l),c=new Array(a),u=new Array(a);for(let t=0;t<a;++t)c[t]=new Uint8ClampedArray(i[t]),u[t]=[0,0,0,0];for(let e=0;e<l;e+=4){for(let t=0;t<a;++t){const i=c[t];u[t][0]=i[e],u[t][1]=i[e+1],u[t][2]=i[e+2],u[t][3]=i[e+3]}const i=t(u,n);h[e]=i[0],h[e+1]=i[1],h[e+2]=i[2],h[e+3]=i[3]}return h.buffer}}function Rg(t,e){const i=Object.keys(t.lib||{}).map((function(e){return"const "+e+" = "+t.lib[e].toString()+";"})).concat(["const __minion__ = ("+Cg.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 bg extends n{constructor(t){let e;super(),this.imageOps_=!!t.imageOps,e=0===t.threads?0:this.imageOps_?1:t.threads||
vendor: 31,813 bytes, line 2387
23871;const i=new Array(e);if(e)for(let n=0;n<e;++n)i[n]=Rg(t,this.onWorkerMessage_.bind(this,n));else i[0]=function(t,e){const i=Cg(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,new ImageData(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 Pg="beforeoperations",Ig="afteroperations";class Lg extends t{constructor(t,e,i){super(t),this.extent=e.extent,this.resolution=e.viewState.resolution/e.pixelRatio,this.data=i}}class Fg extends Ld{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]=Og(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(v,e);var i;this.useResolutions_=null!==t.resolutions,this.tileQueue_=new Ql((function(){return 1}),this.processSources_.bind(this)),this.requestedFrameState_,this.renderedImageCanvas_=null,this.renderedRevision_,this.frameState_={animate:!1,coordinateToPixelTransform:[1,0,0,1,0,0],declutter: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:U(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 Kc?r:r.getSource();if(!s)continue;const o=s.getAttributions()?.(e);"string"==typeof o?i.push(o):void 0!==o&&i.push(...o)}return i})),void 0!==t.operation&&this.setOperation(t.operation,t.lib)}setOperation(t,e){this.processor_&&this.processor_.dispose(),this.processor_=new bg({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=Se(t);n.size[0]=Math.ceil(Ie(t)/e),n.size[1]=Math.ceil(Ce(t)/e),n.extent=[r[0]-n.size[0]*e/2,r[1]-n.size[1]*e/2,r[0]+n.size[0]*e/2,r[1]+n.size[1]*e/2],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(),!t||"ready"!==t.getState()){e=!1;break}return e}getImage(t,e,i,n){if(!this.allSourcesReady_())return null;this.tileQueue_.loadMoreTiles(16,16),e=this.findNearestResolution(e);const r=this.updateFrameState_(t,e,n);if(this.requestedFrameState_=r,this.renderedImageCanvas_){const t=this.renderedImageCanvas_.getResolution(),i=this.renderedImageCanvas_.getExtent();e===t&&he(r.extent,i)||(this.renderedImageCanvas_=null)}return this.renderedImageCanvas_&&this.getRevision()===this.renderedRevision_||this.processSources_(),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,t.renderTargets={};const e=Ag(this.layers_[n],t);if(!e)return;i[n]=e}const n={};this.dispatchEvent(new Lg(Pg,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||!he(r,this.requestedFrameState_.extent))return;let o;if(this.renderedImageCanvas_)o=this.renderedImageCanvas_.getImage().getContext("2d");else{o=pt(Math.round(Ie(r)/s),Math.round(Ce(r)/s)),this.renderedImageCanvas_=new Yr(r,s,1,o.canvas)}o.putImageData(i,0,0),t.animate?requestAnimationFrame(this.changed.bind(this)):this.changed(),this.renderedRevision_=this.getRevision(),this.dispatchEvent(new Lg(Ig,t,n))}getResolutions(t){if(!this.useResolutions_)return null;let e=super.getResolutions();if(!e)for(let i=0,n=this.layers_.length;i<n;++i){if(e=this.layers_[i].getSource().getResolutions(t),e)break}return e}disposeInternal(){this.processor_&&this.processor_.dispose(),super.disposeInternal()}}Fg.prototype.dispose;let Mg=null;function Ag(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(Mg){const t=Mg.canvas;t.width!==n||t.height!==r?Mg=pt(n,r,void 0,{willReadFrequently:!0}):Mg.clearRect(0,0,n,r)}else Mg=pt(n,r,void 0,{willReadFrequently:!0});return Mg.drawImage(o,0,0,n,r),Mg.getImageData(0,0,n,r)}function Og(t){let e;return t instanceof Kc?t instanceof hu?e=new Tg({source:t}):t instanceof Ld&&(e=new pg({source:t})):e=t,e}const Dg={stamen_terrain:{extension:"png"},stamen_terrain_background:{extension:"png"},stamen_terrain_labels:{extension:"png"},stamen_terrain_lines:{extension:"png"},stamen_toner_background:{extension:"png"},stamen_toner:{extension:"png"},stamen_toner_labels:{extension:"png"},stamen_toner_lines:{extension:"png"},stamen_toner_lite:{extension:"png"},stamen_watercolor:{extension:"jpg"},alidade_smooth:{extension:"png"},alidade_smooth_dark:{extension:"png"},alidade_satellite:{extension:"png"},outdoors:{extension:"png"},osm_bright:{extension:"png"}},Ng={stamen_terrain:{minZoom:0,maxZoom:18,retina:!0},stamen_toner:{minZoom:0,maxZoom:20,retina:!0},stamen_watercolor:{minZoom:1,maxZoom:18,retina:!1}};class kg extends nt{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==J&&!0===i?(this.state=Y,O(this,v,(i=>{e(this.getData(t))})),this.loadInternal_()):!0===i?setTimeout((()=>{e(this.getData(t))}),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=K,this.changed()}loadInternal_(){if(this.state==Y)if(this.state=H,this.jsonp_)Sc(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(J)}}const Gg=34962,jg=34963,Ug=35044,Bg=35048,zg=5126,Xg=["experimental-webgl","webgl","webkit-3d","moz-webgl"];function Vg(t,e){e=Object.assign({preserveDrawingBuffer:!0,antialias:!at},e);const i=Xg.length;for(let n=0;n<i;++n)try{const i=t.getContext(Xg[n],e);if(i)return i}catch(t){}return null}let $g=null;const Wg="http://www.w3.org/2001/XMLSchema-instance";function Zg(t,e){return yf().createElementNS(t,e)}function Yg(t,e){return Hg(t,e,[]).join("")}function Hg(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)Hg(n,e,i)}return i}function Kg(t){return"documentElement"in t}function qg(t,e,i){return t.getAttributeNS(e,i)||""}function Jg(t){return(new DOMParser).parseFromString(t,"application/xml")}function Qg(t,e){return function(i,n){const r=t.call(e??this,i,n);if(void 0!==r){h(n[n.length-1],r)}}}function tf(t,e){return function(i,n){const r=t.call(e??this,i,n);if(void 0!==r){n[n.length-1].push(r)}}}function ef(t,e){return function(i,n){const r=t.call(e??this,i,n);void 0!==r&&(n[n.length-1]=r)}}function nf(t,e,i){return function(n,r){const s=t.call(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 rf(t,e,i){return function(n,r){const s=t.call(i??this,n,r);if(void 0!==s){r[r.length-1][void 0!==e?e:n.localName]=s}}}function sf(t,e){return function(i,n,r){t.call(e??this,i,n,r);r[r.length-1].node.appendChild(i)}}function of(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=af(e.localName)}gf(i,n,r,s)}}function af(t,e){return function(i,n,r){const s=n[n.length-1].node;let o=t;void 0===o&&(o=r);return Zg(void 0!==e?e:s.namespaceURI,o)}}const lf=af();function hf(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 cf(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 uf(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 df(t,e,i,n,r){return n.push(t),uf(e,i,n,r),n.pop()}function gf(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(s,a,n,void 0!==r?r[h]:void 0),void 0!==l&&t[l.namespaceURI][l.localName].call(s,l,a,n))}function ff(t,e,i,n,r,s,o){return r.push(t),gf(e,i,n,r,s,o),r.pop()}let pf,mf;function _f(){return void 0===pf&&"undefined"!=typeof XMLSerializer&&(pf=new XMLSerializer),pf}function yf(){return void 0===mf&&"undefined"!=typeof document&&(mf=document.implementation.createDocument("","",null)),mf}class xf extends x{constructor(t){super(),this.tile,this.handleTileChange_=this.handleTileChange_.bind(this),this.gutter=t.gutter||0,this.helper=t.helper,this.loaded=!1,this.ready=!1}setTile(t){if(t!==this.tile)if(this.tile&&this.tile.removeEventListener(v,this.handleTileChange_),this.tile=t,this.loaded=t.getState()===K,this.loaded)this.uploadTile();else{if(t instanceof Hr){const e=t.getImage();e instanceof Image&&!e.crossOrigin&&(e.crossOrigin="anonymous")}t.addEventListener(v,this.handleTileChange_)}}uploadTile(){G()}setReady(){this.ready=!0,this.dispatchEvent(v)}handleTileChange_(){this.tile.getState()===K&&(this.loaded=!0,this.uploadTile())}setHelper(t){this.helper=t,this.helper&&this.loaded&&this.uploadTile()}disposeInternal(){this.setHelper(null),this.tile.removeEventListener(v,this.handleTileChange_)}}const vf=Ug;class Sf{constructor(t,e){this.array_=null,this.type_=t,Ft(t===Gg||t===jg,"A `WebGLArrayBuffer` must either be of type `ELEMENT_ARRAY_BUFFER` or `ARRAY_BUFFER`"),this.usage_=void 0!==e?e:vf}ofSize(t){return this.array_=new(Ef(this.type_))(t),this}fromArray(t){return this.array_=Ef(this.type_).from(t),this}fromArrayBuffer(t){return this.array_=new(Ef(this.type_))(t),this}getType(){return this.type_}getArray(){return this.array_}setArray(t){const e=Ef(this.type_);if(!(t instanceof e))throw new Error(`Expected ${e}`);this.array_=t}getUsage(){return this.usage_}getSize(){return this.array_?this.array_.length:0}}function Ef(t){switch(t){case Gg:return Float32Array;case jg:return Uint32Array;default:return Float32Array}}var wf="webglcontextlost",Tf="webglcontextrestored";class Cf{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(),this.depthBuffer_=e.createRenderbuffer();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((i=>{this.uniforms_.push({value:t.uniforms[i],location:e.getUniformLocation(this.renderTargetProgram_,i)})}))}getRenderTargetTexture(){return this.renderTargetTexture_}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.bindRenderbuffer(e.RENDERBUFFER,this.getDepthBuffer()),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),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,i[0],i[1]),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,this.depthBuffer_)}}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=U(r.canvas);if(!t.renderTargets[e]){const i=r.getContextAttributes();i&&i.preserveDrawingBuffer&&(r.clearColor(0,0,0,0),r.clearDepth(1),r.clear(r.COLOR_BUFFER_BIT|r.DEPTH_BUFFER_BIT)),t.renderTargets[e]=!0}}r.disable(r.DEPTH_TEST),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_}getDepthBuffer(){return this.depthBuffer_}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 Rf(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}function bf(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 Pf={PROJECTION_MATRIX:"u_projectionMatrix",SCREEN_TO_WORLD_MATRIX:"u_screenToWorldMatrix",TIME:"u_time",ZOOM:"u_zoom",RESOLUTION:"u_resolution",ROTATION:"u_rotation",VIEWPORT_SIZE_PX:"u_viewportSizePx",PIXEL_RATIO:"u_pixelRatio",HIT_DETECTION:"u_hitDetection"},If={UNSIGNED_BYTE:5121,UNSIGNED_SHORT:5123,UNSIGNED_INT:5125,FLOAT:zg},Lf={};function Ff(t){return"shared/"+t}let Mf=0;class Af extends n{constructor(t){super(),t=t||{},this.boundHandleWebGLContextLost_=this.handleWebGLContextLost.bind(this),this.boundHandleWebGLContextRestored_=this.handleWebGLContextRestored.bind(this),this.canvasCacheKey_=t.canvasCacheKey?Ff(t.canvasCacheKey):function(){const t="unique/"+Mf;return Mf+=1,t}(),this.gl_=function(t){let e=Lf[t];if(!e){const i=document.createElement("canvas");i.width=1,i.height=1,i.style.position="absolute",i.style.left="0",e={users:0,context:Vg(i)},Lf[t]=e}return e.users+=1,e.context}(this.canvasCacheKey_),this.bufferCache_={},this.extensionCache_={},this.currentProgram_=null,this.needsToBeRecreated_=!1;const e=this.gl_.canvas;e.addEventListener(wf,this.boundHandleWebGLContextLost_),e.addEventListener(Tf,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.uniformLocationsByProgram_={},this.attribLocationsByProgram_={},this.uniforms_=[],t.uniforms&&this.setUniforms(t.uniforms),this.postProcessPasses_=t.postProcesses?t.postProcesses.map((t=>new Cf({webGlContext:this.gl_,scaleRatio:t.scaleRatio,vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,uniforms:t.uniforms}))):[new Cf({webGlContext:this.gl_})],this.shaderCompileErrors_=null,this.startTime_=Date.now()}setUniforms(t){this.uniforms_=[],this.addUniforms(t)}addUniforms(t){for(const e in t)this.uniforms_.push({name:e,value:t[e]})}canvasCacheKeyMatches(t){return this.canvasCacheKey_===Ff(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.gl_,i=U(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.gl_;this.bindBuffer(t),e.bufferData(t.getType(),t.getArray(),t.getUsage())}deleteBuffer(t){const e=U(t);delete this.bufferCache_[e]}disposeInternal(){const t=this.gl_.canvas;t.removeEventListener(wf,this.boundHandleWebGLContextLost_),t.removeEventListener(Tf,this.boundHandleWebGLContextRestored_),function(t){const e=Lf[t];if(!e)return;if(e.users-=1,e.users>0)return;const i=e.context,n=i.getExtension("WEBGL_lose_context");n&&n.loseContext();const r=i.canvas;r.width=1,r.height=1,delete Lf[t]}(this.canvasCacheKey_),delete this.gl_}prepareDraw(t,e,i){const n=this.gl_,r=this.getCanvas(),s=t.size,o=t.pixelRatio;r.width===s[0]*o&&r.height===s[1]*o||(r.width=s[0]*o,r.height=s[1]*o,r.style.width=s[0]+"px",r.style.height=s[1]+"px");for(let e=this.postProcessPasses_.length-1;e>=0;e--)this.postProcessPasses_[e].init(t);n.bindTexture(n.TEXTURE_2D,null),n.clearColor(0,0,0,0),n.depthRange(0,1),n.clearDepth(1),n.clear(n.COLOR_BUFFER_BIT|n.DEPTH_BUFFER_BIT),n.enable(n.BLEND),n.blendFunc(n.ONE,e?n.ZERO:n.ONE_MINUS_SRC_ALPHA),i?(n.enable(n.DEPTH_TEST),n.depthFunc(n.LEQUAL)):n.disable(n.DEPTH_TEST)}bindFrameBuffer(t,e){const i=this.getGL();i.bindFramebuffer(i.FRAMEBUFFER,t),e&&i.framebufferTexture2D(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,e,0)}bindInitialFrameBuffer(){const t=this.getGL(),e=this.postProcessPasses_[0].getFrameBuffer();t.bindFramebuffer(t.FRAMEBUFFER,e);const i=this.postProcessPasses_[0].getRenderTargetTexture();t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,i,0)}bindTexture(t,e,i){const n=this.gl_;n.activeTexture(n.TEXTURE0+e),n.bindTexture(n.TEXTURE_2D,t),n.uniform1i(this.getUniformLocation(i),e)}bindAttribute(t,e,i){const n=this.getGL();this.bindBuffer(t);const r=this.getAttributeLocation(e);n.enableVertexAttribArray(r),n.vertexAttribPointer(r,i,n.FLOAT,!1,0,0)}prepareDrawToRenderTarget(t,e,i,n){const r=this.gl_,s=e.getSize();r.bindFramebuffer(r.FRAMEBUFFER,e.getFramebuffer()),r.bindRenderbuffer(r.RENDERBUFFER,e.getDepthbuffer()),r.viewport(0,0,s[0],s[1]),r.bindTexture(r.TEXTURE_2D,e.getTexture()),r.clearColor(0,0,0,0),r.depthRange(0,1),r.clearDepth(1),r.clear(r.COLOR_BUFFER_BIT|r.DEPTH_BUFFER_BIT),r.enable(r.BLEND),r.blendFunc(r.ONE,i?r.ZERO:r.ONE_MINUS_SRC_ALPHA),n?(r.enable(r.DEPTH_TEST),r.depthFunc(r.LEQUAL)):r.disable(r.DEPTH_TEST)}drawElements(t,e){const i=this.gl_;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.gl_.canvas}getGL(){return this.gl_}applyFrameState(t){const e=t.size,i=t.viewState.rotation,n=t.pixelRatio;this.setUniformFloatValue(Pf.TIME,.001*(Date.now()-this.startTime_)),this.setUniformFloatValue(Pf.ZOOM,t.viewState.zoom),this.setUniformFloatValue(Pf.RESOLUTION,t.viewState.resolution),this.setUniformFloatValue(Pf.PIXEL_RATIO,n),this.setUniformFloatVec2(Pf.VIEWPORT_SIZE_PX,[e[0],e[1]]),this.setUniformFloatValue(Pf.ROTATION,i)}applyHitDetectionUniform(t){const e=this.getUniformLocation(Pf.HIT_DETECTION);this.getGL().uniform1i(e,t?1:0),t&&this.setUniformFloatValue(Pf.PIXEL_RATIO,.5)}applyUniforms(t){const e=this.gl_;let i,n=0;this.uniforms_.forEach((r=>{if(i="function"==typeof r.value?r.value(t):r.value,i instanceof HTMLCanvasElement||i instanceof HTMLImageElement||i instanceof ImageData||i instanceof WebGLTexture){i instanceof WebGLTexture&&!r.texture?(r.prevValue=void 0,r.texture=i):r.texture||(r.prevValue=void 0,r.texture=e.createTexture()),this.bindTexture(r.texture,n,r.name),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);const t=!(i instanceof HTMLImageElement)||i.complete;i instanceof WebGLTexture||!t||r.prevValue===i||(r.prevValue=i,e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,i)),n++}else if(Array.isArray(i)&&6===i.length)this.setUniformMatrixValue(r.name,bf(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)}))}useProgram(t,e){this.gl_.useProgram(t),this.currentProgram_=t,e&&(this.applyFrameState(e),this.applyUniforms(e))}compileShader(t,e){const i=this.gl_,n=i.createShader(e);return i.shaderSource(n,t),i.compileShader(n),n}getProgram(t,e){const i=this.gl_,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 compilation 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.getProgramInfoLog(s)}`;throw new Error(t)}return s}getUniformLocation(t){const e=U(this.currentProgram_);return void 0===this.uniformLocationsByProgram_[e]&&(this.uniformLocationsByProgram_[e]={}),void 0===this.uniformLocationsByProgram_[e][t]&&(this.uniformLocationsByProgram_[e][t]=this.gl_.getUniformLocation(this.currentProgram_,t)),this.uniformLocationsByProgram_[e][t]}getAttributeLocation(t){const e=U(this.currentProgram_);return void 0===this.attribLocationsByProgram_[e]&&(this.attribLocationsByProgram_[e]={}),void 0===this.attribLocationsByProgram_[e][t]&&(this.attribLocationsByProgram_[e][t]=this.gl_.getAttribLocation(this.currentProgram_,t)),this.attribLocationsByProgram_[e][t]}makeProjectionTransform(t,e){const i=t.size,n=t.viewState.rotation,r=t.viewState.resolution,s=t.viewState.center;return Vt(e,0,0,2/(r*i[0]),2/(r*i[1]),-n,-s[0],-s[1]),e}setUniformFloatValue(t,e){this.gl_.uniform1f(this.getUniformLocation(t),e)}setUniformFloatVec2(t,e){this.gl_.uniform2fv(this.getUniformLocation(t),e)}setUniformFloatVec4(t,e){this.gl_.uniform4fv(this.getUniformLocation(t),e)}setUniformMatrixValue(t,e){this.gl_.uniformMatrix4fv(this.getUniformLocation(t),!1,e)}enableAttributeArray_(t,e,i,n,r){const s=this.getAttributeLocation(t);s<0||(this.gl_.enableVertexAttribArray(s),this.gl_.vertexAttribPointer(s,e,i,!1,n,r))}enableAttributes(t){const e=Of(t);let i=0;for(let n=0;n<t.length;n++){const r=t[n];this.enableAttributeArray_(r.name,r.size,r.type||zg,e,i),i+=r.size*Df(r.type)}}handleWebGLContextLost(t){_(this.bufferCache_),this.currentProgram_=null,t.preventDefault()}handleWebGLContextRestored(){this.needsToBeRecreated_=!0}needsToBeRecreated(){return this.needsToBeRecreated_}createTexture(t,e,i,n){const r=this.gl_;i=i||r.createTexture();const s=n?r.NEAREST:r.LINEAR;r.bindTexture(r.TEXTURE_2D,i),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MIN_FILTER,s),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_MAG_FILTER,s),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,r.CLAMP_TO_EDGE),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,r.CLAMP_TO_EDGE);const o=r.RGBA,a=r.RGBA,l=r.UNSIGNED_BYTE;return e instanceof Uint8Array?r.texImage2D(r.TEXTURE_2D,0,o,t[0],t[1],0,a,l,e):e?r.texImage2D(r.TEXTURE_2D,0,o,a,l,e):r.texImage2D(r.TEXTURE_2D,0,o,t[0],t[1],0,a,l,null),i}}function Of(t){let e=0;for(let i=0;i<t.length;i++){const n=t[i];e+=n.size*Df(n.type)}return e}function Df(t){switch(t){case If.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case If.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case If.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case If.FLOAT:default:return Float32Array.BYTES_PER_ELEMENT}}class Nf{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_}delete(t){this.texture_&&t.deleteTexture(this.texture_),this.texture_=null}}const kf=new Uint8Array(4);class Gf{constructor(t,e){this.helper_=t;const i=t.getGL();this.texture_=i.createTexture(),this.framebuffer_=i.createFramebuffer(),this.depthbuffer_=i.createRenderbuffer(),this.size_=e||[1,1],this.data_=new Uint8Array(0),this.dataCacheDirty_=!0,this.updateSize_()}setSize(t){c(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 kf[0]=0,kf[1]=0,kf[2]=0,kf[3]=0,kf;this.readAll();const i=Math.floor(t)+(this.size_[1]-Math.floor(e)-1)*this.size_[0];return kf[0]=this.data_[4*i],kf[1]=this.data_[4*i+1],kf[2]=this.data_[4*i+2],kf[3]=this.data_[4*i+3],kf}getTexture(){return this.texture_}getFramebuffer(){return this.framebuffer_}getDepthbuffer(){return this.depthbuffer_}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),e.bindRenderbuffer(e.RENDERBUFFER,this.depthbuffer_),e.renderbufferStorage(e.RENDERBUFFER,e.DEPTH_COMPONENT16,t[0],t[1]),e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,this.depthbuffer_),this.data_=new Uint8Array(t[0]*t[1]*4)}}function jf(t,e,i=2){const n=e&&e.length,r=n?e[0]*i:t.length;let s=Uf(t,0,r,i,!0);const o=[];if(!s||s.next===s.prev)return o;let a,l,h;if(n&&(s=function(t,e,i,n){const r=[];for(let i=0,s=e.length;i<s;i++){const o=Uf(t,e[i]*n,i<s-1?e[i+1]*n:t.length,n,!1);o===o.next&&(o.steiner=!0),r.push(qf(o))}r.sort(Zf);for(let t=0;t<r.length;t++)i=Yf(r[t],i);return i}(t,e,s,i)),t.length>80*i){a=1/0,l=1/0;let e=-1/0,n=-1/0;for(let s=i;s<r;s+=i){const i=t[s],r=t[s+1];i<a&&(a=i),r<l&&(l=r),i>e&&(e=i),r>n&&(n=r)}h=Math.max(e-a,n-l),h=0!==h?32767/h:0}return zf(s,o,i,a,l,h,0),o}function Uf(t,e,i,n,r){let s;if(r===function(t,e,i,n){let r=0;for(let s=e,o=i-n;s<i;s+=n)r+=(t[o]-t[s])*(t[s+1]+t[o+1]),o=s;return r}
vendor: 4,214 bytes, line 2387
2387(t,e,i,n)>0)for(let r=e;r<i;r+=n)s=ap(r/n|0,t[r],t[r+1],s);else for(let r=i-n;r>=e;r-=n)s=ap(r/n|0,t[r],t[r+1],s);return s&&ep(s,s.next)&&(lp(s),s=s.next),s}function Bf(t,e){if(!t)return t;e||(e=t);let i,n=t;do{if(i=!1,n.steiner||!ep(n,n.next)&&0!==tp(n.prev,n,n.next))n=n.next;else{if(lp(n),n=e=n.prev,n===n.next)break;i=!0}}while(i||n!==e);return e}function zf(t,e,i,n,r,s,o){if(!t)return;!o&&s&&function(t,e,i,n){let r=t;do{0===r.z&&(r.z=Kf(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){let e,i=1;do{let n,r=t;t=null;let s=null;for(e=0;r;){e++;let o=r,a=0;for(let t=0;t<i&&(a++,o=o.nextZ,o);t++);let l=i;for(;a>0||l>0&&o;)0!==a&&(0===l||!o||r.z<=o.z)?(n=r,r=r.nextZ,a--):(n=o,o=o.nextZ,l--),s?s.nextZ=n:t=n,n.prevZ=s,s=n;r=o}s.nextZ=null,i*=2}while(e>1)}(r)}(t,n,r,s);let a=t;for(;t.prev!==t.next;){const l=t.prev,h=t.next;if(s?Vf(t,n,r,s):Xf(t))e.push(l.i,t.i,h.i),lp(t),t=h.next,a=h.next;else if((t=h)===a){o?1===o?zf(t=$f(Bf(t),e),e,i,n,r,s,2):2===o&&Wf(t,e,i,n,r,s):zf(Bf(t),e,i,n,r,s,1);break}}}function Xf(t){const e=t.prev,i=t,n=t.next;if(tp(e,i,n)>=0)return!1;const r=e.x,s=i.x,o=n.x,a=e.y,l=i.y,h=n.y,c=r<s?r<o?r:o:s<o?s:o,u=a<l?a<h?a:h:l<h?l:h,d=r>s?r>o?r:o:s>o?s:o,g=a>l?a>h?a:h:l>h?l:h;let f=n.next;for(;f!==e;){if(f.x>=c&&f.x<=d&&f.y>=u&&f.y<=g&&Jf(r,a,s,l,o,h,f.x,f.y)&&tp(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function Vf(t,e,i,n){const r=t.prev,s=t,o=t.next;if(tp(r,s,o)>=0)return!1;const a=r.x,l=s.x,h=o.x,c=r.y,u=s.y,d=o.y,g=a<l?a<h?a:h:l<h?l:h,f=c<u?c<d?c:d:u<d?u:d,p=a>l?a>h?a:h:l>h?l:h,m=c>u?c>d?c:d:u>d?u:d,_=Kf(g,f,e,i,n),y=Kf(p,m,e,i,n);let x=t.prevZ,v=t.nextZ;for(;x&&x.z>=_&&v&&v.z<=y;){if(x.x>=g&&x.x<=p&&x.y>=f&&x.y<=m&&x!==r&&x!==o&&Jf(a,c,l,u,h,d,x.x,x.y)&&tp(x.prev,x,x.next)>=0)return!1;if(x=x.prevZ,v.x>=g&&v.x<=p&&v.y>=f&&v.y<=m&&v!==r&&v!==o&&Jf(a,c,l,u,h,d,v.x,v.y)&&tp(v.prev,v,v.next)>=0)return!1;v=v.nextZ}for(;x&&x.z>=_;){if(x.x>=g&&x.x<=p&&x.y>=f&&x.y<=m&&x!==r&&x!==o&&Jf(a,c,l,u,h,d,x.x,x.y)&&tp(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;v&&v.z<=y;){if(v.x>=g&&v.x<=p&&v.y>=f&&v.y<=m&&v!==r&&v!==o&&Jf(a,c,l,u,h,d,v.x,v.y)&&tp(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function $f(t,e){let i=t;do{const n=i.prev,r=i.next.next;!ep(n,r)&&ip(n,i,i.next,r)&&sp(n,r)&&sp(r,n)&&(e.push(n.i,i.i,r.i),lp(i),lp(i.next),i=t=r),i=i.next}while(i!==t);return Bf(i)}function Wf(t,e,i,n,r,s){let o=t;do{let t=o.next.next;for(;t!==o.prev;){if(o.i!==t.i&&Qf(o,t)){let a=op(o,t);return o=Bf(o,o.next),a=Bf(a,a.next),zf(o,e,i,n,r,s,0),void zf(a,e,i,n,r,s,0)}t=t.next}o=o.next}while(o!==t)}function Zf(t,e){return t.x-e.x}function Yf(t,e){const i=function(t,e){let i=e;const n=t.x,r=t.y;let s,o=-1/0;do{if(r<=i.y&&r>=i.next.y&&i.next.y!==i.y){const t=i.x+(r-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(t<=n&&t>o&&(o=t,s=i.x<i.next.x?i:i.next,t===n))return s}i=i.next}while(i!==e);if(!s)return null;const a=s,l=s.x,h=s.y;let c=1/0;i=s;do{if(n>=i.x&&i.x>=l&&n!==i.x&&Jf(r<h?n:o,r,l,h,r<h?o:n,r,i.x,i.y)){const e=Math.abs(r-i.y)/(n-i.x);sp(i,t)&&(e<c||e===c&&(i.x>s.x||i.x===s.x&&Hf(s,i)))&&(s=i,c=e)}i=i.next}while(i!==a);return s}(t,e);if(!i)return e;const n=op(i,t);return Bf(n,n.next),Bf(i,i.next)}function Hf(t,e){return tp(t.prev,t,e.prev)<0&&tp(e.next,t,t.next)<0}function Kf(t,e,i,n,r){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*r|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-n)*r|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function qf(t){let 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 Jf(t,e,i,n,r,s,o,a){return(r-o)*(e-a)>=(t-o)*(s-a)&&(t-o)*(n-a)>=(i-o)*(e-a)&&(i-o)*(s-a)>=(r-o)*(n-a)}function Qf(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&ip(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(sp(t,e)&&sp(e,t)&&function(t,e){let i=t,n=!1;const 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)&&(tp(t.prev,t,e.prev)||tp(t,e.prev,e))||ep(t,e)&&tp(t.prev,t,t.next)>0&&tp(e.prev,e,e.next)>0)}
vendor: 1,140 bytes, line 2387
2387function tp(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function ep(t,e){return t.x===e.x&&t.y===e.y}function ip(t,e,i,n){const r=rp(tp(t,e,i)),s=rp(tp(t,e,n)),o=rp(tp(i,n,t)),a=rp(tp(i,n,e));return r!==s&&o!==a||(!(0!==r||!np(t,i,e))||(!(0!==s||!np(t,n,e))||(!(0!==o||!np(i,t,n))||!(0!==a||!np(i,e,n)))))}function np(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 rp(t){return t>0?1:t<0?-1:0}function sp(t,e){return tp(t.prev,t,t.next)<0?tp(t,e,t.next)>=0&&tp(t,t.prev,e)>=0:tp(t,e,t.prev)<0||tp(t,t.next,e)<0}function op(t,e){const i=hp(t.i,t.x,t.y),n=hp(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 ap(t,e,i,n){const r=hp(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 lp(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 hp(t,e,i){return{i:t,x:e,y:i,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}const cp=.985,up=[],dp={vertexPosition:0,indexPosition:0};
vendor: 15,556 bytes, line 2387
2387function gp(t,e,i,n,r){t[e+0]=i,t[e+1]=n,t[e+2]=r}function fp(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 pp(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 mp(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 _p(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;mp(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 yp=null;class xp extends xf{constructor(t){super(t),this.textures=[],this.renderSize_=no(t.grid.getTileSize(t.tile.tileCoord[0])),this.bandCount=NaN;const e=new Sf(Gg,Ug);e.fromArray([0,1,1,1,1,0,0,0]),this.helper.flushBufferData(e),this.coords=e,this.setTile(t.tile)}setHelper(t){const e=this.helper?.getGL();if(e){this.helper.deleteBuffer(this.coords);for(let t=0;t<this.textures.length;++t)e.deleteTexture(this.textures[t])}super.setHelper(t),t&&t.flushBufferData(this.coords)}uploadTile(){const t=this.helper,e=t.getGL(),i=this.tile;let n;this.textures.length=0,n=i instanceof Hr||i instanceof Wc?i.getImage():i.getData();const r=Tt(n);if(r){const t=e.createTexture();return this.textures.push(t),this.bandCount=4,function(t,e,i,n){mp(t,e,n),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,i)}(e,t,r,i.interpolate),void this.setReady()}n=Ct(n);const s=i.getSize(),o=[s[0]+2*this.gutter,s[1]+2*this.gutter],a=n instanceof Float32Array,l=o[0]*o[1],h=a?Float32Array:Uint8Array,c=h.BYTES_PER_ELEMENT,u=n.byteLength/o[1];this.bandCount=Math.floor(u/c/o[0]);const d=Math.ceil(this.bandCount/4);if(1===d){const r=e.createTexture();return this.textures.push(r),_p(t,r,n,o,this.bandCount,i.interpolate),void this.setReady()}const g=new Array(d);for(let t=0;t<d;++t){const i=e.createTexture();this.textures.push(i);const n=t<d-1?4:(this.bandCount-1)%4+1;g[t]=new h(l*n)}let f=0,p=0;const m=o[0]*this.bandCount;for(let t=0;t<o[1];++t){for(let t=0;t<m;++t){const e=n[p+t],i=Math.floor(f/this.bandCount),r=t%this.bandCount,s=g[Math.floor(r/4)];s[i*(s.length/l)+r%4]=e,++f}p+=u/c}for(let e=0;e<d;++e){const n=this.textures[e],r=g[e];_p(t,n,r,o,r.length/l,i.interpolate)}this.setReady()}getImagePixelData_(t,e,i){const n=this.gutter,r=this.renderSize_[0],s=this.renderSize_[1];yp||(yp=pt(1,1,void 0,{willReadFrequently:!0})),yp.clearRect(0,0,1,1);const o=t.width-2*n,a=t.height-2*n,l=n+Math.floor(o*(e/r)),h=n+Math.floor(a*(i/s));let c;try{yp.drawImage(t,l,h,1,1,0,0,1,1),c=yp.getImageData(0,0,1,1).data}catch(t){return yp=null,null}return c}getArrayPixelData_(t,e,i,n){const r=this.gutter,s=this.renderSize_[0],o=this.renderSize_[1],a=e[0],l=e[1],h=a+2*r,c=l+2*r,u=r+Math.floor(a*(i/s)),d=r+Math.floor(l*(n/o));if(t instanceof DataView){const e=t.byteLength/(h*c),i=e*(d*h+u),n=t.buffer.slice(i,i+e);return new DataView(n)}const g=this.bandCount*(d*h+u);return t.slice(g,g+this.bandCount)}getPixelData(t,e){if(!this.loaded)return null;if(this.tile instanceof Lt){const i=this.tile.getData(),n=Ct(i);if(n){const i=this.tile.getSize();return this.getArrayPixelData_(n,i,t,e)}return this.getImagePixelData_(Tt(i),t,e)}return this.getImagePixelData_(this.tile.getImage(),t,e)}}class vp extends hg{constructor(t,e){super(t),e=e||{},this.inversePixelTransform_=[1,0,0,1,0,0],this.postProcesses_=e.postProcesses,this.uniforms_=e.uniforms,this.helper,this.onMapChanged_=()=>{this.clearCache(),this.removeHelper()},t.addChangeListener(os,this.onMapChanged_),this.dispatchPreComposeEvent=this.dispatchPreComposeEvent.bind(this),this.dispatchPostComposeEvent=this.dispatchPostComposeEvent.bind(this)}dispatchPreComposeEvent(t,e){const i=this.getLayer();if(i.hasListener(cs)){const n=new Il(cs,void 0,e,t);i.dispatchEvent(n)}}dispatchPostComposeEvent(t,e){const i=this.getLayer();if(i.hasListener(us)){const n=new Il(us,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 vp)){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.helper.needsToBeRecreated()||(this.removeHelper(),this.helper=new Af({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}clearCache(){}disposeInternal(){this.clearCache(),this.removeHelper(),this.getLayer()?.removeChangeListener(os,this.onMapChanged_),super.disposeInternal()}dispatchRenderEvent_(t,e,i){const n=this.getLayer();if(n.hasListener(t)){Vt(this.inversePixelTransform_,0,0,i.pixelRatio,-i.pixelRatio,0,0,-i.size[1]);const r=new Il(t,this.inversePixelTransform_,i,e);n.dispatchEvent(r)}}preRender(t,e){this.dispatchRenderEvent_(ls,t,e)}postRender(t,e){this.dispatchRenderEvent_(hs,t,e)}}const Sp={TILE_TRANSFORM:"u_tileTransform",TRANSITION_ALPHA:"u_transitionAlpha",DEPTH:"u_depth",RENDER_EXTENT:"u_renderExtent",PATTERN_ORIGIN:"u_patternOrigin",RESOLUTION:"u_resolution",ZOOM:"u_zoom",GLOBAL_ALPHA:"u_globalAlpha",PROJECTION_MATRIX:"u_projectionMatrix",SCREEN_TO_WORLD_MATRIX:"u_screenToWorldMatrix"};function Ep(t){return 1/(t+2)}function wp(){return{tileIds:new Set,representationsByZ:{}}}function Tp(t,e){return t.tileIds.has(U(e))}function Cp(t,e,i){const n=t.representationsByZ;i in n||(n[i]=new Set),n[i].add(e),t.tileIds.add(U(e.tile))}function Rp(t,e){const i=t.layerStatesArray[t.layerIndex];i.extent&&(e=Re(e,xn(i.extent,t.viewState.projection)));const n=i.layer.getRenderSource();if(!n.getWrapX()){const i=n.getTileGridForProjection(t.viewState.projection).getExtent();i&&(e=Re(e,i))}return e}function bp(t,e){return`${t.getKey()},${oc(e)}`}class Pp extends vp{constructor(t,e){super(t,{uniforms:e.uniforms,postProcesses:e.postProcesses}),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 uc(0,0,0,0),this.tempTileCoord_=rc(0,0,0),this.tempSize_=[0,0];const i=void 0!==e.cacheSize?e.cacheSize:512;this.tileRepresentationCache=new nc(i),this.frameState=null,this.renderedProjection_=void 0}reset(t){super.reset({uniforms:t.uniforms})}prepareFrameInternal(t){this.renderedProjection_?t.viewState.projection!==this.renderedProjection_&&(this.clearCache(),this.renderedProjection_=t.viewState.projection):this.renderedProjection_=t.viewState.projection;const e=this.getLayer().getRenderSource();return!!e&&(!Fe(Rp(t,t.extent))&&"ready"===e.getState())}createTileRepresentation(t){return G()}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=U(a);c in t.wantedTiles||(t.wantedTiles[c]={});const u=t.wantedTiles[c],d=this.tileRepresentationCache,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=rc(r,e,g,this.tempTileCoord_),f=bp(a,i);let p,m;if(d.containsKey(f)&&(p=d.get(f),m=p.tile),!(p&&p.tile.key===a.getKey()||(m=a.getTile(r,e,g,t.pixelRatio,s.projection),m)))continue;if(Tp(n,m))continue;p?p.setTile(m):(p=this.createTileRepresentation({tile:m,grid:l,helper:this.helper,gutter:h}),d.set(f,p)),Cp(n,p,r);const _=m.getKey();u[_]=!0,m.getState()===Y&&(t.tileQueue.isKeyQueued(_)||t.tileQueue.enqueue([m,c,l.getTileCoordCenter(i),o]))}}}beforeTilesRender(t,e){this.helper.prepareDraw(this.frameState,!e,!0)}beforeTilesMaskRender(t){return!1}renderTile(t,e,i,n,r,s,o,a,l,h,c){}renderTileMask(t,e,i,n){}drawTile_(t,e,i,n,r,s,o){if(!e.ready)return;const a=e.tile.tileCoord,l=oc(a),h=l in s?s[l]:1,c=o.getResolution(i),u=no(o.getTileSize(i),this.tempSize_),d=o.getOrigin(i),g=o.getTileCoordExtent(a),f=h<1?-1:Ep(i);h<1&&(t.animate=!0);const p=t.viewState,m=p.center[0],_=p.center[1],y=u[0]+2*n,x=u[1]+2*n,v=y/x,S=(m-d[0])/(u[0]*c),E=(d[1]-_)/(u[1]*c),w=p.resolution/c,T=a[1],C=a[2];Nt(this.tileTransform_),zt(this.tileTransform_,2/(t.size[0]*w/y),-2/(t.size[1]*w/y)),Bt(this.tileTransform_,p.rotation),zt(this.tileTransform_,1,1/v),Xt(this.tileTransform_,(u[0]*(T-S)-n)/y,(u[1]*(C-E)-n)/x),this.renderTile(e,this.tileTransform_,t,r,c,u,d,g,f,n,h)}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),a=r.getGutterForProjection(i.projection),l=Rp(t,t.extent),h=s.getZForResolution(i.resolution,r.zDirection),c=wp(),u=n.getPreload();if(t.nextExtent){const e=s.getZForResolution(i.nextResolution,r.zDirection),n=Rp(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=U(this),f=t.time;let p=!1;const m=c.representationsByZ;if(h in m)for(const t of m[h]){const e=t.tile;if((e instanceof Wc||e instanceof Qu)&&e.getState()===J)continue;const i=e.tileCoord;if(t.ready){const t=e.getAlpha(g,f);if(1===t){e.endTransition(g);continue}p=!0;d[oc(i)]=t}this.renderComplete=!1;if(this.findAltTiles_(s,i,h+1,c))continue;const n=s.getMinZoom();for(let t=h-1;t>=n;--t){if(this.findAltTiles_(s,i,t,c))break}}const _=Object.keys(m).map(Number).sort(o);if(this.beforeTilesMaskRender(t))for(let t=0,e=_.length;t<e;++t){const e=_[t];for(const t of m[e]){const i=t.tile.tileCoord;if(oc(i)in d)continue;const n=s.getTileCoordExtent(i);this.renderTileMask(t,e,n,Ep(e))}}this.beforeTilesRender(t,p);for(let e=0,i=_.length;e<i;++e){const i=_[e];for(const e of m[i]){oc(e.tile.tileCoord)in d||this.drawTile_(t,e,i,a,l,d,s)}}if(h in m)for(const e of m[h]){oc(e.tile.tileCoord)in d&&this.drawTile_(t,e,h,a,l,d,s)}this.beforeFinalize(t),this.helper.finalizeDraw(t,this.dispatchPreComposeEvent,this.dispatchPostComposeEvent);const y=this.helper.getCanvas(),x=this.tileRepresentationCache;for(;x.canExpireCache();){x.pop().dispose()}return this.postRender(e,t),y}beforeFinalize(t){}findAltTiles_(t,e,i,n){const r=t.getTileRangeForTileCoordAndZ(e,i,this.tempTileRange_);if(!r)return!1;let s=!0;const o=this.tileRepresentationCache,a=this.getLayer().getRenderSource();for(let t=r.minX;t<=r.maxX;++t)for(let e=r.minY;e<=r.maxY;++e){const r=bp(a,[i,t,e]);let l=!1;if(o.containsKey(r)){const t=o.get(r);t.ready&&!Tp(n,t.tile)&&(Cp(n,t,i),l=!0)}l||(s=!1)}return s}clearCache(){super.clearCache();const t=this.tileRepresentationCache;t.forEach((t=>t.dispose())),t.clear()}afterHelperCreated(){super.afterHelperCreated(),this.tileRepresentationCache.forEach((t=>t.setHelper(this.helper)))}disposeInternal(){super.disposeInternal(),delete this.frameState}}const Ip={...Sp,TILE_TEXTURE_ARRAY:"u_tileTextures",TEXTURE_PIXEL_WIDTH:"u_texturePixelWidth",TEXTURE_PIXEL_HEIGHT:"u_texturePixelHeight",TEXTURE_RESOLUTION:"u_textureResolution",TEXTURE_ORIGIN_X:"u_textureOriginX",TEXTURE_ORIGIN_Y:"u_textureOriginY"},Lp={TEXTURE_COORD:"a_textureCoord"},Fp=[{name:Lp.TEXTURE_COORD,size:2,type:If.FLOAT}];class Mp extends Pp{constructor(t,e){super(t,e),this.program_,this.vertexShader_=e.vertexShader,this.fragmentShader_=e.fragmentShader,this.indices_=new Sf(jg,Ug),this.indices_.fromArray([0,1,3,1,2,3]),this.paletteTextures_=e.paletteTextures||[]}reset(t){if(super.reset(t),this.helper){const t=this.helper.getGL();for(const e of this.paletteTextures_)e.delete(t)}if(this.vertexShader_=t.vertexShader,this.fragmentShader_=t.fragmentShader,this.paletteTextures_=t.paletteTextures||[],this.helper){this.program_=this.helper.getProgram(this.fragmentShader_,this.vertexShader_);const t=this.helper.getGL();for(const e of this.paletteTextures_)e.getTexture(t)}}afterHelperCreated(){super.afterHelperCreated();const t=this.helper.getGL();for(const e of this.paletteTextures_)e.getTexture(t);this.program_=this.helper.getProgram(this.fragmentShader_,this.vertexShader_),this.helper.flushBufferData(this.indices_)}removeHelper(){if(this.helper){const t=this.helper.getGL();for(const e of this.paletteTextures_)e.delete(t)}super.removeHelper()}createTileRepresentation(t){return new xp(t)}beforeTilesRender(t,e){super.beforeTilesRender(t,e),this.helper.useProgram(this.program_,t)}renderTile(t,e,i,n,r,s,o,a,l,h,c){const u=this.helper.getGL();this.helper.bindBuffer(t.coords),this.helper.bindBuffer(this.indices_),this.helper.enableAttributes(Fp);let d=0;for(;d<t.textures.length;){const e=`${Ip.TILE_TEXTURE_ARRAY}[${d}]`;this.helper.bindTexture(t.textures[d],d,e),++d}for(let t=0;t<this.paletteTextures_.length;++t){const e=this.paletteTextures_[t],i=e.getTexture(u);this.helper.bindTexture(i,d,e.name),++d}const g=i.viewState,f=s[0]+2*h,p=s[1]+2*h,m=t.tile.tileCoord,_=m[1],y=m[2];this.helper.setUniformMatrixValue(Ip.TILE_TRANSFORM,bf(this.tempMat4,e)),this.helper.setUniformFloatValue(Ip.TRANSITION_ALPHA,c),this.helper.setUniformFloatValue(Ip.DEPTH,l);let x=n;h>0&&(x=a,Re(x,n,x)),this.helper.setUniformFloatVec4(Ip.RENDER_EXTENT,x),this.helper.setUniformFloatValue(Ip.RESOLUTION,g.resolution),this.helper.setUniformFloatValue(Ip.ZOOM,g.zoom),this.helper.setUniformFloatValue(Ip.TEXTURE_PIXEL_WIDTH,f),this.helper.setUniformFloatValue(Ip.TEXTURE_PIXEL_HEIGHT,p),this.helper.setUniformFloatValue(Ip.TEXTURE_RESOLUTION,r),this.helper.setUniformFloatValue(Ip.TEXTURE_ORIGIN_X,o[0]+_*s[0]*r-h*r),this.helper.setUniformFloatValue(Ip.TEXTURE_ORIGIN_Y,o[1]-y*s[1]*r+h*r),this.helper.drawElements(0,this.indices_.getSize())}getData(t){if(!this.helper.getGL())return null;const e=this.frameState;if(!e)return null;const i=this.getLayer(),n=Ut(e.pixelToCoordinateTransform,t.slice()),r=e.viewState,s=i.getExtent();if(s&&!te(xn(s,r.projection),n))return null;const o=i.getSources(Kt([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||te(t,n))break}if(a<0)return null;const c=this.tileRepresentationCache;for(let t=h.getZForResolution(r.resolution);t>=h.getMinZoom();--t){const e=h.getTileCoordForCoordAndZ(n,t),i=bp(l,e);if(!c.containsKey(i))continue;const r=c.get(i),s=r.tile;if((s instanceof Wc||s instanceof Qu)&&s.getState()===J)return null;if(!r.loaded)continue;const o=h.getOrigin(t),a=no(h.getTileSize(t)),u=h.getResolution(t),d=(n[0]-o[0])/u-e[1]*a[
23870],g=(o[1]-n[1])/u-e[2]*a[1];return r.getPixelData(d,g)}return null}disposeInternal(){const t=this.helper;if(t){const e=t.getGL();for(const t of this.paletteTextures_)t.delete(e);this.paletteTextures_.length=0,e.deleteProgram(this.program_),delete this.program_,t.deleteBuffer(this.indices_)}super.disposeInternal(),delete this.indices_}}function Ap(t){const e=t.toString();return e.includes(".")?e:e+".0"}function Op(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(Ap).join(", ")})`}function Dp(t){const e=To(t),i=e.length>3?e[3]:1;return Op([e[0]/255,e[1]/255,e[2]/255,i])}function Np(t){return Op(no(t))}const kp={};let Gp=0;function jp(t){return t in kp||(kp[t]=Gp++),kp[t]}function Up(t){return Ap(jp(t))}function Bp(t){return"u_var_"+t}function zp(){return{inFragmentShader:!1,variables:{},properties:{},functions:{},bandCount:0,style:{}}}const Xp="getBandValue",Vp="u_paletteTextures";function $p(t,e,i,n){return Yp(ja(t,e,i),e,n)}function Wp(t){return(e,i,n)=>{const r=i.args.length,s=new Array(r);for(let t=0;t<r;++t)s[t]=Yp(i.args[t],n,e);return t(s,e)}}const Zp={[Ua.Get]:(t,e)=>{const i=e.args[0].value;i in t.properties||(t.properties[i]={name:i,type:e.type});return(t.inFragmentShader?"v_prop_":"a_prop_")+i},[Ua.GeometryType]:(t,e,i)=>{const n="geometryType";n in t.properties||(t.properties[n]={name:n,type:Ra,evaluator:t=>Ha(t.getGeometry())});return(t.inFragmentShader?"v_prop_":"a_prop_")+n},[Ua.LineMetric]:()=>"currentLineMetric",[Ua.Var]:(t,e)=>{const i=e.args[0].value;return i in t.variables||(t.variables[i]={name:i,type:e.type}),Bp(i)},[Ua.Resolution]:()=>"u_resolution",[Ua.Zoom]:()=>"u_zoom",[Ua.Time]:()=>"u_time",[Ua.Any]:Wp((t=>`(${t.join(" || ")})`)),[Ua.All]:Wp((t=>`(${t.join(" && ")})`)),[Ua.Not]:Wp((([t])=>`(!${t})`)),[Ua.Equal]:Wp((([t,e])=>`(${t} == ${e})`)),[Ua.NotEqual]:Wp((([t,e])=>`(${t} != ${e})`)),[Ua.GreaterThan]:Wp((([t,e])=>`(${t} > ${e})`)),[Ua.GreaterThanOrEqualTo]:Wp((([t,e])=>`(${t} >= ${e})`)),[Ua.LessThan]:Wp((([t,e])=>`(${t} < ${e})`)),[Ua.LessThanOrEqualTo]:Wp((([t,e])=>`(${t} <= ${e})`)),[Ua.Multiply]:Wp((t=>`(${t.join(" * ")})`)),[Ua.Divide]:Wp((([t,e])=>`(${t} / ${e})`)),[Ua.Add]:Wp((t=>`(${t.join(" + ")})`)),[Ua.Subtract]:Wp((([t,e])=>`(${t} - ${e})`)),[Ua.Clamp]:Wp((([t,e,i])=>`clamp(${t}, ${e}, ${i})`)),[Ua.Mod]:Wp((([t,e])=>`mod(${t}, ${e})`)),[Ua.Pow]:Wp((([t,e])=>`pow(${t}, ${e})`)),[Ua.Abs]:Wp((([t])=>`abs(${t})`)),[Ua.Floor]:Wp((([t])=>`floor(${t})`)),[Ua.Ceil]:Wp((([t])=>`ceil(${t})`)),[Ua.Round]:Wp((([t])=>`floor(${t} + 0.5)`)),[Ua.Sin]:Wp((([t])=>`sin(${t})`)),[Ua.Cos]:Wp((([t])=>`cos(${t})`)),[Ua.Atan]:Wp((([t,e])=>void 0!==e?`atan(${t}, ${e})`:`atan(${t})`)),[Ua.Sqrt]:Wp((([t])=>`sqrt(${t})`)),[Ua.Match]:Wp((t=>{const e=t[0],i=t[t.length-1];let n=null;for(let r=t.length-3;r>=1;r-=2){n=`(${e} == ${t[r]} ? ${t[r+1]} : ${n||i})`}return n})),[Ua.Between]:Wp((([t,e,i])=>`(${t} >= ${e} && ${t} <= ${i})`)),[Ua.Interpolate]:Wp((([t,e,...i])=>{let n="";for(let r=0;r<i.length-2;r+=2){const s=i[r],o=n||i[r+1],a=i[r+2],l=i[r+3];let h;h=t===Ap(1)?`(${e} - ${s}) / (${a} - ${s})`:`(pow(${t}, (${e} - ${s})) - 1.0) / (pow(${t}, (${a} - ${s})) - 1.0)`,n=`mix(${o}, ${l}, clamp(${h}, 0.0, 1.0))`}return n})),[Ua.Case]:Wp((t=>{const e=t[t.length-1];let i=null;for(let n=t.length-3;n>=0;n-=2){i=`(${t[n]} ? ${t[n+1]} : ${i||e})`}return i})),[Ua.In]:Wp((([t,...e],i)=>{const n=function(t,e){return`operator_${t}_${Object.keys(e.functions).length}`}("in",i),r=[];for(let t=0;t<e.length;t+=1)r.push(`  if (inputValue == ${e[t]}) { return true; }`);return i.functions[n]=`bool ${n}(float inputValue) {\n${r.join("\n")}\n  return false;\n}`,`${n}(${t})`})),[Ua.Array]:Wp((t=>`vec${t.length}(${t.join(", ")})`)),[Ua.Color]:Wp((t=>{if(1===t.length)return`vec4(vec3(${t[0]} / 255.0), 1.0)`;if(2===t.length)return`vec4(vec3(${t[0]} / 255.0), ${t[1]})`;const e=t.slice(0,3).map((t=>`${t} / 255.0`));if(3===t.length)return`vec4(${e.join(", ")}, 1.0)`;const i=t[3];return`vec4(${e.join(", ")}, ${i})`})),[Ua.Band]:Wp((([t,e,i],n)=>{if(!(Xp in n.functions)){let t="";const e=n.bandCount||1;for(let i=0;i<e;i++){const n=Math.floor(i/4);let r=i%4;i===e-1&&1===r&&(r=3);t+=`  if (band == ${i+1}.0) {\n    return texture2D(${`${Ip.TILE_TEXTURE_ARRAY}[${n}]`}, v_textureCoord + vec2(dx, dy))[${r}];\n  }\n`}n.functions[Xp]=`float getBandValue(float band, float xOffset, float yOffset) {\n  float dx = xOffset / ${Ip.TEXTURE_PIXEL_WIDTH};\n  float dy = yOffset / ${Ip.TEXTURE_PIXEL_HEIGHT};\n${t}\n}`}return`${Xp}(${t}, ${e??"0.0"}, ${i??"0.0"})`})),[Ua.Palette]:(t,e)=>{const[i,...n]=e.args,r=n.length,s=new Uint8Array(4*r);for(let t=0;t<n.length;t++){const e=To(n[t].value),i=4*t;s[i]=e[0],s[i+1]=e[1],s[i+2]=e[2],s[i+3]=255*e[3]}t.paletteTextures||(t.paletteTextures=[]);const o=`${Vp}[${t.paletteTextures.length}]`,a=new Nf(o,s);t.paletteTextures.push(a);return`texture2D(${o}, vec2((${Yp(i,Ca,t)} + 0.5) / ${r}.0, 0.5))`}};function Yp(t,e,i){if(t instanceof ka){const n=Zp[t.operator];if(void 0===n)throw new Error(`No compiler defined for this operator: ${JSON.stringify(t.operator)}`);return n(i,t,e)}if((t.type&Ca)>0)return Ap(t.value);if((t.type&Ta)>0)return t.value.toString();if((t.type&Ra)>0)return Up(t.value.toString());if((t.type&ba)>0)return Dp(t.value);if((t.type&Pa)>0)return Op(t.value);if((t.type&Ia)>0)return Np(t.value);throw new Error(`Unexpected expression ${t.value} (expected type ${Aa(e)})`)}function Hp(){return{"fill-color":"rgba(255,255,255,0.4)","stroke-color":"#3399CC","stroke-width":1.25,"circle-radius":5,"circle-fill-color":"rgba(255,255,255,0.4)","circle-stroke-width":1.25,"circle-stroke-color":"#3399CC"}}const Kp="#ifdef GL_FRAGMENT_PRECISION_HIGH\nprecision highp float;\n#else\nprecision mediump float;\n#endif\nuniform mat4 u_projectionMatrix;\nuniform mat4 u_screenToWorldMatrix;\nuniform vec2 u_viewportSizePx;\nuniform float u_pixelRatio;\nuniform float u_globalAlpha;\nuniform float u_time;\nuniform float u_zoom;\nuniform float u_resolution;\nuniform float u_rotation;\nuniform vec4 u_renderExtent;\nuniform vec2 u_patternOrigin;\nuniform float u_depth;\nuniform mediump int u_hitDetection;\n\nconst float PI = 3.141592653589793238;\nconst float TWO_PI = 2.0 * PI;\nfloat currentLineMetric = 0.; // an actual value will be used in the stroke shaders\n",qp={"fill-color":"rgba(255,255,255,0.4)","stroke-color":"#3399CC","stroke-width":1.25,"circle-radius":5,"circle-fill-color":"rgba(255,255,255,0.4)","circle-stroke-width":1.25,"circle-stroke-color":"#3399CC"};class Jp{constructor(){this.uniforms_=[],this.attributes_=[],this.varyings_=[],this.hasSymbol_=!1,this.symbolSizeExpression_=`vec2(${Ap(qp["circle-radius"])} + ${Ap(.5*qp["circle-stroke-width"])})`,this.symbolRotationExpression_="0.0",this.symbolOffsetExpression_="vec2(0.0)",this.symbolColorExpression_=Dp(qp["circle-fill-color"]),this.texCoordExpression_="vec4(0.0, 0.0, 1.0, 1.0)",this.discardExpression_="false",this.symbolRotateWithView_=!1,this.hasStroke_=!1,this.strokeWidthExpression_=Ap(qp["stroke-width"]),this.strokeColorExpression_=Dp(qp["stroke-color"]),this.strokeOffsetExpression_="0.",this.strokeCapExpression_=Up("round"),this.strokeJoinExpression_=Up("round"),this.strokeMiterLimitExpression_="10.",this.strokeDistanceFieldExpression_="-1000.",this.hasFill_=!1,this.fillColorExpression_=Dp(qp["fill-color"]),this.vertexShaderFunctions_=[],this.fragmentShaderFunctions_=[]}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}setSymbolSizeExpression(t){return this.hasSymbol_=!0,this.symbolSizeExpression_=t,this}getSymbolSizeExpression(){return this.symbolSizeExpression_}setSymbolRotationExpression(t){return this.symbolRotationExpression_=t,this}setSymbolOffsetExpression(t){return this.symbolOffsetExpression_=t,this}getSymbolOffsetExpression(){return this.symbolOffsetExpression_}setSymbolColorExpression(t){return this.hasSymbol_=!0,this.symbolColorExpression_=t,this}getSymbolColorExpression(){return this.symbolColorExpression_}
2387setTextureCoordinateExpression(t){return this.texCoordExpression_=t,this}setFragmentDiscardExpression(t){return this.discardExpression_=t,this}getFragmentDiscardExpression(){return this.discardExpression_}setSymbolRotateWithView(t){return this.symbolRotateWithView_=t,this}setStrokeWidthExpression(t){return this.hasStroke_=!0,this.strokeWidthExpression_=t,this}setStrokeColorExpression(t){return this.hasStroke_=!0,this.strokeColorExpression_=t,this}getStrokeColorExpression(){return this.strokeColorExpression_}setStrokeOffsetExpression(t){return this.strokeOffsetExpression_=t,this}setStrokeCapExpression(t){return this.strokeCapExpression_=t,this}setStrokeJoinExpression(t){return this.strokeJoinExpression_=t,this}setStrokeMiterLimitExpression(t){return this.strokeMiterLimitExpression_=t,this}setStrokeDistanceFieldExpression(t){return this.strokeDistanceFieldExpression_=t,this}setFillColorExpression(t){return this.hasFill_=!0,this.fillColorExpression_=t,this}getFillColorExpression(){return this.fillColorExpression_}addVertexShaderFunction(t){this.vertexShaderFunctions_.includes(t)||this.vertexShaderFunctions_.push(t)}addFragmentShaderFunction(t){this.fragmentShaderFunctions_.includes(t)||this.fragmentShaderFunctions_.push(t)}getSymbolVertexShader(){return this.hasSymbol_?`${Kp}\n${this.uniforms_.map((function(t){return"uniform "+t+";"})).join("\n")}\nattribute vec2 a_position;\nattribute float a_index;\nattribute vec4 a_prop_hitColor;\n${this.attributes_.map((function(t){return"attribute "+t+";"})).join("\n")}\nvarying vec2 v_texCoord;\nvarying vec2 v_quadCoord;\nvarying vec4 v_prop_hitColor;\nvarying vec2 v_centerPx;\nvarying float v_angle;\nvarying vec2 v_quadSizePx;\n${this.varyings_.map((function(t){return"varying "+t.type+" "+t.name+";"})).join("\n")}\n${this.vertexShaderFunctions_.join("\n")}\nvec2 pxToScreen(vec2 coordPx) {\n  vec2 scaled = coordPx / u_viewportSizePx / 0.5;\n  return scaled;\n}\n\nvec2 screenToPx(vec2 coordScreen) {\n  return (coordScreen * 0.5 + 0.5) * u_viewportSizePx;\n}\n\nvoid main(void) {\n  v_quadSizePx = ${this.symbolSizeExpression_};\n  vec2 halfSizePx = v_quadSizePx * 0.5;\n  vec2 centerOffsetPx = ${this.symbolOffsetExpression_};\n  vec2 offsetPx = centerOffsetPx;\n  if (a_index == 0.0) {\n    offsetPx -= halfSizePx;\n  } else if (a_index == 1.0) {\n    offsetPx += halfSizePx * vec2(1., -1.);\n  } else if (a_index == 2.0) {\n    offsetPx += halfSizePx;\n  } else {\n    offsetPx += halfSizePx * vec2(-1., 1.);\n  }\n  float angle = ${this.symbolRotationExpression_};\n  ${this.symbolRotateWithView_?"angle += u_rotation;":""}\n  float c = cos(-angle);\n  float s = sin(-angle);\n  offsetPx = vec2(c * offsetPx.x - s * offsetPx.y, s * offsetPx.x + c * offsetPx.y);\n  vec4 center = u_projectionMatrix * vec4(a_position, 0.0, 1.0);\n  gl_Position = center + vec4(pxToScreen(offsetPx), u_depth, 0.);\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  v_prop_hitColor = a_prop_hitColor;\n  v_angle = angle;\n  c = cos(-v_angle);\n  s = sin(-v_angle);\n  centerOffsetPx = vec2(c * centerOffsetPx.x - s * centerOffsetPx.y, s * centerOffsetPx.x + c * centerOffsetPx.y); \n  v_centerPx = screenToPx(center.xy) + centerOffsetPx;\n${this.varyings_.map((function(t){return"  "+t.name+" = "+t.expression+";"})).join("\n")}\n}`:null}getSymbolFragmentShader(){return this.hasSymbol_?`${Kp}\n${this.uniforms_.map((function(t){return"uniform "+t+";"})).join("\n")}\nvarying vec2 v_texCoord;\nvarying vec4 v_prop_hitColor;\nvarying vec2 v_centerPx;\nvarying float v_angle;\nvarying vec2 v_quadSizePx;\n${this.varyings_.map((function(t){return"varying "+t.type+" "+t.name+";"})).join("\n")}\n${this.fragmentShaderFunctions_.join("\n")}\n\nvoid main(void) {\n  if (${this.discardExpression_}) { discard; }\n  vec2 coordsPx = gl_FragCoord.xy / u_pixelRatio - v_centerPx; // relative to center\n  float c = cos(v_angle);\n  float s = sin(v_angle);\n  coordsPx = vec2(c * coordsPx.x - s * coordsPx.y, s * coordsPx.x + c * coordsPx.y);\n  gl_FragColor = ${this.symbolColorExpression_};\n  gl_FragColor.rgb *= gl_FragColor.a;\n  if (u_hitDetection > 0) {\n    if (gl_FragColor.a < 0.05) { discard; };\n    gl_FragColor = v_prop_hitColor;\n  }\n}`:null}getStrokeVertexShader(){return this.hasStroke_?`${Kp}\n${this.uniforms_.map((function(t){return"uniform "+t+";"})).join("\n")}\nattribute vec2 a_segmentStart;\nattribute vec2 a_segmentEnd;\nattribute float a_measureStart;\nattribute float a_measureEnd;\nattribute float a_parameters;\nattribute float a_distance;\nattribute vec2 a_joinAngles;\nattribute vec4 a_prop_hitColor;\n${this.attributes_.map((function(t){return"attribute "+t+";"})).join("\n")}\nvarying vec2 v_segmentStart;\nvarying vec2 v_segmentEnd;\nvarying float v_angleStart;\nvarying float v_angleEnd;\nvarying float v_width;\nvarying vec4 v_prop_hitColor;\nvarying float v_distanceOffsetPx;\nvarying float v_measureStart;\nvarying float v_measureEnd;\n${this.varyings_.map((function(t){return"varying "+t.type+" "+t.name+";"})).join("\n")}\n${this.vertexShaderFunctions_.join("\n")}\nvec2 worldToPx(vec2 worldPos) {\n  vec4 screenPos = u_projectionMatrix * vec4(worldPos, 0.0, 1.0);\n  return (0.5 * screenPos.xy + 0.5) * u_viewportSizePx;\n}\n\nvec4 pxToScreen(vec2 pxPos) {\n  vec2 screenPos = 2.0 * pxPos / u_viewportSizePx - 1.0;\n  return vec4(screenPos, u_depth, 1.0);\n}\n\nbool isCap(float joinAngle) {\n  return joinAngle < -0.1;\n}\n\nvec2 getJoinOffsetDirection(vec2 normalPx, float joinAngle) {\n  float halfAngle = joinAngle / 2.0;\n  float c = cos(halfAngle);\n  float s = sin(halfAngle);\n  vec2 angleBisectorNormal = vec2(s * normalPx.x + c * normalPx.y, -c * normalPx.x + s * normalPx.y);\n  float length = 1.0 / s;\n  return angleBisectorNormal * length;\n}\n\nvec2 getOffsetPoint(vec2 point, vec2 normal, float joinAngle, float offsetPx) {\n  // if on a cap or the join angle is too high, offset the line along the segment normal\n  if (cos(joinAngle) > 0.998 || isCap(joinAngle)) {\n    return point - normal * offsetPx;\n  }\n  // offset is applied along the inverted normal (positive offset goes "right" relative to line direction)\n  return point - getJoinOffsetDirection(normal, joinAngle) * offsetPx;\n}\n\nvoid main(void) {\n  v_angleStart = a_joinAngles.x;\n  v_angleEnd = a_joinAngles.y;\n  float vertexNumber = floor(abs(a_parameters) / 10000. + 0.5);\n  currentLineMetric = vertexNumber < 1.5 ? a_measureStart : a_measureEnd;\n  // we're reading the fractional part while keeping the sign (so -4.12 gives -0.12, 3.45 gives 0.45)\n  float angleTangentSum = fract(abs(a_parameters) / 10000.) * 10000. * sign(a_parameters);\n\n  float lineWidth = ${this.strokeWidthExpression_};\n  float lineOffsetPx = ${this.strokeOffsetExpression_};\n\n  // compute segment start/end in px with offset\n  vec2 segmentStartPx = worldToPx(a_segmentStart);\n  vec2 segmentEndPx = worldToPx(a_segmentEnd);\n  vec2 tangentPx = normalize(segmentEndPx - segmentStartPx);\n  vec2 normalPx = vec2(-tangentPx.y, tangentPx.x);\n  segmentStartPx = getOffsetPoint(segmentStartPx, normalPx, v_angleStart, lineOffsetPx),\n  segmentEndPx = getOffsetPoint(segmentEndPx, normalPx, v_angleEnd, lineOffsetPx);\n  \n  // compute current vertex position\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 joinDirection;\n  vec2 positionPx = vertexNumber < 1.5 ? segmentStartPx : segmentEndPx;\n  // if angle is too high, do not make a proper join\n  if (cos(angle) > 0.985 || isCap(angle)) {\n    joinDirection = normalPx * normalDir - tangentPx * tangentDir;\n  } else {\n    joinDirection = getJoinOffsetDirection(normalPx * normalDir, angle);\n  }\n  positionPx = positionPx + joinDirection * (lineWidth * 0.5 + 1.); // adding 1 pixel for antialiasing\n  gl_Position = pxToScreen(positionPx);\n\n  v_segmentStart = segmentStartPx;\n  v_segmentEnd = segmentEndPx;\n  v_width = lineWidth;\n  v_prop_hitColor = a_prop_hitColor;\n  v_distanceOffsetPx = a_distance / u_resolution - (lineOffsetPx * angleTangentSum);\n  v_measureStart = a_measureStart;\n  v_measureEnd = a_measureEnd;\n${this.varyings_.map((function(t){return"  "+t.name+" = "+t.expression+";"})).join("\n")}\n}`:null}getStrokeFragmentShader(){return this.hasStroke_?`${Kp}\n${this.uniforms_.map((function(t){return"uniform "+t+";"})).join("\n")}\nvarying vec2 v_segmentStart;\nvarying vec2 v_segmentEnd;\nvarying float v_angleStart;\nvarying float v_angleEnd;\nvarying float v_width;\nvarying vec4 v_prop_hitColor;\nvarying float v_distanceOffsetPx;\nvarying float v_measureStart;\nvarying float v_measureEnd;\n${this.varyings_.map((function(t){return"varying "+t.type+" "+t.name+";"})).join("\n")}\n${this.fragmentShaderFunctions_.join("\n")}\n\nvec2 pxToWorld(vec2 pxPos) {\n  vec2 screenPos = 2.0 * pxPos / u_viewportSizePx - 1.0;\n  return (u_screenToWorldMatrix * vec4(screenPos, 0.0, 1.0)).xy;\n}\n\nbool isCap(float joinAngle) {\n  return joinAngle < -0.1;\n}\n\nfloat segmentDistanceField(vec2 point, vec2 start, vec2 end, float width) {\n  vec2 tangent = normalize(end - start);\n  vec2 normal = vec2(-tangent.y, tangent.x);\n  vec2 startToPoint = point - start;\n  return abs(dot(startToPoint, normal)) - width * 0.5;\n}\n\nfloat buttCapDistanceField(vec2 point, vec2 start, vec2 end) {\n  vec2 startToPoint = point - start;\n  vec2 tangent = normalize(end - start);\n  return dot(startToPoint, -tangent);\n}\n\nfloat squareCapDistanceField(vec2 point, vec2 start, vec2 end, float width) {\n  return buttCapDistanceField(point, start, end) - width * 0.5;\n}
2387\n\nfloat roundCapDistanceField(vec2 point, vec2 start, vec2 end, float width) {\n  float onSegment = max(0., 1000. * dot(point - start, end - start)); // this is very high when inside the segment\n  return length(point - start) - width * 0.5 - onSegment;\n}\n\nfloat roundJoinDistanceField(vec2 point, vec2 start, vec2 end, float width) {\n  return roundCapDistanceField(point, start, end, width);\n}\n\nfloat bevelJoinField(vec2 point, vec2 start, vec2 end, float width, float joinAngle) {\n  vec2 startToPoint = point - start;\n  vec2 tangent = normalize(end - start);\n  float c = cos(joinAngle * 0.5);\n  float s = sin(joinAngle * 0.5);\n  float direction = -sign(sin(joinAngle));\n  vec2 bisector = vec2(c * tangent.x - s * tangent.y, s * tangent.x + c * tangent.y);\n  float radius = width * 0.5 * s;\n  return dot(startToPoint, bisector * direction) - radius;\n}\n\nfloat miterJoinDistanceField(vec2 point, vec2 start, vec2 end, float width, float joinAngle) {\n  if (cos(joinAngle) > 0.985) { // avoid risking a division by zero\n    return bevelJoinField(point, start, end, width, joinAngle);\n  }\n  float miterLength = 1. / sin(joinAngle * 0.5);\n  float miterLimit = ${this.strokeMiterLimitExpression_};\n  if (miterLength > miterLimit) {\n    return bevelJoinField(point, start, end, width, joinAngle);\n  }\n  return -1000.;\n}\n\nfloat capDistanceField(vec2 point, vec2 start, vec2 end, float width, float capType) {\n   if (capType == ${Up("butt")}) {\n    return buttCapDistanceField(point, start, end);\n  } else if (capType == ${Up("square")}) {\n    return squareCapDistanceField(point, start, end, width);\n  }\n  return roundCapDistanceField(point, start, end, width);\n}\n\nfloat joinDistanceField(vec2 point, vec2 start, vec2 end, float width, float joinAngle, float joinType) {\n  if (joinType == ${Up("bevel")}) {\n    return bevelJoinField(point, start, end, width, joinAngle);\n  } else if (joinType == ${Up("miter")}) {\n    return miterJoinDistanceField(point, start, end, width, joinAngle);\n  }\n  return roundJoinDistanceField(point, start, end, width);\n}\n\nfloat computeSegmentPointDistance(vec2 point, vec2 start, vec2 end, float width, float joinAngle, float capType, float joinType) {\n  if (isCap(joinAngle)) {\n    return capDistanceField(point, start, end, width, capType);\n  }\n  return joinDistanceField(point, start, end, width, joinAngle, joinType);\n}\n\nvoid main(void) {\n  vec2 currentPoint = gl_FragCoord.xy / u_pixelRatio;\n  #ifdef GL_FRAGMENT_PRECISION_HIGH\n  vec2 worldPos = pxToWorld(currentPoint);\n  if (\n    abs(u_renderExtent[0] - u_renderExtent[2]) > 0.0 && (\n      worldPos[0] < u_renderExtent[0] ||\n      worldPos[1] < u_renderExtent[1] ||\n      worldPos[0] > u_renderExtent[2] ||\n      worldPos[1] > u_renderExtent[3]\n    )\n  ) {\n    discard;\n  }\n  #endif\n\n  float segmentLength = length(v_segmentEnd - v_segmentStart);\n  vec2 segmentTangent = (v_segmentEnd - v_segmentStart) / segmentLength;\n  vec2 segmentNormal = vec2(-segmentTangent.y, segmentTangent.x);\n  vec2 startToPoint = currentPoint - v_segmentStart;\n  float lengthToPoint = max(0., min(dot(segmentTangent, startToPoint), segmentLength));\n  float currentLengthPx = lengthToPoint + v_distanceOffsetPx; \n  float currentRadiusPx = abs(dot(segmentNormal, startToPoint));\n  float currentRadiusRatio = dot(segmentNormal, startToPoint) * 2. / v_width;\n  currentLineMetric = mix(v_measureStart, v_measureEnd, lengthToPoint / segmentLength);\n\n  if (${this.discardExpression_}) { discard; }\n\n  vec4 color = ${this.strokeColorExpression_};\n  float capType = ${this.strokeCapExpression_};\n  float joinType = ${this.strokeJoinExpression_};\n  float segmentStartDistance = computeSegmentPointDistance(currentPoint, v_segmentStart, v_segmentEnd, v_width, v_angleStart, capType, joinType);\n  float segmentEndDistance = computeSegmentPointDistance(currentPoint, v_segmentEnd, v_segmentStart, v_width, v_angleEnd, capType, joinType);\n  float distance = max(\n    segmentDistanceField(currentPoint, v_segmentStart, v_segmentEnd, v_width),\n    max(segmentStartDistance, segmentEndDistance)\n  );\n  distance = max(distance, ${this.strokeDistanceFieldExpression_});\n  color.a *= smoothstep(0.5, -0.5, distance);\n  gl_FragColor = color;\n  gl_FragColor.a *= u_globalAlpha;\n  gl_FragColor.rgb *= gl_FragColor.a;\n  if (u_hitDetection > 0) {\n    if (gl_FragColor.a < 0.1) { discard; };\n    gl_FragColor = v_prop_hitColor;\n  }\n}`:null}getFillVertexShader(){return this.hasFill_?`${Kp}\n${this.uniforms_.map((function(t){return"uniform "+t+";"})).join("\n")}\nattribute vec2 a_position;\nattribute vec4 a_prop_hitColor;\n${this.attributes_.map((function(t){return"attribute "+t+";"})).join("\n")}\nvarying vec4 v_prop_hitColor;\n${this.varyings_.map((function(t){return"varying "+t.type+" "+t.name+";"})).join("\n")}\n${this.vertexShaderFunctions_.join("\n")}\nvoid main(void) {\n  gl_Position = u_projectionMatrix * vec4(a_position, u_depth, 1.0);\n  v_prop_hitColor = a_prop_hitColor;\n${this.varyings_.map((function(t){return"  "+t.name+" = "+t.expression+";"})).join("\n")}\n}`:null}getFillFragmentShader(){return this.hasFill_?`${Kp}\n${this.uniforms_.map((function(t){return"uniform "+t+";"})).join("\n")}\nvarying vec4 v_prop_hitColor;\n${this.varyings_.map((function(t){return"varying "+t.type+" "+t.name+";"})).join("\n")}\n${this.fragmentShaderFunctions_.join("\n")}\nvec2 pxToWorld(vec2 pxPos) {\n  vec2 screenPos = 2.0 * pxPos / u_viewportSizePx - 1.0;\n  return (u_screenToWorldMatrix * vec4(screenPos, 0.0, 1.0)).xy;\n}\n\nvec2 worldToPx(vec2 worldPos) {\n  vec4 screenPos = u_projectionMatrix * vec4(worldPos, 0.0, 1.0);\n  return (0.5 * screenPos.xy + 0.5) * u_viewportSizePx;\n}\n\nvoid main(void) {\n  vec2 pxPos = gl_FragCoord.xy / u_pixelRatio;\n  vec2 pxOrigin = worldToPx(u_patternOrigin);\n  #ifdef GL_FRAGMENT_PRECISION_HIGH\n  vec2 worldPos = pxToWorld(pxPos);\n  if (\n    abs(u_renderExtent[0] - u_renderExtent[2]) > 0.0 && (\n      worldPos[0] < u_renderExtent[0] ||\n      worldPos[1] < u_renderExtent[1] ||\n      worldPos[0] > u_renderExtent[2] ||\n      worldPos[1] > u_renderExtent[3]\n    )\n  ) {\n    discard;\n  }\n  #endif\n  if (${this.discardExpression_}) { discard; }\n  gl_FragColor = ${this.fillColorExpression_};\n  gl_FragColor.a *= u_globalAlpha;\n  gl_FragColor.rgb *= gl_FragColor.a;\n  if (u_hitDetection > 0) {\n    if (gl_FragColor.a < 0.1) { discard; };\n    gl_FragColor = v_prop_hitColor;\n  }\n}`:null}}class Qp{constructor(){this.globalCounter_=0,this.refToFeature_=new Map,this.uidToRef_=ne
vendor: 4,469 bytes, line 2387
2387w Map,this.freeGlobalRef_=[],this.polygonBatch={entries:{},geometriesCount:0,verticesCount:0,ringsCount:0},this.pointBatch={entries:{},geometriesCount:0},this.lineStringBatch={entries:{},geometriesCount:0,verticesCount:0}}addFeatures(t,e){for(let i=0;i<t.length;i++)this.addFeature(t[i],e)}addFeature(t,e){let i=t.getGeometry();i&&(e&&(i=i.clone(),i.applyTransform(e)),this.addGeometry_(i,t))}clearFeatureEntryInPointBatch_(t){const e=this.pointBatch.entries[U(t)];if(e)return this.pointBatch.geometriesCount-=e.flatCoordss.length,delete this.pointBatch.entries[U(t)],e}clearFeatureEntryInLineStringBatch_(t){const e=this.lineStringBatch.entries[U(t)];if(e)return this.lineStringBatch.verticesCount-=e.verticesCount,this.lineStringBatch.geometriesCount-=e.flatCoordss.length,delete this.lineStringBatch.entries[U(t)],e}clearFeatureEntryInPolygonBatch_(t){const e=this.polygonBatch.entries[U(t)];if(e)return this.polygonBatch.verticesCount-=e.verticesCount,this.polygonBatch.ringsCount-=e.ringsCount,this.polygonBatch.geometriesCount-=e.flatCoordss.length,delete this.polygonBatch.entries[U(t)],e}addGeometry_(t,e){const i=t.getType();switch(i){case"GeometryCollection":{const i=t.getGeometriesArray();for(const t of i)this.addGeometry_(t,e);break}case"MultiPolygon":{const n=t;this.addCoordinates_(i,n.getFlatCoordinates(),n.getEndss(),e,U(e),n.getStride());break}case"MultiLineString":{const n=t;this.addCoordinates_(i,n.getFlatCoordinates(),n.getEnds(),e,U(e),n.getStride());break}case"MultiPoint":{const n=t;this.addCoordinates_(i,n.getFlatCoordinates(),null,e,U(e),n.getStride());break}case"Polygon":{const n=t;this.addCoordinates_(i,n.getFlatCoordinates(),n.getEnds(),e,U(e),n.getStride());break}case"Point":{const n=t;this.addCoordinates_(i,n.getFlatCoordinates(),null,e,U(e),n.getStride());break}case"LineString":case"LinearRing":{const n=t,r=n.getStride();this.addCoordinates_(i,n.getFlatCoordinates(),null,e,U(e),r,n.getLayout?.());break}}}addCoordinates_(t,e,i,n,r,s,o){let a;switch(t){case"MultiPolygon":{const t=i;for(let i=0,a=t.length;i<a;i++){let a=t[i];const l=i>0?t[i-1]:null,h=l?l[l.length-1]:0,c=a[a.length-1];a=h>0?a.map((t=>t-h)):a,this.addCoordinates_("Polygon",e.slice(h,c),a,n,r,s,o)}break}case"MultiLineString":{const t=i;for(let i=0,a=t.length;i<a;i++){const a=i>0?t[i-1]:0;this.addCoordinates_("LineString",e.slice(a,t[i]),null,n,r,s,o)}break}case"MultiPoint":for(let t=0,i=e.length;t<i;t+=s)this.addCoordinates_("Point",e.slice(t,t+2),null,n,r,null,null);break;case"Polygon":{const t=i;if(n instanceof zu){const i=Tr(e,t);if(i.length>1)return void this.addCoordinates_("MultiPolygon",e,i,n,r,s,o)}this.polygonBatch.entries[r]||(this.polygonBatch.entries[r]=this.addRefToEntry_(r,{feature:n,flatCoordss:[],verticesCount:0,ringsCount:0,ringsVerticesCounts:[]})),a=e.length/s;const l=i.length,h=i.map(((t,e,i)=>e>0?(t-i[e-1])/s:t/s));this.polygonBatch.verticesCount+=a,this.polygonBatch.ringsCount+=l,this.polygonBatch.geometriesCount++,this.polygonBatch.entries[r].flatCoordss.push(function(t,e){if(2===e)return t;return t.filter(((t,i)=>i%e<2))}(e,s)),this.polygonBatch.entries[r].ringsVerticesCounts.push(h),this.polygonBatch.entries[r].verticesCount+=a,this.polygonBatch.entries[r].ringsCount+=l;for(let i=0,a=t.length;i<a;i++){const a=i>0?t[i-1]:0;this.addCoordinates_("LinearRing",e.slice(a,t[i]),null,n,r,s,o)}break}case"Point":this.pointBatch.entries[r]||(this.pointBatch.entries[r]=this.addRefToEntry_(r,{feature:n,flatCoordss:[]})),this.pointBatch.geometriesCount++,this.pointBatch.entries[r].flatCoordss.push(e);break;case"LineString":case"LinearRing":this.lineStringBatch.entries[r]||(this.lineStringBatch.entries[r]=this.addRefToEntry_(r,{feature:n,flatCoordss:[],verticesCount:0})),a=e.length/s,this.lineStringBatch.verticesCount+=a,this.lineStringBatch.geometriesCount++,this.lineStringBatch.entries[r].flatCoordss.push(function(t,e,i){if(3===e&&"XYM"===i)return t;if(4===e)return t.filter(((t,i)=>i%e!=2));if(3===e)return t.map(((t,i)=>i%e!=2?t:0));return new Array(1.5*t.length).fill(0).map(((e,i)=>i%3==2?0:t[Math.round(i/1.5)]))}(e,s,o)),this.lineStringBatch.entries[r].verticesCount+=a}}addRefToEntry_(t,e){const i=this.uidToRef_.get(t),n=i||this.freeGlobalRef_.pop()||++this.globalCounter_;return e.ref=n,i||(this.refToFeature_.set(n,e.feature),this.uidToRef_.set(t,n)),e}returnRef_(t,e){if(!t)throw new Error("This feature has no ref: "+e);this.refToFeature_.delete(t),this.uidToRef_.delete(e),this.freeGlobalRef_.push(t)}
2387changeFeature(t){this.removeFeature(t);const e=t.getGeometry();e&&this.addGeometry_(e,t)}removeFeature(t){let e;e=this.clearFeatureEntryInPointBatch_(t)||e,e=this.clearFeatureEntryInPolygonBatch_(t)||e,e=this.clearFeatureEntryInLineStringBatch_(t)||e,e&&this.returnRef_(e.ref,U(e.feature))}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,this.globalCounter_=0,this.freeGlobalRef_=[],this.refToFeature_.clear(),this.uidToRef_.clear()}getFeatureFromRef(t){return this.refToFeature_.get(t)}}class tm extends xf{constructor(t,e){super(t),this.batch_=new Qp,this.styleRenderers_=e,this.buffers=[],this.maskVertices=new Sf(Gg,Ug),this.setTile(t.tile)}generateMaskBuffer_(){const t=this.tile.getSourceTiles()[0].extent;this.maskVertices.fromArray([t[0],t[1],t[2],t[1],t[2],t[3],t[0],t[3]]),this.helper.flushBufferData(this.maskVertices)}uploadTile(){this.generateMaskBuffer_(),this.batch_.clear();const t=this.tile.getSourceTiles(),e=t.reduce(((t,e)=>t.concat(e.getFeatures())),[]);this.batch_.addFeatures(e);const i=Xt([1,0,0,1,0,0],-t[0].extent[0],-t[0].extent[1]),n=this.styleRenderers_.map(((t,e)=>t.generateBuffers(this.batch_,i).then((t=>{this.buffers[e]=t}))));Promise.all(n).then((()=>{this.setReady()}))}}function em(t,e,i){return $p(e,i,Ga(),t)}function im(t){const e=To(t);return[256*e[0]+e[1],256*e[2]+Math.round(255*e[3])]}function nm(t){return t===ba||t===Ia?2:t===Pa?4:1}function rm(t){const e=nm(t);return e>1?`vec${e}`:"float"}function sm(t){return(JSON.stringify(t).split("").reduce(((t,e)=>(t<<5)-t+e.charCodeAt(0)),0)>>>0).toString()}function om(t,e,i,n){if(`${n}radius`in t&&"icon-"!==n){let r=em(i,t[`${n}radius`],Ca);if(`${n}radius2`in t){r=`max(${r}, ${em(i,t[`${n}radius2`],Ca)})`}`${n}stroke-width`in t&&(r=`(${r} + ${em(i,t[`${n}stroke-width`],Ca)} * 0.5)`),e.setSymbolSizeExpression(`vec2(${r} * 2. + 0.5)`)}if(`${n}scale`in t){const r=em(i,t[`${n}scale`],Ia);e.setSymbolSizeExpression(`${e.getSymbolSizeExpression()} * ${r}`)}`${n}displacement`in t&&e.setSymbolOffsetExpression(em(i,t[`${n}displacement`],Pa)),`${n}rotation`in t&&e.setSymbolRotationExpression(em(i,t[`${n}rotation`],Ca)),`${n}rotate-with-view`in t&&e.setSymbolRotateWithView(!!t[`${n}rotate-with-view`])}function am(t,e,i,n,r){let s="vec4(0.)";if(null!==e&&(s=e),null!==i&&null!==n){s=`mix(${i}, ${s}, ${`smoothstep(-${n} + 0.63, -${n} - 0.58, ${t})`})`}let o=`${s} * vec4(1.0, 1.0, 1.0, ${`(1.0 - smoothstep(-0.63, 0.58, ${t}))`})`;return null!==r&&(o=`${o} * vec4(1.0, 1.0, 1.0, ${r})`),o}function lm(t,e,i,n,r){const s=new Image;s.crossOrigin=void 0===t[`${n}cross-origin`]?"anonymous":t[`${n}cross-origin`],s.src=t[`${n}src`],i[`u_texture${r}_size`]=()=>s.complete?[s.width,s.height]:[0,0],e.addUniform(`vec2 u_texture${r}_size`);const o=`u_texture${r}_size`;return i[`u_texture${r}`]=s,e.addUniform(`sampler2D u_texture${r}`),o}function hm(t,e,i,n,r){let s=em(i,t[`${e}offset`],Pa);if(`${e}offset-origin`in t)switch(t[`${e}offset-origin`]){case"top-right":s=`vec2(${n}.x, 0.) + ${r} * vec2(-1., 0.) + ${s} * vec2(-1., 1.)`;break;case"bottom-left":s=`vec2(0., ${n}.y) + ${r} * vec2(0., -1.) + ${s} * vec2(1., -1.)`;break;case"bottom-right":s=`${n} - ${r} - ${s}`}return s}function cm(t){const e={inFragmentShader:!1,properties:{},variables:{},functions:{},style:t},i={inFragmentShader:!0,variables:e.variables,properties:{},functions:{},style:t},n=new Jp,r={};if("icon-src"in t?function(t,e,i,n,r){let s="vec4(1.0)";"icon-color"in t&&(s=em(r,t["icon-color"],ba)),"icon-opacity"in t&&(s=`${s} * vec4(1.0, 1.0, 1.0, ${em(r,t["icon-opacity"],Ca)})`);const o=sm(t["icon-src"]),a=lm(t,e,i,"icon-",o);if(e.setSymbolColorExpression(`${s} * texture2D(u_texture${o}, v_texCoord)`).setSymbolSizeExpression(a),"icon-width"in t&&"icon-height"in t&&e.setSymbolSizeExpression(`vec2(${em(n,t["icon-width"],Ca)}, ${em(n,t["icon-height"],Ca)})`),"icon-offset"in t&&"icon-size"in t){const i=em(n,t["icon-size"],Pa),r=e.getSymbolSizeExpression();e.setSymbolSizeExpression(i);const s=hm(t,"icon-",n,"v_quadSizePx",i);
vendor: 2,307 bytes, line 2387
2387e.setTextureCoordinateExpression(`(vec4((${s}).xyxy) + vec4(0., 0., ${i})) / (${r}).xyxy`)}if(om(t,e,n,"icon-"),"icon-anchor"in t){const i=em(n,t["icon-anchor"],Pa);let r,s="1.0";"icon-scale"in t&&(s=em(n,t["icon-scale"],Ia)),r="pixels"===t["icon-anchor-x-units"]&&"pixels"===t["icon-anchor-y-units"]?`${i} * ${s}`:"pixels"===t["icon-anchor-x-units"]?`${i} * vec2(vec2(${s}).x, v_quadSizePx.y)`:"pixels"===t["icon-anchor-y-units"]?`${i} * vec2(v_quadSizePx.x, vec2(${s}).x)`:`${i} * v_quadSizePx`;let o=`v_quadSizePx * vec2(0.5, -0.5) + ${r} * vec2(-1., 1.)`;if("icon-anchor-origin"in t)switch(t["icon-anchor-origin"]){case"top-right":o=`v_quadSizePx * -0.5 + ${r}`;break;case"bottom-left":o=`v_quadSizePx * 0.5 - ${r}`;break;case"bottom-right":o=`v_quadSizePx * vec2(-0.5, 0.5) + ${r} * vec2(1., -1.)`}e.setSymbolOffsetExpression(`${e.getSymbolOffsetExpression()} + ${o}`)}}(t,n,r,e,i):"shape-points"in t?function(t,e,i,n,r){r.functions.round="float round(float v) {\n  return sign(v) * floor(abs(v) + 0.5);\n}",r.functions.starDistanceField="float starDistanceField(vec2 point, float numPoints, float radius, float radius2, float angle) {\n  float startAngle = -PI * 0.5 + angle; // tip starts upwards and rotates clockwise with angle\n  float c = cos(startAngle);\n  float s = sin(startAngle);\n  vec2 pointRotated = vec2(c * point.x - s * point.y, s * point.x + c * point.y);\n  float alpha = TWO_PI / numPoints; // the angle of one sector\n  float beta = atan(pointRotated.y, pointRotated.x);\n  float gamma = round(beta / alpha) * alpha; // angle in sector\n  c = cos(-gamma);\n  s = sin(-gamma);\n  vec2 inSector = vec2(c * pointRotated.x - s * pointRotated.y, abs(s * pointRotated.x + c * pointRotated.y));\n  vec2 tipToPoint = inSector + vec2(-radius, 0.);\n  vec2 edgeNormal = vec2(radius2 * sin(alpha * 0.5), -radius2 * cos(alpha * 0.5) + radius);\n  return dot(normalize(edgeNormal), tipToPoint);\n}",r.functions.regularDistanceField="float regularDistanceField(vec2 point, float numPoints, float radius, float angle) {\n  float startAngle = -PI * 0.5 + angle; // tip starts upwards and rotates clockwise with angle\n  float c = cos(startAngle);\n  float s = sin(startAngle);\n  vec2 pointRotated = vec2(c * point.x - s * point.y, s * point.x + c * point.y);\n  float alpha = TWO_PI / numPoints;
2387 // the angle of one sector\n  float radiusIn = radius * cos(PI / numPoints);\n  float beta = atan(pointRotated.y, pointRotated.x);\n  float gamma = round((beta - alpha * 0.5) / alpha) * alpha + alpha * 0.5; // angle in sector from mid\n  c = cos(-gamma);\n  s = sin(-gamma);\n  vec2 inSector = vec2(c * pointRotated.x - s * pointRotated.y, abs(s * pointRotated.x + c * pointRotated.y));\n  return inSector.x - radiusIn;\n}",om(t,e,n,"shape-");let s=null;"shape-opacity"in t&&(s=em(r,t["shape-opacity"],Ca));let o="coordsPx";"shape-scale"in t&&(o=`coordsPx / ${em(r,t["shape-scale"],Ia)}`);let a=null;"shape-fill-color"in t&&(a=em(r,t["shape-fill-color"],ba));let l=null;"shape-stroke-color"in t&&(l=em(r,t["shape-stroke-color"],ba));let h=null;"shape-stroke-width"in t&&(h=em(r,t["shape-stroke-width"],Ca));const c=em(r,t["shape-points"],Ca);let u,d="0.";"shape-angle"in t&&(d=em(r,t["shape-angle"],Ca));let g=em(r,t["shape-radius"],Ca);if(null!==h&&(g=`${g} + ${h} * 0.5`),"shape-radius2"in t){let e=em(r,t["shape-radius2"],Ca);null!==h&&(e=`${e} + ${h} * 0.5`),u=`starDistanceField(${o}, ${c}, ${g}, ${e}, ${d})`}else u=`regularDistanceField(${o}, ${c}, ${g}, ${d})`;const f=am(u,a,l,h,s);e.setSymbolColorExpression(f)}(t,n,0,e,i):"circle-radius"in t&&function(t,e,i,n,r){r.functions.circleDistanceField="float circleDistanceField(vec2 point, float radius) {\n  return length(point) - radius;\n}",om(t,e,n,"circle-");let s=null;"circle-opacity"in t&&(s=em(r,t["circle-opacity"],Ca));let o="coordsPx";"circle-scale"in t&&(o=`coordsPx / ${em(r,t["circle-scale"],Ia)}`);let a=null;"circle-fill-color"in t&&(a=em(r,t["circle-fill-color"],ba));let l=null;"circle-stroke-color"in t&&(l=em(r,t["circle-stroke-color"],ba));let h=em(r,t["circle-radius"],Ca),c=null;"circle-stroke-width"in t&&(c=em(r,t["circle-stroke-width"],Ca),h=`(${h} + ${c} * 0.5)`);const u=am(`circleDistanceField(${o}, ${h})`,a,l,c,s);e.setSymbolColorExpression(u)}(t,n,0,e,i),function(t,e,i,n,r){if("stroke-color"in t&&e.setStrokeColorExpression(em(r,t["stroke-color"],ba)),"stroke-pattern-src"in t){const n=sm(t["stroke-pattern-src"]),s=lm(t,e,i,"stroke-pattern-",n);let o=s,a="vec2(0.)";"stroke-pattern-offset"in t&&"stroke-pattern-size"in t&&(o=em(r,t["stroke-pattern-size"],Pa),a=hm(t,"stroke-pattern-",r,s,o));let l="0.";"stroke-pattern-spacing"in t&&(l=em(r,t["stroke-pattern-spacing"],Ca)),r.functions.sampleStrokePattern="vec4 sampleStrokePattern(sampler2D texture, vec2 textureSize, vec2 textureOffset, vec2 sampleSize, float spacingPx, float currentLengthPx, float currentRadiusRatio, float lineWidth) {\n  float currentLengthScaled = currentLengthPx * sampleSize.y / lineWidth;\n  float spacingScaled = spacingPx * sampleSize.y / lineWidth;\n  float uCoordPx = mod(currentLengthScaled, (sampleSize.x + spacingScaled));\n  // make sure that we're not sampling too close to the borders to avoid interpolation with outside pixels\n  uCoordPx = clamp(uCoordPx, 0.5, sampleSize.x - 0.5);\n  float vCoordPx = (-currentRadiusRatio * 0.5 + 0.5) * sampleSize.y;\n  vec2 texCoord = (vec2(uCoordPx, vCoordPx) + textureOffset) / textureSize;\n  return texture2D(texture, texCoord);\n}";const h=`u_texture${n}`;let c="1.";"stroke-color"in t&&(c=e.getStrokeColorExpression()),e.setStrokeColorExpression(`${c} * sampleStrokePattern(${h}, ${s}, ${a}, ${o}, ${l}, currentLengthPx, currentRadiusRatio, v_width)`)}if("stroke-width"in t&&e.setStrokeWidthExpression(em(n,t["stroke-width"],Ca)),"stroke-offset"in t&&e.setStrokeOffsetExpression(em(n,t["stroke-offset"],Ca)),"stroke-line-cap"in t&&e.setStrokeCapExpression(em(n,t["stroke-line-cap"],Ra)),"stroke-line-join"in t&&e.setStrokeJoinExpression(em(n,t["stroke-line-join"],Ra)),"stroke-miter-limit"in t&&e.setStrokeMiterLimitExpression(em(n,t["stroke-miter-limit"],Ca)),"stroke-line-dash"in t){r.functions.getSingleDashDistance=`float getSingleDashDistance(float distance, float radius, float dashOffset, float dashLength, float dashLengthTotal, float capType) {\n  float localDistance = mod(distance, dashLengthTotal);\n  float distanceSegment = abs(localDistance - dashOffset - dashLength * 0.5) - dashLength * 0.5;\n  distanceSegment = min(distanceSegment, dashLengthTotal - localDistance);\n  if (capType == ${Up("square")}) {\n    distanceSegment -= v_width * 0.5;\n  } else if (capType == ${Up("round")}) {\n    distanceSegment = min(distanceSegment, sqrt(distanceSegment * distanceSegment + radiu
2387s * radius) - v_width * 0.5);\n  }\n  return distanceSegment;\n}`;let i=t["stroke-line-dash"].map((t=>em(r,t,Ca)));i.length%2==1&&(i=[...i,...i]);let s="0.";"stroke-line-dash-offset"in t&&(s=em(n,t["stroke-line-dash-offset"],Ca));const o=`dashDistanceField_${sm(t["stroke-line-dash"])}`,a=i.map(((t,e)=>`float dashLength${e} = ${t};`)),l=i.map(((t,e)=>`dashLength${e}`)).join(" + ");let h="0.",c=`getSingleDashDistance(distance, radius, ${h}, dashLength0, totalDashLength, capType)`;for(let t=2;t<i.length;t+=2)h=`${h} + dashLength${t-2} + dashLength${t-1}`,c=`min(${c}, getSingleDashDistance(distance, radius, ${h}, dashLength${t}, totalDashLength, capType))`;r.functions[o]=`float ${o}(float distance, float radius, float capType) {\n  ${a.join("\n  ")}\n  float totalDashLength = ${l};\n  return ${c};\n}`,e.setStrokeDistanceFieldExpression(`${o}(currentLengthPx + ${s}, currentRadiusPx, capType)`)}}(t,n,r,e,i),function(t,e,i,n,r){if("fill-color"in t&&e.setFillColorExpression(em(r,t["fill-color"],ba)),"fill-pattern-src"in t){const n=sm(t["fill-pattern-src"]),s=lm(t,e,i,"fill-pattern-",n);let o=s,a="vec2(0.)";"fill-pattern-offset"in t&&"fill-pattern-size"in t&&(o=em(r,t["fill-pattern-size"],Pa),a=hm(t,"fill-pattern-",r,s,o)),r.functions.sampleFillPattern="vec4 sampleFillPattern(sampler2D texture, vec2 textureSize, vec2 textureOffset, vec2 sampleSize, vec2 pxOrigin, vec2 pxPosition) {\n  float scaleRatio = pow(2., mod(u_zoom + 0.5, 1.) - 0.5);\n  vec2 pxRelativePos = pxPosition - pxOrigin;\n  // rotate the relative position from origin by the current view rotation\n  pxRelativePos = vec2(pxRelativePos.x * cos(u_rotation) - pxRelativePos.y * sin(u_rotation), pxRelativePos.x * sin(u_rotation) + pxRelativePos.y * cos(u_rotation));\n  // sample position is computed according to the sample offset & size\n  vec2 samplePos = mod(pxRelativePos / scaleRatio, sampleSize);\n  // also make sure that we're not sampling too close to the borders to avoid interpolation with outside pixels\n  samplePos = clamp(samplePos, vec2(0.5), sampleSize - vec2(0.5));\n  samplePos.y = sampleSize.y - samplePos.y; // invert y axis so that images appear upright\n  return texture2D(texture, (samplePos + textureOffset) / textureSize);\n}";const l=`u_texture${n}`;let h="1.";"fill-color"in t&&(h=e.getFillColorExpression()),e.setFillColorExpression(`${h} * sampleFillPattern(${l}, ${s}, ${a}, ${o}, pxOrigin, pxPos)`)}}(t,n,r,0,i),t.filter){const e=em(i,t.filter,Ta);n.setFragmentDiscardExpression(`!${e}`)}for(const e in i.variables){const s=i.variables[e],o=Bp(s.name);n.addUniform(`${rm(s.type)} ${o}`),r[o]=()=>{const e=t.variables[s.name];return"number"==typeof e?e:"boolean"==typeof e?e?1:0:s.type===ba?im([...To(e||"#eee")]):"string"==typeof e?jp(e):e}}for(const t in i.properties){const r=i.properties[t];e.properties[t]||(e.properties[t]=r);let s=rm(r.type),o=`a_prop_${r.name}`;r.type===ba&&(s="vec4",o=`unpackColor(${o})`,n.addVertexShaderFunction("vec4 unpackColor(vec2 packedColor) {\n  return vec4(\n    fract(floor(packedColor[0] / 256.0) / 256.0),\n    fract(packedColor[0] / 256.0),\n    fract(floor(packedColor[1] / 256.0) / 256.0),\n    fract(packedColor[1] / 256.0)\n  );\n}")),n.addVarying(`v_prop_${r.name}`,s,o)}for(const t in e.properties){const i=e.properties[t];n.addAttribute(`${rm(i.type)} a_prop_${i.name}`)}for(const t in e.functions)n.addVertexShaderFunction(e.functions[t]);for(const t in i.functions)n.addFragmentShaderFunction(i.functions[t]);const s={};for(const t in e.properties){const i=e.properties[t],n=t=>{const e=i.evaluator?i.evaluator(t):t.get(i.name);return i.type===ba?im([...To(e||"#eee")]):"string"==typeof e?jp(e):"boolean"==typeof e?e?1:0:e};s[i.name]={size:nm(i.type),callback:n}}return{builder:n,attributes:s,uniforms:r}}const um={TEXTURE:"u_texture",VELOCITY_TEXTURE:"u_velocityTexture",POSITION_TEXTURE:"u_positionTexture",PARTICLE_COUNT_SQRT:"u_particleCountSqrt",MAX_SPEED:"u_maxSpeed",GAIN:"u_gain",OFFSET:"u_offset",IS_FLOAT:"u_isFloat",RANDOM_SEED:"u_randomSeed",SPEED_FACTOR:"u_speedFactor",DROP_RATE:"u_dropRate",DROP_RATE_BUMP:"u_dropRateBump",OPACITY:"u_opacity",ROTATION:Pf.ROTATION,VIEWPORT_SIZE_PX:Pf.VIEWPORT_SIZE_PX},dm="a_position",gm="a_index",fm="v_position";class pm extends Mp{constructor(t,e){super(t,{vertexShader:e.tileVertexShader,fragmentShader:e.tileFragmentShader,cacheSize:e.cacheSize,postProcesses:[{}],uniforms:{[um.MAX_SPEED]:e.maxSpeed}}),this.particleColorFragmentShader_=e.particleColorFragmentShader,this.velocityTexture_=null,this.particleCountSqrt_=e.particles?Math.
vendor: 7,214 bytes, line 2387
2387ceil(Math.sqrt(e.particles)):256,this.particleIndexBuffer_,this.quadBuffer_,this.particlePositionProgram_,this.particlePositionVertexShader_=e.particlePositionVertexShader,this.particlePositionFragmentShader_=e.particlePositionFragmentShader,this.previousPositionTexture_,this.nextPositionTexture_,this.particleColorProgram_,this.particleColorVertexShader_=e.particleColorVertexShader,this.particleColorFragmentShader_=e.particleColorFragmentShader,this.textureProgram_,this.textureVertexShader_=e.textureVertexShader,this.textureFragmentShader_=e.textureFragmentShader,this.previousTrailsTexture_,this.nextTrailsTexture_,this.fadeOpacity_=.996,this.maxSpeed_=e.maxSpeed,this.speedFactor_=e.speedFactor||.001,this.dropRate_=.003,this.dropRateBump_=.01,this.tempVec2_=[0,0],this.renderedWidth_=0,this.renderedHeight_=0}afterHelperCreated(){super.afterHelperCreated();const t=this.helper,e=t.getGL();this.framebuffer_=e.createFramebuffer();const i=this.particleCountSqrt_*this.particleCountSqrt_,n=new Float32Array(i);for(let t=0;t<i;++t)n[t]=t;const r=new Sf(Gg,Ug);r.setArray(n),t.flushBufferData(r),this.particleIndexBuffer_=r;const s=new Float32Array([0,0,1,0,0,1,0,1,1,0,1,1]),o=new Sf(Gg,Ug);o.setArray(s),t.flushBufferData(o),this.quadBuffer_=o;const a=new Uint8Array(4*i);for(let t=0;t<a.length;++t)a[t]=Math.floor(256*Math.random());this.previousPositionTexture_=t.createTexture([this.particleCountSqrt_,this.particleCountSqrt_],a,null,!0),this.nextPositionTexture_=t.createTexture([this.particleCountSqrt_,this.particleCountSqrt_],a,null,!0),this.particlePositionProgram_=t.getProgram(this.particlePositionFragmentShader_,this.particlePositionVertexShader_),this.particleColorProgram_=t.getProgram(this.particleColorFragmentShader_,this.particleColorVertexShader_),this.textureProgram_=t.getProgram(this.textureFragmentShader_,this.textureVertexShader_)}createSizeDependentTextures_(){const t=this.helper,e=t.getGL(),i=t.getCanvas(),n=i.width,r=i.height,s=new Uint8Array(n*r*4);this.nextTrailsTexture_&&e.deleteTexture(this.nextTrailsTexture_),this.nextTrailsTexture_=t.createTexture([n,r],s,null,!0),this.previousTrailsTexture_&&e.deleteTexture(this.previousTrailsTexture_),this.previousTrailsTexture_=t.createTexture([n,r],s,null,!0)}beforeFinalize(t){const e=this.helper,i=e.getGL(),n=e.getCanvas(),r=n.width,s=n.height;this.renderedWidth_==r&&this.renderedHeight_==s||this.createSizeDependentTextures_();const o=[r,s];this.velocityTexture_=e.createTexture(o,null,this.velocityTexture_),i.copyTexImage2D(i.TEXTURE_2D,0,i.RGBA,0,0,r,s,0),this.drawParticleTrails_(t),this.updateParticlePositions_(t),t.animate=!0,this.renderedWidth_=r,this.renderedHeight_=s}drawParticleTrails_(t){const e=this.helper,i=e.getGL();e.bindFrameBuffer(this.framebuffer_,this.nextTrailsTexture_),this.drawTexture_(this.previousTrailsTexture_,this.fadeOpacity_),this.drawParticleColor_(t),e.bindInitialFrameBuffer(),i.clearColor(0,0,0,0),i.clear(i.COLOR_BUFFER_BIT),i.enable(i.BLEND),i.blendFunc(i.SRC_ALPHA,i.ONE_MINUS_SRC_ALPHA),this.drawTexture_(this.nextTrailsTexture_,1),i.disable(i.BLEND);const n=this.nextTrailsTexture_;this.nextTrailsTexture_=this.previousTrailsTexture_,this.previousTrailsTexture_=n}drawTexture_(t,e){const i=this.helper,n=i.getGL();i.useProgram(this.textureProgram_),i.bindTexture(t,0,um.TEXTURE),i.bindAttribute(this.quadBuffer_,dm,2),this.helper.setUniformFloatValue(um.OPACITY,e),n.drawArrays(n.TRIANGLES,0,6)}drawParticleColor_(t){const e=this.helper,i=e.getGL();e.useProgram(this.particleColorProgram_);const n=this.particleCountSqrt_*this.particleCountSqrt_;e.bindAttribute(this.particleIndexBuffer_,gm,1),e.bindTexture(this.previousPositionTexture_,0,um.POSITION_TEXTURE),e.bindTexture(this.velocityTexture_,1,um.VELOCITY_TEXTURE),this.helper.setUniformFloatValue(um.PARTICLE_COUNT_SQRT,this.particleCountSqrt_);const r=this.tempVec2_;r[0]=Math.cos(t.viewState.rotation),r[1]=Math.sin(t.viewState.rotation),this.helper.setUniformFloatVec2(um.ROTATION,r),this.helper.setUniformFloatValue(um.MAX_SPEED,this.maxSpeed_),i.drawArrays(i.POINTS,0,n)}updateParticlePositions_(t){const e=this.helper,i=e.getGL();e.useProgram(this.particlePositionProgram_),i.viewport(0,0,this.particleCountSqrt_,this.particleCountSqrt_),e.bindFrameBuffer(this.framebuffer_,this.nextPositionTexture_),e.bindTexture(this.previousPositionTexture_,0,um.POSITION_TEXTURE),e.bindTexture(this.velocityTexture_,1,um.VELOCITY_TEXTURE),e.bindAttribute(this.quadBuffer_,dm,2),e.setUniformFloatValue(um.RANDOM_SEED,Math.random()),e.setUniformFloatValue(um.SPEED_FACTOR,this.speedFactor_),e.setUniformFloatValue(um.DROP_RATE,this.dropRate_),e.setUniformFloatValue(um.DROP_RATE_BUMP,this.dropRateBump_);const n=this.tempVec2_;n[0]=Math.cos(t.viewState.rotation),n[1]=Math.sin(t.viewState.rotation),this.helper.setUniformFloatVec2(um.ROTATION,n);const r=t.size;this.helper.setUniformFloatVec2(um.VIEWPORT_SIZE_PX,[r[0],r[1]]),i.drawArrays(i.TRIANGLES,0,6);const s=this.nextPositionTexture_;this.nextPositionTexture_=this.previousPositionTexture_,this.previousPositionTexture_=s}}const mm="GENERATE_POLYGON_BUFFERS",_m="GENERATE_POINT_BUFFERS",ym="GENERATE_LINE_STRING_BUFFERS";function xm(){const t='const t="GENERATE_POLYGON_BUFFERS",e="GENERATE_POINT_BUFFERS",n="GENERATE_LINE_STRING_BUFFERS";function r(t,e){const n=e[0],r=e[1];return e[0]=t[0]*n+t[2]*r+t[4],e[1]=t[1]*n+t[3]*r+t[5],e}function x(t,e){const n=(r=e)[0]*r[3]-r[1]*r[2];var r;!function(t,e){if(!t)throw new Error(e)}(0!==n,"Transformation matrix cannot be inverted");const x=e[0],o=e[1],u=e[2],i=e[3],f=e[4],s=e[5];return t[0]=i/n,t[1]=-o/n,t[2]=-u/n,t[3]=x/n,t[4]=(u*s-i*f)/n,t[5]=-(x*s-o*f)/n,t}function o(t,e,n=2){const r=e&&e.length,x=r?e[0]*n:t.length;let o=u(t,0,x,n,!0);const i=[];if(!o||o.next===o.prev)return i;let s,l,c;if(r&&(o=function(t,e,n,r){const x=[];for(let n=0,o=e.length;n<o;n++){const i=u(t,e[n]*r,n<o-1?e[n+1]*r:t.length,r,!1);i===i.next&&(i.steiner=!0),x.push(g(i))}x.sort(y);for(let t=0;t<x.length;t++)n=h(x[t],n);return n}(t,e,o,n)),t.length>80*n){s=1/0,l=1/0;let e=-1/0,r=-1/0;for(let o=n;o<x;o+=n){const n=t[o],x=t[o+1];n<s&&(s=n),x<l&&(l=x),n>e&&(e=n),x>r&&(r=x)}c=Math.max(e-s,r-l),c=0!==c?32767/c:0}return f(o,i,n,s,l,c,0),i}function u(t,e,n,r,x){let o;if(x===function(t,e,n,r){let x=0;for(let o=e,u=n-r;o<n;o+=r)x+=(t[u]-t[o])*(t[o+1]+t[u+1]),u=o;return x}(t,e,n,r)>0)for(let x=e;x<n;x+=r)o=z(x/r|0,t[x],t[x+1],o);else for(let x=n-r;x>=e;x-=r)o=z(x/r|0,t[x],t[x+1],o);return o&&M(o,o.next)&&(F(o),o=o.next),o}function i(t,e){if(!t)return t;e||(e=t);let n,r=t;do{if(n=!1,r.steiner||!M(r,r.next)&&0!==d(r.prev,r,r.next))r=r.next;else{if(F(r),r=e=r.prev,r===r.next)break;n=!0}}while(n||r!==e);return e}function f(t,e,n,r,x,o,u){if(!t)return;!u&&o&&function(t,e,n,r){let x=t;do{0===x.z&&(x.z=v(x.x,x.y,e,n,r)),x.prevZ=x.prev,x.nextZ=x.next,x=x.next}while(x!==t);x.prevZ.nextZ=null,x.prevZ=null,function(t){let e,n=1;do{let r,x=t;t=null;let o=null;for(e=0;x;){e++;let u=x,i=0;for(let t=0;t<n&&(i++,u=u.nextZ,u);t++);let f=n;for(;i>0||f>0&&u;)0!==i&&(0===f||!u||x.z<=u.z)?(r=x,x=x.nextZ,i--):(r=u,u=u.nextZ,f--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;x=u}o.nextZ=null,n*=2}while(e>1)}(x)}(t,r,x,o);let y=t;for(;t.prev!==t.next;){const h=t.prev,p=t.next;
vendor: 4,531 bytes, line 2387
2387if(o?l(t,r,x,o):s(t))e.push(h.i,t.i,p.i),F(t),t=p.next,y=p.next;else if((t=p)===y){u?1===u?f(t=c(i(t),e),e,n,r,x,o,2):2===u&&a(t,e,n,r,x,o):f(i(t),e,n,r,x,o,1);break}}}function s(t){const e=t.prev,n=t,r=t.next;if(d(e,n,r)>=0)return!1;const x=e.x,o=n.x,u=r.x,i=e.y,f=n.y,s=r.y,l=x<o?x<u?x:u:o<u?o:u,c=i<f?i<s?i:s:f<s?f:s,a=x>o?x>u?x:u:o>u?o:u,y=i>f?i>s?i:s:f>s?f:s;let h=r.next;for(;h!==e;){if(h.x>=l&&h.x<=a&&h.y>=c&&h.y<=y&&b(x,i,o,f,u,s,h.x,h.y)&&d(h.prev,h,h.next)>=0)return!1;h=h.next}return!0}function l(t,e,n,r){const x=t.prev,o=t,u=t.next;if(d(x,o,u)>=0)return!1;const i=x.x,f=o.x,s=u.x,l=x.y,c=o.y,a=u.y,y=i<f?i<s?i:s:f<s?f:s,h=l<c?l<a?l:a:c<a?c:a,p=i>f?i>s?i:s:f>s?f:s,g=l>c?l>a?l:a:c>a?c:a,Z=v(y,h,e,n,r),M=v(p,g,e,n,r);let w=t.prevZ,m=t.nextZ;for(;w&&w.z>=Z&&m&&m.z<=M;){if(w.x>=y&&w.x<=p&&w.y>=h&&w.y<=g&&w!==x&&w!==u&&b(i,l,f,c,s,a,w.x,w.y)&&d(w.prev,w,w.next)>=0)return!1;if(w=w.prevZ,m.x>=y&&m.x<=p&&m.y>=h&&m.y<=g&&m!==x&&m!==u&&b(i,l,f,c,s,a,m.x,m.y)&&d(m.prev,m,m.next)>=0)return!1;m=m.nextZ}for(;w&&w.z>=Z;){if(w.x>=y&&w.x<=p&&w.y>=h&&w.y<=g&&w!==x&&w!==u&&b(i,l,f,c,s,a,w.x,w.y)&&d(w.prev,w,w.next)>=0)return!1;w=w.prevZ}for(;m&&m.z<=M;){if(m.x>=y&&m.x<=p&&m.y>=h&&m.y<=g&&m!==x&&m!==u&&b(i,l,f,c,s,a,m.x,m.y)&&d(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function c(t,e){let n=t;do{const r=n.prev,x=n.next.next;!M(r,x)&&w(r,n,n.next,x)&&E(r,x)&&E(x,r)&&(e.push(r.i,n.i,x.i),F(n),F(n.next),n=t=x),n=n.next}while(n!==t);return i(n)}function a(t,e,n,r,x,o){let u=t;do{let t=u.next.next;for(;t!==u.prev;){if(u.i!==t.i&&Z(u,t)){let s=I(u,t);return u=i(u,u.next),s=i(s,s.next),f(u,e,n,r,x,o,0),void f(s,e,n,r,x,o,0)}t=t.next}u=u.next}while(u!==t)}function y(t,e){return t.x-e.x}function h(t,e){const n=function(t,e){let n=e;const r=t.x,x=t.y;let o,u=-1/0;do{if(x<=n.y&&x>=n.next.y&&n.next.y!==n.y){const t=n.x+(x-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(t<=r&&t>u&&(u=t,o=n.x<n.next.x?n:n.next,t===r))return o}n=n.next}while(n!==e);if(!o)return null;const i=o,f=o.x,s=o.y;let l=1/0;n=o;do{if(r>=n.x&&n.x>=f&&r!==n.x&&b(x<s?r:u,x,f,s,x<s?u:r,x,n.x,n.y)){const e=Math.abs(x-n.y)/(r-n.x);E(n,t)&&(e<l||e===l&&(n.x>o.x||n.x===o.x&&p(o,n)))&&(o=n,l=e)}n=n.next}while(n!==i);return o}(t,e);if(!n)return e;const r=I(n,t);return i(r,r.next),i(n,n.next)}function p(t,e){return d(t.prev,t,e.prev)<0&&d(e.next,t,t.next)<0}function v(t,e,n,r,x){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-n)*x|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*x|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function g(t){let e=t,n=t;do{(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next}while(e!==t);return n}function b(t,e,n,r,x,o,u,i){return(x-u)*(e-i)>=(t-u)*(o-i)&&(t-u)*(r-i)>=(n-u)*(e-i)&&(n-u)*(o-i)>=(x-u)*(r-i)}function Z(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&w(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(t,e)&&(E(t,e)&&E(e,t)&&function(t,e){let n=t,r=!1;const x=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!=n.next.y>o&&n.next.y!==n.y&&x<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),n=n.next}while(n!==t);return r}(t,e)&&(d(t.prev,t,e.prev)||d(t,e.prev,e))||M(t,e)&&d(t.prev,t,t.next)>0&&d(e.prev,e,e.next)>0)}function d(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function M(t,e){return t.x===e.x&&t.y===e.y}function w(t,e,n,r){const x=A(d(t,e,n)),o=A(d(t,e,r)),u=A(d(n,r,t)),i=A(d(n,r,e));return x!==o&&u!==i||(!(0!==x||!m(t,n,e))||(!(0!==o||!m(t,r,e))||(!(0!==u||!m(n,t,r))||!(0!==i||!m(n,e,r)))))}function m(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function A(t){return t>0?1:t<0?-1:0}function E(t,e){return d(t.prev,t,t.next)<0?d(t,e,t.next)>=0&&d(t,t.prev,e)>=0:d(t,e,t.prev)<0||d(t,t.next,e)<0}function I(t,e){const n=P(t.i,t.x,t.y),r=P(e.i,e.x,e.y),x=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=x,x.prev=n,r.next=n,n.prev=r,o.next=r,r.prev=o,r}function z(t,e,n,r){const x=P(t,e,n);return r?(x.next=r.next,x.prev=r,r.next.prev=x,r.next=x):(x.prev=x,x.next=x),x}function F(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 P(t,e,n){return{i:t,x:e,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}new Array(6);const B=[],N={vertexPosition:0,indexPosition:0};function R(t,e,n,r,x){t[e+0]=n,t[e+1]=r,t[e+2]=x}function S(t,e,n,r,x,o){const u=3+x,i=t[e+0],f=t[e+1],s=B;s.length=x;for(let n=0;n<s.length;n++)s[n]=t[e+2+n];
2387let l=o?o.vertexPosition:0,c=o?o.indexPosition:0;const a=l/u;return R(n,l,i,f,0),s.length&&n.set(s,l+3),l+=u,R(n,l,i,f,1),s.length&&n.set(s,l+3),l+=u,R(n,l,i,f,2),s.length&&n.set(s,l+3),l+=u,R(n,l,i,f,3),s.length&&n.set(s,l+3),l+=u,r[c++]=a,r[c++]=a+1,r[c++]=a+3,r[c++]=a+1,r[c++]=a+2,r[c++]=a+3,N.vertexPosition=l,N.indexPosition=c,N}function T(t,e,n,x,o,u,i,f,s,l,c){const a=10+f.length,y=u.length/a,h=[t[e+0],t[e+1]],p=[t[n],t[n+1]],v=t[e+2],g=t[n+2],b=r(s,[...h]),Z=r(s,[...p]);function d(t,e,n){const r=Math.sqrt((e[0]-t[0])*(e[0]-t[0])+(e[1]-t[1])*(e[1]-t[1])),x=[(e[0]-t[0])/r,(e[1]-t[1])/r],o=[-x[1],x[0]],u=Math.sqrt((n[0]-t[0])*(n[0]-t[0])+(n[1]-t[1])*(n[1]-t[1])),i=[(n[0]-t[0])/u,(n[1]-t[1])/u],f=0===r||0===u?0:Math.acos((s=i[0]*x[0]+i[1]*x[1],l=-1,c=1,Math.min(Math.max(s,l),c)));var s,l,c;return i[0]*o[0]+i[1]*o[1]>0?f:2*Math.PI-f}let M=-1,w=-1,m=c;const A=null!==o;if(null!==x){M=d(b,Z,r(s,[...[t[x],t[x+1]]])),Math.cos(M)<=.985&&(m+=Math.tan((M-Math.PI)/2))}if(A){w=d(Z,b,r(s,[...[t[o],t[o+1]]])),Math.cos(w)<=.985&&(m+=Math.tan((Math.PI-w)/2))}function E(t,e){return 0===e?1e4*t:Math.sign(e)*(1e4*t+Math.abs(e))}return u.push(h[0],h[1],v,p[0],p[1],g,M,w,l,E(0,c)),u.push(...f),u.push(h[0],h[1],v,p[0],p[1],g,M,w,l,E(1,c)),u.push(...f),u.push(h[0],h[1],v,p[0],p[1],g,M,w,l,E(2,c)),u.push(...f),u.push(h[0],h[1],v,p[0],p[1],g,M,w,l,E(3,c)),u.push(...f),i.push(y,y+1,y+2,y+1,y+3,y+2),{length:l+Math.sqrt((Z[0]-b[0])*(Z[0]-b[0])+(Z[1]-b[1])*(Z[1]-b[1])),angle:m}}function _(t,e,n,r,x){const u=2+x;let i=e;const f=t.slice(i,i+x);i+=x;const s=t[i++];let l=0;const c=new Array(s-1);for(let e=0;e<s;e++)l+=t[i++],e<s-1&&(c[e]=l);const a=t.slice(i,i+2*l),y=o(a,c,2);for(let t=0;t<y.length;t++)r.push(y[t]+n.length/u);for(let t=0;t<a.length;t+=2)n.push(a[t],a[t+1],...f);return i+2*l}const O=self;O.onmessage=r=>{const o=r.data;switch(o.type){case e:{const t=3,e=2,n=o.customAttributesSize,r=e+n,x=new Float32Array(o.renderInstructions),u=x.length/r,i=4*u*(n+t),f=new Uint32Array(6*u),s=new Float32Array(i);let l;for(let t=0;t<x.length;t+=r)l=S(x,t,s,f,n,l);const c=Object.assign({vertexBuffer:s.buffer,indexBuffer:f.buffer,renderInstructions:x.buffer},o);O.postMessage(c,[s.buffer,f.buffer,x.buffer]);break}case n:{const t=[],e=[],n=o.customAttributesSize,r=3,u=new Float32Array(o.renderInstructions);let i=0;const f=[1,0,0,1,0,0];let s,l;for(x(f,o.renderInstructionsTransform);i<u.length;){l=Array.from(u.slice(i,i+n)),i+=n,s=u[i++];const x=i,o=i+(s-1)*r,c=u[x]===u[o]&&u[x+1]===u[o+1];let a=0,y=0;for(let n=0;n<s-1;n++){let h=null;n>0?h=i+(n-1)*r:c&&(h=o-r);let p=null;n<s-2?p=i+(n+2)*r:c&&(p=x+r);const v=T(u,i+n*r,i+(n+1)*r,h,p,t,e,l,f,a,y);a=v.length,y=v.angle}i+=s*r}const c=Uint32Array.from(e),a=Float32Array.from(t),y=Object.assign({vertexBuffer:a.buffer,indexBuffer:c.buffer,renderInstructions:u.buffer},o);O.postMessage(y,[a.buffer,c.buffer,u.buffer]);break}case t:{const t=[],e=[],n=o.customAttributesSize,r=new Float32Array(o.renderInstructions);let x=0;for(;x<r.length;)x=_(r,x,t,e,n);const u=Uint32Array.from(e),i=Float32Array.from(t),f=Object.assign({vertexBuffer:i.buffer,indexBuffer:u.buffer,renderInstructions:r.buffer},o);O.postMessage(f,[i.buffer,u.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"})))}function vm(t,e){const i=t.viewState.projection,n=e.getSource().getWrapX()&&i.canWrapX(),r=i.getExtent(),s=t.extent,o=n?Ie(r):null,a=n?Math.ceil((s[2]-r[2])/o)+1:1;return[n?Math.floor((s[0]-r[0])/o):0,a,o]}class Sm extends vp{constructor(t,e){const i=e.uniforms||{},n=[1,0,0,1,0,0];i[Pf.PROJECTION_MATRIX]=n,super(t,{uniforms:i,postProcesses:e.postProcesses}),this.sourceRevision_=-1,this.verticesBuffer_=new Sf(Gg,Bg),this.indicesBuffer_=new Sf(jg,Bg),this.vertexShader_=e.vertexShader,this.fragmentShader_=e.fragmentShader,this.program_,this.hitDetectionEnabled_=e.hitDetectionEnabled??!0;const r=e.attributes?e.attributes.map((function(t){return{name:"a_prop_"+t.name,size:1,type:If.FLOAT}})):[];this.attributes=[{name:"a_position",size:2,type:If.FLOAT},{name:"a_index",size:1,type:If.FLOAT}],this.hitDetectionEnabled_&&(this.attributes.push({name:"a_prop_hitColor",size:4,type:If.FLOAT}),this.attributes.push({name:"a_featureUid",size:1,type:If.FLOAT})),this.attributes.push(...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.hitRenderTarget_,this.lastSentId=0,this.worker_=xm(),this.worker_.addEventListener("message",(t=>{const e=t.data;if(e.type===_m){const i=e.projectionTransform;this.verticesBuffer_.fromArrayBuffer(e.vertexBuffer),this.helper.flushBufferData(this.verticesBuffer_),this.indicesBuffer_.fromArrayBuffer(e.indexBuffer),this.helper.flushBufferData(this.indicesBuffer_),this.renderTransform_=i,$t(this.invertRenderTransform_,this.renderTransform_),this.renderInstructions_=new Float32Array(t.data.renderInstructions),e.id===this.lastSentId&&(this.ready=!0),this.getLayer().changed()}})),this.featureCache_={},this.featureCount_=0;const s=this.getLayer().getSource();this.sourceListenKeys_=[A(s,Vu,this.handleSourceFeatureAdded_,this),A(s,$u,this.handleSourceFeatureChanged_,this),A(s,Zu,this.handleSourceFeatureDelete_,this),A(s,Wu,this.handleSourceFeatureClear_,this)],s.forEac
2387hFeature((t=>{this.featureCache_[U(t)]={feature:t,properties:t.getProperties(),geometry:t.getGeometry()},this.featureCount_++}))}afterHelperCreated(){this.program_=this.helper.getProgram(this.fragmentShader_,this.vertexShader_),this.hitDetectionEnabled_&&(this.hitRenderTarget_=new Gf(this.helper)),this.verticesBuffer_.getArray()&&this.helper.flushBufferData(this.verticesBuffer_),this.indicesBuffer_.getArray()&&this.helper.flushBufferData(this.indicesBuffer_)}handleSourceFeatureAdded_(t){const e=t.feature;this.featureCache_[U(e)]={feature:e,properties:e.getProperties(),geometry:e.getGeometry()},this.featureCount_++}handleSourceFeatureChanged_(t){const e=t.feature;this.featureCache_[U(e)]={feature:e,properties:e.getProperties(),geometry:e.getGeometry()}}handleSourceFeatureDelete_(t){const e=t.feature;delete this.featureCache_[U(e)],this.featureCount_--}handleSourceFeatureClear_(){this.featureCache_={},this.featureCount_=0}renderFrame(t){const e=this.helper.getGL();this.preRender(e,t);const[i,n,r]=vm(t,this.getLayer());this.renderWorlds(t,!1,i,n,r),this.helper.finalizeDraw(t,this.dispatchPreComposeEvent,this.dispatchPostComposeEvent),this.hitDetectionEnabled_&&(this.renderWorlds(t,!0,i,n,r),this.hitRenderTarget_.clearCachedData()),this.postRender(e,t);return this.helper.getCanvas()}prepareFrameInternal(t){const e=this.getLayer(),i=e.getSource(),n=t.viewState,r=!t.viewHints[gs]&&!t.viewHints[fs],s=!he(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 Rl?e.getRenderBuffer():0,a=qt(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=pn(),n=(this.hitDetectionEnabled_?7:2)+this.customAttributes.length,r=n*this.featureCount_;let s,o;this.renderInstructions_&&this.renderInstructions_.length===r||(this.renderInstructions_=new Float32Array(r));const a=[],l=[];let h=-1;for(const n in this.featureCache_)if(s=this.featureCache_[n],o=s.geometry,o&&"Point"===o.getType()){if(i){const e=_n(o.getFlatCoordinates(),t.viewState.projection);a[0]=e[0],a[1]=e[1]}else a[0]=o.getFlatCoordinates()[0],a[1]=o.getFlatCoordinates()[1];if(Ut(e,a),this.renderInstructions_[++h]=a[0],this.renderInstructions_[++h]=a[1],this.hitDetectionEnabled_){const t=fp(h+5,l);this.renderInstructions_[++h]=t[0],this.renderInstructions_[++h]=t[1],this.renderInstructions_[++h]=t[2],this.renderInstructions_[++h]=t[3],this.renderInstructions_[++h]=Number(n)}for(let t=0;t<this.customAttributes.length;t++){const e=this.customAttributes[t].callback(s.feature,s.properties);this.renderInstructions_[++h]=e}}const c={id:++this.lastSentId,type:_m,renderInstructions:this.renderInstructions_.buffer,customAttributesSize:n-2};c.projectionTransform=e,this.ready=!1,this.worker_.postMessage(c,[this.renderInstructions_.buffer]),this.renderInstructions_=null}forEachFeatureAtCoordinate(t,e,i,n,r){if(Ft(this.hitDetectionEnabled_,"`forEachFeatureAtCoordinate` cannot be used on a WebGL layer if the hit detection logic has been disabled using the `disableHitDetection: true` option."),!this.renderInstructions_||!this.hitDetectionEnabled_)return;const s=Ut(e.coordinateToPixelTransform,t.slice()),o=this.hitRenderTarget_.readPixel(s[0]/2,s[1]/2),a=pp([o[0]/255,o[1]/255,o[2]/255,o[3]/255]),l=this.renderInstructions_[a],h=Math.floor(l).toString(),c=this.getLayer().getSource().getFeatureByUid(h);return c?n(c,this.getLayer(),null):void 0}renderWorlds(t,e,i,n,r){let s=i;this.helper.useProgram(this.program_,t),e&&(this.hitRenderTarget_.setSize([Math.floor(t.size[0]/2),Math.floor(t.size[1]/2)]),this.helper.prepareDrawToRenderTarget(t,this.hitRenderTarget_,!0)),this.helper.bindBuffer(this.verticesBuffer_),this.helper.bindBuffer(this.indicesBuffer_),this.helper.enableAttributes(this.attributes);do{this.helper.makeProjectionTransform(t,this.currentTransform_),Xt(this.currentTransform_,s*r,0),kt(this.currentTransform_,this.invertRenderTransform_),this.helper.applyUniforms(t),this.helper.applyHitDetectionUniform(e);const i=this.indicesBuffer_.getSize();this.helper.drawElements(0,i)}while(++s<n)}disposeInternal(){this.worker_.terminate(),this.sourceListenKeys_.forEach((function(t){D(t)})),this.sourceListenKeys_=null,super.disposeInternal()}renderDeclutter(){}}function Em(t,e,i,n){let r=0;for(const s in e){const o=e[s],a=o.callback.call(i,i.feature);t[n+r++]=a[0]??a,o.size&&1!==o.size&&(t[n+r++]=a[1],o.size<3||(t[n+r++]=a[2],o.size<4||(t[n+r++]=a[3])))}return r}function wm(t){return Object.keys(t).reduce(((e,i)=>e+(t[i].size||1)),0)}function Tm(t,e,i,n){const r=(2+wm(i))*t.geometriesCount;e&&e.length===r||(e=new Float32Array(r));const s=[];let o=0;for(const r in t.entries){const a=t.entries[r];for(let t=0,r=a.flatCoordss.length;t<r;t++)s[0]=a.flatCoordss[t][0],s[1]=a.flatCoordss[t][1],Ut(n,s),e[o++]=s[0],e[o++]=s[1],o+=Em(e,i,a,o)}return e}function Cm(t,e,i,n){const r=3*t.verticesCount+(1+wm(i))*t.geometriesCount;e&&e.length===r||(e=new Float32Array(r));const s=[];let o=0;for(const r in t.entries){const a=t.entries[r];for(let t=0,r=a.flatCoordss.length;t<r;t++){s.length=a.flatCoordss[t].length,Tn(a.flatCoordss[t],0,s.length,3,n,s,3),o+=Em(e,i,a,o),e[o++]=s.length/3;for(let t=0,i=s.length;t<i;t+=3)e[o++]=s[t],e[o++]=s[t+1],e[o++]=s[t+2]}}return e}function Rm(t,e,i,n){const r=2*t.verticesCount+(1+wm(i))*t.geometriesCount+t.ringsCount;e&&e.length===r||(e=new Float32Array(r));const s=[];let o=0;for(const r in t.entries){const a=t.entries[r];for(let t=0,r=a.flatCoordss.length;t<r;t++){s.length=a.flatCoordss[t].length,Tn(a.flatCoordss[t],0,s.length,2,n,s),o+=Em(e,i,a,o),e[o++]=a.ringsVerticesCounts[t].length;for(let i=0,n=a.ringsVerticesCounts[t].length;i<n;i++)e[o++]=a.ringsVerticesCounts[t][i];for(let t=0,i=s.length;t<i;t+=2)e[o++]=s[t],e[o++]=s[t+1]}}return e}const bm=[],Pm=xm();let Im=0;const Lm="a_position",Fm="a_index",Mm="a_segmentStart",Am="a_segmentEnd",Om="a_measureStart",Dm="a_measureEnd",Nm="a_parameters",km="a_joinAngles",Gm="a_distance";class jm{constructor(t,e,i){this.helper_,this.hitDetectionEnabled_=i;let n=t;if(!("builder"in t)){const e=cm(t);n={builder:e.builder,attributes:e.attributes,uniforms:e.uniforms}}this.fillProgram_,this.strokeProgram_,this.symbolProgram_,this.hasFill_=!!n.builder.getFillVertexShader(),this.hasFill_&&(this.fillVertexShader_=n.builder.getFillVertexShader(),this.fillFragmentShader_=n.builder.getFillFragmentShader()),this.hasStroke_=!!n.builder.getStrokeVertexShader(),this.hasStroke_&&(this.strokeVertexShader_=n.builder.getStrokeVertexShader(),this.strokeFragmentShader_=n.builder.getStrokeFragmentShader()),this.hasSymbol_=!!n.builder.getSymbolVertexShader(),this.hasSymbol_&&(this.symbolVertexShader_=n.builder.getSymbolVertexShader(),this.symbolFragmentShader_=n.builder.getSymbolFragmentShader());const r=this.hitDetectionEnabled_?{hitColor:{callback(){return fp(this.ref,bm)},size:4}}:{};this.customAttributes_=Object.assign({},r,n.attributes),this.uniforms_=n.uniforms;const s=Object.entries(this.customAttributes_).map((([t,e])=>({name:`a_prop_${t}`,size:e.size||1,type:If.FLOAT})));this.polygonAttributesDesc_=[{name:Lm,size:2,type:If.FLOAT},...s],this.lineStringAttributesDesc_=[{name:Mm,size:2,type:If.FLOAT},{name:Om,size:1,type:If.FLOAT},{name:Am,size:2,type:If.FLOAT},{name:Dm,size:1,type:If.FLOAT},{name:km,size:2,type:If.FLOAT},{name:Gm,size:1,type:If.FLOAT},{name:Nm,size:1,type:If.FLOAT},...s],this.pointAttributesDesc_=[{name:Lm,size:2,type:If.FLOAT},{name:Fm,size:1,type:If.FLOAT},...s],this.setHelper(e)}async generateBuffers(t,e){const i=this.generateRenderInstructions_(t,e),[n,r,s]=await Promise.all([this.generateBuffersForType_(i.polygonInstructions,"Polygon",e),this.generateBuffersForType_(i.lineStringInstructions,"LineString",e),this.generateBuffersForType_(i.pointInstructions,"Point",e)]);return{polygonBuffers:n,lineStringBuffers:r,pointBuffers:s,invertVerticesTransform:$t([1,0,0,1,0,0],e)}}generateRenderInstructions_(t,e){return{polygonInstructions:this.hasFill_?Rm(t.polygonBatch,new Float32Array(0),this.customAttributes_,e):null,lineStringInstructions:this.hasStroke_?Cm(t.lineStringBatch,new Float32Array(0),this.customAttributes_,e):null,pointInstructions:this.hasSymbol_?Tm(t.pointBatch,new Float32Array(0),this.customAttributes_,e):null}}generateBuffersForType_(t,e,i){if(null===t)return null;const n=Im++;let r;switch(e){case"Polygon":r=mm;break;case"LineString":r=ym;break;case"Point":r=_m}const s={id:n,type:r,renderInstructions:t.buffer,renderInstructionsTransform:i,customAttributesSize:wm(this.customAttributes_)};return Pm.postMessage(s,[t.buffer]),t=null,new Promise((t=>{const e=i=>{const r=i.data;if(r.id!==n)return;if(Pm.removeEventListener("message",e),!this.helper_.getGL())return;const s=new Sf(Gg,Bg).fromArrayBuffer(r.vertexBuffer),o=new Sf(jg,Bg).fromArrayBuffer(r.
vendor: 49,803 bytes, line 2387
2387indexBuffer);this.helper_.flushBufferData(s),this.helper_.flushBufferData(o),t([o,s])};Pm.addEventListener("message",e)}))}render(t,e,i){this.hasFill_&&this.renderInternal_(t.polygonBuffers[0],t.polygonBuffers[1],this.fillProgram_,this.polygonAttributesDesc_,e,i),this.hasStroke_&&this.renderInternal_(t.lineStringBuffers[0],t.lineStringBuffers[1],this.strokeProgram_,this.lineStringAttributesDesc_,e,i),this.hasSymbol_&&this.renderInternal_(t.pointBuffers[0],t.pointBuffers[1],this.symbolProgram_,this.pointAttributesDesc_,e,i)}renderInternal_(t,e,i,n,r,s){const o=t.getSize();0!==o&&(this.helper_.useProgram(i,r),this.helper_.bindBuffer(e),this.helper_.bindBuffer(t),this.helper_.enableAttributes(n),s(),this.helper_.drawElements(0,o))}setHelper(t,e=null){this.helper_=t,this.hasFill_&&(this.fillProgram_=this.helper_.getProgram(this.fillFragmentShader_,this.fillVertexShader_)),this.hasStroke_&&(this.strokeProgram_=this.helper_.getProgram(this.strokeFragmentShader_,this.strokeVertexShader_)),this.hasSymbol_&&(this.symbolProgram_=this.helper_.getProgram(this.symbolFragmentShader_,this.symbolVertexShader_)),this.helper_.addUniforms(this.uniforms_),e&&(e.polygonBuffers&&(this.helper_.flushBufferData(e.polygonBuffers[0]),this.helper_.flushBufferData(e.polygonBuffers[1])),e.lineStringBuffers&&(this.helper_.flushBufferData(e.lineStringBuffers[0]),this.helper_.flushBufferData(e.lineStringBuffers[1])),e.pointBuffers&&(this.helper_.flushBufferData(e.pointBuffers[0]),this.helper_.flushBufferData(e.pointBuffers[1])))}}const Um={...Pf,RENDER_EXTENT:"u_renderExtent",PATTERN_ORIGIN:"u_patternOrigin",GLOBAL_ALPHA:"u_globalAlpha"};const Bm={...Sp,TILE_MASK_TEXTURE:"u_depthMask",TILE_ZOOM_LEVEL:"u_tileZoomLevel"},zm={POSITION:"a_position"};const Xm=0,Vm=1,$m=2,Wm=3,Zm=4,Ym=5,Hm=6,Km=7,qm=8,Jm=9,Qm=10,t_=11,e_=12,i_=[qm],n_=[e_],r_=[Vm],s_=[Wm];class o_ extends Rc{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],te(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=ne(l,u),f!==g?(p&&(o[a++]=h,o[a++]=c,p=!1),o[a++]=u[0],o[a++]=u[1]):f===Ht.INTERSECTING?(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,r){this.beginGeometry(t,e,r);const s=t.getType(),o=t.getStride(),a=this.coordinates.length;let l,h,c,u,d;switch(s){case"MultiPolygon":l=t.getOrientedFlatCoordinates(),u=[];const e=t.getEndss();d=0;for(let t=0,i=e.length;t<i;++t){const i=[];d=this.drawCustomCoordinates_(l,d,e[t],o,i),u.push(i)}this.instructions.push([Zm,a,u,t,i,tr,r]),this.hitDetectionInstructions.push([Zm,a,u,t,n||i,tr,r]);break;case"Polygon":case"MultiLineString":c=[],l="Polygon"==s?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),d=this.drawCustomCoordinates_(l,0,t.getEnds(),o,c),this.instructions.push([Zm,a,c,t,i,Qn,r]),this.hitDetectionInstructions.push([Zm,a,c,t,n||i,Qn,r]);break;case"LineString":case"Circle":l=t.getFlatCoordinates(),h=this.appendFlatLineCoordinates(l,0,l.length,o,!1,!1),this.instructions.push([Zm,a,h,t,i,Jn,r]),this.hitDetectionInstructions.push([Zm,a,h,t,n||i,Jn,r]);break;case"MultiPoint":l=t.getFlatCoordinates(),h=this.appendFlatPointCoordinates(l,o),h>a&&(this.instructions.push([Zm,a,h,t,i,Jn,r]),this.hitDetectionInstructions.push([Zm,a,h,t,n||i,Jn,r]));break;case"Point":l=t.getFlatCoordinates(),this.coordinates.push(l[0],l[1]),h=this.coordinates.length,this.instructions.push([Zm,a,h,t,i,void 0,r]),this.hitDetectionInstructions.push([Zm,a,h,t,n||i,void 0,r])}this.endGeometry(e)}beginGeometry(t,e,i){this.beginGeometryInstruction1_=[Xm,e,0,t,i],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[Xm,e,0,t,i],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==Km?s=e:r==Xm&&(n[2]=e,l(this.hitDetectionInstructions,s,e),s=-1)}setFillStrokeStyle(t,e){const i=this.state;if(t){const e=t.getColor();i.fillPatternScale=e&&"object"==typeof e&&"src"in e?this.pixelRatio:1,i.fillStyle=Ao(e||Vo)}else i.fillStyle=void 0;if(e){const t=e.getColor();i.strokeStyle=Ao(t||Ho);const n=e.getLineCap();i.lineCap=void 0!==n?n:$o;const r=e.getLineDash();i.lineDash=r?r.slice():Wo;const s=e.getLineDashOffset();i.lineDashOffset=s||0;const o=e.getLineJoin();i.lineJoin=void 0!==o?o:Zo;const a=e.getWidth();i.lineWidth=void 0!==a?a:1;const l=e.getMiterLimit();i.miterLimit=void 0!==l?l:Yo,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=[Qm,e];return"string"!=typeof e&&i.push(t.fillPatternScale),i}applyStroke(t){this.instructions.push(this.createStroke(t))}createStroke(t){return[t_,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&&!c(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=[Km,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)}getBufferedMaxExtent(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=Jt(this.maxExtent),this.maxLineWidth>0)){const t=this.resolution*(this.maxLineWidth+1)/2;qt(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_}}class a_ extends o_{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,i){if(!this.image_||this.maxExtent&&!te(this.maxExtent,t.getFlatCoordinates()))return;this.beginGeometry(t,e,i);const n=t.getFlatCoordinates(),r=t.getStride(),s=this.coordinates.length,o=this.appendFlatPointCoordinates(n,r);this.instructions.push([Hm,s,o,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([Hm,s,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(e)}drawMultiPoint(t,e,i){if(!this.image_)return;this.beginGeometry(t,e,i);const n=t.getFlatCoordinates(),r=[];for(let e=0,i=n.length;e<i;e+=t.getStride())this.maxExtent&&!te(this.maxExtent,n.slice(e,e+2))||r.push(n[e],n[e+1]);const s=this.coordinates.length,o=this.appendFlatPointCoordinates(r,2);this.instructions.push([Hm,s,o,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([Hm,s,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,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 l_ extends o_{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=[Jm,r,s];return this.instructions.push(o),this.hitDetectionInstructions.push(o),i}drawLineString(t,e,i){const n=this.state,r=n.strokeStyle,s=n.lineWidth;if(void 0===r||void 0===s)return;this.updateStrokeStyle(n,this.applyStroke),this.beginGeometry(t,e,i),this.hitDetectionInstructions.push([t_,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,Wo,0],r_);const o=t.getFlatCoordinates(),a=t.getStride();this.drawFlatCoordinates_(o,0,o.length,a),this.hitDetectionInstructions.push(n_),this.endGeometry(e)}drawMultiLineString(t,e,i){const n=this.state,r=n.strokeStyle,s=n.lineWidth;if(void 0===r||void 0===s)return;this.updateStrokeStyle(n,this.applyStroke),this.beginGeometry(t,e,i),this.hitDetectionInstructions.push([t_,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,Wo,0],r_);const o=t.getEnds(),a=t.getFlatCoordinates(),l=t.getStride();let h=0;for(let t=0,e=o.length;t<e;++t)h=this.drawFlatCoordinates_(a,h,o[t],l);this.hitDetectionInstructions.push(n_),this.endGeometry(e)}finish(){const t=this.state;return null!=t.lastStroke&&t.lastStroke!=this.coordinates.length&&this.instructions.push(n_),this.reverseHitDetectionInstructions(),this.state=null,super.finish()}applyStroke(t){null!=t.lastStroke&&t.lastStroke!=this.coordinates.length&&(this.instructions.push(n_),t.lastStroke=this.coordinates.length),t.lastStroke=0,super.applyStroke(t),this.instructions.push(r_)}}class h_ extends o_{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(r_),this.hitDetectionInstructions.push(r_);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=[Jm,a,l];this.instructions.push(h),this.hitDetectionInstructions.push(h),o&&(this.instructions.push(s_),this.hitDetectionInstructions.push(s_)),e=s}return s&&(this.instructions.push(i_),this.hitDetectionInstructions.push(i_)),o&&(this.instructions.push(n_),this.hitDetectionInstructions.push(n_)),e}drawCircle(t,e,i){const n=this.state,r=n.fillStyle,s=n.strokeStyle;if(void 0===r&&void 0===s)return;this.setFillStrokeStyles_(),this.beginGeometry(t,e,i),void 0!==n.fillStyle&&this.hitDetectionInstructions.push([Qm,Vo]),void 0!==n.strokeStyle&&this.hitDetectionInstructions.push([t_,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,Wo,0]);const o=t.getFlatCoordinates(),a=t.getStride(),l=this.coordinates.length;this.appendFlatLineCoordinates(o,0,o.length,a,!1,!1);const h=[$m,l];this.instructions.push(r_,h),this.hitDetectionInstructions.push(r_,h),void 0!==n.fillStyle&&(this.instructions.push(i_),this.hitDetectionInstructions.push(i_)),void 0!==n.strokeStyle&&(this.instructions.push(n_),this.hitDetectionInstructions.push(n_)),this.endGeometry(e)}drawPolygon(t,e,i){const n=this.state,r=n.fillStyle,s=n.strokeStyle;if(void 0===r&&void 0===s)return;this.setFillStrokeStyles_(),this.beginGeometry(t,e,i),void 0!==n.fillStyle&&this.hitDetectionInstructions.push([Qm,Vo]),void 0!==n.strokeStyle&&this.hitDetectionInstructions.push([t_,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,Wo,0]);const o=t.getEnds(),a=t.getOrientedFlatCoordinates(),l=t.getStride();this.drawFlatCoordinatess_(a,0,o,l),this.endGeometry(e)}drawMultiPolygon(t,e,i){const n=this.state,r=n.fillStyle,s=n.strokeStyle;if(void 0===r&&void 0===s)return;this.setFillStrokeStyles_(),this.beginGeometry(t,e,i),void 0!==n.fillStyle&&this.hitDetectionInstructions.push([Qm,Vo]),void 0!==n.strokeStyle&&this.hitDetectionInstructions.push([t_,n.strokeStyle,n.lineWidth,n.lineCap,n.lineJoin,n.miterLimit,Wo,0]);const o=t.getEndss(),a=t.getOrientedFlatCoordinates(),l=t.getStride();let h=0;for(let t=0,e=o.length;t<e;++t)h=this.drawFlatCoordinatess_(a,h,o[t],l);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]=Yn(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 c_(t,e,i,n,r){const s=[];let o=i,a=0,l=e.slice(i,2);for(;a<t&&o+r<n;){const[i,n]=l.slice(-2),h=e[o+r],c=e[o+r+1],u=Math.sqrt((h-i)*(h-i)+(c-n)*(c-n));if(a+=u,a>=t){const e=(t-a+u)/u,d=_i(i,h,e),g=_i(n,c,e);l.push(d,g),s.push(l),l=[d,g],a==t&&(o+=r),a=0}else if(a<t)l.push(e[o+r],e[o+r+1]),o+=r;else{const t=u-a,e=_i(i,h,t/u),d=_i(n,c,t/u);l.push(e,d),s.push(l),l=[e,d],a=0,o+=r}}return a>0&&s.push(l),s}function u_(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 d_={left:0,center:.5,right:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1};class g_ extends o_{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.fillStates[Vo]={fillStyle:Vo},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",this.declutterMode_=void 0,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,i){const n=this.textFillState_,r=this.textStrokeState_,s=this.textState_;if(""===this.text_||!s||!n&&!r)return;const o=this.coordinates;let a=o.length;const l=t.getType();let h=null,c=t.getStride();if("line"!==s.placement||"LineString"!=l&&"MultiLineString"!=l&&"Polygon"!=l&&"MultiPolygon"!=l){let n=s.overflow?null:[];switch(l){case"Point":case"MultiPoint":h=t.getFlatCoordinates();break;case"LineString":h=t.getFlatMidpoint();break;case"Circle":h=t.getCenter();break;case"MultiLineString":h=t.getFlatMidpoints(),c=2;break;case"Polygon":h=t.getFlatInteriorPoint(),s.overflow||n.push(h[2]/this.resolution),c=3;break;case"MultiPolygon":const e=t.getFlatInteriorPoints();h=[];for(let t=0,i=e.length;t<i;t+=3)s.overflow||n.push(e[t+2]/this.resolution),h.push(e[t],e[t+1]);if(0===h.length)return;c=2}const r=this.appendFlatPointCoordinates(h,c);if(r===a)return;if(n&&(r-a)/2!=h.length/c){let t=a/2;n=n.filter(((e,i)=>{const n=o[2*(t+i)]===h[i*c]&&o[2*(t+i)+1]===h[i*c+1];return n||--t,n}))}this.saveTextStates_(),(s.backgroundFill||s.backgroundStroke)&&(this.setFillStrokeStyle(s.backgroundFill,s.backgroundStroke),s.backgroundFill&&this.updateFillStyle(this.state,this.createFill),s.backgroundStroke&&(this.updateStrokeStyle(this.state,this.applyStroke),this.hitDetectionInstructions.push(this.createStroke(this.state)))),this.beginGeometry(t,e,i);let u=s.padding;if(u!=Jo&&(s.scale[0]<0||s.scale[1]<0)){let t=s.padding[0],e=s.padding[1],i=s.padding[2],n=s.padding[3];s.scale[0]<0&&(e=-e,n=-n),s.scale[1]<0&&(t=-t,i=-i),u=[t,e,i,n]}const d=this.pixelRatio;this.instructions.push([Hm,a,r,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterMode_,this.declutterImageWithText_,u==Jo?Jo:u.map((function(t){return t*d})),!!s.backgroundFill,!!s.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,n]);const g=1/d,f=this.state.fillStyle;s.backgroundFill&&(this.state.fillStyle=Vo,this.hitDetectionInstructions.push(this.createFill(this.state))),this.hitDetectionInstructions.push([Hm,a,r,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[g,g],NaN,this.declutterMode_,this.declutterImageWithText_,u,!!s.backgroundFill,!!s.backgroundStroke,this.text_,this.textKey_,this.strokeKey_,this.fillKey_?Vo:this.fillKey_,this.textOffsetX_,this.textOffsetY_,n]),s.backgroundFill&&(this.state.fillStyle=f,this.hitDetectionInstructions.push(this.createFill(this.state))),this.endGeometry(e)}else{if(!Le(this.maxExtent,t.getExtent()))return;let n;if(h=t.getFlatCoordinates(),"LineString"==l)n=[h.length];else if("MultiLineString"==l)n=t.getEnds();else if("Polygon"==l)n=t.getEnds().slice(0,1);else if("MultiPolygon"==l){const e=t.getEndss();n=[];for(let t=0,i=e.length;t<i;++t)n.push(e[t][0])}this.beginGeometry(t,e,i);const r=s.repeat,u=r?void 0:s.textAlign;let d=0;for(let t=0,e=n.length;t<e;++t){let e;e=r?c_(r*this.resolution,h,d,n[t],c):[h.slice(d,n[t])];for(let i=0,r=e.length;i<r;++i){const r=e[i];let l=0,h=r.length;if(null==u){const t=u_(s.maxAngle,r,0,r.length,2);l=t[0],h=t[1]}for(let t=l;t<h;t+=c)o.push(r[t],r[t+1]);const g=o.length;d=n[t],this.drawChars_(a,g),a=g}}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||Ko,justify:e.justify,textBaseline:e.textBaseline||qo,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=d_[n.textBaseline],h=this.textOffsetY_*a,c=this.text_,u=i?i.lineWidth*Math.abs(n.scale[0])/2:0;this.instructions.push([Ym,t,e,l,n.overflow,o,n.maxAngle,a,h,r,u*a,c,s,1,this.declutterMode_]),this.hitDetectionInstructions.push([Ym,t,e,l,n.overflow,o?Vo:o,n.maxAngle,a,h,r,u*a,c,s,1/a,this.declutterMode_])}setTextStyle(t,e){let i,n,r;if(t){const e=t.getFill();e?(n=this.textFillState_,n||(n={},this.textFillState_=n),n.fillStyle=Ao(e.getColor()||Vo)):(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()||$o,r.lineDash=t?t.slice():Wo,r.lineDashOffset=void 0===e?0:e,r.lineJoin=s.getLineJoin()||Zo,r.lineWidth=void 0===i?1:i,r.miterLimit=void 0===n?Yo:n,r.strokeStyle=Ao(s.getColor()||Ho)}else r=null,this.textStrokeState_=r;i=this.textState_;const o=t.getFont()||Xo;na(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.repeat=t.getRepeat(),i.justify=t.getJustify(),i.textBaseline=t.getTextBaseline()||qo,i.backgroundFill=t.getBackgroundFill(),i.backgroundStroke=t.getBackgroundStroke(),i.padding=t.getPadding()||Jo,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:U(r.strokeStyle))+r.lineCap+r.lineDashOffset+"|"+r.lineWidth+r.lineJoin+r.miterLimit+"["+r.lineDash.join()+"]":"",this.textKey_=i.font+i.scale+(i.textAlign||"?")+(i.repeat||"?")+(i.justify||"?")+(i.textBaseline||"?"),this.fillKey_=n&&n.fillStyle?"string"==typeof n.fillStyle?n.fillStyle:"|"+U(n.fillStyle):""}else this.text_="";this.declutterMode_=t.getDeclutterMode(),this.declutterImageWithText_=e}}const f_={Circle:h_,Default:o_,Image:a_,LineString:l_,Polygon:h_,Text:g_};class p_{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,f_[e])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),n[e]=r}return r}}function m_(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=_i(f,d,x),S=_i(p,g,x),E=e-n,w=_,T=s+a*l(h,r,c);for(;e<i-n&&_+m<T;)y();x=0===m?0:(T-_)/m;const C=_i(f,d,x),R=_i(p,g,x);let b;if(u){const t=[v,S,C,R];Cn(t,0,4,2,u,t,t),b=t[0]>t[2]}else b=v>C;const P=Math.PI,I=[],L=E+n===e;let F;if(m=0,_=w,d=t[e=E],g=t[e+1],L){y(),F=Math.atan2(g-p,d-f),b&&(F+=F>0?-P:P);const t=(C+v)/2,e=(R+S)/2;return I[0]=[t,e,(T-s)/2,F,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(b&&(v+=v>0?-P:P),void 0!==F){let t=v-F;if(t+=t>P?-2*P:t<-P?2*P:0,Math.abs(t)>o)return null}F=v;const S=t;let E=0;for(;t<u;++t){const o=a*l(h,r[b?u-t-1:t],c);if(e+n<i&&_+m<s+E+o/2)break;E+=o}if(t===S)continue;const w=b?r.substring(u-S,u-t):r.substring(S,t);x=0===m?0:(s+E/2-_)/m;const T=_i(f,d,x),C=_i(p,g,x);I.push([T,C,E/2,v,w]),s+=E}return I}const __=[1/0,1/0,-1/0,-1/0],y_=[],x_=[],v_=[],S_=[];function E_(t){return t[3].declutterBox}const w_=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 T_(t,e){return"start"===e?e=w_.test(t)?"right":"left":"end"===e&&(e=w_.test(t)?"left":"right"),d_[e]}function C_(t,e,i){return i>0&&t.push("\n",""),t.push(e,""),t}class R_{constructor(t,e,i,n,r){this.overlaps=i,this.pixelRatio=e,this.resolution=t,this.alignAndScaleFill_,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_={},this.zIndexContext_=r?new cg:null}getZIndexContext(){return this.zIndexContext_}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=a.justify?d_[a.justify]:T_(Array.isArray(t)?t[0]:t,a.textAlign||Ko),u=n&&s.lineWidth?s.lineWidth:0,d=Array.isArray(t)?t:String(t).split("\n").reduce(C_,[]),{width:g,height:f,widths:p,heights:m,lineWidths:_}=la(a,d),y=g+u,x=[],v=(y+2)*h[0],S=(f+u)*h[1],E={width:v<0?Math.floor(v):Math.ceil(v),height:S<0?Math.floor(S):Math.ceil(S),contextInstructions:x};1==h[0]&&1==h[1]||x.push("scale",h),n&&(x.push("strokeStyle",s.strokeStyle),x.push("lineWidth",u),x.push("lineCap",s.lineCap),x.push("lineJoin",s.lineJoin),x.push("miterLimit",s.miterLimit),x.push("setLineDash",[s.lineDash]),x.push("lineDashOffset",s.lineDashOffset)),i&&x.push("fillStyle",o.fillStyle),x.push("textBaseline","middle"),x.push("textAlign","center");const w=.5-c;let T=c*y+w*u;const C=[],R=[];let b,P=0,I=0,L=0,F=0;for(let t=0,e=d.length;t<e;t+=2){const e=d[t];if("\n"===e){I+=P,P=0,T=c*y+w*u,++F;continue}const r=d[t+1]||a.font;r!==b&&(n&&C.push("font",r),i&&R.push("font",r),b=r),P=Math.max(P,m[L]);const s=[e,T+w*p[L]+c*(p[L]-_[F]),.5*(u+P)+I];T+=p[L],n&&C.push("strokeText",s),i&&R.push("fillText",s),++L}return Array.prototype.push.apply(x,C),Array.prototype.push.apply(x,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.alignAndScaleFill_=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],E=m-g[3],w=_-g[0];let T;return(f||0!==c)&&(y_[0]=E,S_[0]=E,y_[1]=w,x_[1]=w,x_[0]=E+v,v_[0]=x_[0],v_[1]=w+S,S_[1]=v_[1]),0!==c?(T=Vt([1,0,0,1,0,0],i,n,1,1,c,-i,-n),Ut(T,y_),Ut(T,x_),Ut(T,v_),Ut(T,S_),se(Math.min(y_[0],x_[0],v_[0],S_[0]),Math.min(y_[1],x_[1],v_[1],S_[1]),Math.max(y_[0],x_[0],v_[0],S_[0]),Math.max(y_[1],x_[1],v_[1],S_[1]),__)):se(Math.min(E,E+v),Math.min(w,w+S),Math.max(E,E+v),Math.max(w,w+S),__),d&&(m=Math.round(m),_=Math.round(_)),{drawImageX:m,drawImageY:_,drawImageW:y,drawImageH:x,originX:l,originY:h,declutterBox:{minX:__[0],minY:__[1],maxX:__[2],maxY:__[3],value:p},canvasTransform:T,scale:u}}replayImageOrLabel_(t,e,i,n,r,s,o){const a=!(!s&&!o),l=n.declutterBox,h=o?o[2]*n.scale[0]/2:0;return l.minX-h<=e[0]&&l.maxX+h>=0&&l.minY-h<=e[1]&&l.maxY+h>=0&&(a&&this.replayTextBackground_(t,y_,x_,v_,S_,s,o),ha(t,n.canvasTransform,r,i,n.originX,n.originY,n.drawImageW,n.drawImageH,n.drawImageX,n.drawImageY,n.scale)),!0}fill_(t){const e=this.alignAndScaleFill_;if(e){const i=Ut(this.renderedTransform_,[0,0]),n=512*this.pixelRatio;t.save(),t.translate(i[0]%n,i[1]%n),1!==e&&t.scale(e,e),t.rotate(this.viewRotation_)}t.fill(),e&&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=T_(Array.isArray(t)?t[0]:t,r.textAlign||Ko),h=d_[r.textBaseline||qo],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){const l=this.zIndexContext_;let h;this.pixelCoordinates_&&c(i,this.renderedTransform_)?h=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),h=Tn(this.coordinates,0,this.coordinates.length,2,i,this.pixelCoordinates_),jt(this.renderedTransform_,i));let u=0;const d=n.length;let g,f,p,m,_,y,x,v,S,E,w,T,C,R=0,b=0,P=0,I=null,L=null;const F=this.coordinateCache_,M=this.viewRotation_,A=Math.round(1e12*Math.atan2(-i[1],i[0]))/1e12,O={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:M},D=this.instructions!=n||this.overlaps?0:200;let N,k,G,j;for(;u<d;){const i=n[u];switch(i[0]){case Xm:N=i[1],j=i[3],N.getGeometry()?void 0===o||Le(o,j.getExtent())?++u:u=i[2]+1:u=i[2],l&&(l.zIndex=i[4]);break;case Vm:b>D&&(this.fill_(t),b=0),P>D&&(t.stroke(),P=0),b||P||(t.beginPath(),_=NaN,y=NaN),++u;break;case $m:R=i[1];const n=h[R],c=h[R+1],d=h[R+2]-n,U=h[R+3]-c,B=Math.sqrt(d*d+U*U);t.moveTo(n+B,c),t.arc(n,c,B,0,2*Math.PI,!0),++u;break;case Wm:t.closePath(),++u;break;case Zm:R=i[1],g=i[2];const z=i[3],X=i[4],V=i[5];O.geometry=z,O.feature=N,u in F||(F[u]=[]);const $=F[u];V?V(h,R,g,2,$):($[0]=h[R],$[1]=h[R+1],$.length=2),l&&(l.zIndex=i[6]),X($,O),++u;break;case Hm:R=i[1],g=i[2],S=i[3],f=i[4],p=i[5];let W=i[6];const Z=i[7],Y=i[8],H=i[9],K=i[10];let q=i[11];const J=i[12];let Q=i[13];m=i[14]||"declutter";const tt=i[15];if(!S&&i.length>=20){E=i[19],w=i[20],T=i[21],C=i[22];const t=this.drawLabelWithPointPlacement_(E,w,T,C);S=t.label,i[3]=S;const e=i[23];f=(t.anchorX-e)*this.pixelRatio,i[4]=f;const n=i[24];p=(t.anchorY-n)*this.pixelRatio,i[5]=p,W=S.height,i[6]=W,Q=S.width,i[13]=Q}let et,it,nt,rt;i.length>25&&(et=i[25]),i.length>17?(it=i[16],nt=i[17],rt=i[18]):(it=Jo,nt=!1,rt=!1),K&&A?q+=M:K||A||(q-=M);let st=0;for(;R<g;R+=2){if(et&&et[st++]<Q/this.pixelRatio)continue;const i=this.calculateImageOrLabelDimensions_(S.width,S.height,h[R],h[R+1],Q,W,f,p,Y,H,q,J,r,it,nt||rt,N),n=[t,e,S,i,Z,nt?I:null,rt?L:null];if(a){let t,e,r,s,o;if(tt){const i=g-R;if(!tt[i]){tt[i]={args:n,declutterMode:m};continue}const s=tt[i];t=s.args,e=s.declutterMode,delete tt[i],r=E_(t)}if(!t||"declutter"===e&&a.collides(r)||(s=!0),"declutter"===m&&a.collides(i.declutterBox)||(o=!0),"declutter"===e&&"declutter"===m){const t=s&&o;s=t,o=t}s&&("none"!==e&&a.insert(r),this.replayImageOrLabel_.apply(this,t)),o&&("none"!==m&&a.insert(i.declutterBox),this.replayImageOrLabel_.apply(this,n))}else this.replayImageOrLabel_.apply(this,n)}++u;break;case Ym:const ot=i[1],at=i[2],lt=i[3],ht=i[4];C=i[5];const ct=i[6],ut=i[7],dt=i[8];T=i[9];const gt=i[10];E=i[11],w=i[12];const ft=[i[13],i[13]];m=i[14]||"declutter";const pt=this.textStates[w],mt=pt.font,_t=[pt.scale[0]*ut,pt.scale[1]*ut];let yt;mt in this.widths_?yt=this.widths_[mt]:(yt={},this.widths_[mt]=yt);const xt=Du(h,ot,at,2),vt=Math.abs(_t[0])*aa(mt,E,yt);if(ht||vt<=xt){const i=m_(h,ot,at,2,E,(xt-vt)*T_(E,this.textStates[w].textAlign),ct,Math.abs(_t[0]),aa,mt,yt,A?0:this.viewRotation_);t:if(i){const n=[];let r,s,o,l,h;if(T)for(r=0,s=i.length;r<s;++r){h=i[r],o=h[4],l=this.createLabel(o,w,"",T),f=h[2]+(_t[0]<0?-gt:gt),p=lt*l.height+2*(.5-lt)*gt*_t[1]/_t[0]-dt;const s=this.calculateImageOrLabelDimensions_(l.width,l.height,h[0],h[1],l.width,l.height,f,p,0,0,h[3],ft,!1,Jo,!1,N);if(a&&"declutter"===m&&a.collides(s.declutterBox))break t;n.push([t,e,l,s,1,null,null])}if(C)for(r=0,s=i.length;r<s;++r){h=i[r],o=h[4],l=this.createLabel(o,w,C,""),f=h[2],p=lt*l.height-dt;const s=this.calculateImageOrLabelDimensions_(l.width,l.height,h[0],h[1],l.width,l.height,f,p,0,0,h[3],ft,!1,Jo,!1,N);if(a&&"declutter"===m&&a.collides(s.declutterBox))break t;n.push([t,e,l,s,1,null,null])}a&&"none"!==m&&a.load(n.map(E_));for(let t=0,e=n.length;t<e;++t)this.replayImageOrLabel_.apply(this,n[t])}}++u;break;case Km:if(void 0!==s){N=i[1];const t=s(N,j,m);if(t)return t}++u;break;case qm:D?b++:this.fill_(t),++u;break;case Jm:for(R=i[1],g=i[2],k=h[R],G=h[R+1],t.moveTo(k,G),_=k+.5|0,y=G+.5|0,R+=2;R<g;R+=2)k=h[R],G=h[R+1],x=k+.5|0,v=G+.5|0,R!=g-2&&x===_&&v===y||(t.lineTo(k,G),_=x,y=v);++u;break;case Qm:I=i,this.alignAndScaleFill_=i[2],b&&(this.fill_(t),b=0,P&&(t.stroke(),P=0)),t.fillStyle=i[1],++u;break;case t_:L=i,P&&(t.stroke(),P=0),this.setStrokeStyle_(t,i),++u;break;case e_:D?P++:t.stroke(),++u;break;default:++u}}b&&this.fill_(t),P&&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,[t.canvas.width,t.canvas.height],e,this.hitDetectionInstructions,!0,n,r)}}const b_=["Polygon","Circle","LineString","Image","Text","Default"],P_=["Image","Text"],I_=b_.filter((t=>!P_.includes(t)));class L_{constructor(t,e,i,n,r,s,o){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.renderedContext_=null,this.deferredZIndexContexts_={},this.createExecutors_(r,o)}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,e){for(const i in t){let n=this.executorsByZIndex_[i];void 0===n&&(n={},this.executorsByZIndex_[i]=n);const r=t[i];for(const t in r){const i=r[t];n[t]=new R_(this.resolution_,this.pixelRatio_,this.overlaps_,i,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,o){const a=2*(n=Math.round(n))+1,l=Vt(this.hitDetectionTransform_,n+.5,n+.5,1/e,-1/e,-i,-t[0],-t[1]),h=!this.hitDetectionContext_;h&&(this.hitDetectionContext_=pt(a,a,void 0,{willReadFrequently:!0}));const c=this.hitDetectionContext_;let u;c.canvas.width!==a||c.canvas.height!==a?(c.canvas.width=a,c.canvas.height=a):h||c.clearRect(0,0,a,a),void 0!==this.renderBuffer_&&(u=[1/0,1/0,-1/0,-1/0],de(u,t),qt(u,e*(this.renderBuffer_+n),u));const d=M_(n);let g;function f(t,e,i){const s=c.getImageData(0,0,a,a).data;for(let l=0,h=d.length;l<h;l++)if(s[d[l]]>0){if(!o||"none"===i||"Image"!==g&&"Text"!==g||o.includes(t)){const i=(d[l]-3)/4,s=n-i%a,o=n-(i/a|0),h=r(t,e,s*s+o*o);if(h)return h}c.clearRect(0,0,a,a);break}}const p=Object.keys(this.executorsByZIndex_).map(Number);let m,_,y,x,v;for(p.sort(s),m=p.length-1;m>=0;--m){const t=p[m].toString();for(y=this.executorsByZIndex_[t],_=b_.length-1;_>=0;--_)if(g=b_[_],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 Tn(o,0,8,2,t,o),o}isEmpty(){return y(this.executorsByZIndex_)}execute(t,e,i,n,r,o,a){const l=Object.keys(this.executorsByZIndex_).map(Number);l.sort(s),o=o||b_;const h=b_.length;let c,u,d,g,f;for(a&&l.reverse(),c=0,u=l.length;c<u;++c){const s=l[c].toString();for(f=this.executorsByZIndex_[s],d=0,g=o.length;d<g;++d){const s=o[d],u=f[s];if(void 0!==u){const o=null===a?void 0:u.getZIndexContext(),g=o?o.getContext():t,f=this.maxExtent_&&"Image"!==s&&"Text"!==s;if(f&&(g.save(),this.clip(g,i)),o&&"Text"!==s&&"Image"!==s?o.pushFunction((t=>u.execute(t,e,i,n,r,a))):u.execute(g,e,i,n,r,a),f&&g.restore(),o){o.offset();const t=l[c]*h+d;this.deferredZIndexContexts_[t]||(this.deferredZIndexContexts_[t]=[]),this.deferredZIndexContexts_[t].push(o)}}}}this.renderedContext_=t}getDeferredZIndexContexts(){return this.deferredZIndexContexts_}getRenderedContext(){return this.renderedContext_}renderDeferred(){const t=this.deferredZIndexContexts_,e=Object.keys(t).map(Number).sort(s);for(let i=0,n=e.length;i<n;++i)t[e[i]].forEach((t=>{t.draw(this.renderedContext_),t.clear()})),t[e[i]].length=0}}const F_={};function M_(t){if(void 0!==F_[t])return F_[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 F_[t]=r,r}const A_=.5;function O_(t,e,i,n,r,o,a,l,h){const c=h?yn(r,h):r,u=pt(t[0]*A_,t[1]*A_);u.imageSmoothingEnabled=!1;const d=u.canvas,g=new bc(u,A_,r,null,a,l,h?hn(pn(),h):null),f=i.length,p=Math.floor(16777215/f),m={};for(let t=1;t<=f;++t){const e=i[t-1],r=e.getStyleFunction()||n;if(!r)continue;let s=r(e,o);if(!s)continue;Array.isArray(s)||(s=[s]);const a=(t*p).toString(16).padStart(7,"#00000");for(let t=0,i=s.length;t<i;++t){const i=s[t],n=i.getGeometryFunction()(e);if(!n||!Le(c,n.getExtent()))continue;const r=i.clone(),o=r.getFill();o&&o.setColor(a);const l=r.getStroke();l&&(l.setColor(a),l.setLineDash(null)),r.setText(void 0);const h=i.getImage();if(h){const t=h.getImageSize();if(!t)continue;const e=pt(t[0],t[1],void 0,{alpha:!1}),i=e.canvas;e.fillStyle=a,e.fillRect(0,0,i.width,i.height),r.setImage(new Sa({img:i,anchor:h.getAnchor(),anchorXUnits:"pixels",anchorYUnits:"pixels",offset:h.getOrigin(),opacity:1,size:h.getSize(),scale:h.getScale(),rotation:h.getRotation(),rotateWithView:h.getRotateWithView()}))}const u=r.getZIndex()||0;let d=m[u];d||(d={},m[u]=d,d.Polygon=[],d.Circle=[],d.LineString=[],d.Point=[]);const g=n.getType();if("GeometryCollection"===g){const t=n.getGeometriesArrayRecursive();for(let e=0,i=t.length;e<i;++e){const i=t[e];d[i.getType().replace("Multi","")].push(i,r)}}else d[g.replace("Multi","")].push(n,r)}}const _=Object.keys(m).map(Number).sort(s);for(let t=0,i=_.length;t<i;++t){const i=m[_[t]];for(const t in i){const n=i[t];for(let t=0,i=n.length;t<i;t+=2){g.setStyle(n[t+1]);for(let i=0,r=e.length;i<r;++i)g.setTransform(e[i]),g.drawGeometry(n[t])}}}return u.getImageData(0,0,d.width,d.height)}function D_(t,e,i){const n=[];if(i){const r=Math.floor(Math.round(t[0])*A_),s=Math.floor(Math.round(t[1])*A_),o=4*(ci(r,0,i.width-1)+ci(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 N_ extends gg{constructor(t){super(t),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.animatingOrInteracting_,this.hitDetectionImageData_=null,this.clipped_=!1,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.renderedPixelRatio_=1,this.renderedRenderOrder_=null,this.renderedFrameDeclutter_,this.replayGroup_=null,this.replayGroupChanged=!0,this.clipping=!0,this.targetContext_=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=this.getLayer().getDeclutter(),d=e.pixelRatio,g=e.viewHints,f=!(g[gs]||g[fs]),p=this.context,m=Math.round(Ie(n)/o*d),_=Math.round(Ce(n)/o*d),y=c.getWrapX()&&a.canWrapX(),x=y?Ie(h):null,v=y?Math.ceil((n[2]-h[2])/x)+1:1;let S=y?Math.floor((n[0]-h[0])/x):0;do{let n=this.getRenderTransform(s,o,0,d,m,_,S*x);e.declutter&&(n=n.slice(0)),t.execute(p,[p.canvas.width,p.canvas.height],n,l,f,void 0===i?b_:i?P_:I_,i?u&&e.declutter[u]:void 0)}while(++S<v)}setDrawContext_(){1!==this.opacity_&&(this.targetContext_=this.context,this.context=pt(this.context.canvas.width,this.context.canvas.height,ug))}resetDrawContext_(){if(1!==this.opacity_){const t=this.targetContext_.globalAlpha;this.targetContext_.globalAlpha=this.opacity_,this.targetContext_.drawImage(this.context.canvas,0,0),this.targetContext_.globalAlpha=t,yt(this.context),ug.push(this.context.canvas),this.context=this.targetContext_,this.targetContext_=null}}renderDeclutter(t){this.replayGroup_&&this.getLayer().getDeclutter()&&this.renderWorlds(this.replayGroup_,t,!0)}renderDeferredInternal(t){this.replayGroup_&&(this.replayGroup_.renderDeferred(),this.clipped_&&this.context.restore(),this.resetDrawContext_())}renderFrame(t,e){const i=t.layerStatesArray[t.layerIndex];this.opacity_=i.opacity;const n=t.viewState;this.prepareContainer(t,e);const r=this.context,s=this.replayGroup_;let o=s&&!s.isEmpty();if(!o){if(!(this.getLayer().hasListener(ls)||this.getLayer().hasListener(hs)))return null}this.setDrawContext_(),this.preRender(r,t);const a=n.projection;if(this.clipped_=!1,o&&i.extent&&this.clipping){const e=xn(i.extent,a);o=Le(e,t.extent),this.clipped_=o&&!ee(e,t.extent),this.clipped_&&this.clipUnrotated(r,t,e)}return o&&this.renderWorlds(s,t,!this.getLayer().getDeclutter()&&void 0),!t.declutter&&this.clipped_&&r.restore(),this.postRender(r,t),this.renderedRotation_!==n.rotation&&(this.renderedRotation_=n.rotation,this.hitDetectionImageData_=null),t.declutter||this.resetDrawContext_(),this.container}getFeatures(t){return new Promise((e=>{if(this.frameState&&!this.hitDetectionImageData_&&!this.animatingOrInteracting_){const t=this.frameState.size.slice(),e=this.renderedCenter_,i=this.renderedResolution_,n=this.renderedRotation_,r=this.renderedProjection_,s=this.wrappedRenderedExtent_,o=this.getLayer(),a=[],l=t[0]*A_,h=t[1]*A_;a.push(this.getRenderTransform(e,i,n,A_,l,h,0).slice());const c=o.getSource(),u=r.getExtent();if(c.getWrapX()&&r.canWrapX()&&!ee(u,s)){let t=s[0];const r=Ie(u);let o,c=0;for(;t<u[0];)--c,o=r*c,a.push(this.getRenderTransform(e,i,n,A_,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,A_,l,h,o).slice()),t-=r}const d=pn();this.hitDetectionImageData_=O_(t,a,this.renderedFeatures_,o.getStyleFunction(),s,i,n,Fc(i,this.renderedPixelRatio_),d?r:null)}e(D_(t,this.renderedFeatures_,this.hitDetectionImageData_))}))}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=U(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_],d=this.getLayer().getDeclutter();return u.some((n=>c=n.forEachFeatureAtCoordinate(t,s,o,i,h,d&&e.declutter[d]?e.declutter[d].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[gs],r=t.viewHints[fs],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,u=l.resolution,d=t.pixelRatio,g=e.getRevision(),f=e.getRenderBuffer();let p=e.getRenderOrder();void 0===p&&(p=Lc);const m=l.center.slice(),_=qt(a,f*u),y=_.slice(),x=[_.slice()],v=h.getExtent();if(i.getWrapX()&&h.canWrapX()&&!ee(v,t.extent)){const t=Ie(v),e=Math.max(Ie(_)/2,t);_[0]=v[0]-e,_[2]=v[2]+e,Ni(m,h);const i=Ne(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_==u&&this.renderedRevision_==g&&this.renderedRenderOrder_==p&&this.renderedFrameDeclutter_===!!t.declutter&&ee(this.wrappedRenderedExtent_,_))return c(this.renderedExtent_,y)||(this.hitDetectionImageData_=null,this.renderedExtent_=y),this.renderedCenter_=m,this.replayGroupChanged=!1,!0;this.replayGroup_=null;const S=new p_(Mc(u,d),_,u,d),E=pn();let w;if(E){for(let t=0,e=x.length;t<e;++t){const e=yn(x[t],h);i.loadFeatures(e,vn(u,h),E)}w=hn(E,h)}else for(let t=0,e=x.length;t<e;++t)i.loadFeatures(x[t],u,h);const T=Fc(u,d);let C=!0;const R=(t,i)=>{let n;const r=t.getStyleFunction()||e.getStyleFunction();if(r&&(n=r(t,u)),n){const e=this.renderFeature(t,T,n,S,w,this.getLayer().getDeclutter(),i);C=C&&!e}},b=yn(_,h),P=i.getFeaturesInExtent(b);p&&P.sort(p);for(let t=0,e=P.length;t<e;++t)R(P[t],t);this.renderedFeatures_=P,this.ready=C;const I=S.finish(),L=new L_(_,u,d,i.getOverlaps(),I,e.getRenderBuffer(),!!t.declutter);return this.renderedResolution_=u,this.renderedRevision_=g,this.renderedRenderOrder_=p,this.renderedFrameDeclutter_=!!t.declutter,this.renderedExtent_=y,this.wrappedRenderedExtent_=_,this.renderedCenter_=m,this.renderedProjection_=h,this.renderedPixelRatio_=d,this.replayGroup_=L,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0}renderFeature(t,e,i,n,r,s,o){if(!i)return!1;let a=!1;if(Array.isArray(i))for(let l=0,h=i.length;l<h;++l)a=Ac(n,t,i[l],e,this.boundHandleStyleImageChange_,r,s,o)||a;else a=Ac(n,t,i,e,this.boundHandleStyleImageChange_,r,s,o);return a}}class k_ extends fg{constructor(t){super(t),this.vectorRenderer_=new N_(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 Promise.resolve([]);const e=Ut(this.coordinateToVectorPixelTransform_,Ut(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),Ae(o,this.layerImageRatio_));const a=Ie(o)/n,l=Ce(o)/n;if(!r[gs]&&!r[fs]&&!Fe(o)){s.useContainer(null,null);const r=s.context,h=t.layerStatesArray[t.layerIndex],c=Object.assign({},h,{opacity:1}),u=Object.assign({},t,{extent:o,size:[a,l],viewState:Object.assign({},t.viewState,{rotation:0}),layerStatesArray:[c],layerIndex:0,declutter:null}),d=this.getLayer().getDeclutter();d&&(u.declutter={[d]:new Bs(9)});let g=!0;const f=new Yr(o,n,e,r.canvas,(function(t){s.prepareFrame(u)&&s.replayGroupChanged&&(s.clipping=!1,s.renderFrame(u,null)&&(s.renderDeclutter(u),s.renderDeferred(u),g=!1),t())}));f.addEventListener(v,(()=>{if(f.getState()!==zr.LOADED)return;this.image=g?null:f;const t=f.getPixelRatio(),n=Xc(f.getResolution())*e/t;this.renderedResolution=n,this.coordinateToVectorPixelTransform_=Vt(this.coordinateToVectorPixelTransform_,a/2,l/2,1/n,-1/n,0,-i.center[0],-i.center[1])})),f.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 G_={image:["Polygon","Circle","LineString","Image","Text"],hybrid:["Polygon","LineString"],vector:[]},j_={hybrid:["Image","Text","Default"],vector:["Polygon","Circle","LineString","Image","Text","Default"]};class U_ extends wg{constructor(t,e){super(t,e),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.renderedLayerRevision_,this.renderedPixelToCoordinateTransform_=null,this.renderedRotation_,this.renderedOpacity_=1,this.tmpTransform_=[1,0,0,1,0,0],this.tileClipContexts_=null}drawTile(t,e,i,n,r,s,o,a){this.updateExecutorGroup_(t,e.pixelRatio,e.viewState.projection),this.tileImageNeedsRender_(t)&&this.renderTileImage_(t,e),super.drawTile(t,e,i,n,r,s,o,a)}getTile(t,e,i,n){const r=this.getOrCreateTile(t,e,i,n);if(!r)return null;const s=n.viewState.resolution,o=n.viewHints;return!!(o[gs]||o[fs])&&r.wantedResolution||(r.wantedResolution=s),r}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=U(n);delete t.hitDetectionImageData[g],t.executorGroups[g]=[],a.dirty=!1;for(let i=0,r=d.length;i<r;++i){const r=d[i];if(r.getState()!=K)continue;const f=r.tileCoord,p=c.getTileCoordExtent(f),m=Re(u,p),_=qt(m,n.getRenderBuffer()*o,this.tempExtent),y=he(p,m)?null:_,x=new p_(0,m,o,e),v=Fc(o,e),S=function(t,e){let i;const r=t.getStyleFunction()||n.getStyleFunction();if(r&&(i=r(t,o)),i){const n=this.renderFeature(t,v,i,x,h,e);a.dirty=a.dirty||n}},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&&!Le(y,e.getGeometry().getExtent())||S.call(this,e,t)}const w=x.finish(),T="vector"!==n.getRenderMode()&&h&&1===d.length?null:m,C=new L_(T,o,e,l.getOverlaps(),w,n.getRenderBuffer(),!0);t.executorGroups[g].push(C)}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=Kt([t]);qt(h,s*i,h);const c={}
2387,u=function(t,e,i){let s=t.getId();void 0===s&&(s=U(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(!Le(l.getTileCoordExtent(r.wrappedTileCoord),h))continue;const c=U(a),f=[r.executorGroups[c]],p=a.getDeclutter();f.some((n=>{const r=p?e.declutter[p].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(((e,i)=>{const n=this.getLayer(),r=U(n),s=n.getSource(),o=this.renderedProjection,a=o.getExtent(),l=this.renderedResolution,h=s.getTileGridForProjection(o),c=Ut(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()===K){const t=h.getTileCoordExtent(d.tileCoord);s.getWrapX()&&o.canWrapX()&&!ee(a,t)&&Ni(c,o);break}d=void 0}if(!d||d.loadingSourceTiles>0)return void e([]);const g=be(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){const t=no(h.getTileSize(h.getZForResolution(l,s.zDirection))),e=this.renderedRotation_;m=O_(t,[this.getRenderTransform(h.getTileCoordCenter(d.wrappedTileCoord),l,0,A_,t[0]*A_,t[1]*A_,0)],p,n.getStyleFunction(),h.getTileCoordExtent(d.wrappedTileCoord),d.getReplayState(n).renderedResolution,e),d.hitDetectionImageData[r]=m}e(D_(f,p,m))}))}getFeaturesInExtent(t){const e=[],i=this.getTileCache();if(0===i.getCount())return e;const n=this.getLayer().getSource().getTileGridForProjection(this.frameState.viewState.projection),r=n.getZForResolution(this.renderedResolution),s={};return i.forEach((i=>{if(i.tileCoord[0]!==r||i.getState()!==K)return;const o=i.getSourceTiles();for(let i=0,r=o.length;i<r;++i){const r=o[i],a=r.getKey();if(a in s)continue;s[a]=!0;const l=r.tileCoord;if(Le(t,n.getTileCoordExtent(l))){const i=r.getFeatures();if(i)for(let n=0,r=i.length;n<r;++n){const r=i[n],s=r.getGeometry();Le(t,s.getExtent())&&e.push(r)}}}})),e}handleFontsChanged(){const t=this.getLayer();t.getVisible()&&void 0!==this.renderedLayerRevision_&&t.changed()}handleStyleImageChange_(t){this.renderIfReadyAndVisible()}renderDeclutter(t,e){const i=this.context,n=i.globalAlpha;i.globalAlpha=e.opacity;const r=t.viewHints,s=!(r[gs]||r[fs]),o=this.renderedTiles;for(let e=0,i=o.length;e<i;++e){const i=o[e],n=i.executorGroups[U(this.getLayer())],r=this.getLayer().getDeclutter();if(n)for(let e=n.length-1;e>=0;--e)n[e].execute(this.context,[this.context.canvas.width,this.context.canvas.height],this.getTileRenderTransform(i,t),t.viewState.rotation,s,P_,r?t.declutter[r]:void 0)}i.globalAlpha=n}renderDeferredInternal(t){const e=this.renderedTiles.reduce(((t,e,i)=>(e.executorGroups[U(this.getLayer())].forEach((e=>t.push({executorGroup:e,index:i}))),t)),[]),i=e.map((({executorGroup:t})=>t.getDeferredZIndexContexts())),n={};for(let t=0,i=e.length;t<i;++t){const i=e[t].executorGroup.getDeferredZIndexContexts();for(const t in i)n[t]=!0}Object.keys(n).sort(s).map(Number).forEach((t=>{i.forEach(((i,n)=>{i[t]&&(i[t].forEach((t=>{const{executorGroup:i,index:r}=e[n],s=i.getRenderedContext(),o=s.globalAlpha;s.globalAlpha=this.renderedOpacity_;const a=this.tileClipContexts_[r];a&&a.draw(s),t.draw(s),a&&s.restore(),s.globalAlpha=o,t.clear()})),i[t].length=0)}))}))}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.tempExtent)[0]-d[0];return kt(zt(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[gs]||i[fs]);this.renderedPixelToCoordinateTransform_=e.pixelToCoordinateTransform.slice(),this.renderedRotation_=e.viewState.rotation,this.renderedOpacity_=e.layerStatesArray[e.layerIndex].opacity;const r=this.getLayer(),s=r.getRenderMode(),o=t.globalAlpha;t.globalAlpha=this.renderedOpacity_;const a=r.getDeclutter(),l=a?j_[s].filter((t=>!P_.includes(t))):j_[s],h=e.viewState,c=h.rotation,u=r.getSource(),d=u.getTileGridForProjection(h.projection).getZForResolution(h.resolution,u.zDirection),g=this.renderedTiles,f=[],p=[],m=[];let _=!0;for(let i=g.length-1;i>=0;--i){const s=g[i];_=_&&!s.getReplayState(r).dirty;const o=s.executorGroups[U(r)].filter((t=>t.hasExecutors(l)));if(0===o.length)continue;const h=this.getTileRenderTransform(s,e),u=s.tileCoord[0];let y=!1;const x=o[0].getClipCoords(h);let v,S=t;
vendor: 4,691 bytes, line 2387
2387if(x){v=new cg,S=v.getContext();for(let t=0,e=f.length;t<e;++t)if(d!==u&&u<p[t]){const e=f[t];Le([x[0],x[3],x[4],x[7]],[e[0],e[3],e[4],e[7]])&&(y||(S.save(),y=!0),S.beginPath(),S.moveTo(x[0],x[1]),S.lineTo(x[2],x[3]),S.lineTo(x[4],x[5]),S.lineTo(x[6],x[7]),S.moveTo(e[6],e[7]),S.lineTo(e[4],e[5]),S.lineTo(e[2],e[3]),S.lineTo(e[0],e[1]),S.clip())}f.push(x),p.push(u)}for(let i=0,r=o.length;i<r;++i){o[i].execute(t,[t.canvas.width,t.canvas.height],h,c,n,l,e.declutter?.[a])}y&&(S===t?S.restore():m[i]=v)}t.globalAlpha=o,this.ready=_,this.tileClipContexts_=m,e.declutter||this.renderDeferredInternal(e),super.postRender(t,e)}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=Ac(n,t,i[a],e,this.boundHandleStyleImageChange_,void 0,r,s)||o;else o=Ac(n,t,i,e,this.boundHandleStyleImageChange_,void 0,r,s);return o}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[U(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();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=Nt(this.tmpTransform_);zt(t,_,_),p.setTransform.apply(p,t)}const y=u.getTileCoordExtent(o,this.tempExtent),x=g/f,v=Nt(this.tmpTransform_);zt(v,x,-x),Xt(v,-y[0],-y[3]);for(let t=0,e=s.length;t<e;++t){s[t].execute(p,[p.canvas.width*_,p.canvas.height*_],v,0,!0,G_[i.getRenderMode()],null)}n.renderedTileResolution=t.wantedResolution}}let B_=null;function z_(t){B_=t;const e=Object.keys(t.defs),i=e.length;let n,r;for(n=0;n<i;++n){const i=e[n];if(!Qi(i)){const e=t.defs(i);let n=e.units;n||"longlat"!==e.projName||(n="degrees"),qi(new Be({code:i,axisOrientation:e.axis,metersPerUnit:e.to_meter,units:n}))}}for(n=0;n<i;++n){const s=e[n],o=Qi(s);for(r=0;r<i;++r){const i=e[r],n=Qi(i);if(!hi(s,i))if(t.defs[s]===t.defs[i])en([o,n]);else{const e=t(s,i);on(o,n,En(o,n,e.forward),En(n,o,e.inverse))}}}}let X_=async function(t){const e=await fetch(`https://epsg.io/${t}.proj4`);if(!e.ok)throw new Error(`Unexpected response from epsg.io: ${e.status}`);return e.text()};const V_=`\n  attribute vec2 ${Lp.TEXTURE_COORD};\n  uniform mat4 ${Ip.TILE_TRANSFORM};\n  uniform float ${Ip.TEXTURE_PIXEL_WIDTH};\n  uniform float ${Ip.TEXTURE_PIXEL_HEIGHT};\n  uniform float ${Ip.TEXTURE_RESOLUTION};\n  uniform float ${Ip.TEXTURE_ORIGIN_X};\n  uniform float ${Ip.TEXTURE_ORIGIN_Y};\n  uniform float ${Ip.DEPTH};\n\n  varying vec2 v_textureCoord;\n  varying vec2 v_mapCoord;\n\n  void main() {\n    v_textureCoord = ${Lp.TEXTURE_COORD};\n    v_mapCoord = vec2(\n      ${Ip.TEXTURE_ORIGIN_X} + ${Ip.TEXTURE_RESOLUTION} * ${Ip.TEXTURE_PIXEL_WIDTH} * v_textureCoord[0],\n      ${Ip.TEXTURE_ORIGIN_Y} - ${Ip.TEXTURE_RESOLUTION} * ${Ip.TEXTURE_PIXEL_HEIGHT} * v_textureCoord[1]\n    );\n    gl_Position = ${Ip.TILE_TRANSFORM} * vec4(${Lp.TEXTURE_COORD}, ${Ip.DEPTH}, 1.0);\n  }\n`,$_=`\n  #ifdef GL_FRAGMENT_PRECISION_HIGH\n  precision highp float;\n  #else\n  precision mediump float;\n  #endif\n\n  uniform vec4 ${Ip.RENDER_EXTENT};\n  uniform float ${um.MAX_SPEED};\n  uniform sampler2D ${Ip.TILE_TEXTURE_ARRAY}[1];\n\n  varying vec2 v_textureCoord;\n  varying vec2 v_mapCoord;\n\n  void main() {\n    if (\n      v_mapCoord[0] < ${Ip.RENDER_EXTENT}[0] ||\n      v_mapCoord[1] < ${Ip.RENDER_EXTENT}[1] ||\n      v_mapCoord[0] > ${Ip.RENDER_EXTENT}[2] ||\n      v_mapCoord[1] > ${Ip.RENDER_EXTENT}[3]\n    ) {\n      discard;\n    }\n\n    vec4 velocity = texture2D(${Ip.TILE_TEXTURE_ARRAY}[0],  v_textureCoord);\n    gl_FragColor = vec4((velocity.xy + ${um.MAX_SPEED}) / (2.0 * ${um.MAX_SPEED}), 0, 1);\n  }\n`,W_=`\n  #ifdef GL_FRAGMENT_PRECISION_HIGH\n  precision highp float;\n  #else\n  precision mediump float;\n  #endif\n\n  attribute vec2 ${dm};\n\n  varying vec2 ${fm};\n\n  void main() {\n    ${fm} = ${dm};\n    gl_Position = vec4(1.0 - 2.0 * ${dm}, 0, 1);\n  }\n`,Z_=`\n  #ifdef GL_FRAGMENT_PRECISION_HIGH\n  precision highp float;\n  #else\n  precision mediump float;\n  #endif\n\n  uniform sampler2D ${um.TEXTURE};\n  uniform float ${um.OPACITY};\n\n  varying vec2 ${fm};\n\n  void main() {\n    vec4 color = texture2D(${um.TEXTURE}, 1.0 - ${fm});\n    gl_FragColor = vec4(floor(255.0 * color * ${um.OPACITY}
2387) / 255.0);\n  }\n`,Y_=`\n  #ifdef GL_FRAGMENT_PRECISION_HIGH\n  precision highp float;\n  #else\n  precision mediump float;\n  #endif\n\n  uniform sampler2D ${um.POSITION_TEXTURE};\n  uniform sampler2D ${um.VELOCITY_TEXTURE};\n  uniform float ${um.RANDOM_SEED};\n  uniform float ${um.SPEED_FACTOR};\n  uniform float ${um.DROP_RATE};\n  uniform float ${um.DROP_RATE_BUMP};\n  uniform vec2 ${um.ROTATION};\n  uniform vec2 ${um.VIEWPORT_SIZE_PX};\n\n  varying vec2 ${fm};\n\n  // pseudo-random generator\n  const vec3 randConstants = vec3(12.9898, 78.233, 4375.85453);\n\n  float rand(const vec2 co) {\n    float t = dot(randConstants.xy, co);\n    return fract(sin(t) * (randConstants.z + t));\n  }\n\n  void main() {\n    vec4 positionColor = texture2D(${um.POSITION_TEXTURE}, ${fm});\n\n    // decode particle position from pixel RGBA\n    vec2 particlePosition = vec2(\n      positionColor.r / 255.0 + positionColor.b,\n      positionColor.g / 255.0 + positionColor.a\n    );\n\n    vec4 velocityColor = texture2D(${um.VELOCITY_TEXTURE}, particlePosition);\n    if (velocityColor.a == 0.0) {\n      discard;\n    }\n\n    float vx = 2.0 * velocityColor.r - 1.0;\n    float vy = 2.0 * velocityColor.g - 1.0;\n\n    // normalized veloicty (magnitude 0 - 1)\n    vec2 velocity = vec2(\n      vx * ${um.ROTATION}.x - vy * ${um.ROTATION}.y,\n      vx * ${um.ROTATION}.y + vy * ${um.ROTATION}.x\n    );\n\n    // account for aspect ratio (square particle position texture, non-square map)\n    float aspectRatio = ${um.VIEWPORT_SIZE_PX}.x / ${um.VIEWPORT_SIZE_PX}.y;\n    vec2 offset = vec2(velocity.x / aspectRatio, velocity.y) * ${um.SPEED_FACTOR};\n\n    // update particle position, wrapping around the edge\n    particlePosition = fract(1.0 + particlePosition + offset);\n\n    // a random seed to use for the particle drop\n    vec2 seed = (particlePosition + ${fm}) * ${um.RANDOM_SEED};\n\n    // drop rate is a chance a particle will restart at random position, to avoid degeneration\n    float dropRate = ${um.DROP_RATE} + length(velocity) * ${um.DROP_RATE_BUMP};\n    float drop = step(1.0 - dropRate, rand(seed));\n\n    vec2 randomPosition = vec2(rand(seed + 1.3), rand(seed + 2.1));\n    particlePosition = mix(particlePosition, randomPosition, drop);\n\n    // encode the new particle position back into RGBA\n    gl_FragColor = vec4(\n      fract(particlePosition * 255.0),\n      floor(particlePosition * 255.0) / 255.0\n    );\n  }\n`,H_=`\n  #ifdef GL_FRAGMENT_PRECISION_HIGH\n  precision highp float;\n  #else\n  precision mediump float;\n  #endif\n\n  attribute float ${gm};\n\n  uniform sampler2D ${um.POSITION_TEXTURE};\n  uniform float ${um.PARTICLE_COUNT_SQRT};\n\n  varying vec2 ${fm};\n\n  void main() {\n    vec4 color = texture2D(\n      ${um.POSITION_TEXTURE},\n      vec2(\n        fract(${gm} / ${um.PARTICLE_COUNT_SQRT}),\n        floor(${gm} / ${um.PARTICLE_COUNT_SQRT}) / ${um.PARTICLE_COUNT_SQRT}\n      )\n    );\n\n    ${fm} = vec2(\n      color.r / 255.0 + color.b,\n      color.g / 255.0 + color.a\n    );\n\n    gl_PointSize = 1.0;\n    gl_Position = vec4(\n      2.0 * ${fm}.x - 1.0,\n      2.0 * ${fm}.y - 1.0,\n      0,\n      1\n    );\n  }\n`;const K_=[];class q_ extends yg{constructor(t){const e=Object.assign({},t);if(delete e.maxSpeed,delete e.speedFactor,delete e.particles,super(e),this.style_=t.style||{},!(t.maxSpeed>0))throw new Error("maxSpeed is required");this.maxSpeed_=t.maxSpeed,this.speedFactor_=t.speedFactor,this.particles_=t.particles,this.styleVariables_=this.style_.variables||{},this.addChangeListener(ss,this.handleSourceUpdate_)}handleSourceUpdate_(){this.hasRenderer()&&this.getRenderer().clearCache()}updateStyleVariables(t){Object.assign(this.styleVariables_,t),this.changed()}getSources(t,e){const i=this.getSource();return K_[0]=i,K_}createRenderer(){const t=function(t){const e={inFragmentShader:!1,variables:{},properties:{},functions:{},bandCount:0,style:{}};e.inFragmentShader=!0;const i=[];if(void 0!==t.color){const n=em(e,t.color,ba);i.push(`color = ${n};`)}const n=Object.keys(e.variables);if(n.length>1&&!t.variables)throw new Error(`Missing variables in style (expected ${e.variables})`);const r={};for(const e of n){if(!(e in t.variables))throw new Error(`Missing '${e}' in style variables`);r[Bp(e)]=function(){let i=t.variables[e];return"string"==typeof i&&(i=jp(i)),void 0!==i?i:-9999999}}const s=Object.keys(r).map((function(t){return`uniform float ${t};`})),o=Object.keys(e.functions).map((function(t){return e.functions[t]})),a=`\n    #ifdef GL_FRAGMENT_PRECISION_HIGH\n    precision highp float;\n    #else\n    precision mediump float;\n    #endif\n\n    uniform sampler2D ${um.VELOCITY_TEXTURE};\n    uniform float ${um.MAX_SPEED};\n    uniform vec2 ${um.ROTATION};\n\n    ${s.join("\n")}\n\n    varying vec2 ${fm};\n    \n    ${o.join("\n")}\n\n    void main() {\n      vec4 velocityColor = texture2D(${um.VELOCITY_TEXTURE}, ${fm});\n\n      float vx = mix(-${um.MAX_SPEED}, ${um.MAX_SPEED}, velocityColor.r);\n      float vy = mix(-${um.MAX_SPEED}, ${um.MAX_SPEED}, velocityColor.g);\n\n      vec2 velocity = vec2(\n        vx * ${um.ROTATION}.x - vy * ${um.ROTATION}.y,\n        vx * ${um.ROTATION}.y + vy * ${um.ROTATION}.x\n      );\n\n      float v_prop_speed = length(velocity);\n\n      vec4 color;\n\n      ${i.join("\n")}\n\n      if (color.a == 0.0) {\n        discard;\n      }\n\n      gl_FragColor = color;\n    }\n  `;return{tileVertexShader:V_,tileFragmentShader:$_,particleColorVertexShader:H_,particleColorFragmentShader:a,particlePositionVertexShader:W_,particlePositionFragmentShader:Y_,textureVertexShader:W_,textureFragmentShader:Z_}}(this.style_);return new pm(this,{...t,cacheSize:this.getCacheSize(),maxSpeed:this.maxSpeed_,speedFactor:this.speedFactor_,particles:this.particles_})}}q_.prototype.dispose;class J_ extends Rl{constructor(t){super(t)}createRenderer(){return new N_(this)}}function Q_(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),ui(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 ty(t,e,i,n,r){return Q_((function(n){return[t,e+(i-e)*n]}),cn(Qi("EPSG:4326"),n),r)}function ey(t,e,i,n,r){return Q_((function(n){return[e+(i-e)*n,t]}),cn(Qi("EPSG:4326"),n),r)}const iy=new ga({color:"rgba(0,0,0,0.2)"}),ny=[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 ry="blur",sy="gradient",oy="radius",ay=["#00f","#0ff","#0f0","#ff0","#f00"];function ly(t,e){const i=`\n    attribute vec2 ${Lp.TEXTURE_COORD};\n    uniform mat4 ${Ip.TILE_TRANSFORM};\n    uniform float ${Ip.TEXTURE_PIXEL_WIDTH};\n    uniform float ${Ip.TEXTURE_PIXEL_HEIGHT};\n    uniform float ${Ip.TEXTURE_RESOLUTION};\n    uniform float ${Ip.TEXTURE_ORIGIN_X};\n    uniform float ${Ip.TEXTURE_ORIGIN_Y};\n    uniform float ${Ip.DEPTH};\n\n    varying vec2 v_textureCoord;\n    varying vec2 v_mapCoord;\n\n    void main() {\n      v_textureCoord = ${Lp.TEXTURE_COORD};\n      v_mapCoord = vec2(\n        ${Ip.TEXTURE_ORIGIN_X} + ${Ip.TEXTURE_RESOLUTION} * ${Ip.TEXTURE_PIXEL_WIDTH} * v_textureCoord[0],\n        ${Ip.TEXTURE_ORIGIN_Y} - ${Ip.TEXTURE_RESOLUTION} * ${Ip.TEXTURE_PIXEL_HEIGHT} * v_textureCoord[1]\n      );\n      gl_Position = ${Ip.TILE_TRANSFORM} * vec4(${Lp.TEXTURE_COORD}, ${Ip.DEPTH}, 1.0);\n    }\n  `,n={inFragmentShader:!1,variables:{},properties:{},functions:{},bandCount:0,style:{},inFragmentShader:!0,bandCount:e,style:t},r=[];if(void 0!==t.color){const e=em(n,t.color,ba);r.push(`color = ${e};`)}if(void 0!==t.contrast){const e=em(n,t.contrast,Ca);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));`)}
2387if(void 0!==t.exposure){const e=em(n,t.exposure,Ca);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=em(n,t.saturation,Ca);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=em(n,t.gamma,Ca);r.push(`color.rgb = pow(color.rgb, vec3(1.0 / ${e}));`)}if(void 0!==t.brightness){const e=em(n,t.brightness,Ca);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=Object.keys(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[Object.keys(n.variables)[e]];if(!(i.name in t.variables))throw new Error(`Missing '${i.name}' in style variables`);s[Bp(i.name)]=function(){let e=t.variables[i.name];return"string"==typeof e&&(e=jp(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 ${Ip.TILE_TEXTURE_ARRAY}[${l}];`),n.paletteTextures&&a.push(`uniform sampler2D ${Vp}[${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 ${Ip.RENDER_EXTENT};\n    uniform float ${Ip.TRANSITION_ALPHA};\n    uniform float ${Ip.TEXTURE_PIXEL_WIDTH};\n    uniform float ${Ip.TEXTURE_PIXEL_HEIGHT};\n    uniform float ${Ip.RESOLUTION};\n    uniform float ${Ip.ZOOM};\n\n    ${a.join("\n")}\n\n    ${h.join("\n")}\n\n    void main() {\n      if (\n        v_mapCoord[0] < ${Ip.RENDER_EXTENT}[0] ||\n        v_mapCoord[1] < ${Ip.RENDER_EXTENT}[1] ||\n        v_mapCoord[0] > ${Ip.RENDER_EXTENT}[2] ||\n        v_mapCoord[1] > ${Ip.RENDER_EXTENT}[3]\n      ) {\n        discard;\n      }\n\n      vec4 color = texture2D(${Ip.TILE_TEXTURE_ARRAY}[0],  v_textureCoord);\n\n      ${r.join("\n")}\n\n      gl_FragColor = color;\n      gl_FragColor.rgb *= gl_FragColor.a;\n      gl_FragColor *= ${Ip.TRANSITION_ALPHA};\n    }`,uniforms:s,paletteTextures:n.paletteTextures}}class hy extends yg{constructor(t){const e=(t=t?Object.assign({},t):{}).style||{};delete t.style,super(t),this.sources_=t.sources,this.renderedSource_=null,this.renderedResolution_=NaN,this.style_=e,this.styleVariables_=this.style_.variables||{},this.addChangeListener(ss,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();const t=this.getSource();if(t)if("loading"===t.getState()){const e=()=>{"ready"===t.getState()&&(t.removeEventListener("change",e),this.setStyle(this.style_))};t.addEventListener("change",e)}else 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=ly(this.style_,this.getSourceBandCount_());return new Mp(this,{vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,uniforms:t.uniforms,cacheSize:this.getCacheSize(),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){if(this.styleVariables_=t.variables||{},this.style_=t,this.hasRenderer()){const t=ly(this.style_,this.get
vendor: 72,724 bytes, line 2387
2387SourceBandCount_());this.getRenderer().reset({vertexShader:t.vertexShader,fragmentShader:t.fragmentShader,uniforms:t.uniforms,paletteTextures:t.paletteTextures}),this.changed()}}updateStyleVariables(t){Object.assign(this.styleVariables_,t),this.changed()}}hy.prototype.dispose;const cy="addfeatures";class uy extends t{constructor(t,e,i,n){super(t),this.features=i,this.file=e,this.projection=n}}const dy="drawstart",gy="drawend",fy="drawabort";class py extends t{constructor(t,e){super(t),this.feature=e}}function my(t,e){return di(t[0],t[1],e[0],e[1])}function _y(t,e){const i=t.length;return e<0?t[e+i]:e>=i?t[e-i]:t[e]}function yy(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 my(Ty(t,n),Ty(t,r))}let a=0;if(n<s){a+=my(Ty(t,n),_y(t,s))}if(o<r){a+=my(_y(t,o),Ty(t,r))}for(let e=s;e<o-1;++e){a+=my(_y(t,e),_y(t,e+1))}return a}function xy(t,e,i){if(e instanceof Nu)Sy(t,e.getCoordinates(),!1,i);else if(e instanceof ku){const n=e.getCoordinates();for(let e=0,r=n.length;e<r;++e)Sy(t,n[e],!1,i)}else if(e instanceof Cr){const n=e.getCoordinates();for(let e=0,r=n.length;e<r;++e)Sy(t,n[e],!0,i)}else if(e instanceof Uu){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)Sy(t,r[e],!0,i)}}else if(e instanceof Lu){const n=e.getGeometries();for(let e=0;e<n.length;++e)xy(t,n[e],i)}else;}const vy={index:-1,endIndex:NaN};function Sy(t,e,i,n){const r=t[0],s=t[1];for(let t=0,o=e.length-1;t<o;++t){const o=wy(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 Ey={along:0,squaredDistance:0};function wy(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=ci(((t-r)*o+(e-s)*a)/(o*o+a*a),0,1),h+=o*l,c+=a*l),Ey.along=l,Ey.squaredDistance=yi(di(t,e,h,c),10),Ey}function Ty(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 Cy(){const t=ya();return function(e,i){return t[e.getGeometry().getType()]}}const Ry="extentchanged";class by extends t{constructor(t){super(Ry),this.extent=t}}function Py(){const t=ya();return function(e,i){return t.Polygon}}function Iy(){const t=ya();return function(e,i){return t.Point}}function Ly(t){return function(e){return Kt([t,e])}}function Fy(t,e){return t[0]==e[0]?function(i){return Kt([t,[i[0],e[1]]])}:t[1]==e[1]?function(i){return Kt([t,[e[0],i[1]]])}:null}function My(t){return parseFloat(t)}function Ay(t){return function(t){return yi(t,5)}(t).toString()}function Oy(t,e){return!isNaN(t)&&t!==My(Ay(e))}const Dy=[0,0,0,0],Ny=[],ky="modifystart",Gy="modifyend";class jy extends t{constructor(t,e,i){super(t),this.features=e,this.mapBrowserEvent=i}}function Uy(t,e){return t.index-e.index}function By(t,e,i){const n=e.geometry;if("Circle"===n.getType()){let r=n;if(1===e.index){const e=pn();e&&(r=r.clone().transform(e,i));const n=Mi(r.getCenter(),_n(t,i)),s=Math.sqrt(n)-r.getRadius();return s*s}}const r=_n(t,i);return Ny[0]=_n(e.segment[0],i),Ny[1]=_n(e.segment[1],i),Oi(r,Ny)}function zy(t,e,i){const n=e.geometry;if("Circle"===n.getType()&&1===e.index){let e=n;const r=pn();return r&&(e=e.clone().transform(r,i)),mn(e.getClosestPoint(_n(t,i)),i)}const r=_n(t,i);return Ny[0]=_n(e.segment[0],i),Ny[1]=_n(e.segment[1],i),mn(Ri(r,Ny),i)}function Xy(){const t=ya();return function(e,i){return t.Point}}const Vy="select";class $y extends t{constructor(t,e,i,n){super(t),this.selected=e,this.deselected=i,this.mapBrowserEvent=n}}const Wy={};class Zy extends ah{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:Sh,this.addCondition_=t.addCondition?t.addCondition:vh,this.removeCondition_=t.removeCondition?t.removeCondition:vh,this.toggleCondition_=t.toggleCondition?t.toggleCondition:Th,this.multi_=!!t.multi&&t.multi,this.filter_=t.filter?t.filter:d,this.hitTolerance_=t.hitTolerance?t.hitTolerance:0,this.style_=void 0!==t.style?t.style:function(){const t=ya();return h(t.Polygon,t.LineString),h(t.GeometryCollection,t.LineString),function(e){return e.getGeometry()?t[e.getGeometry().getType()]:null}}(),this.features_=t.features||new Z,t.layers)if("function"==typeof t.layers)e=t.layers;else{const i=t.layers;e=function(t){return i.includes(t)}}else e=d;this.layerFilter_=e,this.featureLayerAssociation_={}}addFeatureLayerAssociation_(t,e){this.featureLayerAssociation_[U(t)]=e}getFeatures(){return this.features_}getHitTolerance(){return this.hitTolerance_}getLayer(t){return this.featureLayerAssociation_[U(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(X,this.boundAddFeature_),this.features_.addEventListener(V,this.boundRemoveFeature_),this.style_&&this.features_.forEach(this.applySelectedStyle_.bind(this))):(this.features_.removeEventListener(X,this.boundAddFeature_),this.features_.removeEventListener(V,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 J_&&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=U(t);e in Wy||(Wy[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 Zy&&n.getStyle()&&-1!==n.getFeatures().getArray().lastIndexOf(t))return void t.setStyle(n.getStyle())}const i=U(t);t.setStyle(Wy[i]),delete Wy[i]}removeFeatureLayerAssociation_(t){delete this.featureLayerAssociation_[U(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){_(this.featureLayerAssociation_),s.forEachFeatureAtPixel(t.pixel,((t,e)=>{if(t instanceof Mt&&this.filter_(t,e))return this.addFeatureLayerAssociation_(t,e),l.push(t),!this.multi_}),{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,((t,r)=>{if(t instanceof Mt&&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_}),{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 $y(Vy,l,a,t)),!0}}const Yy="snap";class Hy extends t{constructor(t,e){super(t),this.vertex=e.vertex,this.vertexPixel=e.vertexPixel,this.feature=e.feature,this.segment=e.segment}}function Ky(t){return t.feature?t.feature:t.element?t.element:null}const qy=[];const Jy="translatestart",Qy="translating",tx="translateend";class ex extends t{constructor(t,e,i,n,r){super(t),this.features=e,this.coordinate=i,this.startCoordinate=n,this.mapBrowserEvent=r}}function ix(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 nx{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.featureClass=Mt,this.supportedMediaTypes=null}getReadOptions(t,e){if(e){let i=e.dataProjection?Qi(e.dataProjection):this.readProjection(t);e.extent&&i&&"tile-pixels"===i.getUnits()&&(i=Qi(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,featureClass:this.featureClass},t)}getType(){return G()}readFeature(t,e){return G()}readFeatures(t,e){return G()}readGeometry(t,e){return G()}readProjection(t){return G()}writeFeature(t,e){return G()}writeFeatures(t,e){return G()}writeGeometry(t,e){return G()}}function rx(t,e,i){const n=i?Qi(i.featureProjection):null,r=i?Qi(i.dataProjection):null;let s=t;if(n&&r&&!ln(n,r)){e&&(s=t.clone());const i=e?n:r,o=e?r:n;"tile-pixels"===i.getUnits()?s.transform(i,o):s.applyTransform(cn(i,o))}if(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 sx(t,e){const i=e?Qi(e.featureProjection):null,n=e?Qi(e.dataProjection):null;return i&&n&&!ln(i,n)?dn(t,n,i):t}const ox={Point:sr,LineString:Nu,Polygon:Cr,MultiPoint:Gu,MultiLineString:ku,MultiPolygon:Uu};function ax(t,e){const i=t.geometry;if(!i)return[];if(Array.isArray(i))return i.map((e=>ax({...t,geometry:e}))).flat();const n="MultiPolygon"===i.type?"Polygon":i.type;if("GeometryCollection"===n||"Circle"===n)throw new Error("Unsupported geometry type: "+n);const r=i.layout.length;return rx(new zu(n,"Polygon"===n?function(t,e,i){return Array.isArray(e[0])?(Sr(t,0,e,i)||wr(t=t.slice(),0,e,i),t):(vr(t,0,e,i)||Er(t=t.slice(),0,e,i),t)}(i.flatCoordinates,i.ends,r):i.flatCoordinates,i.ends?.flat(),r,t.properties||{},t.id).enableSimplifyTransformed(),!1,e)}function lx(t,e){if(!t)return null;if(Array.isArray(t)){const i=t.map((t=>lx(t,e)));return new Lu(i)}return rx(new(0,ox[t.type])(t.flatCoordinates,t.layout,t.ends),!1,e)}class hx extends nx{constructor(){super()}getType(){return"json"}readFeature(t,e){return this.readFeatureFromObject(cx(t),this.getReadOptions(t,e))}readFeatures(t,e){return this.readFeaturesFromObject(cx(t),this.getReadOptions(t,e))}readFeatureFromObject(t,e){return G()}readFeaturesFromObject(t,e){return G()}readGeometry(t,e){return this.readGeometryFromObject(cx(t),this.getReadOptions(t,e))}readGeometryFromObject(t,e){return G()}readProjection(t){return this.readProjectionFromObject(cx(t))}readProjectionFromObject(t){return G()}writeFeature(t,e){return JSON.stringify(this.writeFeatureObject(t,e))}writeFeatureObject(t,e){return G()}writeFeatures(t,e){return JSON.stringify(this.writeFeaturesObject(t,e))}writeFeaturesObject(t,e){return G()}writeGeometry(t,e){return JSON.stringify(this.writeGeometryObject(t,e))}writeGeometryObject(t,e){return G()}}function cx(t){if("string"==typeof t){const e=JSON.parse(t);return e||null}return null!==t?t:null}const ux={Point:function(t){let e;e=void 0!==t.m&&void 0!==t.z?new sr([t.x,t.y,t.z,t.m],"XYZM"):void 0!==t.z?new sr([t.x,t.y,t.z],"XYZ"):void 0!==t.m?new sr([t.x,t.y,t.m],"XYM"):new sr([t.x,t.y]);return e},LineString:function(t){const e=fx(t);return new Nu(t.paths[0],e)},Polygon:function(t){const e=fx(t);return new Cr(t.rings,e)},MultiPoint:function(t){const e=fx(t);return new Gu(t.points,e)},MultiLineString:function(t){const e=fx(t);return new ku(t.paths,e)},MultiPolygon:function(t){const e=fx(t);return new Uu(t.rings,e)}},dx={Point:function(t,e){const i=t.getCoordinates();let n;const r=t.getLayout();if("XYZ"===r)n={x:i[0],y:i[1],z:i[2]};else if("XYM"===r)n={x:i[0],y:i[1],m:i[2]};else if("XYZM"===r)n={x:i[0],y:i[1],z:i[2],m:i[3]};else{if("XY"!==r)throw new Error("Invalid geometry layout");n={x:i[0],y:i[1]}}return n},LineString:function(t,e){const i=px(t);return{hasZ:i.hasZ,hasM:i.hasM,paths:[t.getCoordinates()]}},Polygon:function(t,e){const i=px(t);return{hasZ:i.hasZ,hasM:i.hasM,rings:t.getCoordinates(!1)}},MultiPoint:function(t,e){const i=px(t);return{hasZ:i.hasZ,hasM:i.hasM,points:t.getCoordinates()}},MultiLineString:function(t,e){const i=px(t);return{hasZ:i.hasZ,hasM:i.hasM,paths:t.getCoordinates()}},MultiPolygon:function(t,e){const i=px(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 gx(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=fx(e),r=function(t,e){const i=[],n=[],r=[];let s,o;for(s=0,o=t.length;s<o;++s){i.length=0,zn(i,0,t[s],e.length);xr(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(ee(new rr(i).getExtent(),new rr(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 rx((0,ux[i])(t),!1,e)}function fx(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 px(t){const e=t.getLayout();return{hasZ:"XYZ"===e||"XYZM"===e,hasM:"XYM"===e||"XYZM"===e}}function mx(t,e){return(0,dx[t.getType()])(rx(t,!0,e),e)}class _x extends nx{constructor(){super(),this.xmlSerializer_=_f()}getType(){return"xml"}readFeature(t,e){if(!t)return null;if("string"==typeof t){const i=Jg(t);return this.readFeatureFromDocument(i,e)}return Kg(t)?this.readFeatureFromDocument(t,e):this.readFeatureFromNode(t,e)}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)return[];if("string"==typeof t){const i=Jg(t);return this.readFeaturesFromDocument(i,e)}return Kg(t)?this.readFeaturesFromDocument(t,e):this.readFeaturesFromNode(t,e)}readFeaturesFromDocument(t,e){const i=[];for(let n=t.firstChild;n;n=n.nextSibling)n.nodeType==Node.ELEMENT_NODE&&h(i,this.readFeaturesFromNode(n,e));return i}readFeaturesFromNode(t,e){return G()}readGeometry(t,e){if(!t)return null;if("string"==typeof t){const i=Jg(t);return this.readGeometryFromDocument(i,e)}return Kg(t)?this.readGeometryFromDocument(t,e):this.readGeometryFromNode(t,e)}readGeometryFromDocument(t,e){return null}readGeometryFromNode(t,e){return null}readProjection(t){if(!t)return null;if("string"==typeof t){const e=Jg(t);return this.readProjectionFromDocument(e)}return Kg(t)?this.readProjectionFromDocument(t):this.readProjectionFromNode(t)}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 yx="http://www.opengis.net/gml",xx=/^\s*$/;class vx extends _x{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:tf(this.readFeaturesInternal),featureMembers:ef(this.readFeaturesInternal)},this.supportedMediaTypes=["application/gml+xml"]}readFeaturesInternal(t,e){const i=t.localName;let n=null;if("FeatureCollection"==i)n=df([],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?tf(this.readFeatureElement,this):ef(this.readFeatureElement,this))}h[o[t]]=e}n=df("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"),df(null,this.GEOMETRY_PARSERS,t,e,this)}readExtentElement(t,e){const i=e[0],n=this.readGeometryOrExtent(t,e);return n?sx(n,i):void 0}readGeometryElement(t,e){const i=e[0],n=this.readGeometryOrExtent(t,e);return n?rx(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=Yg(s,!1),xx.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 instanceof In)){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)return r;const s=new Mt(r);n&&s.setGeometryName(n);const o=t.getAttribute("fid")||qg(t,this.namespace,"id");return o&&s.setId(o),s}readFeatureElement(t,e){return this.readFeatureElementInternal(t,e,!0)}readPoint(t,e){const i=this.readFlatCoordinatesFromNode(t,e);if(i)return new sr(i,"XYZ")}readMultiPoint(t,e){const i=df([],this.MULTIPOINT_PARSERS,t,e,this);if(i)return new Gu(i)}readMultiLineString(t,e){const i=df([],this.MULTILINESTRING_PARSERS,t,e,this);if(i)return new ku(i)}readMultiPolygon(t,e){const i=df([],this.MULTIPOLYGON_PARSERS,t,e,this);if(i)return new Uu(i)}pointMemberParser(t,e){uf(this.POINTMEMBER_PARSERS,t,e,this)}lineStringMemberParser(t,e){uf(this.LINESTRINGMEMBER_PARSERS,t,e,this)}polygonMemberParser(t,e){uf(this.POLYGONMEMBER_PARSERS,t,e,this)}readLineString(t,e){const i=this.readFlatCoordinatesFromNode(t,e);if(i){return new Nu(i,"XYZ")}}readFlatLinearRing(t,e){const i=df(null,this.GEOMETRY_FLAT_COORDINATES_PARSERS,t,e,this);if(i)return i}readLinearRing(t,e){const i=this.readFlatCoordinatesFromNode(t,e);if(i)return new rr(i,"XYZ")}readPolygon(t,e){const i=df([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)h(t,i[n]),e.push(t.length);return new Cr(t,"XYZ",e)}}readFlatCoordinatesFromNode(t,e){return df(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 Qi(this.srsName?this.srsName:t.firstElementChild.getAttribute("srsName"))}}function Sx(t){return Ex(Yg(t,!1))}function Ex(t){const e=/^\s*(true|1)|(false|0)\s*$/.exec(t);if(e)return void 0!==e[1]||!1}function wx(t){const e=Yg(t,!1),i=Date.parse(e);return isNaN(i)?void 0:i/1e3}function Tx(t){return Cx(Yg(t,!1))}function Cx(t){const e=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(t);if(e)return parseFloat(e[1])}function Rx(t){return bx(Yg(t,!1))}function bx(t){const e=/^\s*(\d+)\s*$/.exec(t);if(e)return parseInt(e[1],10)}function Px(t){return Yg(t,!1).trim()}function Ix(t,e){Ox(t,e?"1":"0")}function Lx(t,e){t.appendChild(yf().createCDATASection(e))}function Fx(t,e){const i=new Date(1e3*e),n=i.getUTCFullYear()+"-"+Ei(i.getUTCMonth()+1,2)+"-"+Ei(i.getUTCDate(),2)+"T"+Ei(i.getUTCHours(),2)+":"+Ei(i.getUTCMinutes(),2)+":"+Ei(i.getUTCSeconds(),2)+"Z";t.appendChild(yf().createTextNode(n))}function Mx(t,e){const i=e.toPrecision();t.appendChild(yf().createTextNode(i))}function Ax(t,e){const i=e.toString();t.appendChild(yf().createTextNode(i))}function Ox(t,e){t.appendChild(yf().createTextNode(e))}vx.prototype.namespace=yx,vx.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml":{}},vx.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml":{}},vx.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml":{}},vx.prototype.MULTIPOINT_PARSERS={"http://www.opengis.net/gml":{pointMember:tf(vx.prototype.pointMemberParser),pointMembers:tf(vx.prototype.pointMemberParser)}},vx.prototype.MULTILINESTRING_PARSERS={"http://www.opengis.net/gml":{lineStringMember:tf(vx.prototype.lineStringMemberParser),lineStringMembers:tf(vx.prototype.lineStringMemberParser)}},vx.prototype.MULTIPOLYGON_PARSERS={"http://www.opengis.net/gml":{polygonMember:tf(vx.prototype.polygonMemberParser),polygonMembers:tf(vx.prototype.polygonMemberParser)}},vx.prototype.POINTMEMBER_PARSERS={"http://www.opengis.net/gml":{Point:tf(vx.prototype.readFlatCoordinatesFromNode)}},vx.prototype.LINESTRINGMEMBER_PARSERS={"http://www.opengis.net/gml":{LineString:tf(vx.prototype.readLineString)}},vx.prototype.POLYGONMEMBER_PARSERS={"http://www.opengis.net/gml":{Polygon:tf(vx.prototype.readPolygon)}},vx.prototype.RING_PARSERS={"http://www.opengis.net/gml":{LinearRing:ef(vx.prototype.readFlatLinearRing)}};const Dx=yx+" http://schemas.opengis.net/gml/2.1.2/feature.xsd",Nx={MultiLineString:"lineStringMember",MultiCurve:"curveMember",MultiPolygon:"polygonMember",MultiSurface:"surfaceMember"};class kx extends vx{constructor(t){super(t=t||{}),this.FEATURE_COLLECTION_PARSERS[yx].featureMember=tf(this.readFeaturesInternal),this.schemaLocation=t.schemaLocation?t.schemaLocation:Dx}readFlatCoordinates(t,e){const i=Yg(t,!1).replace(/^\s*|\s*$/g,""),n=e[0].srsName;let r="enu";if(n){const t=Qi(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;r.startsWith("en")?o.push(i,n,a):o.push(n,i,a)}return o}readBox(t,e){const i=df([null],this.BOX_PARSERS_,t,e,this);return se(i[1][0],i[1][1],i[1][3],i[1][4])}innerBoundaryIsParser(t,e){const i=df(void 0,this.RING_PARSERS,t,e,this);if(i){e[e.length-1].push(i)}}outerBoundaryIsParser(t,e){const i=df(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"),Zg("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]=sf(this.writeGeometryElement,this)):e in r.serializers[s]||(r.serializers[s][e]=sf(Ox)))}}const h=Object.assign({},r);h.node=t,ff(h,r.serializers,af(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=Zg(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();ff({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)?sx(e,n):rx(e,!0,n),ff(r,this.GEOMETRY_SERIALIZERS,this.GEOMETRY_NODE_FACTORY_,[s],i,void 0,this)}createCoordinatesNode_(t){const e=Zg(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)}Ox(t,l.join(" "))}writeCurveSegments_(t,e,i){const n=Zg(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();ff({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=Zg(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),Zg(r.namespaceURI,void 0!==s?"innerBoundaryIs":"outerBoundaryIs")}writeSurfacePatches_(t,e,i){const n=Zg(t.namespaceURI,"PolygonPatch");t.appendChild(n),this.writeSurfaceOrPolygon(n,e,i)}writeRing(t,e,i){const n=Zg(t.namespaceURI,"LinearRing");t.appendChild(n),this.writeLinearRing(n,e,i)}getCoords_(t,e,i){let n=(e?Qi(e).getAxisOrientation():"enu").startsWith("en")?t[0]+","+t[1]:t[1]+","+t[0];if(i){n+=","+(t[2]||0)}return n}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();Ox(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();ff({node:t,hasZ:r,srsName:s},this.POINTMEMBER_SERIALIZERS,af("pointMember"),o,i,void 0,this)}writePointMember(t,e,i){const n=Zg(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();ff({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]];ff({node:t},this.ENVELOPE_SERIALIZERS,lf,r,i,["lowerCorner","upperCorner"],this)}MULTIGEOMETRY_MEMBER_NODE_FACTORY_(t,e,i){const n=e[e.length-1].node;return Zg("http://www.opengis.net/gml",Nx[n.nodeName])}}kx.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml":{coordinates:ef(kx.prototype.readFlatCoordinates)}},kx.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml":{innerBoundaryIs:kx.prototype.innerBoundaryIsParser,outerBoundaryIs:kx.prototype.outerBoundaryIsParser}},kx.prototype.BOX_PARSERS_={"http://www.opengis.net/gml":{coordinates:tf(kx.prototype.readFlatCoordinates)}},kx.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml":{Point:ef(vx.prototype.readPoint),MultiPoint:ef(vx.prototype.readMultiPoint),LineString:ef(vx.prototype.readLineString),MultiLineString:ef(vx.prototype.readMultiLineString),LinearRing:ef(vx.prototype.readLinearRing),Polygon:ef(vx.prototype.readPolygon),MultiPolygon:ef(vx.prototype.readMultiPolygon),Box:ef(kx.prototype.readBox)}},kx.prototype.GEOMETRY_SERIALIZERS={"http://www.opengis.net/gml":{Curve:sf(kx.prototype.writeCurveOrLineString),MultiCurve:sf(kx.prototype.writeMultiCurveOrLineString),Point:sf(kx.prototype.writePoint),MultiPoint:sf(kx.prototype.writeMultiPoint),LineString:sf(kx.prototype.writeCurveOrLineString),MultiLineString:sf(kx.prototype.writeMultiCurveOrLineString),LinearRing:sf(kx.prototype.writeLinearRing),Polygon:sf(kx.prototype.writeSurfaceOrPolygon),MultiPolygon:sf(kx.prototype.writeMultiSurfaceOrPolygon),Surface:sf(kx.prototype.writeSurfaceOrPolygon),MultiSurface:sf(kx.prototype.writeMultiSurfaceOrPolygon),Envelope:sf(kx.prototype.writeEnvelope)}},kx.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{lineStringMember:sf(kx.prototype.writeLineStringOrCurveMember),curveMember:sf(kx.prototype.writeLineStringOrCurveMember)}},kx.prototype.RING_SERIALIZERS={"http://www.opengis.net/gml":{outerBoundaryIs:sf(kx.prototype.writeRing),innerBoundaryIs:sf(kx.prototype.writeRing)}},kx.prototype.POINTMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{pointMember:sf(kx.prototype.writePointMember)}},kx.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{surfaceMember:sf(kx.prototype.writeSurfaceOrPolygonMember),polygonMember:sf(kx.prototype.writeSurfaceOrPolygonMember)}},kx.prototype.ENVELOPE_SERIALIZERS={"http://www.opengis.net/gml":{lowerCorner:sf(Ox),upperCorner:sf(Ox)}};const Gx=yx+" http://schemas.opengis.net/gml/3.1.1/profiles/gmlsfProfile/1.0.0/gmlsf.xsd",jx={MultiLineString:"lineStringMember",MultiCurve:"curveMember",MultiPolygon:"polygonMember",MultiSurface:"surfaceMember"};class Ux extends vx{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:Gx,this.hasZ=void 0!==t.hasZ&&t.hasZ}readMultiCurve(t,e){const i=df([],this.MULTICURVE_PARSERS,t,e,this);if(i){return new ku(i)}}readFlatCurveRing(t,e){const i=df([],this.MULTICURVE_PARSERS,t,e,this),n=[];for(let t=0,e=i.length;t<e;++t)h(n,i[t].getFlatCoordinates());return n}readMultiSurface(t,e){const i=df([],this.MULTISURFACE_PARSERS,t,e,this);if(i)return new Uu(i)}curveMemberParser(t,e){uf(this.CURVEMEMBER_PARSERS,t,e,this)}surfaceMemberParser(t,e){uf(this.SURFACEMEMBER_PARSERS,t,e,this)}readPatch(t,e){return df([null],this.PATCHES_PARSERS,t,e,this)}readSegment(t,e){return df([],this.SEGMENTS_PARSERS,t,e,this)}readPolygonPatch(t,e){return df([null],this.FLAT_LINEAR_RINGS_PARSERS,t,e,this)}readLineStringSegment(t,e){return df([null],this.GEOMETRY_FLAT_COORDINATES_PARSERS,t,e,this)}interiorParser(t,e){const i=df(void 0,this.RING_PARSERS,t,e,this);if(i){e[e.length-1].push(i)}}exteriorParser(t,e){const i=df(void 0,this.RING_PARSERS,t,e,this);if(i){e[e.length-1][0]=i}}readSurface(t,e){const i=df([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)h(t,i[n]),e.push(t.length);return new Cr(t,"XYZ",e)}}readCurve(t,e){const i=df([null],this.CURVE_PARSERS,t,e,this);if(i){return new Nu(i,"XYZ")}}readEnvelope(t,e){const i=df([null],this.ENVELOPE_PARSERS,t,e,this);return se(i[1][0],i[1][1],i[2][0],i[2][1])}readFlatPos(t,e){let i=Yg(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;if("neu"===(o?Qi(o).getAxisOrientation():"enu"))for(let 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 a=r.length;return 2==a&&r.push(0),0!==a?r:void 0}readFlatPosList(t,e){const i=Yg(t,!1).replace(/^\s*|\s*$/g,""),n=e[0],r=n.srsName,s=n.srsDimension,o=r?Qi(r).getAxisOrientation():"enu",a=i.split(/\s+/);let l=2;t.getAttribute("srsDimension")?l=bx(t.getAttribute("srsDimension")):t.getAttribute("dimension")?l=bx(t.getAttribute("dimension")):t.parentNode.getAttribute("srsDimension")?l=bx(t.parentNode.getAttribute("srsDimension")):s&&(l=bx(s));const h=o.startsWith("en");let c,u,d;const g=[];for(let t=0,e=a.length;t<e;t+=l)c=parseFloat(a[t]),u=parseFloat(a[t+1]),d=3===l?parseFloat(a[t+2]):0,h?g.push(c,u,d):g.push(u,c,d);return g}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,a=o?Qi(o).getAxisOrientation():"enu",l=e.getCoordinates();let h=a.startsWith("en")?l[0]+" "+l[1]:l[1]+" "+l[0];if(r){h+=" "+(l[2]||0)}Ox(t,h)}getCoords_(t,e,i){let n=(e?Qi(e).getAxisOrientation():"enu").startsWith("en")?t[0]+" "+t[1]:t[1]+" "+t[0];if(i){n+=" "+(t[2]||0)}return n}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);Ox(t,h.join(" "))}writePoint(t,e,i){const n=i[i.length-1].srsName;n&&t.setAttribute("srsName",n);const r=Zg(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]];ff({node:t},this.ENVELOPE_SERIALIZERS,lf,r,i,["lowerCorner","upperCorner"],this)}writeLinearRing(t,e,i){const n=i[i.length-1].srsName;n&&t.setAttribute("srsName",n);const r=Zg(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),Zg(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();ff({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=Zg(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=Zg(t.namespaceURI,"posList");t.appendChild(n),this.writePosList_(n,e,i)}else if("Curve"===t.nodeName){const n=Zg(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();ff({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();ff({node:t,hasZ:s,srsName:r},this.POINTMEMBER_SERIALIZERS,af("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();ff({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=Zg(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=Zg(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=Zg(t.namespaceURI,"PolygonPatch");t.appendChild(n),this.writeSurfaceOrPolygon(n,e,i)}writeCurveSegments_(t,e,i){const n=Zg(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)?sx(e,n):rx(e,!0,n),ff(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]=sf(this.writeGeometryElement,this)):e in r.serializers[s]||(r.serializers[s][e]=sf(Ox)))}}const h=Object.assign({},r);h.node=t,ff(h,r.serializers,af(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]=sf(this.writeFeatureElement,this);const a=Object.assign({},n);a.node=t,ff(a,o,af(r,s),e,i)}MULTIGEOMETRY_MEMBER_NODE_FACTORY_(t,e,i){const n=e[e.length-1].node;return Zg(this.namespace,jx[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"),Zg(this.namespace,i)}writeGeometryNode(t,e){e=this.adaptOptions(e);const i=Zg(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=Zg(this.namespace,"featureMembers");i.setAttributeNS(Wg,"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}}Ux.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml":{pos:ef(Ux.prototype.readFlatPos),posList:ef(Ux.prototype.readFlatPosList),coordinates:ef(kx.prototype.readFlatCoordinates)}},Ux.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml":{interior:Ux.prototype.interiorParser,exterior:Ux.prototype.exteriorParser}},Ux.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml":{Point:ef(vx.prototype.readPoint),MultiPoint:ef(vx.prototype.readMultiPoint),LineString:ef(vx.prototype.readLineString),MultiLineString:ef(vx.prototype.readMultiLineString),LinearRing:ef(vx.prototype.readLinearRing),Polygon:ef(vx.prototype.readPolygon),MultiPolygon:ef(vx.prototype.readMultiPolygon),Surface:ef(Ux.prototype.readSurface),MultiSurface:ef(Ux.prototype.readMultiSurface),Curve:ef(Ux.prototype.readCurve),MultiCurve:ef(Ux.prototype.readMultiCurve),Envelope:ef(Ux.prototype.readEnvelope)}},Ux.prototype.MULTICURVE_PARSERS={"http://www.opengis.net/gml":{curveMember:tf(Ux.prototype.curveMemberParser),curveMembers:tf(Ux.prototype.curveMemberParser)}},Ux.prototype.MULTISURFACE_PARSERS={"http://www.opengis.net/gml":{surfaceMember:tf(Ux.prototype.surfaceMemberParser),surfaceMembers:tf(Ux.prototype.surfaceMemberParser)}},Ux.prototype.CURVEMEMBER_PARSERS={"http://www.opengis.net/gml":{LineString:tf(vx.prototype.readLineString),Curve:tf(Ux.prototype.readCurve)}},Ux.prototype.SURFACEMEMBER_PARSERS={"http://www.opengis.net/gml":{Polygon:tf(vx.prototype.readPolygon),Surface:tf(Ux.prototype.readSurface)}},Ux.prototype.SURFACE_PARSERS={"http://www.opengis.net/gml":{patches:ef(Ux.prototype.readPatch)}},Ux.prototype.CURVE_PARSERS={"http://www.opengis.net/gml":{segments:ef(Ux.prototype.readSegment)}},Ux.prototype.ENVELOPE_PARSERS={"http://www.opengis.net/gml":{lowerCorner:tf(Ux.prototype.readFlatPosList),upperCorner:tf(Ux.prototype.readFlatPosList)}},Ux.prototype.PATCHES_PARSERS={"http://www.opengis.net/gml":{PolygonPatch:ef(Ux.prototype.readPolygonPatch)}},Ux.prototype.SEGMENTS_PARSERS={"http://www.opengis.net/gml":{LineStringSegment:Qg(Ux.prototype.readLineStringSegment)}},vx.prototype.RING_PARSERS={"http://www.opengis.net/gml":{LinearRing:ef(vx.prototype.readFlatLinearRing),Ring:ef(Ux.prototype.readFlatCurveRing)}},Ux.prototype.writeFeatures,Ux.prototype.RING_SERIALIZERS={"http://www.opengis.net/gml":{exterior:sf(Ux.prototype.writeRing),interior:sf(Ux.prototype.writeRing)}},Ux.prototype.ENVELOPE_SERIALIZERS={"http://www.opengis.net/gml":{lowerCorner:sf(Ox),upperCorner:sf(Ox)}},Ux.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{surfaceMember:sf(Ux.prototype.writeSurfaceOrPolygonMember),polygonMember:sf(Ux.prototype.writeSurfaceOrPolygonMember)}},Ux.prototype.POINTMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{pointMember:sf(Ux.prototype.writePointMember)}},Ux.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS={"http://www.opengis.net/gml":{lineStringMember:sf(Ux.prototype.writeLineStringOrCurveMember),curveMember:sf(Ux.prototype.writeLineStringOrCurveMember)}},Ux.prototype.GEOMETRY_SERIALIZERS={"http://www.opengis.net/gml":{Curve:sf(Ux.prototype.writeCurveOrLineString),MultiCurve:sf(Ux.prototype.writeMultiCurveOrLineString),Point:sf(Ux.prototype.writePoint),MultiPoint:sf(Ux.prototype.writeMultiPoint),LineString:sf(Ux.prototype.writeCurveOrLineString),MultiLineString:sf(Ux.prototype.writeMultiCurveOrLineString),LinearRing:sf(Ux.prototype.writeLinearRing),Polygon:sf(Ux.prototype.writeSurfaceOrPolygon),MultiPolygon:sf(Ux.prototype.writeMultiSurfaceOrPolygon),Surface:sf(Ux.prototype.writeSurfaceOrPolygon),MultiSurface:sf(Ux.prototype.writeMultiSurfaceOrPolygon),Envelope:sf(Ux.prototype.writeEnvelope)}};const Bx=Ux;Bx.prototype.writeFeatures,Bx.prototype.writeFeaturesNode;class zx extends Ux{constructor(t){super(t=t||{}),this.schemaLocation=t.schemaLocation?t.schemaLocation:this.namespace+" http://schemas.opengis.net/gml/3.2.1/gml.xsd"}writeGeometryElement(t,e,i){const n=i[i.length-1];i[i.length-1]=Object.assign({multiCurve:!0,multiSurface:!0},n),super.writeGeometryElement(t,e,i)}}zx.prototype.namespace="http://www.opengis.net/gml/3.2",zx.prototype.GEOMETRY_FLAT_COORDINATES_PARSERS={"http://www.opengis.net/gml/3.2":{pos:ef(Ux.prototype.readFlatPos),posList:ef(Ux.prototype.readFlatPosList),coordinates:ef(kx.prototype.readFlatCoordinates)}},zx.prototype.FLAT_LINEAR_RINGS_PARSERS={"http://www.opengis.net/gml/3.2":{interior:Ux.prototype.interiorParser,exterior:Ux.prototype.exteriorParser}},zx.prototype.GEOMETRY_PARSERS={"http://www.opengis.net/gml/3.2":{Point:ef(vx.prototype.readPoint),MultiPoint:ef(vx.prototype.readMultiPoint),LineString:ef(vx.prototype.readLineString),MultiLineString:ef(vx.prototype.readMultiLineString),LinearRing:ef(vx.prototype.readLinearRing),Polygon:ef(vx.prototype.readPolygon),MultiPolygon:ef(vx.prototype.readMultiPolygon),Surface:ef(zx.prototype.readSurface),MultiSurface:ef(Ux.prototype.readMultiSurface),Curve:ef(zx.prototype.readCurve),MultiCurve:ef(Ux.prototype.readMultiCurve),Envelope:ef(zx.prototype.readEnvelope)}},zx.prototype.MULTICURVE_PARSERS={"http://www.opengis.net/gml/3.2":{curveMember:tf(Ux.prototype.curveMemberParser),curveMembers:tf(Ux.prototype.curveMemberParser)}},zx.prototype.MULTISURFACE_PARSERS={"http://www.opengis.net/gml/3.2":{surfaceMember:tf(Ux.prototype.surfaceMemberParser),surfaceMembers:tf(Ux.prototype.surfaceMemberParser)}},zx.prototype.CURVEMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{LineString:tf(vx.prototype.readLineString),Curve:tf(Ux.prototype.readCurve)}},zx.prototype.SURFACEMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{Polygon:tf(vx.prototype.readPolygon),Surface:tf(Ux.prototype.readSurface)}},zx.prototype.SURFACE_PARSERS={"http://www.opengis.net/gml/3.2":{patches:ef(Ux.prototype.readPatch)}},zx.prototype.CURVE_PARSERS={"http://www.opengis.net/gml/3.2":{segments:ef(Ux.prototype.readSegment)}},zx.prototype.ENVELOPE_PARSERS={"http://www.opengis.net/gml/3.2":{lowerCorner:tf(Ux.prototype.readFlatPosList),upperCorner:tf(Ux.prototype.readFlatPosList)}},zx.prototype.PATCHES_PARSERS={"http://www.opengis.net/gml/3.2":{PolygonPatch:ef(Ux.prototype.readPolygonPatch)}},zx.prototype.SEGMENTS_PARSERS={"http://www.opengis.net/gml/3.2":{LineStringSegment:Qg(Ux.prototype.readLineStringSegment)}},zx.prototype.MULTIPOINT_PARSERS={"http://www.opengis.net/gml/3.2":{pointMember:tf(vx.prototype.pointMemberParser),pointMembers:tf(vx.prototype.pointMemberParser)}},zx.prototype.MULTILINESTRING_PARSERS={"http://www.opengis.net/gml/3.2":{lineStringMember:tf(vx.prototype.lineStringMemberParser),lineStringMembers:tf(vx.prototype.lineStringMemberParser)}},zx.prototype.MULTIPOLYGON_PARSERS={"http://www.opengis.net/gml/3.2":{polygonMember:tf(vx.prototype.polygonMemberParser),polygonMembers:tf(vx.prototype.polygonMemberParser)}},zx.prototype.POINTMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{Point:tf(vx.prototype.readFlatCoordinatesFromNode)}},zx.prototype.LINESTRINGMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{LineString:tf(vx.prototype.readLineString)}},zx.prototype.POLYGONMEMBER_PARSERS={"http://www.opengis.net/gml/3.2":{Polygon:tf(vx.prototype.readPolygon)}},zx.prototype.RING_PARSERS={"http://www.opengis.net/gml/3.2":{LinearRing:ef(vx.prototype.readFlatLinearRing),Ring:ef(zx.prototype.readFlatCurveRing)}},zx.prototype.RING_SERIALIZERS={"http://www.opengis.net/gml/3.2":{exterior:sf(Ux.prototype.writeRing),interior:sf(Ux.prototype.writeRing)}},zx.prototype.ENVELOPE_SERIALIZERS={"http://www.opengis.net/gml/3.2":{lowerCorner:sf(Ox),upperCorner:sf(Ox)}},zx.prototype.SURFACEORPOLYGONMEMBER_SERIALIZERS={"http://www.opengis.net/gml/3.2":{surfaceMember:sf(Ux.prototype.writeSurfaceOrPolygonMember),polygonMember:sf(Ux.prototype.writeSurfaceOrPolygonMember)}},zx.prototype.POINTMEMBER_SERIALIZERS={"http://www.opengis.net/gml/3.2":{pointMember:sf(Ux.prototype.writePointMember)}},zx.prototype.LINESTRINGORCURVEMEMBER_SERIALIZERS={"http://www.opengis.net/gml/3.2":{lineStringMember:sf(Ux.prototype.writeLineStringOrCurveMember),curveMember:sf(Ux.prototype.writeLineStringOrCurveMember)}},zx.prototype.GEOMETRY_SERIALIZERS={"http://www.opengis.net/gml/3.2":{Curve:sf(Ux.prototype.writeCurveOrLineString),MultiCurve:sf(Ux.prototype.writeMultiCurveOrLineString),Point:sf(zx.prototype.writePoint),MultiPoint:sf(Ux.prototype.writeMultiPoint),LineString:sf(Ux.prototype.writeCurveOrLineString),MultiLineString:sf(Ux.prototype.writeMultiCurveOrLineString),LinearRing:sf(Ux.prototype.writeLinearRing),Polygon:sf(Ux.prototype.writeSurfaceOrPolygon),MultiPolygon:sf(Ux.prototype.writeMultiSurfaceOrPolygon),Surface:sf(Ux.prototype.writeSurfaceOrPolygon),MultiSurface:sf(Ux.prototype.writeMultiSurfaceOrPolygon),Envelope:sf(Ux.prototype.writeEnvelope)}};const Xx=[null,"http://www.topografix.com/GPX/1/0","http://www.topografix.com/GPX/1/1"],Vx={rte:vv,trk:Sv,wpt:Ev},$x=cf(Xx,{rte:tf(vv),trk:tf(Sv),wpt:tf(Ev)}),Wx=cf(Xx,{text:rf(Px,"linkText"),type:rf(Px,"linkType")}),Zx=cf(Xx,{name:rf(Px),email:function(t,e){const i=e[e.length-1],n=t.getAttribute("id"),r=t.getAttribute("domain");null!==n&&null!==r&&(i.email=`${n}@${r}`)},link:yv}),Yx=cf(Xx,{name:rf(Px),desc:rf(Px),author:rf((function(t,e){const i=df({},Zx,t,e);if(i)return i;return})),copyright:rf((function(t,e){const i=df({},Hx,t,e);if(i){const e=t.getAttribute("author");return null!==e&&(i.author=e),i}return})),link:yv,time:rf(wx),keywords:rf(Px),bounds:function(t,e){const i=e[e.length-1],n=t.getAttribute("minlat"),r=t.getAttribute("minlon"),s=t.getAttribute("maxlat"),o=t.getAttribute("maxlon");null!==r&&null!==n&&null!==o&&null!==s&&(i.bounds=[[parseFloat(r),parseFloat(n)],[parseFloat(o),parseFloat(s)]])},extensions:xv}),Hx=cf(Xx,{year:rf(Rx),license:rf(Px)}),Kx=cf(Xx,{rte:sf((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=rx(o,!0,n);s.geometryLayout=t.getLayout(),r.rtept=t.getCoordinates()}const a=i[i.length-1].node,l=sv[a.namespaceURI],h=hf(r,l);ff(s,ov,lf,h,i,l)})),trk:sf((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=rx(o,!0,n);r.trkseg=t.getLineStrings()}const a=i[i.length-1].node,l=lv[a.namespaceURI],h=hf(r,l);ff(s,hv,lf,h,i,l)})),wpt:sf((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=rx(s,!0,n);r.geometryLayout=e.getLayout(),Tv(t,e.getCoordinates(),i)}}))});const qx=cf(Xx,{name:rf(Px),cmt:rf(Px),desc:rf(Px),src:rf(Px),link:yv,number:rf(Rx),extensions:xv,type:rf(Px),rtept:function(t,e){const i=df({},Jx,t,e);if(i){const n=e[e.length-1];mv(n.flatCoordinates,n.layoutOptions,t,i)}}}),Jx=cf(Xx,{ele:rf(Tx),time:rf(wx)}),Qx=cf(Xx,{name:rf(Px),cmt:rf(Px),desc:rf(Px),src:rf(Px),link:yv,number:rf(Rx),type:rf(Px),extensions:xv,trkseg:function(t,e){const i=e[e.length-1];uf(tv,t,e);const n=i.flatCoordinates;i.ends.push(n.length)}}),tv=cf(Xx,{trkpt:function(t,e){const i=df({},ev,t,e);if(i){const n=e[e.length-1];mv(n.flatCoordinates,n.layoutOptions,t,i)}}}),ev=cf(Xx,{ele:rf(Tx),time:rf(wx)}),iv=cf(Xx,{ele:rf(Tx),time:rf(wx),magvar:rf(Tx),geoidheight:rf(Tx),name:rf(Px),cmt:rf(Px),desc:rf(Px),src:rf(Px),link:yv,sym:rf(Px),type:rf(Px),fix:rf(Px),sat:rf(Rx),hdop:rf(Tx),vdop:rf(Tx),pdop:rf(Tx),ageofdgpsdata:rf(Tx),dgpsid:rf(Rx),extensions:xv}),nv=["text","type"],rv=cf(Xx,{text:sf(Ox),type:sf(Ox)}),sv=cf(Xx,["name","cmt","desc","src","link","number","type","rtept"]),ov=cf(Xx,{name:sf(Ox),cmt:sf(Ox),desc:sf(Ox),src:sf(Ox),link:sf(wv),number:sf(Ax),type:sf(Ox),rtept:of(sf(Tv))}),av=cf(Xx,["ele","time"]),lv=cf(Xx,["name","cmt","desc","src","link","number","type","trkseg"]),hv=cf(Xx,{name:sf(Ox),cmt:sf(Ox),desc:sf(Ox),src:sf(Ox),link:sf(wv),number:sf(Ax),type:sf(Ox),trkseg:of(sf((function(t,e,i){const n={node:t};n.geometryLayout=e.getLayout(),n.properties={},ff(n,uv,cv,e.getCoordinates(),i)})))}),cv=af("trkpt"),uv=cf(Xx,{trkpt:sf(Tv)}),dv=cf(Xx,["ele","time","magvar","geoidheight","name","cmt","desc","src","link","sym","type","fix","sat","hdop","vdop","pdop","ageofdgpsdata","dgpsid"]),gv=cf(Xx,{ele:sf(Mx),time:sf(Fx),magvar:sf(Mx),geoidheight:sf(Mx),name:sf(Ox),cmt:sf(Ox),desc:sf(Ox),src:sf(Ox),link:sf(wv),sym:sf(Ox),type:sf(Ox),fix:sf(Ox),sat:sf(Ax),hdop:sf(Mx),vdop:sf(Mx),pdop:sf(Mx),ageofdgpsdata:sf(Mx),dgpsid:sf(Ax)}),fv={Point:"wpt",LineString:"rte",MultiLineString:"trk"};function pv(t,e,i){const n=t.getGeometry();if(n){const t=fv[n.getType()];if(t){return Zg(e[e.length-1].node.namespaceURI,t)}}}function mv(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 _v(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 yv(t,e){const i=e[e.length-1],n=t.getAttribute("href");null!==n&&(i.link=n),uf(Wx,t,e)}function xv(t,e){e[e.length-1].extensionsNode_=t}function vv(t,e){const i=e[0],n=df({flatCoordinates:[],layoutOptions:{}},qx,t,e);if(!n)return;const r=n.flatCoordinates;delete n.flatCoordinates;const s=n.layoutOptions;delete n.layoutOptions;const o=_v(s,r),a=new Nu(r,o);rx(a,!1,i);const l=new Mt(a);return l.setProperties(n,!0),l}function Sv(t,e){const i=e[0],n=df({flatCoordinates:[],ends:[],layoutOptions:{}},Qx,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=_v(o,r,s),l=new ku(r,a,s);rx(l,!1,i);const h=new Mt(l);return h.setProperties(n,!0),h}function Ev(t,e){const i=e[0],n=df({},iv,t,e);if(!n)return;const r={},s=mv([],r,t,n),o=_v(r,s),a=new sr(s,o);rx(a,!1,i);const l=new Mt(a);return l.setProperties(n,!0),l}function wv(t,e,i){t.setAttribute("href",e);const n=i[i.length-1].properties,r=[n.linkText,n.linkType];ff({node:t},rv,lf,r,i,nv)}function Tv(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?av[r]:dv[r],a=hf(s,o);ff({node:t,properties:s},gv,lf,a,i,o)}function Cv(t,e){if(!t)return null;let i;switch(t.type){case"Point":i=function(t){const e=t.coordinates;return{type:"Point",flatCoordinates:e,layout:Fn(e.length)}}(t);break;case"LineString":i=function(t){const e=t.coordinates,i=e.flat();return{type:"LineString",flatCoordinates:i,ends:[i.length],layout:Fn(e[0]?.length||2)}}(t);break;case"Polygon":i=function(t){const e=t.coordinates,i=[],n=e[0]?.[0]?.length,r=Xn(i,0,e,n);return{type:"Polygon",flatCoordinates:i,ends:r,layout:Fn(n)}}(t);break;case"MultiPoint":i=function(t){const e=t.coordinates;return{type:"MultiPoint",flatCoordinates:e.flat(),layout:Fn(e[0]?.length||2)}}(t);break;case"MultiLineString":i=function(t){const e=t.coordinates,i=e[0]?.[0]?.length||2,n=[],r=Xn(n,0,e,i);return{type:"MultiLineString",flatCoordinates:n,ends:r,layout:Fn(i)}}(t);break;case"MultiPolygon":i=function(t){const e=t.coordinates,i=[],n=e[0]?.[0]?.[0].length||2,r=Vn(i,0,e,n);return{type:"MultiPolygon",flatCoordinates:i,ends:r,layout:Fn(n)}}(t);break;case"GeometryCollection":i=function(t,e){const i=t.geometries.map((function(t){return Cv(t)}));return i}(t);break;default:throw new Error("Unsupported GeoJSON type: "+t.type)}return i}function Rv(t,e){const i=(t=rx(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){e=Object.assign({},e),delete e.featureProjection;const i=t.getGeometriesArray().map((function(t){return Rv(t,e)}));return{type:"GeometryCollection",geometries:i}}(t,e);break;case"Circle":n={type:"GeometryCollection",geometries:[]};break;default:throw new Error("Unsupported geometry type: "+i)}return n}class bv extends nx{constructor(){super()}getType(){return"text"}readFeature(t,e){return this.readFeatureFromText(Pv(t),this.adaptOptions(e))}readFeatureFromText(t,e){return G()}readFeatures(t,e){return this.readFeaturesFromText(Pv(t),this.adaptOptions(e))}readFeaturesFromText(t,e){return G()}readGeometry(t,e){return this.readGeometryFromText(Pv(t),this.adaptOptions(e))}readGeometryFromText(t,e){return G()}readProjection(t){return this.readProjectionFromText(Pv(t))}readProjectionFromText(t){return this.dataProjection}writeFeature(t,e){return this.writeFeatureText(t,this.adaptOptions(e))}writeFeatureText(t,e){return G()}writeFeatures(t,e){return this.writeFeaturesText(t,this.adaptOptions(e))}writeFeaturesText(t,e){return G()}writeGeometry(t,e){return this.writeGeometryText(t,this.adaptOptions(e))}writeGeometryText(t,e){return G()}}function Pv(t){return"string"==typeof t?t:""}const Iv=/^B(\d{2})(\d{2})(\d{2})(\d{2})(\d{5})([NS])(\d{3})(\d{5})([EW])([AV])(\d{5})(\d{5})/,Lv=/^H.([A-Z]{3}).*?:(.*)/,Fv=/^HFDTE(\d{2})(\d{2})(\d{2})/,Mv=/^HFDTEDATE:(\d{2})(\d{2})(\d{2}),(\d{2})/,Av=/\r\n|\r|\n/;const Ov=["http://www.google.com/kml/ext/2.2"],Dv=[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"],Nv={fraction:"fraction",pixels:"pixels",insetPixels:"pixels"},kv=cf(Dv,{ExtendedData:US,Region:BS,MultiGeometry:rf(FS,"geometry"),LineString:rf(PS,"geometry"),LinearRing:rf(IS,"geometry"),Point:rf(MS,"geometry"),Polygon:rf(OS,"geometry"),Style:rf(NS),StyleMap:function(t,e){const i=fS.call(this,t,e);if(!i)return;const n=e[e.length-1];if(Array.isArray(i))n.Style=i;else{if("string"!=typeof i)throw new Error("`styleMapValue` has an unknown type");n.styleUrl=i}},address:rf(Px),description:rf(Px),name:rf(Px),open:rf(Sx),phoneNumber:rf(Px),styleUrl:rf(uS),visibility:rf(Sx)},cf(Ov,{MultiTrack:rf((function(t,e){const i=df([],SS,t,e);if(!i)return;return new ku(i)}),"geometry"),Track:rf(wS,"geometry")})),Gv=cf(Dv,{ExtendedData:US,Region:BS,Link:function(t,e){uf(jv,t,e)},address:rf(Px),description:rf(Px),name:rf(Px),open:rf(Sx),phoneNumber:rf(Px),visibility:rf(Sx)}),jv=cf(Dv,{href:rf(cS)}),Uv=cf(Dv,{Altitude:rf(Tx),Longitude:rf(Tx),Latitude:rf(Tx),Tilt:rf(Tx),AltitudeMode:rf(Px),Heading:rf(Tx),Roll:rf(Tx)}),Bv=cf(Dv,{LatLonAltBox:function(t,e){const i=df({},VS,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=df({},$S,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)}}),zv=cf(Dv,["Document","Placemark"]),Xv=cf(Dv,{Document:sf((function(t,e,i){ff({node:t},KS,qS,e,i,void 0,this)})),Placemark:sf(SE)});let Vv,$v,Wv,Zv,Yv,Hv,Kv=null;let qv,Jv=null;let Qv,tS=null;let eS=null;let iS=null;let nS,rS=null;function sS(t){return 32/Math.min(t[0],t[1])}function oS(t){return t}function aS(t,e,i){return Array.isArray(t)?t:"string"==typeof t?aS(i[t],e,i):e}function lS(t){const e=Yg(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 hS(t){let e=Yg(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 cS(t){const e=Yg(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 uS(t){const e=Yg(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 dS(t){return Tx(t)}const gS=cf(Dv,{Pair:function(t,e){const i=df({},zS,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 fS(t,e){return df(void 0,gS,t,e,this)}const pS=cf(Dv,{Icon:rf((function(t,e){const i=df({},TS,t,e);if(i)return i;return null})),color:rf(lS),heading:rf(Tx),hotSpot:rf((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:Nv[e],y:parseFloat(t.getAttribute("y")),yunits:Nv[i],origin:n}})),scale:rf(dS)});const mS=cf(Dv,{color:rf(lS),scale:rf(dS)});const _S=cf(Dv,{color:rf(lS),width:rf(Tx)});const yS=cf(Dv,{color:rf(lS),fill:rf(Sx),outline:rf(Sx)});const xS=cf(Dv,{coordinates:ef(hS)});function vS(t,e){return df(null,xS,t,e)}const SS=cf(Ov,{Track:tf(wS)});const ES=cf(Dv,{when:function(t,e){const i=e[e.length-1].whens,n=Yg(t,!1),r=Date.parse(n);i.push(isNaN(r)?0:r)}},cf(Ov,{coord:function(t,e){const i=e[e.length-1].coordinates,n=Yg(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 wS(t,e){const i=df({coordinates:[],whens:[]},ES,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 Nu(n,"XYZM")}const TS=cf(Dv,{href:rf(cS)},cf(Ov,{x:rf(Tx),y:rf(Tx),w:rf(Tx),h:rf(Tx)}));const CS=cf(Dv,{coordinates:ef(hS)});function RS(t,e){return df(null,CS,t,e)}const bS=cf(Dv,{extrude:rf(Sx),tessellate:rf(Sx),altitudeMode:rf(Px)});function PS(t,e){const i=df({},bS,t,e),n=RS(t,e);if(n){const t=new Nu(n,"XYZ");return t.setProperties(i,!0),t}}function IS(t,e){const i=df({},bS,t,e),n=RS(t,e);if(n){const t=new Cr(n,"XYZ",[n.length]);return t.setProperties(i,!0),t}}const LS=cf(Dv,{LineString:tf(PS),LinearRing:tf(IS),MultiGeometry:tf(FS),Point:tf(MS),Polygon:tf(OS)});function FS(t,e){const i=df([],LS,t,e);if(!i)return null;if(0===i.length)return new Lu(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],h(e,o.getFlatCoordinates());n=new Gu(e,t),kS(n,i)}else if("LineString"==s)n=new ku(i),kS(n,i);else if("Polygon"==s)n=new Uu(i),kS(n,i);else{if("GeometryCollection"!=s&&!s.startsWith("Multi"))throw new Error("Unknown geometry type found");n=new Lu(i)}}else n=new Lu(i);return n}function MS(t,e){const i=df({},bS,t,e),n=RS(t,e);if(n){const t=new sr(n,"XYZ");return t.setProperties(i,!0),t}}const AS=cf(Dv,{innerBoundaryIs:function(t,e){const i=df([],WS,t,e);if(i.length>0){e[e.length-1].push(...i)}},outerBoundaryIs:function(t,e){const i=df(void 0,ZS,t,e);if(i){e[e.length-1][0]=i}}});function OS(t,e){const i=df({},bS,t,e),n=df([null],AS,t,e);if(n&&n[0]){const t=n[0],e=[t.length];for(let i=1,r=n.length;i<r;++i)h(t,n[i]),e.push(t.length);const r=new Cr(t,"XYZ",e);return r.setProperties(i,!0),r}}const DS=cf(Dv,{IconStyle:function(t,e){const i=df({},pS,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=Hv);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=$v,h=Wv,c=Zv):o.includes("arrow-reverse")?(l=[54,42],h=Wv,c=Zv):o.includes("paddle")&&(l=[32,1],h=Wv,c=Zv));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=pi(v));const S=i.scale,E=i.color;if(s){o==Hv&&(m=Yv);const t=new Sa({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:E}),e=t.getScaleArray()[0],i=t.getSize();if(null===i){const i=t.getImageState();if(i===zr.IDLE||i===zr.LOADING){const n=function(){const i=t.getImageState();if(i!==zr.IDLE&&i!==zr.LOADING){const i=t.getSize();if(i&&2==i.length){const n=sS(i);t.setScale(e*n)}t.unlistenImageChange(n)}};t.listenImageChange(n),i===zr.IDLE&&t.load()}}else if(2==i.length){const n=sS(i);t.setScale(e*n)}n.imageStyle=t}else n.imageStyle=qv},LabelStyle:function(t,e){const i=df({},mS,t,e);if(!i)return;const n=e[e.length-1],r=new Ea({fill:new da({color:"color"in i?i.color:Vv}),scale:i.scale});n.textStyle=r},LineStyle:function(t,e){const i=df({},_S,t,e);if(!i)return;const n=e[e.length-1],r=new ga({color:"color"in i?i.color:Vv,width:"width"in i?i.width:1});n.strokeStyle=r},PolyStyle:function(t,e){const i=df({},yS,t,e);if(!i)return;const n=e[e.length-1],r=new da({color:"color"in i?i.color:Vv});n.fillStyle=r;const s=i.fill;void 0!==s&&(n.fill=s);const o=i.outline;void 0!==o&&(n.outline=o)}});function NS(t,e){const i=df({},DS,t,e,this);if(!i)return null;let n="fillStyle"in i?i.fillStyle:Kv;const r=i.fill;let s;void 0===r||r||(n=null),"imageStyle"in i?i.imageStyle!=qv&&(s=i.imageStyle):s=Jv;const o="textStyle"in i?i.textStyle:eS,a="strokeStyle"in i?i.strokeStyle:tS,l=i.outline;return void 0===l||l?[new fa({fill:n,image:s,stroke:a,text:o,zIndex:void 0})]:[new fa({geometry:function(t){const e=t.getGeometry(),i=e.getType();if("GeometryCollection"===i){return new Lu(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 fa({geometry:function(t){const e=t.getGeometry(),i=e.getType();if("GeometryCollection"===i){return new Lu(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 kS(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 GS=cf(Dv,{displayName:rf(Px),value:rf(Px)});const jS=cf(Dv,{Data:function(t,e){const i=t.getAttribute("name");uf(GS,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){uf(XS,t,e)}});function US(t,e){uf(jS,t,e)}function BS(t,e){uf(Bv,t,e)}const zS=cf(Dv,{Style:rf(NS),key:rf(Px),styleUrl:rf(uS)});const XS=cf(Dv,{SimpleData:function(t,e){const i=t.getAttribute("name");if(null!==i){const n=Px(t);e[e.length-1][i]=n}}});const VS=cf(Dv,{altitudeMode:rf(Px),minAltitude:rf(Tx),maxAltitude:rf(Tx),north:rf(Tx),south:rf(Tx),east:rf(Tx),west:rf(Tx)});const $S=cf(Dv,{minLodPixels:rf(Tx),maxLodPixels:rf(Tx),minFadeExtent:rf(Tx),maxFadeExtent:rf(Tx)});const WS=cf(Dv,{LinearRing:tf(vS)});const ZS=cf(Dv,{LinearRing:ef(vS)});function YS(t,e){const i=To(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}Ox(t,n.join(""))}const HS=cf(Dv,{Data:sf((function(t,e,i){t.setAttribute("name",e.name);const n={node:t},r=e.value;"object"==typeof r?(null!==r&&r.displayName&&ff(n,HS,lf,[r.displayName],i,["displayName"]),null!==r&&r.value&&ff(n,HS,lf,[r.value],i,["value"])):ff(n,HS,lf,[r],i,["value"])})),value:sf((function(t,e){Ox(t,e)})),displayName:sf((function(t,e){Lx(t,e)}))});const KS=cf(Dv,{Placemark:sf(SE)}),qS=function(t,e,i){return Zg(e[e.length-1].node.namespaceURI,"Placemark")};const JS=af("Data");const QS=cf(Dv,["href"],cf(Ov,["x","y","w","h"])),tE=cf(Dv,{href:sf(Ox)},cf(Ov,{x:sf(Mx),y:sf(Mx),w:sf(Mx),h:sf(Mx)})),eE=function(t,e,i){return Zg(Ov[0],"gx:"+i)};const iE=cf(Dv,["scale","heading","Icon","color","hotSpot"]),nE=cf(Dv,{Icon:sf((function(t,e,i){const n={node:t},r=i[i.length-1].node;let s=QS[r.namespaceURI],o=hf(e,s);ff(n,tE,lf,o,i,s),s=QS[Ov[0]],o=hf(e,s),ff(n,tE,eE,o,i,s)})),color:sf(YS),heading:sf(Mx),hotSpot:sf((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:sf(FE)});const rE=cf(Dv,["color","scale"]),sE=cf(Dv,{color:sf(YS),scale:sf(FE)});const oE=cf(Dv,["color","width"]),aE=cf(Dv,{color:sf(YS),width:sf(Mx)});const lE={Point:"Point",LineString:"LineString",LinearRing:"LinearRing",Polygon:"Polygon",MultiPoint:"MultiGeometry",MultiLineString:"MultiGeometry",MultiPolygon:"MultiGeometry",GeometryCollection:"MultiGeometry"},hE=function(t,e,i){if(t){return Zg(e[e.length-1].node.namespaceURI,lE[t.getType()])}},cE=af("Point"),uE=af("LineString"),dE=af("LinearRing"),gE=af("Polygon"),fE=cf(Dv,{LineString:sf(TE),Point:sf(TE),Polygon:sf(IE),GeometryCollection:sf(pE)});function pE(t,e,i){const n={node:t},r=e.getType();let s,o=[];if("GeometryCollection"===r)e.getGeometriesArrayRecursive().forEach((function(t){const e=t.getType();if("MultiPoint"===e)o=o.concat(t.getPoints());else if("MultiLineString"===e)o=o.concat(t.getLineStrings());else if("MultiPolygon"===e)o=o.concat(t.getPolygons());else{if("Point"!==e&&"LineString"!==e&&"Polygon"!==e)throw new Error("Unknown geometry type");o.push(t)}})),s=hE;else if("MultiPoint"===r)o=e.getPoints(),s=cE;else if("MultiLineString"===r)o=e.getLineStrings(),s=uE;else{if("MultiPolygon"!==r)throw new Error("Unknown geometry type");o=e.getPolygons(),s=gE}ff(n,fE,s,o,i)}const mE=cf(Dv,{LinearRing:sf(TE)});function _E(t,e,i){ff({node:t},mE,dE,[e],i)}const yE=cf(Dv,{ExtendedData:sf((function(t,e,i){const n={node:t},r=e.names,s=e.values,o=r.length;for(let t=0;t<o;t++)ff(n,HS,JS,[{name:r[t],value:s[t]}],i)})),MultiGeometry:sf(pE),LineString:sf(TE),LinearRing:sf(TE),Point:sf(TE),Polygon:sf(IE),Style:sf((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=ME[s.namespaceURI],a=hf(r,o);ff(n,AE,lf,a,i,o)})),address:sf(Ox),description:sf(Ox),name:sf(Ox),open:sf(Ix),phoneNumber:sf(Ox),styleUrl:sf(Ox),visibility:sf(Ix)}),xE=cf(Dv,["name","open","visibility","address","phoneNumber","description","styleUrl","Style"]),vE=af("ExtendedData");function SE(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=xE[l.namespaceURI],c=hf(r,h);if(ff(n,yE,lf,c,i,h),o.length>0){const t=hf(r,o);ff(n,yE,vE,[{names:o,values:t}],i)}const u=i[0];let d=e.getGeometry();d&&(d=rx(d,!0,u)),ff(n,yE,hE,[d],i)}const EE=cf(Dv,["extrude","tessellate","altitudeMode","coordinates"]),wE=cf(Dv,{extrude:sf(Ix),tessellate:sf(Ix),altitudeMode:sf(Ox),coordinates:sf((function(t,e,i){const n=i[i.length-1],r=n.layout,s=n.stride;let o;if("XY"==r||"XYM"==r)o=2;else{if("XYZ"!=r&&"XYZM"!=r)throw new Error("Invalid geometry layout");o=3}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]}}Ox(t,l)}))});function TE(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=EE[o.namespaceURI],l=hf(s,a);ff(r,wE,lf,l,i,a)}const CE=cf(Dv,["color","fill","outline"]),RE=cf(Dv,{outerBoundaryIs:sf(_E),innerBoundaryIs:sf(_E)}),bE=af("innerBoundaryIs"),PE=af("outerBoundaryIs");function IE(t,e,i){const n=e.getLinearRings(),r=n.shift(),s={node:t};ff(s,RE,bE,n,i),ff(s,RE,PE,[r],i)}const LE=cf(Dv,{color:sf(YS),fill:sf(Ix),outline:sf(Ix)});function FE(t,e){Mx(t,Math.round(1e6*e)/1e6)}const ME=cf(Dv,["IconStyle","LabelStyle","LineStyle","PolyStyle"]),AE=cf(Dv,{IconStyle:sf((function(t,e,
2387i){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=Yv),2==c.length){h/=sS(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=iE[g.namespaceURI],p=hf(r,f);ff(n,nE,lf,p,i,f)})),LabelStyle:sf((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=rE[a.namespaceURI],h=hf(r,l);ff(n,sE,lf,h,i,l)})),LineStyle:sf((function(t,e,i){const n={node:t},r={color:e.getColor(),width:Number(e.getWidth())||1},s=i[i.length-1].node,o=oE[s.namespaceURI],a=hf(r,o);ff(n,aE,lf,a,i,o)})),PolyStyle:sf((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=CE[a.namespaceURI],h=hf(o,l);ff(n,LE,lf,h,i,l)}))});const OE=4294967296,DE=1/OE,NE="undefined"==typeof TextDecoder?null:new TextDecoder("utf-8");class kE{constructor(t=new Uint8Array(16)){this.buf=ArrayBuffer.isView(t)?t:new Uint8Array(t),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length}readFields(t,e,i=this.length){for(;this.pos<i;){const i=this.readVarint(),n=i>>3,r=this.pos;this.type=7&i,t(n,e,this),this.pos===r&&this.skip(i)}return e}readMessage(t,e){return this.readFields(t,e,this.readVarint()+this.pos)}readFixed32(){const t=this.dataView.getUint32(this.pos,!0);return this.pos+=4,t}readSFixed32(){const t=this.dataView.getInt32(this.pos,!0);return this.pos+=4,t}readFixed64(){const t=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*OE;return this.pos+=8,t}readSFixed64(){const t=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*OE;return this.pos+=8,t}readFloat(){const t=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,t}readDouble(){const t=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,t}readVarint(t){const e=this.buf;let i,n;return n=e[this.pos++],i=127&n,n<128?i:(n=e[this.pos++],i|=(127&n)<<7,n<128?i:(n=e[this.pos++],i|=(127&n)<<14,n<128?i:(n=e[this.pos++],i|=(127&n)<<21,n<128?i:(n=e[this.pos],i|=(15&n)<<28,function(t,e,i){const n=i.buf;let r,s;if(s=n[i.pos++],r=(112&s)>>4,s<128)return GE(t,r,e);if(s=n[i.pos++],r|=(127&s)<<3,s<128)return GE(t,r,e);if(s=n[i.pos++],r|=(127&s)<<10,s<128)return GE(t,r,e);if(s=n[i.pos++],r|=(127&s)<<17,s<128)return GE(t,r,e);if(s=n[i.pos++],r|=(127&s)<<24,s<128)return GE(t,r,e);if(s=n[i.pos++],r|=(1&s)<<31,s<128)return GE(t,r,e);throw new Error("Expected varint not more than 10 bytes")}(i,t,this)))))}readVarint64(){return this.readVarint(!0)}readSVarint(){const t=this.readVarint();return t%2==1?(t+1)/-2:t/2}readBoolean(){return Boolean(this.readVarint())}readString(){const t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&NE?NE.decode(this.buf.subarray(e,t)):function(t,e,i){let n="",r=e;for(;r<i;){const e=t[r];let s,o,a,l=null,h=e>239?4:e>223?3:e>191?2:1;if(r+h>i)break;1===h?e<128&&(l=e):2===h?(s=t[r+1],128==(192&s)&&(l=(31&e)<<6|63&s,l<=127&&(l=null))):3===h?(s=t[r+1],o=t[r+2],128==(192&s)&&128==(192&o)&&(l=(15&e)<<12|(63&s)<<6|63&o,(l<=2047||l>=55296&&l<=57343)&&(l=null))):4===h&&(s=t[r+1],o=t[r+2],a=t[r+3],128==(192&s)&&128==(192&o)&&128==(192&a)&&(l=(15&e)<<18|(63&s)<<12|(63&o)<<6|63&a,(l<=65535||l>=1114112)&&(l=null))),null===l?(l=65533,h=1):l>65535&&(l-=65536,n+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),n+=String.fromCharCode(l),r+=h}return n}(this.buf,e,t)}readBytes(){const t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e}readPackedVarint(t=[],e){const i=this.readPackedEnd();for(;this.pos<i;)t.push(this.readVarint(e));return t}readPackedSVarint(t=[]){const e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readSVarint());return t}readPackedBoolean(t=[]){const e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readBoolean());return t}readPackedFloat(t=[]){const e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readFloat());return t}readPackedDouble(t=[]){const e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readDouble());return t}readPackedFixed32(t=[]){const e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readFixed32());return t}readPackedSFixed32(t=[]){const e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readSFixed32());return t}readPackedFixed64(t=[]){const e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readFixed64());return t}readPackedSFixed64(t=[]){const e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readSFixed64());return t}readPackedEnd(){return 2===this.type?this.readVarint()+this.pos:this.pos+1}skip(t){const e=7&t;if(0===e)for(;this.buf[this.pos++]>127;);else if(2===e)this.pos=this.readVarint()+this.pos;else if(5===e)this.pos+=4;else{if(1!==e)throw new Error(`Unimplemented type: ${e}`);this.pos+=8}}writeTag(t,e){this.writeVarint(t<<3|e)}realloc(t){let e=this.length||16;for(;e<this.pos+t;)e*=2;if(e!==this.length){const t=new Uint8Array(e);t.set(this.buf),this.buf=t,this.dataView=new DataView(t.buffer),this.length=e}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(t){this.realloc(4),this.dataView.setInt32(this.pos,t,!0),this.pos+=4}writeSFixed32(t){this.realloc(4),this.dataView.setInt32(this.pos,t,!0),this.pos+=4}
vendor: 4,456 bytes, line 2387
2387writeFixed64(t){this.realloc(8),this.dataView.setInt32(this.pos,-1&t,!0),this.dataView.setInt32(this.pos+4,Math.floor(t*DE),!0),this.pos+=8}writeSFixed64(t){this.realloc(8),this.dataView.setInt32(this.pos,-1&t,!0),this.dataView.setInt32(this.pos+4,Math.floor(t*DE),!0),this.pos+=8}writeVarint(t){(t=+t||0)>268435455||t<0?function(t,e){let i,n;t>=0?(i=t%4294967296|0,n=t/4294967296|0):(i=~(-t%4294967296),n=~(-t/4294967296),4294967295^i?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){const 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(t){this.writeVarint(t<0?2*-t-1:2*t)}writeBoolean(t){this.writeVarint(+t)}writeString(t){t=String(t),this.realloc(4*t.length),this.pos++;const e=this.pos;this.pos=function(t,e,i){for(let n,r,s=0;s<e.length;s++){if(n=e.charCodeAt(s),n>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);const i=this.pos-e;i>=128&&jE(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i}writeFloat(t){this.realloc(4),this.dataView.setFloat32(this.pos,t,!0),this.pos+=4}writeDouble(t){this.realloc(8),this.dataView.setFloat64(this.pos,t,!0),this.pos+=8}writeBytes(t){const e=t.length;this.writeVarint(e),this.realloc(e);for(let i=0;i<e;i++)this.buf[this.pos++]=t[i]}writeRawMessage(t,e){this.pos++;const i=this.pos;t(e,this);const n=this.pos-i;n>=128&&jE(i,n,this),this.pos=i-1,this.writeVarint(n),this.pos+=n}writeMessage(t,e,i){this.writeTag(t,2),this.writeRawMessage(e,i)}writePackedVarint(t,e){e.length&&this.writeMessage(t,UE,e)}writePackedSVarint(t,e){e.length&&this.writeMessage(t,BE,e)}writePackedBoolean(t,e){e.length&&this.writeMessage(t,VE,e)}writePackedFloat(t,e){e.length&&this.writeMessage(t,zE,e)}writePackedDouble(t,e){e.length&&this.writeMessage(t,XE,e)}writePackedFixed32(t,e){e.length&&this.writeMessage(t,$E,e)}writePackedSFixed32(t,e){e.length&&this.writeMessage(t,WE,e)}writePackedFixed64(t,e){e.length&&this.writeMessage(t,ZE,e)}writePackedSFixed64(t,e){e.length&&this.writeMessage(t,YE,e)}writeBytesField(t,e){this.writeTag(t,2),this.writeBytes(e)}writeFixed32Field(t,e){this.writeTag(t,5),this.writeFixed32(e)}writeSFixed32Field(t,e){this.writeTag(t,5),this.writeSFixed32(e)}writeFixed64Field(t,e){this.writeTag(t,1),this.writeFixed64(e)}writeSFixed64Field(t,e){this.writeTag(t,1),this.writeSFixed64(e)}writeVarintField(t,e){this.writeTag(t,0),this.writeVarint(e)}writeSVarintField(t,e){this.writeTag(t,0),this.writeSVarint(e)}writeStringField(t,e){this.writeTag(t,2),this.writeString(e)}writeFloatField(t,e){this.writeTag(t,5),this.writeFloat(e)}writeDoubleField(t,e){this.writeTag(t,1),this.writeDouble(e)}writeBooleanField(t,e){this.writeVarintField(t,+e)}}function GE(t,e,i){return i?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function jE(t,e,i){const n=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));i.realloc(n);for(let e=i.pos-1;e>=t;e--)i.buf[e+n]=i.buf[e]}function UE(t,e){for(let i=0;i<t.length;i++)e.writeVarint(t[i])}function BE(t,e){for(let i=0;i<t.length;i++)e.writeSVarint(t[i])}function zE(t,e){for(let i=0;i<t.length;i++)e.writeFloat(t[i])}function XE(t,e){for(let i=0;i<t.length;i++)e.writeDouble(t[i])}function VE(t,e){for(let i=0;i<t.length;i++)e.writeBoolean(t[i])}function $E(t,e){for(let i=0;i<t.length;i++)e.writeFixed32(t[i])}function WE(t,e){for(let i=0;i<t.length;i++)e.writeSFixed32(t[i])}function ZE(t,e){for(let i=0;i<t.length;
vendor: 28,643 bytes, line 2387
2387i++)e.writeFixed64(t[i])}function YE(t,e){for(let i=0;i<t.length;i++)e.writeSFixed64(t[i])}function HE(t,e,i){if(3===t){const t={keys:[],values:[],features:[]},n=i.readVarint()+i.pos;i.readFields(KE,t,n),t.length=t.features.length,t.length&&(e[t.name]=t)}}function KE(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 qE(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 JE(t,e,i){t.pos=e.features[i];const n=t.readVarint()+t.pos,r={layer:e,type:0,properties:{}};return t.readFields(qE,r,n),r}const QE=[null],tw=cf(QE,{nd:function(t,e){const i=e[e.length-1];i.ndrefs.push(t.getAttribute("ref")),t.hasAttribute("lon")&&t.hasAttribute("lat")&&(i.flatCoordinates.push(parseFloat(t.getAttribute("lon"))),i.flatCoordinates.push(parseFloat(t.getAttribute("lat"))))},tag:nw}),ew=cf(QE,{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=df({tags:{}},iw,t,e);if(!y(o.tags)){const t=new sr(s);rx(t,!1,i);const e=new Mt(t);void 0!==r&&e.setId(r),e.setProperties(o.tags,!0),n.features.push(e)}},way:function(t,e){const i=df({id:t.getAttribute("id"),ndrefs:[],flatCoordinates:[],tags:{}},tw,t,e);e[e.length-1].ways.push(i)}});const iw=cf(QE,{tag:nw});function nw(t,e){e[e.length-1].tags[t.getAttribute("k")]=t.getAttribute("v")}class rw{read(t){if(!t)return null;if("string"==typeof t){const e=Jg(t);return this.readFromDocument(e)}return Kg(t)?this.readFromDocument(t):this.readFromNode(t)}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){G()}}const sw="http://www.w3.org/1999/xlink";function ow(t){return t.getAttributeNS(sw,"href")}const aw=[null,"http://www.opengis.net/ows/1.1"],lw=cf(aw,{ServiceIdentification:rf((function(t,e){return df({},Sw,t,e)})),ServiceProvider:rf((function(t,e){return df({},Ew,t,e)})),OperationsMetadata:rf((function(t,e){return df({},_w,t,e)}))});class hw extends rw{constructor(){super()}readFromNode(t){const e=df({},lw,t,[]);return e||null}}const cw=cf(aw,{DeliveryPoint:rf(Px),City:rf(Px),AdministrativeArea:rf(Px),PostalCode:rf(Px),Country:rf(Px),ElectronicMailAddress:rf(Px)}),uw=cf(aw,{Value:nf((function(t,e){return Px(t)}))}),dw=cf(aw,{AllowedValues:rf((function(t,e){return df({},uw,t,e)}))}),gw=cf(aw,{Phone:rf((function(t,e){return df({},yw,t,e)})),Address:rf((function(t,e){return df({},cw,t,e)}))}),fw=cf(aw,{HTTP:rf((function(t,e){return df({},pw,t,e)}))}),pw=cf(aw,{Get:nf((function(t,e){const i=ow(t);if(!i)return;return df({href:i},xw,t,e)})),Post:void 0}),mw=cf(aw,{DCP:rf((function(t,e){return df({},fw,t,e)}))}),_w=cf(aw,{Operation:function(t,e){const i=t.getAttribute("name"),n=df({},mw,t,e);if(!n)return;e[e.length-1][i]=n}}),yw=cf(aw,{Voice:rf(Px),Facsimile:rf(Px)}),xw=cf(aw,{Constraint:nf((function(t,e){const i=t.getAttribute("name");if(!i)return;return df({name:i},dw,t,e)}))}),vw=cf(aw,{IndividualName:rf(Px),PositionName:rf(Px),ContactInfo:rf((function(t,e){return df({},gw,t,e)}))}),Sw=cf(aw,{Abstract:rf(Px),AccessConstraints:rf(Px),Fees:rf(Px),Title:rf(Px),ServiceTypeVersion:rf(Px),ServiceType:rf(Px)}),Ew=cf(aw,{ProviderName:rf(Px),ProviderSite:rf(ow),ServiceContact:rf((function(t,e){return df({},vw,t,e)}))});function ww(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 Cw(t,i)}function Tw(t,e,i){let n;i=i||1e5;const r=new Array(e);for(n=0;n<e;++n)r[n]=0;const s=Rw(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 Cw(t,e){e=e||1e5;for(let i=0,n=t.length;i<n;++i)t[i]=Math.round(t[i]*e);return bw(t)}function Rw(t,e){e=e||1e5;const i=Pw(t);for(let t=0,n=i.length;t<n;++t)i[t]/=e;return i}function bw(t){for(let e=0,i=t.length;e<i;++e){const i=t[e];t[e]=i<0?~(i<<1):i<<1}return Iw(t)}function Pw(t){const e=Lw(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 Iw(t){let e="";for(let i=0,n=t.length;i<n;++i)e+=Fw(t[i]);return e}function Lw(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 Fw(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 Mw={Point:function(t,e,i){const n=t.coordinates;e&&i&&kw(n,e,i);return new sr(n)},LineString:function(t,e){const i=Aw(t.arcs,e);return new Nu(i)},Polygon:function(t,e){const i=[];for(let n=0,r=t.arcs.length;n<r;++n)i[n]=Aw(t.arcs[n],e);return new Cr(i)},MultiPoint:function(t,e,i){const n=t.coordinates;if(e&&i)for(let t=0,r=n.length;t<r;++t)kw(n[t],e,i);return new Gu(n)},MultiLineString:function(t,e){const i=[];for(let n=0,r=t.arcs.length;n<r;++n)i[n]=Aw(t.arcs[n],e);return new ku(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]=Aw(r[t],e);i[n]=s}return new Uu(i)}};function Aw(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 Ow(t,e,i,n,r,s,o){const a=t.geometries,l=[];for(let t=0,h=a.length;t<h;++t)l[t]=Dw(a[t],e,i,n,r,s,o);return l}function Dw(t,e,i,n,r,s,o){let a=null;const l=t.type;if(l){const r=Mw[l];a="Point"===l||"MultiPoint"===l?r(t,i,n):r(t,e),a=rx(a,!1,o)}const h=new Mt({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 Nw(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,kw(o,e,i)}}function kw(t,e,i){t[0]=t[0]*e[0]+i[0],t[1]=t[1]*e[1]+i[1]}class Gw{constructor(t){this.tagName_=t}getTagName(){return this.tagName_}}class jw extends Gw{constructor(t,e){super(t),this.conditions=e,Ft(this.conditions.length>=2,"At least 2 conditions are required")}}class Uw extends jw{constructor(t){super("And",Array.prototype.slice.call(arguments))}}class Bw extends Gw{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 zw extends Gw{constructor(t,e,i,n){super(t),this.geometryName=e||"the_geom",this.geometry=i,this.srsName=n}}class Xw extends zw{constructor(t,e,i){super("Contains",t,e,i)}}class Vw extends zw{constructor(t,e,i,n,r){super("DWithin",t,e,r),this.distance=i,this.unit=n}}class $w extends zw{constructor(t,e,i){super("Disjoint",t,e,i)}}class Ww extends Gw{constructor(t,e){super(t),this.propertyName=e}}class Zw extends Ww{constructor(t,e,i){super("During",t),this.begin=e,this.end=i}}class Yw extends Ww{constructor(t,e,i,n){super(t,e),this.expression=i,this.matchCase=n}}class Hw extends Yw{constructor(t,e,i){super("PropertyIsEqualTo",t,e,i)}}class Kw extends Yw{constructor(t,e){super("PropertyIsGreaterThan",t,e)}}class qw extends Yw{constructor(t,e){super("PropertyIsGreaterThanOrEqualTo",t,e)}}class Jw extends zw{constructor(t,e,i){super("Intersects",t,e,i)}}class Qw extends Ww{constructor(t,e,i){super("PropertyIsBetween",t),this.lowerBoundary=e,this.upperBoundary=i}}class tT extends Ww{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 eT extends Ww{constructor(t){super("PropertyIsNull",t)}}class iT extends Yw{constructor(t,e){super("PropertyIsLessThan",t,e)}}class nT extends Yw{constructor(t,e){super("PropertyIsLessThanOrEqualTo",t,e)}}class rT extends Gw{constructor(t){super("Not"),this.condition=t}}class sT extends Yw{constructor(t,e,i){super("PropertyIsNotEqualTo",t,e,i)}}class oT extends jw{constructor(t){super("Or",Array.prototype.slice.call(arguments))}}class aT extends Gw{constructor(t){super("ResourceId"),this.rid=t}}class lT extends zw{constructor(t,e,i){super("Within",t,e,i)}}function hT(t){const e=[null].concat(Array.prototype.slice.call(arguments));return new(Function.prototype.bind.apply(Uw,e))}function cT(t,e,i){return new Bw(t,e,i)}const uT={"http://www.opengis.net/gml":{boundedBy:rf(vx.prototype.readExtentElement,"bounds")},"http://www.opengis.net/wfs/2.0":{member:tf(vx.prototype.readFeaturesInternal)}},dT={"http://www.opengis.net/wfs":{totalInserted:rf(Rx),totalUpdated:rf(Rx),totalDeleted:rf(Rx)},"http://www.opengis.net/wfs/2.0":{totalInserted:rf(Rx),totalUpdated:rf(Rx),totalDeleted:rf(Rx)}},gT={"http://www.opengis.net/wfs":{TransactionSummary:rf(TT,"transactionSummary"),InsertResults:rf(PT,"insertIds")},"http://www.opengis.net/wfs/2.0":{TransactionSummary:rf(TT,"transactionSummary"),InsertResults:rf(PT,"insertIds")}},fT={"http://www.opengis.net/wfs":{PropertyName:sf(Ox)},"http://www.opengis.net/wfs/2.0":{PropertyName:sf(Ox)}},pT={"http://www.opengis.net/wfs":{Insert:sf(IT),Update:sf(AT),Delete:sf(MT),Property:sf(OT),Native:sf(DT)},"http://www.opengis.net/wfs/2.0":{Insert:sf(IT),Update:sf(AT),Delete:sf(MT),Property:sf(OT),Native:sf(DT)}},mT="feature",_T="http://www.w3.org/2000/xmlns/",yT={"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"},xT={"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"},vT={"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"},ST={"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"},ET={"2.0.0":zx,"1.1.0":Ux,"1.0.0":kx};function wT(t,e,i,n){ff(n,pT,af(t),e,i)}function TT(t,e){return df({},dT,t,e)}const CT={"http://www.opengis.net/ogc":{FeatureId:tf((function(t,e){return t.getAttribute("fid")}))},"http://www.opengis.net/ogc/1.1":{FeatureId:tf((function(t,e){return t.getAttribute("fid")}))}};function RT(t,e){uf(CT,t,e)}const bT={"http://www.opengis.net/wfs":{Feature:RT},"http://www.opengis.net/wfs/2.0":{Feature:RT}};function PT(t,e){return df([],bT,t,e)}function IT(t,e,i){const n=i[i.length-1],r=n.featureType,s=n.featureNS,o=n.gmlVersion,a=Zg(s,r);t.appendChild(a),2===o?kx.prototype.writeFeatureElement(a,e,i):3===o?Ux.prototype.writeFeatureElement(a,e,i):zx.prototype.writeFeatureElement(a,e,i)}function LT(t,e,i){const n=i[i.length-1].version,r=yT[n],s=Zg(r,"Filter"),o=Zg(r,"FeatureId");s.appendChild(o),o.setAttribute("fid",e),t.appendChild(s)}function FT(t,e){const i=(t=t||mT)+":";return e.startsWith(i)?e:i+e}function MT(t,e,i){const n=i[i.length-1];Ft(void 0!==e.getId(),"Features must have an id set");const r=n.featureType,s=n.featurePrefix,o=n.featureNS,a=FT(s,r);t.setAttribute("typeName",a),t.setAttributeNS(_T,"xmlns:"+s,o);const l=e.getId();void 0!==l&&LT(t,l,i)}function AT(t,e,i){const n=i[i.length-1];Ft(void 0!==e.getId(),"Features must have an id set");const r=n.version,s=n.featureType,o=n.featurePrefix,a=n.featureNS,l=FT(o,s),h=e.getGeometryName();t.setAttribute("typeName",l),t.setAttributeNS(_T,"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})}}ff({version:r,gmlVersion:n.gmlVersion,node:t,hasZ:n.hasZ,srsName:n.srsName},pT,af("Property"),o,i),LT(t,c,i)}}function OT(t,e,i){const n=i[i.length-1],r=n.version,s=xT[r],o=Zg(s,"2.0.0"===r?"ValueReference":"Name"),a=n.gmlVersion;if(t.appendChild(o),Ox(o,e.name),void 0!==e.value&&null!==e.value){const n=Zg(s,"Value");t.appendChild(n),e.value&&"function"==typeof e.value.getSimplifiedGeometry?2===a?kx.prototype.writeGeometryElement(n,e.value,i):3===a?Ux.prototype.writeGeometryElement(n,e.value,i):zx.prototype.writeGeometryElement(n,e.value,i):Ox(n,e.value)}}function DT(t,e,i){e.vendorId&&t.setAttribute("vendorId",e.vendorId),void 0!==e.safeToIgnore&&t.setAttribute("safeToIgnore",String(e.safeToIgnore)),void 0!==e.value&&Ox(t,e.value)}const NT={"http://www.opengis.net/wfs":{Query:sf(kT)},"http://www.opengis.net/wfs/2.0":{Query:sf(kT)},"http://www.opengis.net/ogc":{During:sf(zT),And:sf(XT),Or:sf(XT),Not:sf(VT),BBOX:sf(jT),Contains:sf(UT),Intersects:sf(UT),Within:sf(UT),DWithin:sf(BT),PropertyIsEqualTo:sf($T),PropertyIsNotEqualTo:sf($T),PropertyIsLessThan:sf($T),PropertyIsLessThanOrEqualTo:sf($T),PropertyIsGreaterThan:sf($T),PropertyIsGreaterThanOrEqualTo:sf($T),PropertyIsNull:sf(WT),PropertyIsBetween:sf(ZT),PropertyIsLike:sf(YT)},"http://www.opengis.net/fes/2.0":{During:sf(zT),And:sf(XT),Or:sf(XT),Not:sf(VT),BBOX:sf(jT),Contains:sf(UT),Disjoint:sf(UT),Intersects:sf(UT),ResourceId:sf((function(t,e,i){t.setAttribute("rid",e.rid)})),Within:sf(UT),DWithin:sf(BT),PropertyIsEqualTo:sf($T),PropertyIsNotEqualTo:sf($T),PropertyIsLessThan:sf($T),PropertyIsLessThanOrEqualTo:sf($T),PropertyIsGreaterThan:sf($T),PropertyIsGreaterThanOrEqualTo:sf($T),PropertyIsNull:sf(WT),PropertyIsBetween:sf(ZT),PropertyIsLike:sf(YT)}};function kT(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?FT(s,e):e,c="2.0.0"===r?"typeNames":"typeName",t.setAttribute(c,h),l&&t.setAttribute("srsName",l),o&&t.setAttributeNS(_T,"xmlns:"+s,o);const u=Object.assign({},n);u.node=t,ff(u,fT,af("PropertyName"),a,i);const d=n.filter;if(d){const e=Zg(tC(r),"Filter");t.appendChild(e),GT(e,d,i)}}function GT(t,e,i){const n=i[i.length-1],r={node:t};Object.assign(r,{context:n}),ff(r,NT,af(e.getTagName()),[e],i)}function jT(t,e,i){const n=i[i.length-1],r=n.context.version;n.srsName=e.srsName;const s=ET[r];qT(r,t,e.geometryName),s.prototype.writeGeometryElement(t,e.extent,i)}function UT(t,e,i){const n=i[i.length-1],r=n.context.version;n.srsName=e.srsName;const s=ET[r];qT(r,t,e.geometryName),s.prototype.writeGeometryElement(t,e.geometry,i)}function BT(t,e,i){const n=i[i.length-1].context.version;UT(t,e,i);const r=Zg(tC(n),"Distance");Ox(r,e.distance.toString()),"2.0.0"===n?r.setAttribute("uom",e.unit):r.setAttribute("units",e.unit),t.appendChild(r)}function zT(t,e,i){const n=i[i.length-1].context.version;HT(vT[n],"ValueReference",t,e.propertyName);const r=Zg(yx,"TimePeriod");t.appendChild(r);const s=Zg(yx,"begin");r.appendChild(s),JT(s,e.begin);const o=Zg(yx,"end");r.appendChild(o),JT(o,e.end)}function XT(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];ff(r,NT,af(e.getTagName()),[e],i)}}function VT(t,e,i){const n=i[i.length-1].context,r={node:t};Object.assign(r,{context:n});const s=e.condition;ff(r,NT,af(s.getTagName()),[s],i)}function $T(t,e,i){const n=i[i.length-1].context.version;void 0!==e.matchCase&&t.setAttribute("matchCase",e.matchCase.toString()),qT(n,t,e.propertyName),KT(n,t,""+e.expression)}function WT(t,e,i){qT(i[i.length-1].context.version,t,e.propertyName)}function ZT(t,e,i){const n=i[i.length-1].context.version,r=tC(n);qT(n,t,e.propertyName);const s=Zg(r,"LowerBoundary");t.appendChild(s),KT(n,s,""+e.lowerBoundary);const o=Zg(r,"UpperBoundary");t.appendChild(o),KT(n,o,""+e.upperBoundary)}function YT(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()),qT(n,t,e.propertyName),KT(n,t,""+e.pattern)}function HT(t,e,i,n){const r=Zg(t,e);Ox(r,n),i.appendChild(r)}function KT(t,e,i){HT(tC(t),"Literal",e,i)}function qT(t,e,i){"2.0.0"===t?HT(vT[t],"ValueReference",e,i):HT(yT[t],"PropertyName",e,i)}function JT(t,e){const i=Zg(yx,"TimeInstant");t.appendChild(i);const n=Zg(yx,"timePosition");i.appendChild(n),Ox(n,e)}function QT(t,e,i){const n=i[i.length-1],r=Object.assign({},n);r.node=t,ff(r,NT,af("Query"),e,i)}function tC(t){let e;return e="2.0.0"===t?vT[t]:yT[t],e}const eC=1,iC=2,nC=3,rC=4,sC=5,oC=6,aC=7,lC=15,hC=16,cC=17;class uC{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 eC:return this.readPoint();case iC:return this.readLineString();case nC:case cC:return this.readPolygon();case rC:return this.readMultiPoint();case sC:return this.readMultiLineString();case oC:case lC:case hC:return this.readMultiPolygon();case aC: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,eC)}readMultiLineString(){return this.readWkbCollection(this.readWkbBlock,iC)}readMultiPolygon(){return this.readWkbCollection(this.readWkbBlock,nC)}readGeometryCollection(){return this.readWkbCollection(this.readGeometry)}readGeometry(){const t=this.readWkbHeader(),e=this.readWkbPayload(t);switch(t){case eC:return new sr(e,this.layout_);case iC:return new Nu(e,this.layout_);case nC:case cC:return new Cr(e,this.layout_);case rC:return new Gu(e,this.layout_);case sC:return new ku(e,this.layout_);case oC:case lC:case hC:return new Uu(e,this.layout_);case aC:return new Lu(e);default:return null}}getSrid(){return this.srid_}}class dC{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 Ln)return(i=t.getLayout())===(n=e)?i:"XYZM"===i?n:"XYZM"===n?i:"XY";var i,n;if(t instanceof Lu){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:eC,LineString:iC,Polygon:nC,MultiPoint:rC,MultiLineString:sC,MultiPolygon:oC,GeometryCollection:aC},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 Ln){({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 Lu&&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 gC(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 fC={POINT:sr,LINESTRING:Nu,POLYGON:Cr,MULTIPOINT:Gu,MULTILINESTRING:ku,MULTIPOLYGON:Uu},pC="EMPTY",mC="Z",_C="M",yC=0,xC=1,vC=2,SC=3,EC=4,wC=5,TC=6,CC={Point:"POINT",LineString:"LINESTRING",Polygon:"POLYGON",MultiPoint:"MULTIPOINT",MultiLineString:"MULTILINESTRING",MultiPolygon:"MULTIPOLYGON",GeometryCollection:"GEOMETRYCOLLECTION",Circle:"CIRCLE"};class RC{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=vC;else if(","==t)i=wC;else if(")"==t)i=SC;else if(this.isNumeric_(t)||"-"==t)i=EC,n=this.readNumber_();else if(this.isAlpha_(t))i=xC,n=this.readText_();else{if(this.isWhiteSpace_(t))return this.nextToken();if(""!==t)throw new Error("Unexpected character: "+t);i=TC}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 bC{constructor(t){this.lexer_=t,this.token_={position:0,type:yC},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(xC)){const i=e.value;i===mC?t="XYZ":i===_C?t="XYM":"ZM"===i&&(t="XYZM"),"XY"!==t&&this.consume_()}return t}parseGeometryCollectionText_(){if(this.match(vC)){const t=[];do{t.push(this.parseGeometry_())}while(this.match(wC));if(this.match(SC))return t}throw new Error(this.formatErrorMessage_())}parsePointText_(){if(this.match(vC)){const t=this.parsePoint_();if(this.match(SC))return t}throw new Error(this.formatErrorMessage_())}parseLineStringText_(){if(this.match(vC)){const t=this.parsePointList_();if(this.match(SC))return t}throw new Error(this.formatErrorMessage_())}parsePolygonText_(){if(this.match(vC)){const t=this.parseLineStringTextList_();if(this.match(SC))return t}throw new Error(this.formatErrorMessage_())}parseMultiPointText_(){if(this.match(vC)){let t;if(t=this.token_.type==vC?this.parsePointTextList_():this.parsePointList_(),this.match(SC))return t}throw new Error(this.formatErrorMessage_())}parseMultiLineStringText_(){if(this.match(vC)){const t=this.parseLineStringTextList_();if(this.match(SC))return t}throw new Error(this.formatErrorMessage_())}parseMultiPolygonText_(){if(this.match(vC)){const t=this.parsePolygonTextList_();if(this.match(SC))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(EC))break;t.push(e.value)}if(t.length==e)return t;throw new Error(this.formatErrorMessage_())}parsePointList_(){const t=[this.parsePoint_()];for(;this.match(wC);)t.push(this.parsePoint_());return t}parsePointTextList_(){const t=[this.parsePointText_()];for(;this.match(wC);)t.push(this.parsePointText_());return t}parseLineStringTextList_(){const t=[this.parseLineStringText_()];for(;this.match(wC);)t.push(this.parseLineStringText_());return t}parsePolygonTextList_(){const t=[this.parsePolygonText_()];for(;this.match(wC);)t.push(this.parsePolygonText_());return t}isEmptyGeometry_(){const t=this.isTokenType(xC)&&this.token_.value==pC;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(xC)){const e=t.value;this.layout_=this.parseGeometryLayout_();const i=this.isEmptyGeometry_();if("GEOMETRYCOLLECTION"==e){if(i)return new Lu([]);const t=this.parseGeometryCollectionText_();return new Lu(t)}const n=fC[e];if(!n)throw new Error("Invalid geometry type: "+e);let r;if(i)r="POINT"==e?[NaN,NaN]:[];else switch(e){case"POINT":r=this.parsePointText_();break;case"LINESTRING":r=this.parseLineStringText_();break;case"POLYGON":r=this.parsePolygonText_();break;case"MULTIPOINT":r=this.parseMultiPointText_();break;case"MULTILINESTRING":r=this.parseMultiLineStringText_();break;case"MULTIPOLYGON":r=this.parseMultiPolygonText_()}return new n(r,this.layout_)}throw new Error(this.formatErrorMessage_())}}function PC(t){const e=t.getCoordinates();return 0===e.length?"":e.join(" ")}function IC(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 LC(t){const e=[],i=t.getLinearRings();for(let t=0,n=i.length;t<n;++t)e.push("("+IC(i[t])+")");return e.join(",")}const FC={Point:PC,LineString:IC,Polygon:LC,MultiPoint:function(t){const e=[],i=t.getPoints();for(let t=0,n=i.length;t<n;++t)e.push("("+PC(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("("+IC(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("("+LC(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(MC(i[t]));return e.join(",")}};function MC(t){const e=t.getType(),i=(0,FC[e])(t);let n=CC[e];if("function"==typeof t.getFlatCoordinates){const e=function(t){const e=t.getLayout();let i="";return"XYZ"!==e&&"XYZM"!==e||(i+=mC),"XYM"!==e&&"XYZM"!==e||(i+=_C),i}(t);e.length>0&&(n+=" "+e)}return 0===i.length?n+" "+pC:n+"("+i+")"}const AC=[null,"http://www.opengis.net/wms"];function OC(t){return wi(t[0].version,"1.3")>=0}const DC=cf(AC,{Service:rf((function(t,e){return df({},OC(e)?BC:UC,t,e)})),Capability:rf((function(t,e){return df({},OC(e)?GC:kC,t,e)}))}),NC={Request:rf((function(t,e){return df({},qC,t,e)}
2387)),Exception:rf((function(t,e){return df([],$C,t,e)})),Layer:rf((function(t,e){const i=df({},OC(e)?YC:ZC,t,e);if(void 0===i.Layer)return Object.assign(i,sR(t,e));return i}))},kC=cf(AC,{...NC,UserDefinedSymbolization:rf((function(t,e){return{SupportSLD:!!Ex(t.getAttribute("UserDefinedSymbolization")),UserLayer:!!Ex(t.getAttribute("UserLayer")),UserStyle:!!Ex(t.getAttribute("UserStyle")),RemoteWFS:!!Ex(t.getAttribute("RemoteWFS"))}}))}),GC=cf(AC,NC);const jC={Name:rf(Px),Title:rf(Px),Abstract:rf(Px),KeywordList:rf(hR),OnlineResource:rf(ow),ContactInformation:rf((function(t,e){return df({},zC,t,e)})),Fees:rf(Px),AccessConstraints:rf(Px)},UC=cf(AC,jC),BC=cf(AC,{...jC,LayerLimit:rf(Rx),MaxWidth:rf(Rx),MaxHeight:rf(Rx)}),zC=cf(AC,{ContactPersonPrimary:rf((function(t,e){return df({},XC,t,e)})),ContactPosition:rf(Px),ContactAddress:rf((function(t,e){return df({},VC,t,e)})),ContactVoiceTelephone:rf(Px),ContactFacsimileTelephone:rf(Px),ContactElectronicMailAddress:rf(Px)}),XC=cf(AC,{ContactPerson:rf(Px),ContactOrganization:rf(Px)}),VC=cf(AC,{AddressType:rf(Px),Address:rf(Px),City:rf(Px),StateOrProvince:rf(Px),PostCode:rf(Px),Country:rf(Px)}),$C=cf(AC,{Format:tf(Px)}),WC={Name:rf(Px),Title:rf(Px),Abstract:rf(Px),KeywordList:rf(hR),BoundingBox:nf(rR),Dimension:nf((function(t,e){const i={name:t.getAttribute("name"),units:t.getAttribute("units"),unitSymbol:t.getAttribute("unitSymbol")};OC(e)&&Object.assign(i,{default:t.getAttribute("default"),multipleValues:Ex(t.getAttribute("multipleValues")),nearestValue:Ex(t.getAttribute("nearestValue")),current:Ex(t.getAttribute("current")),values:Px(t)});return i})),Attribution:rf((function(t,e){return df({},HC,t,e)})),AuthorityURL:nf((function(t,e){const i=oR(t,e);if(i)return i.name=t.getAttribute("name"),i;return})),Identifier:nf(Px),MetadataURL:nf((function(t,e){const i=oR(t,e);if(i)return i.type=t.getAttribute("type"),i;return})),DataURL:nf(oR),FeatureListURL:nf(oR),Style:nf((function(t,e){return df({},eR,t,e)})),Layer:nf(sR)},ZC=cf(AC,{...WC,SRS:nf(Px),Extent:rf((function(t,e){return{name:t.getAttribute("name"),default:t.getAttribute("default"),nearestValue:Ex(t.getAttribute("nearestValue"))}})),ScaleHint:nf((function(t,e){return{min:Cx(t.getAttribute("min")),max:Cx(t.getAttribute("max"))}})),LatLonBoundingBox:rf(((t,e)=>rR(t,e,!1))),Layer:nf(sR)}),YC=cf(AC,{...WC,CRS:nf(Px),EX_GeographicBoundingBox:rf((function(t,e){const i=df({},KC,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]})),MinScaleDenominator:rf(Tx),MaxScaleDenominator:rf(Tx),Layer:nf(sR)}),HC=cf(AC,{Title:rf(Px),OnlineResource:rf(ow),LogoURL:rf(lR)}),KC=cf(AC,{westBoundLongitude:rf(Tx),eastBoundLongitude:rf(Tx),southBoundLatitude:rf(Tx),northBoundLatitude:rf(Tx)}),qC=cf(AC,{GetCapabilities:rf(aR),GetMap:rf(aR),GetFeatureInfo:rf(aR)}),JC=cf(AC,{Format:nf(Px),DCPType:nf((function(t,e){return df({},QC,t,e)}))}),QC=cf(AC,{HTTP:rf((function(t,e){return df({},tR,t,e)}))}),tR=cf(AC,{Get:rf(oR),Post:rf(oR)}),eR=cf(AC,{Name:rf(Px),Title:rf(Px),Abstract:rf(Px),LegendURL:nf(lR),StyleSheetURL:rf(oR),StyleURL:rf(oR)}),iR=cf(AC,{Format:rf(Px),OnlineResource:rf(ow)}),nR=cf(AC,{Keyword:tf(Px)});function rR(t,e,i=!0){const n={extent:[Cx(t.getAttribute("minx")),Cx(t.getAttribute("miny")),Cx(t.getAttribute("maxx")),Cx(t.getAttribute("maxy"))],res:[Cx(t.getAttribute("resx")),Cx(t.getAttribute("resy"))]};return i?(OC(e)?n.crs=t.getAttribute("CRS"):n.srs=t.getAttribute("SRS"),n):n}function sR(t,e){const i=OC(e),n=e[e.length-1],r=df({},i?YC:ZC,t,e);if(!r)return;let s=Ex(t.getAttribute("queryable"));void 0===s&&(s=n.queryable),r.queryable=void 0!==s&&s;let o=bx(t.getAttribute("cascaded"));void 0===o&&(o=n.cascaded),r.cascaded=o;let a=Ex(t.getAttribute("opaque"));void 0===a&&(a=n.opaque),r.opaque=void 0!==a&&a;let l=Ex(t.getAttribute("noSubsets"));void 0===l&&(l=n.noSubsets),r.noSubsets=void 0!==l&&l;let h=Cx(t.getAttribute("fixedWidth"));h||(h=n.fixedWidth),r.fixedWidth=h;let c=Cx(t.getAttribute("fixedHeight"));c||(c=n.fixedHeight),r.fixedHeight=c;const u=["Style","AuthorityURL"];i?u.push("CRS"):u.push("SRS","Dimension"),u.forEach((function(t){if(t in n){const e=r[t]||[];r[t]=e.concat(n[t])}}));const d=["BoundingBox","Attribution"];return i?d.push("Dimension","EX_GeographicBoundingBox","MinScaleDenominator","MaxScaleDenominator"):d.push("LatLonBoundingBox","ScaleHint","Extent"),d.forEach((function(t){if(!(t in r)){const e=n[t];r[t]=e}})),r}function oR(t,e){return df({},iR,t,e)}
vendor: 99,739 bytes, line 2387
2387function aR(t,e){return df({},JC,t,e)}function lR(t,e){const i=oR(t,e);if(i){const e=[bx(t.getAttribute("width")),bx(t.getAttribute("height"))];return i.size=e,i}}function hR(t,e){return df([],nR,t,e)}const cR=[null,"http://www.opengis.net/wmts/1.0"],uR=[null,"http://www.opengis.net/ows/1.1"],dR=cf(cR,{Contents:rf((function(t,e){return df({},gR,t,e)}))});const gR=cf(cR,{Layer:nf((function(t,e){return df({},fR,t,e)})),TileMatrixSet:nf((function(t,e){return df({},SR,t,e)}))}),fR=cf(cR,{Style:nf((function(t,e){const i=df({},pR,t,e);if(!i)return;const n="true"===t.getAttribute("isDefault");return i.isDefault=n,i})),Format:nf(Px),TileMatrixSetLink:nf((function(t,e){return df({},mR,t,e)})),Dimension:nf((function(t,e){return df({},xR,t,e)})),ResourceURL:nf((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}))},cf(uR,{Title:rf(Px),Abstract:rf(Px),WGS84BoundingBox:rf(wR),BoundingBox:nf((function(t,e){const i=t.getAttribute("crs"),n=df([],vR,t,e);if(2!=n.length)return;return{extent:Kt(n),crs:i}})),Identifier:rf(Px)})),pR=cf(cR,{LegendURL:nf((function(t,e){const i={};return i.format=t.getAttribute("format"),i.href=ow(t),i}))},cf(uR,{Title:rf(Px),Identifier:rf(Px)})),mR=cf(cR,{TileMatrixSet:rf(Px),TileMatrixSetLimits:rf((function(t,e){return df([],_R,t,e)}))}),_R=cf(cR,{TileMatrixLimits:tf((function(t,e){return df({},yR,t,e)}))}),yR=cf(cR,{TileMatrix:rf(Px),MinTileRow:rf(Rx),MaxTileRow:rf(Rx),MinTileCol:rf(Rx),MaxTileCol:rf(Rx)}),xR=cf(cR,{Default:rf(Px),Value:nf(Px)},cf(uR,{Identifier:rf(Px)})),vR=cf(uR,{LowerCorner:tf(TR),UpperCorner:tf(TR)}),SR=cf(cR,{WellKnownScaleSet:rf(Px),TileMatrix:nf((function(t,e){return df({},ER,t,e)}))},cf(uR,{SupportedCRS:rf(Px),Identifier:rf(Px),BoundingBox:rf(wR)})),ER=cf(cR,{TopLeftCorner:rf(TR),ScaleDenominator:rf(Tx),TileWidth:rf(Rx),TileHeight:rf(Rx),MatrixWidth:rf(Rx),MatrixHeight:rf(Rx)},cf(uR,{Identifier:rf(Px)}));function wR(t,e){const i=df([],vR,t,e);if(2==i.length)return Kt(i)}function TR(t,e){const i=Px(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 CR=["fullscreenchange","webkitfullscreenchange","MSFullscreenChange"],RR="enterfullscreen",bR="leavefullscreen";function PR(t){const e=t.body;return!!(e.webkitRequestFullscreen||e.requestFullscreen&&t.fullscreenEnabled)}function IR(t){return!(!t.webkitIsFullScreen&&!t.fullscreenElement)}function LR(t){t.requestFullscreen?t.requestFullscreen():t.webkitRequestFullscreen&&t.webkitRequestFullscreen()}const FR="projection",MR="coordinateFormat";const AR=.75,OR=.1;const DR="units",NR=[1,2,5],kR=25.4/.28;const GR=0,jR=1;var UR={};return UR.Collection=Z,UR.Collection.CollectionEvent=W,UR.DataTile=Lt,UR.DataTile.asArrayLike=Ct,UR.DataTile.asImageLike=Tt,UR.DataTile.disposedError=Rt,UR.DataTile.toArray=Pt,UR.Disposable=n,UR.Feature=Mt,UR.Feature.createStyleFunction=At,UR.Geolocation=class extends z{constructor(t){super(),this.on,this.once,this.un,t=t||{},this.position_=null,this.transform_=Ki,this.watchId_=void 0,this.addChangeListener(Nr,this.handleProjectionChanged_),this.addChangeListener(Gr,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_=hn(Qi("EPSG:4326"),t),this.position_&&this.set(Dr,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(Lr,e.accuracy),this.set(Mr,null===e.altitude?void 0:e.altitude),this.set(Ar,null===e.altitudeAccuracy?void 0:e.altitudeAccuracy),this.set(Or,null===e.heading?void 0:pi(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(Dr,i.slice()),this.set(kr,null===e.speed?void 0:e.speed);const n=Rr(this.position_,e.accuracy);n.applyTransform(this.transform_),this.set(Fr,n),this.changed()}positionError_(t){this.dispatchEvent(new Br(t))}getAccuracy(){return this.get(Lr)}getAccuracyGeometry(){return this.get(Fr)||null}getAltitude(){return this.get(Mr)}getAltitudeAccuracy(){return this.get(Ar)}getHeading(){return this.get(Or)}getPosition(){return this.get(Dr)}getProjection(){return this.get(Nr)}getSpeed(){return this.get(kr)}getTracking(){return this.get(Gr)}getTrackingOptions(){return this.get(jr)}setProjection(t){this.set(Nr,Qi(t))}setTracking(t){this.set(Gr,t)}setTrackingOptions(t){this.set(jr,t)}},UR.Geolocation.GeolocationError=Br,UR.Image=Xr,UR.Image.decode=Zr,UR.Image.decodeFallback=Wr,UR.Image.listenImage=Vr,UR.Image.load=$r,UR.ImageCanvas=Yr,UR.ImageTile=Hr,UR.Kinetic=Kr,UR.Map=Kh,UR.MapBrowserEvent=Dl,UR.MapBrowserEventHandler=Bl,UR.MapEvent=Ol,UR.Object=z,UR.Object.ObjectEvent=B,UR.Observable=N,UR.Observable.unByKey=k,UR.Overlay=ic,UR.Tile=nt,UR.TileCache=class extends nc{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=ac(this.peekFirstKey())[0];this.forEach((e=>{e.tileCoord[0]!==t&&(this.remove(oc(e.tileCoord)),e.release())}))}},UR.TileQueue=Ql,UR.TileQueue.getTilePriority=th,UR.TileRange=uc,UR.TileRange.createOrUpdate=dc,UR.VectorRenderTile=fc,UR.VectorTile=mc,UR.View=Is,UR.View.createCenterConstraint=Fs,UR.View.createResolutionConstraint=Ms,UR.View.createRotationConstraint=As,UR.View.isNoopAnimation=Os,UR.array={},UR.array.ascending=s,UR.array.binarySearch=r,UR.array.descending=o,UR.array.equals=c,UR.array.extend=h,UR.array.isSorted=u,UR.array.linearFindNearest=a,UR.array.remove=function(t,e){const i=t.indexOf(e),n=i>-1;return n&&t.splice(i,1),n},UR.array.reverseSubArray=l,UR.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},UR.asserts={},UR.asserts.assert=Ft,UR.centerconstraint={},UR.centerconstraint.createExtent=ys,UR.centerconstraint.none=xs,UR.color={},UR.color.NO_COLOR=po,UR.color.asArray=To,UR.color.asString=mo,UR.color.fromString=wo,UR.color.isStringColor=function(t){try{return wo(t),!0}catch(t){return!1}},UR.color.lchaToRgba=Eo,UR.color.normalize=Co,UR.color.rgbaToLcha=So,UR.color.toString=Ro,UR.color.withAlpha=vo,UR.colorlike={},UR.colorlike.asColorLike=Ao,UR.console={},UR.console.error=Wi,UR.console.log=function(...t){Vi>Xi.info||console.log(...t)},UR.console.setLevel=function(t){Vi=Xi[t]},UR.console.warn=$i,UR.control={},UR.control.Attribution=ih,UR.control.Control=eh,UR.control.FullScreen=class extends eh{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(w,this.handleClick_.bind(this),!1),this.setClassName_(this.button_,this.isInFullscreen_),this.element.className=`${this.cssClassName_} ${No} ${Go}`,this.element.appendChild(this.button_)}handleClick_(t){t.preventDefault(),this.handleFullScreen_()}handleFullScreen_(){const t=this.getMap();if(!t)return;const e=t.getOwnerDocument();if(PR(e))if(IR(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():LR(t)}(i):LR(i)}}handleFullScreenChange_(){const t=this.getMap();if(!t)return;const e=this.isInFullscreen_;this.isInFullscreen_=IR(t.getOwnerDocument()),e!==this.isInFullscreen_&&(this.setClassName_(this.button_,this.isInFullscreen_),this.isInFullscreen_?(St(this.labelActiveNode_,this.labelNode_),this.dispatchEvent(RR)):(St(this.labelNode_,this.labelActiveNode_),this.dispatchEvent(bR)),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(Hl,this.boundHandleMapTargetChange_),super.setMap(t),this.handleMapTargetChange_(),t&&t.addChangeListener(Hl,this.boundHandleMapTargetChange_)}handleMapTargetChange_(){const t=this.documentListeners_;for(let e=0,i=t.length;e<i;++e)D(t[e]);t.length=0;const e=this.getMap();if(e){const i=e.getOwnerDocument();PR(i)?this.element.classList.remove(ko):this.element.classList.add(ko);for(let e=0,n=CR.length;e<n;++e)t.push(A(i,CR[e],this.handleFullScreenChange_,this));this.handleFullScreenChange_()}}},UR.control.MousePosition=class extends eh{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(FR,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:"&#160;",this.renderedHTML_=e.innerHTML,this.mapProjection_=null,this.transform_=null,this.wrapX_=!1!==t.wrapX}handleProjectionChanged_(){this.transform_=null}getCoordinateFormat(){return this.get(MR)}getProjection(){return this.get(FR)}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(A(e,kl,this.handleMouseMove,this)),this.renderOnMouseOut_&&this.listenerKeys.push(A(e,Ul,this.handleMouseOut,this)),this.updateHTML_(null)}}setCoordinateFormat(t){this.set(MR,t)}setProjection(t){this.set(FR,Qi(t))}updateHTML_(t){let e=this.placeholder_;if(t&&this.mapProjection_){if(!this.transform_){const t=this.getProjection();this.transform_=t?hn(this.mapProjection_,t):Ki}const i=this.getMap().getCoordinateFromPixelInternal(t);if(i){const t=pn();if(t&&(this.transform_=hn(this.mapProjection_,t)),this.transform_(i,i),this.wrapX_){Ni(i,t||this.getProjection()||this.mapProjection_)}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}},UR.control.OverviewMap=class extends eh{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(w,this.handleClick_.bind(this),!1),this.ovmapDiv_=document.createElement("div"),this.ovmapDiv_.className="ol-overviewmap-map",this.view_=t.view;const a=new Kh({view:t.view,controls:new Z,interactions:new Z});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 ic({position:[0,0],positioning:"center-center",element:l}),this.ovmap_.addOverlay(this.boxOverlay_);const h=e+" "+No+" "+Go+(this.collapsed_&&this.collapsible_?" "+jo:"")+(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.getEventCoordinate(e);d.setPosition(n)},p=function(t){const e=a.getEventCoordinateInternal(t);u.getMap().getView().setCenterInternal(e),window.removeEventListener("pointermove",f),window.removeEventListener("pointerup",p)};this.ovmapDiv_.addEventListener("pointerdown",(function(){event.target===g&&window.addEventListener("pointermove",f),window.addEventListener("pointerup",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(A(t,i,this.handleMapPropertyChange_,this));const e=t.getView();e&&this.bindView_(e),this.ovmap_.isRendered()||this.updateBoxAfterOvmapIsRendered_()}}}handleMapPropertyChange_(t){if(t.key===Kl){const e=t.oldValue;e&&this.unbindView_(e);const i=this.getMap().getView();this.bindView_(i)}else this.ovmap_.isRendered()||t.key!==Hl&&t.key!==Yl||this.ovmap_.updateSize()}bindView_(t){if(!this.view_){const e=new Is({projection:t.getProjection()});this.ovmap_.setView(e)}t.addChangeListener(ps.ROTATION,this.boundHandleRotationChanged_),this.handleRotationChanged_(),t.isDef()&&(this.ovmap_.updateSize(),this.resetExtent_())}unbindView_(t){t.removeChangeListener(ps.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_&&he(n,this.viewExtent_))return;this.viewExtent_=n;const r=e.getSize(),s=e.getView().calculateExtentInternal(r),o=e.getPixelFromCoordinateInternal(be(n)),a=e.getPixelFromCoordinateInternal(ve(n)),l=Math.abs(o[0]-a[0]),h=Math.abs(o[1]-a[1]),c=r[0],u=r[1];l<c*OR||h<u*OR||l>c*AR||h>u*AR?this.resetExtent_():ee(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;Ae(n,1/(Math.pow(2,s/2)*OR)),r.fitInternal(br(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.getCenter(),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_=O(this.ovmap_,zl,(t=>{delete this.ovmapPostrenderKey_,this.updateBox_()})))}handleClick_(t){t.preventDefault(),this.handleToggle_()}handleToggle_(){this.element.classList.toggle(jo),this.collapsed_?St(this.collapseLabel_,this.label_):St(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_()}},UR.control.Rotate=nh,UR.control.ScaleLine=class extends eh{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+" "+No,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(DR,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(DR)}handleUnitsChanged_(){this.updateElement_()}setUnits(t){this.set(DR,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=tn(i,t.resolution,e,r);const o=this.minWidth_*(this.dpi_||kR)/kR,a=void 0!==this.maxWidth_?this.maxWidth_*(this.dpi_||kR)/kR:void 0;let l=o*s,h="";if("degrees"==n){const t=Ue.degrees;l*=t,l<t/60?(h="″",s*=3600):l<t?(h="′",s*=60):h="°"}else if("imperial"==n)l<.9144?(h="in",s/=.0254):l<1609.344?(h="ft",s/=.3048):(h="mi",s/=1609.344);else if("nautical"==n)s/=1852,h="NM";else if("metric"==n)l<1e-6?(h="nm",s*=1e9):l<.001?(h="μm",s*=1e6):l<1?(h="mm",s*=1e3):l<1e3?h="m":(h="km",s/=1e3);else{if("us"!=n)throw new Error("Invalid units");l<.9144?(h="in",s*=39.37):l<1609.344?(h="ft",s/=.30480061):(h="mi",s/=1609.3472)}let c,u,d,g,f,p,m=3*Math.floor(Math.log(o*s)/Math.log(10));for(;;){d=Math.floor(m/3);const t=Math.pow(10,d);if(c=NR[(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 tn(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,"m")*(1e3/25.4)*(this.dpi_||kR)}render(t){const e=t.frameState;this.viewState_=e?e.viewState:null,this.updateElement_()}},UR.control.Zoom=rh,UR.control.ZoomSlider=class extends eh{constructor(t){super({target:(t=t||{}).target,element:document.createElement("div"),render:t.render}),this.dragListenerKeys_=[],this.currentResolution_=void 0,this.direction_=GR,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 i=void 0!==t.className?t.className:"ol-zoomslider",n=document.createElement("button");n.setAttribute("type","button"),n.className=i+"-thumb "+No;const r=this.element;r.className=i+" "+No+" "+Go,r.appendChild(n),r.addEventListener(Gl,this.handleDraggerStart_.bind(this),!1),r.addEventListener(kl,this.handleDraggerDrag_.bind(this),!1),r.addEventListener(jl,this.handleDraggerEnd_.bind(this),!1),r.addEventListener(w,this.handleContainerClick_.bind(this),!1),n.addEventListener(w,e,!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_=jR,this.widthLimit_=e-o):(this.direction_=GR,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:tt})}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(A(i,kl,t,this),A(i,jl,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(D),this.dragListenerKeys_.length=0}}setThumbPosition_(t){const e=this.getPositionForResolution_(t),i=this.element.firstElementChild;this.direction_==jR?i.style.left=this.widthLimit_*e+"px":i.style.top=this.heightLimit_*e+"px"}getRelativePosition_(t,e){let i;return i=this.direction_===jR?t/this.widthLimit_:e/this.heightLimit_,ci(i,0,1)}getResolutionForPosition_(t){return this.getMap().getView().getResolutionForValueFunction()(1-t)}getPositionForResolution_(t){return ci(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)}},UR.control.ZoomToExtent=class extends eh{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(w,this.handleClick_.bind(this),!1);const s=e+" "+No+" "+Go,o=this.element;o.className=s,o.appendChild(r)}handleClick_(t){t.preventDefault(),this.handleZoomToExtent()}handleZoomToExtent(){const t=this.getMap().getView(),e=this.extent?xn(this.extent,t.getProjection()):t.getProjection().getExtent();t.fitInternal(br(e))}},UR.control.defaults={},UR.control.defaults.defaults=sh,UR.coordinate={},UR.coordinate.add=Ti,UR.coordinate.closestOnCircle=Ci,UR.coordinate.closestOnSegment=Ri,UR.coordinate.createStringXY=function(t){return function(e){return Di(e,t)}},UR.coordinate.degreesToStringHDMS=bi,UR.coordinate.distance=Ai,UR.coordinate.equals=Ii,UR.coordinate.format=Pi,UR.coordinate.getWorldsAway=ki,UR.coordinate.rotate=Li,UR.coordinate.scale=Fi,UR.coordinate.squaredDistance=Mi,UR.coordinate.squaredDistanceToSegment=Oi,UR.coordinate.toStringHDMS=function(t,e){return t?bi("NS",t[1],e)+" "+bi("EW",t[0],e):""},UR.coordinate.toStringXY=Di,UR.coordinate.wrapX=Ni,UR.css={},UR.css.CLASS_COLLAPSED=jo,UR.css.CLASS_CONTROL=Go,UR.css.CLASS_HIDDEN=Oo,UR.css.CLASS_SELECTABLE=Do,UR.css.CLASS_UNSELECTABLE=No,UR.css.CLASS_UNSUPPORTED=ko,UR.css.getFontParameters=zo,UR.dom={},UR.dom.createCanvasContext2D=pt,UR.dom.getSharedCanvasContext2D=_t,UR.dom.outerHeight=vt,UR.dom.outerWidth=xt,UR.dom.releaseCanvas=yt,UR.dom.removeChildren=Et,UR.dom.replaceChildren=wt,UR.dom.replaceNode=St,UR.easing={},UR.easing.easeIn=Q,UR.easing.easeOut=tt,UR.easing.inAndOut=et,UR.easing.linear=it,UR.easing.upAndDown=function(t){return t<.5?et(2*t):1-et(2*(t-.5))},UR.events={},UR.events.Event=t,UR.events.Event.preventDefault=function(t){t.preventDefault()},UR.events.Event.stopPropagation=e,UR.events.SnapEvent={},UR.events.SnapEvent.SnapEvent=Hy,UR.events.Target=x,UR.events.condition={},UR.events.condition.all=gh,UR.events.condition.altKeyOnly=fh,UR.events.condition.altShiftKeysOnly=ph,UR.events.condition.always=yh,UR.events.condition.click=function(t){return t.type==Nl.CLICK},UR.events.condition.doubleClick=function(t){return t.type==Nl.DBLCLICK},UR.events.condition.focus=mh,UR.events.condition.focusWithTabindex=_h,UR.events.condition.mouseActionButton=xh,UR.events.condition.mouseOnly=Rh,UR.events.condition.never=vh,UR.events.condition.noModifierKeys=Eh,UR.events.condition.penOnly=function(t){const e=t.originalEvent;return Ft(void 0!==e,"mapBrowserEvent must originate from a pointer event"),"pen"===e.pointerType},UR.events.condition.platformModifierKey=wh,UR.events.condition.platformModifierKeyOnly=function(t){const e=t.originalEvent;return!e.altKey&&(ht?e.metaKey:e.ctrlKey)&&!e.shiftKey},UR.events.condition.pointerMove=function(t){return"pointermove"==t.type},UR.events.condition.primaryAction=bh,UR.events.condition.shiftKeyOnly=Th,UR.events.condition.singleClick=Sh,UR.events.condition.targetNotEditable=Ch,UR.events.condition.touchOnly=function(t){const e=t.originalEvent;return Ft(void 0!==e,"mapBrowserEvent must originate from a pointer event"),"touch"===e.pointerType},UR.events.listen=A,UR.events.listenOnce=O,UR.events.unlistenByKey=D,UR.expr={},UR.expr.cpu={},UR.expr.cpu.buildExpression=qa,UR.expr.cpu.newEvaluationContext=Ka,UR.expr.expression={},UR.expr.expression.AnyType=La,UR.expr.expression.BooleanType=Ta,UR.expr.expression.CallExpression=ka,UR.expr.expression.ColorType=ba,UR.expr.expression.LiteralExpression=Na,UR.expr.expression.NoneType=0,UR.expr.expression.NumberArrayType=Pa,UR.expr.expression.NumberType=Ca,UR.expr.expression.Ops=Ua,UR.expr.expression.SizeType=Ia,UR.expr.expression.StringType=Ra,UR.expr.expression.computeGeometryType=Ha,UR.expr.expression.includesType=Oa,UR.expr.expression.isType=Da,UR.expr.expression.newParsingContext=Ga,UR.expr.expression.overlapsType=function(t,e){return!!(t&e)},UR.expr.expression.parse=ja,UR.expr.expression.typeName=Aa,UR.expr.gpu={},UR.expr.gpu.PALETTE_TEXTURE_ARRAY=Vp,UR.expr.gpu.arrayToGlsl=Op,UR.expr.gpu.buildExpression=$p,UR.expr.gpu.colorToGlsl=Dp,UR.expr.gpu.getStringNumberEquivalent=jp,UR.expr.gpu.newCompilationContext=zp,UR.expr.gpu.numberToGlsl=Ap,UR.expr.gpu.sizeToGlsl=Np,UR.expr.gpu.stringToGlsl=Up,UR.expr.gpu.uniformNameForVariable=Bp,UR.extent={},UR.extent.applyTransform=De,UR.extent.approximatelyEquals=ce,UR.extent.boundingExtent=Kt,UR.extent.buffer=qt,UR.extent.clone=Jt,UR.extent.closestSquaredDistanceXY=Qt,UR.extent.containsCoordinate=te,UR.extent.containsExtent=ee,UR.extent.containsXY=ie,UR.extent.coordinateRelationship=ne,UR.extent.createEmpty=re,UR.extent.createOrUpdate=se,UR.extent.createOrUpdateEmpty=oe,UR.extent.createOrUpdateFromCoordinate=ae,UR.extent.createOrUpdateFromCoordinates=function(t,e){return ge(oe(e),t)},UR.extent.createOrUpdateFromFlatCoordinates=le,UR.extent.createOrUpdateFromRings=function(t,e){return pe(oe(e),t)},UR.extent.equals=he,UR.extent.extend=ue,UR.extent.extendCoordinate=de,UR.extent.extendCoordinates=ge,UR.extent.extendFlatCoordinates=fe,UR.extent.extendRings=pe,UR.extent.extendXY=me,UR.extent.forEachCorner=_e,UR.extent.getArea=ye,UR.extent.getBottomLeft=xe,UR.extent.getBottomRight=ve,UR.extent.getCenter=Se,UR.extent.getCorner=Ee,UR.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)},UR.extent.getForViewAndSize=we,UR.extent.getHeight=Ce,UR.extent.getIntersection=Re,UR.extent.getIntersectionArea=function(t,e){return ye(Re(t,e))},UR.extent.getMargin=function(t){return Ie(t)+Ce(t)},UR.extent.getRotatedViewport=Te,UR.extent.getSize=function(t){return[t[2]-t[0],t[3]-t[1]]},UR.extent.getTopLeft=be,UR.extent.getTopRight=Pe,UR.extent.getWidth=Ie,UR.extent.intersects=Le,UR.extent.intersectsSegment=Oe,UR.extent.isEmpty=Fe,UR.extent.returnOrUpdate=Me,UR.extent.scaleFromCenter=Ae,UR.extent.wrapAndSliceX=ke,UR.extent.wrapX=Ne,UR.featureloader={},UR.featureloader.loadFeaturesXhr=yc,UR.featureloader.setWithCredentials=function(t){_c=t},UR.featureloader.xhr=xc,UR.format={},UR.format.EsriJSON=class extends hx{constructor(t){t=t||{},super(),this.geometryName_=t.geometryName}readFeatureFromObject(t,e,i){const n=t,r=gx(n.geometry,e),s=new Mt;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 gx(t,e)}readProjectionFromObject(t){if(t.spatialReference&&void 0!==t.spatialReference.wkid){return Qi("EPSG:"+t.spatialReference.wkid)}return null}writeGeometryObject(t,e){return mx(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=mx(r,e);const s=e&&(e.dataProjection||e.featureProjection);s&&(i.geometry.spatialReference={wkid:Number(Qi(s).getCode().split(":").pop())}),delete n[t.getGeometryName()]}return y(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}}},UR.format.Feature=nx,UR.format.Feature.createGeometry=lx,UR.format.Feature.createRenderFeature=ax,UR.format.Feature.transformExtentWithOptions=sx,UR.format.Feature.transformGeometryWithOptions=rx,UR.format.GML=Bx,UR.format.GML2=kx,UR.format.GML3=Ux,UR.format.GML32=zx,UR.format.GMLBase=vx,UR.format.GMLBase.GMLNS=yx,UR.format.GPX=class extends _x{constructor(t){super(),t=t||{},this.dataProjection=Qi("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)}}readMetadata(t){return t?"string"==typeof t?this.readMetadataFromDocument(Jg(t)):Kg(t)?this.readMetadataFromDocument(t):this.readMetadataFromNode(t):null}readMetadataFromDocument(t){for(let e=t.firstChild;e;e=e.nextSibling)if(e.nodeType===Node.ELEMENT_NODE){const t=this.readMetadataFromNode(e);if(t)return t}return null}readMetadataFromNode(t){if(!Xx.includes(t.namespaceURI))return null;for(let e=t.firstElementChild;e;e=e.nextElementSibling)if(Xx.includes(e.namespaceURI)&&"metadata"===e.localName)return df({},Yx,e,[]);return null}readFeatureFromNode(t,e){if(!Xx.includes(t.namespaceURI))return null;const i=Vx[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(!Xx.includes(t.namespaceURI))return[];if("gpx"==t.localName){const i=df([],$x,t,[this.getReadOptions(t,e)]);return i?(this.handleReadExtensions_(i),i):[]}return[]}writeFeaturesNode(t,e){e=this.adaptOptions(e);const i=Zg("http://www.topografix.com/GPX/1/1","gpx");return i.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xsi",Wg),i.setAttributeNS(Wg,"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"),ff({node:i},Kx,pv,t,[e]),i}},UR.format.GeoJSON=class extends hx{constructor(t){t=t||{},super(),this.dataProjection=Qi(t.dataProjection?t.dataProjection:"EPSG:4326"),t.featureProjection&&(this.defaultFeatureProjection=Qi(t.featureProjection)),t.featureClass&&(this.featureClass=t.featureClass),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=Cv(i.geometry);if(this.featureClass===zu)return ax({geometry:n,id:i.id,properties:i.properties},e);const r=new Mt;return this.geometryName_?r.setGeometryName(this.geometryName_):this.extractGeometryName_&&i.geometry_name&&r.setGeometryName(i.geometry_name),r.setGeometry(lx(n,e)),"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){const r=this.readFeatureFromObject(n[t],e);r&&i.push(r)}}else i=[this.readFeatureFromObject(t,e)];return i.flat()}readGeometryFromObject(t,e){return function(t,e){const i=Cv(t);return lx(i,e)}(t,e)}readProjectionFromObject(t){const e=t.crs;let i;if(e)if("name"==e.type)i=Qi(e.properties.name);else{if("EPSG"!==e.type)throw new Error("Unknown SRS type");i=Qi("EPSG:"+e.properties.code)}else i=this.dataProjection;return 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=Rv(s,e),delete r[t.getGeometryName()]),y(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 Rv(t,this.adaptOptions(e))}},UR.format.IGC=class extends bv{constructor(t){super(),t=t||{},this.dataProjection=Qi("EPSG:4326"),this.altitudeMode_=t.altitudeMode?t.altitudeMode:"none",this.lad_=!1,this.lod_=!1,this.ladStart_=0,this.ladStop_=0,this.lodStart_=0,this.lodStop_=0}readFeatureFromText(t,e){const i=this.altitudeMode_,n=t.split(Av),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=Iv.exec(t),e){const n=parseInt(e[1],10),r=parseInt(e[2],10),o=parseInt(e[3],10);let a=parseInt(e[4],10)+parseInt(e[5],10)/6e4;this.lad_&&(a+=parseInt(t.slice(this.ladStart_,this.ladStop_),10)/6e4/10**(this.ladStop_-this.ladStart_)),"S"==e[6]&&(a=-a);let d=parseInt(e[7],10)+parseInt(e[8],10)/6e4;if(this.lod_&&(d+=parseInt(t.slice(this.lodStart_,this.lodStop_),10)/6e4/10**(this.lodStop_-this.lodStart_)),"W"==e[9]&&(d=-d),s.push(d,a),"none"!=i){let t;t="gps"==i?parseInt(e[11],10):"barometric"==i?parseInt(e[12],10):0,s.push(t)}let g=Date.UTC(l,h,c,n,r,o);g<u&&(g=Date.UTC(l,h,c+1,n,r,o)),s.push(g/1e3),u=g}}else if("H"==t.charAt(0))e=Mv.exec(t),e?(c=parseInt(e[1],10),h=parseInt(e[2],10)-1,l=2e3+parseInt(e[3],10)):(e=Fv.exec(t),e?(c=parseInt(e[1],10),h=parseInt(e[2],10)-1,l=2e3+parseInt(e[3],10)):(e=Lv.exec(t),e&&(r[e[1]]=e[2].trim())));else if("I"==t.charAt(0)){const e=parseInt(t.slice(1,3),10);for(let i=0;i<e;i++){const e=t.slice(7+7*i,10+7*i);if("LAD"===e||"LOD"===e){const n=parseInt(t.slice(3+7*i,5+7*i),10)-1,r=parseInt(t.slice(5+7*i,7+7*i),10);"LAD"===e?(this.lad_=!0,this.ladStart_=n,this.ladStop_=r):"LOD"===e&&(this.lod_=!0,this.lodStart_=n,this.lodStop_=r)}}}}if(0===s.length)return null;const d=new Nu(s,"none"==i?"XYM":"XYZM"),g=new Mt(rx(d,!1,e));return g.setProperties(r,!0),g}readFeaturesFromText(t,e){const i=this.readFeatureFromText(t,e);return i?[i]:[]}},UR.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 pd;case"http://iiif.io/api/image/2/context.json":return md;case"http://iiif.io/api/image/3/context.json":return _d;case"ol-no-context":if(this.getComplianceLevelEntryFromProfile(pd)&&this.imageInfo.identifier)return pd}Ft(!1,"Cannot determine IIIF Image API version from provided image information JSON")}getComplianceLevelEntryFromProfile(t){if(void 0!==this.imageInfo&&void 0!==this.imageInfo.profile)switch(void 0===t&&(t=this.getImageApiVersion()),t){case pd:if(xd.test(this.imageInfo.profile))return this.imageInfo.profile;break;case _d:if(Sd.test(this.imageInfo.profile))return this.imageInfo.profile;break;case md:if("string"==typeof this.imageInfo.profile&&vd.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]&&vd.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?yd.none.none:yd[t][e]}getTileSourceOptions(t){const e=t||{},i=this.getImageApiVersion();if(void 0===i)return;const n=void 0===i?void 0:Ed[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}},UR.format.JSONFeature=hx,UR.format.KML=class extends _x{constructor(t){super(),t=t||{},rS||(Vv=[255,255,255,1],Kv=new da({color:Vv}),$v=[20,2],Wv="pixels",Zv="pixels",Yv=[64,64],Hv="https://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png",Jv=new Sa({anchor:$v,anchorOrigin:"bottom-left",anchorXUnits:Wv,anchorYUnits:Zv,crossOrigin:"anonymous",rotation:0,scale:sS(Yv),size:Yv,src:Hv}),qv="NO_IMAGE",tS=new ga({color:Vv,width:1}),Qv=new ga({color:[51,51,51,1],width:2}),eS=new Ea({font:"bold 16px Helvetica",fill:Kv,stroke:Qv,scale:.8}),iS=new fa({fill:Kv,image:Jv,text:eS,stroke:tS,zIndex:0}),rS=[iS]),this.dataProjection=Qi("EPSG:4326"),this.defaultStyle_=t.defaultStyle?t.defaultStyle:rS,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:oS,this.supportedMediaTypes=["application/vnd.google-earth.kml+xml"]}readDocumentOrFolder_(t,e){const i=df([],cf(Dv,{Document:Qg(this.readDocumentOrFolder_,this),Folder:Qg(this.readDocumentOrFolder_,this),Placemark:tf(this.readPlacemark_,this),Style:this.readSharedStyle_.bind(this),StyleMap:this.readSharedStyleMap_.bind(this)}),t,e,this);if(i)return i}readPlacemark_(t,e){const i=df({geometry:null},kv,t,e,this);if(!i)return;const n=new Mt,r=t.getAttribute("id");null!==r&&n.setId(r);const s=e[0],o=i.geometry;if(o&&rx(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 Lu)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)&&(nS||(nS=document.createElement("textarea")),nS.innerHTML=l,l=nS.value));let c=i;if(t?c=t:e&&(c=aS(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()||eS.getFont()),s.setScale(s.getScale()||eS.getScale()),s.setFill(s.getFill()||eS.getFill()),s.setStroke(s.getStroke()||Qv)):s=eS.clone();s.setText(e),s.setOffsetX(i[0]),s.setOffsetY(i[1]),s.setTextAlign(n);const o=new fa({image:r,text:s});return o}(c[0],l);if(h.length>0){t.setGeometry(new Lu(h));return[t,new fa({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=NS.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=fS.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(!Dv.includes(t.namespaceURI))return null;const i=this.readPlacemark_(t,[this.getReadOptions(t,e)]);return i||null}readFeaturesFromNode(t,e){if(!Dv.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&&h(i,t)}return i}return[]}readName(t){if(t){if("string"==typeof t){const e=Jg(t);return this.readNameFromDocument(e)}return Kg(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(Dv.includes(e.namespaceURI)&&"name"==e.localName)return Px(e);for(let e=t.firstElementChild;e;e=e.nextElementSibling){const t=e.localName;if(Dv.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=Jg(t);h(e,this.readNetworkLinksFromDocument(i))}else Kg(t)?h(e,this.readNetworkLinksFromDocument(t)):h(e,this.readNetworkLinksFromNode(t));return e}readNetworkLinksFromDocument(t){const e=[];for(let i=t.firstChild;i;i=i.nextSibling)i.nodeType==Node.ELEMENT_NODE&&h(e,this.readNetworkLinksFromNode(i));return e}readNetworkLinksFromNode(t){const e=[];for(let i=t.firstElementChild;i;i=i.nextElementSibling)if(Dv.includes(i.namespaceURI)&&"NetworkLink"==i.localName){const t=df({},Gv,i,[]);e.push(t)}for(let i=t.firstElementChild;i;i=i.nextElementSibling){const t=i.localName;!Dv.includes(i.namespaceURI)||"Document"!=t&&"Folder"!=t&&"kml"!=t||h(e,this.readNetworkLinksFromNode(i))}return e}readRegion(t){const e=[];if("string"==typeof t){const i=Jg(t);h(e,this.readRegionFromDocument(i))}else Kg(t)?h(e,this.readRegionFromDocument(t)):h(e,this.readRegionFromNode(t));return e}readRegionFromDocument(t){const e=[];for(let i=t.firstChild;i;i=i.nextSibling)i.nodeType==Node.ELEMENT_NODE&&h(e,this.readRegionFromNode(i));return e}readRegionFromNode(t){const e=[];for(let i=t.firstElementChild;i;i=i.nextElementSibling)if(Dv.includes(i.namespaceURI)&&"Region"==i.localName){const t=df({},Bv,i,[]);e.push(t)}for(let i=t.firstElementChild;i;i=i.nextElementSibling){const t=i.localName;!Dv.includes(i.namespaceURI)||"Document"!=t&&"Folder"!=t&&"kml"!=t||h(e,this.readRegionFromNode(i))}return e}readCamera(t){const e=[];if("string"==typeof t){const i=Jg(t);h(e,this.readCameraFromDocument(i))}else Kg(t)?h(e,this.readCameraFromDocument(t)):h(e,this.readCameraFromNode(t));return e}readCameraFromDocument(t){const e=[];for(let i=t.firstChild;i;i=i.nextSibling)i.nodeType===Node.ELEMENT_NODE&&h(e,this.readCameraFromNode(i));return e}readCameraFromNode(t){const e=[];for(let i=t.firstElementChild;i;i=i.nextElementSibling)if(Dv.includes(i.namespaceURI)&&"Camera"===i.localName){const t=df({},Uv,i,[]);e.push(t)}for(let i=t.firstElementChild;i;i=i.nextElementSibling){const t=i.localName;!Dv.includes(i.namespaceURI)||"Document"!==t&&"Folder"!==t&&"Placemark"!==t&&"kml"!==t||h(e,this.readCameraFromNode(i))}return e}writeFeaturesNode(t,e){e=this.adaptOptions(e);const i=Zg(Dv[4],"kml"),n="http://www.w3.org/2000/xmlns/";i.setAttributeNS(n,"xmlns:gx",Ov[0]),i.setAttributeNS(n,"xmlns:xsi",Wg),i.setAttributeNS(Wg,"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=zv[i.namespaceURI],a=hf(s,o);return ff(r,Xv,lf,a,[e],o,this),i}},UR.format.KML.getDefaultFillStyle=function(){return Kv},UR.format.KML.getDefaultImageStyle=function(){return Jv},UR.format.KML.getDefaultStrokeStyle=function(){return tS},UR.format.KML.getDefaultStyle=function(){return iS},UR.format.KML.getDefaultStyleArray=function(){return rS},UR.format.KML.getDefaultTextStyle=function(){return eS},UR.format.KML.readFlatCoordinates=hS,UR.format.MVT=class extends nx{constructor(t){super(),t=t||{},this.dataProjection=new Be({code:"",units:"tile-pixels"}),this.featureClass=t.featureClass?t.featureClass:zu,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}if(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;else{if(7!==s)throw new Error("Invalid command found in the PBF");h>c&&(i.push(i[c],i[c+1]),h+=2)}}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===zu)r=new this.featureClass(h,a,l,2,s,o),r.transform(i.dataProjection);else{let t;if("Polygon"==h){const e=Tr(a,l);t=e.length>1?new Uu(a,"XY",e):new Cr(a,"XY",l)}else t="Point"===h?new sr(a,"XY"):"LineString"===h?new Nu(a,"XY"):"MultiPoint"===h?new Gu(a,"XY"):"MultiLineString"===h?new ku(a,"XY",l):null;r=new(0,this.featureClass),this.geometryName_&&r.setGeometryName(this.geometryName_);const e=rx(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=Qi((e=this.adaptOptions(e)).dataProjection);n.setWorldExtent(e.extent),e.dataProjection=n;const r=new kE(t),s=r.readFields(HE,{}),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=JE(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}},UR.format.OSMXML=class extends _x{constructor(){super(),this.dataProjection=Qi("EPSG:4326")}readFeaturesFromNode(t,e){if(e=this.getReadOptions(t,e),"osm"==t.localName){const i=df({nodes:{},ways:[],features:[]},ew,t,[e]);for(let t=0;t<i.ways.length;t++){const n=i.ways[t],r=n.flatCoordinates;if(!r.length)for(let t=0,e=n.ndrefs.length;t<e;t++){h(r,i.nodes[n.ndrefs[t]])}let s;s=n.ndrefs[0]==n.ndrefs[n.ndrefs.length-1]?new Cr(r,"XY",[r.length]):new Nu(r,"XY"),rx(s,!1,e);const o=new Mt(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[]}},UR.format.OWS=hw,UR.format.Polyline=class extends bv{constructor(t){super(),t=t||{},this.dataProjection=Qi("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 Mt(i)}readFeaturesFromText(t,e){return[this.readFeatureFromText(t,e)]}readGeometryFromText(t,e){const i=Mn(this.geometryLayout_),n=Tw(t,i,this.factor_);ix(n,0,n.length,i,n);const r=Jn(n,0,n.length,i);return rx(new Nu(r,this.geometryLayout_),!1,this.adaptOptions(e))}writeFeatureText(t,e){const i=t.getGeometry();if(i)return this.writeGeometryText(i,e);throw new Error("Expected `feature` to have a geometry")}writeFeaturesText(t,e){return this.writeFeatureText(t[0],e)}writeGeometryText(t,e){const i=(t=rx(t,!0,this.adaptOptions(e))).getFlatCoordinates(),n=t.getStride();return ix(i,0,i.length,n,i),ww(i,n,this.factor_)}},UR.format.Polyline.decodeDeltas=Tw,UR.format.Polyline.decodeFloats=Rw,UR.format.Polyline.decodeSignedIntegers=Pw,UR.format.Polyline.decodeUnsignedIntegers=Lw,UR.format.Polyline.encodeDeltas=ww,UR.format.Polyline.encodeFloats=Cw,UR.format.Polyline.encodeSignedIntegers=bw,UR.format.Polyline.encodeUnsignedInteger=Fw,UR.format.Polyline.encodeUnsignedIntegers=Iw,UR.format.TextFeature=bv,UR.format.TopoJSON=class extends hx{constructor(t){super(),t=t||{},this.layerName_=t.layerName,this.layers_=t.layers?t.layers:null,this.dataProjection=Qi(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)Nw(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,Ow(c,o,r,s,h,t,e))):(c=l[t],a.push(Dw(c,o,r,s,h,t,e))));return a}return[]}readProjectionFromObject(t){return this.dataProjection}},UR.format.WFS=class extends _x{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 ET[this.version_],this.schemaLocation_=t.schemaLocation?t.schemaLocation:ST[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_?uT:this.gmlFormat_.FEATURE_COLLECTION_PARSERS;let s=df([],r,t,n,this.gmlFormat_);return s||(s=[]),s}readTransactionResponse(t){if(t){if("string"==typeof t){const e=Jg(t);return this.readTransactionResponseFromDocument(e)}return Kg(t)?this.readTransactionResponseFromDocument(t):this.readTransactionResponseFromNode(t)}}readFeatureCollectionMetadata(t){if(t){if("string"==typeof t){const e=Jg(t);return this.readFeatureCollectionMetadataFromDocument(e)}return Kg(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=bx(t.getAttribute("numberOfFeatures"));return e.numberOfFeatures=i,df(e,uT,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 df({},gT,t,[])}writeGetFeature(t){const e=Zg(xT[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(Wg,"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:[]}),Ft(Array.isArray(t.featureTypes),"`options.featureTypes` must be an Array"),"string"==typeof t.featureTypes[0]){let n=t.filter;t.bbox&&(Ft(t.geometryName,"`options.geometryName` must also be provided when `options.bbox` is set"),n=this.combineBboxAndFilter(t.geometryName,t.bbox,t.srsName,n)),Object.assign(i,{geometryName:t.geometryName,filter:n}),QT(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}),QT(e,[n.name],[i])}));return e}combineBboxAndFilter(t,e,i,n){const r=cT(t,e,i);return n?hT(n,r):r}writeTransaction(t,e,i,n){const r=[],s=n.version?n.version:this.version_,o=Zg(xT[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(Wg,"xsi:schemaLocation",ST[s]);const l=function(t,e,i,n){const r=n.featurePrefix?n.featurePrefix:mT;let s;"1.0.0"===i?s=2:"1.1.0"===i?s=3:"2.0.0"===i&&(s=3.2);const o=Object.assign({node:t},{version:i,featureNS:n.featureNS,featureType:n.featureType,featurePrefix:r,gmlVersion:s,hasZ:n.hasZ,srsName:n.srsName},e);return o}(o,a,s,n);return t&&wT("Insert",t,r,l),e&&wT("Update",e,r,l),i&&wT("Delete",i,r,l),n.nativeElements&&wT("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),Qi(t.pop().srsName)}return null}},UR.format.WFS.writeFilter=function(t,e){const i=Zg(tC(e=e||"1.1.0"),"Filter"),n={node:i};return Object.assign(n,{version:e,filter:t}),GT(i,t,[n]),i},UR.format.WKB=class extends nx{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 Mt({geometry:this.readGeometry(t,e)})}readFeatures(t,e){let i=[];const n=this.readGeometry(t,e);return i=this.splitCollection&&n instanceof Lu?n.getGeometriesArray():[n],i.map((t=>new Mt({geometry:t})))}readGeometry(t,e){const i=gC(t);if(!i)return null;const n=new uC(i).readGeometry();return this.viewCache_=i,e=this.getReadOptions(t,e),this.viewCache_=null,rx(n,!1,e)}readProjection(t){const e=this.viewCache_||gC(t);if(!e)return;const i=new uC(e);return i.readWkbHeader(),i.getSrid()&&Qi("EPSG:"+i.getSrid())||void 0}writeFeature(t,e){return this.writeGeometry(t.getGeometry(),e)}writeFeatures(t,e){return this.writeGeometry(new Lu(t.map((t=>t.getGeometry()))),e)}writeGeometry(t,e){e=this.adaptOptions(e);const i=new dC({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&&Qi(e.dataProjection);if(t){const e=t.getCode();e.startsWith("EPSG:")&&(n=Number(e.substring(5)))}}i.writeGeometry(rx(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}},UR.format.WKT=class extends bv{constructor(t){super(),t=t||{},this.splitCollection_=void 0!==t.splitCollection&&t.splitCollection}parse_(t){const e=new RC(t);return new bC(e).parse()}readFeatureFromText(t,e){const i=this.readGeometryFromText(t,e),n=new Mt;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 Mt;e.setGeometry(i[t]),r.push(e)}return r}readGeometryFromText(t,e){return rx(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 Lu(i);return this.writeGeometryText(n,e)}writeGeometryText(t,e){return MC(rx(t,!0,e))}},UR.format.WMSCapabilities=class extends rw{constructor(){super(),this.version=void 0}readFromNode(t){this.version=t.getAttribute("version").trim();const e=df({version:this.version},DC,t,[]);return e||null}},UR.format.WMSGetFeatureInfo=class extends _x{constructor(t){super(),t=t||{},this.featureNS_="http://mapserver.gis.umn.edu/mapserver",this.gmlFormat_=new kx,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 c=l+"_feature";o.featureType=c,o.featureNS=this.featureNS_;const u={};u[c]=tf(this.gmlFormat_.readFeatureElement,this.gmlFormat_);const d=cf([o.featureNS,null],u);s.setAttribute("namespaceURI",this.featureNS_);const g=df([],d,s,e,this.gmlFormat_);g&&h(n,g)}if("FeatureCollection"==i){const e=df([],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])}},UR.format.WMTSCapabilities=class extends rw{constructor(){super(),this.owsParser_=new hw}readFromNode(t){let e=t.getAttribute("version");e&&(e=e.trim());let i=this.owsParser_.readFromNode(t);return i?(i.version=e,i=df(i,dR,t,[]),i||null):null}},UR.format.XML=rw,UR.format.XMLFeature=_x,UR.format.filter={},UR.format.filter.And=Uw,UR.format.filter.Bbox=Bw,UR.format.filter.Comparison=Ww,UR.format.filter.ComparisonBinary=Yw,UR.format.filter.Contains=Xw,UR.format.filter.DWithin=Vw,UR.format.filter.Disjoint=$w,UR.format.filter.During=Zw,UR.format.filter.EqualTo=Hw,UR.format.filter.Filter=Gw,UR.format.filter.GreaterThan=Kw,UR.format.filter.GreaterThanOrEqualTo=qw,UR.format.filter.Intersects=Jw,UR.format.filter.IsBetween=Qw,UR.format.filter.IsLike=tT,UR.format.filter.IsNull=eT,UR.format.filter.LessThan=iT,UR.format.filter.LessThanOrEqualTo=nT,UR.format.filter.LogicalNary=jw,UR.format.filter.Not=rT,UR.format.filter.NotEqualTo=sT,UR.format.filter.Or=oT,UR.format.filter.ResourceId=aT,UR.format.filter.Spatial=zw,UR.format.filter.Within=lT,UR.format.filter.and=hT,UR.format.filter.bbox=cT,UR.format.filter.between=function(t,e,i){return new Qw(t,e,i)},UR.format.filter.contains=function(t,e,i){return new Xw(t,e,i)},UR.format.filter.disjoint=function(t,e,i){return new $w(t,e,i)},UR.format.filter.during=function(t,e,i){return new Zw(t,e,i)},UR.format.filter.dwithin=function(t,e,i,n,r){return new Vw(t,e,i,n,r)},UR.format.filter.equalTo=function(t,e,i){return new Hw(t,e,i)},UR.format.filter.greaterThan=function(t,e){return new Kw(t,e)},UR.format.filter.greaterThanOrEqualTo=function(t,e){return new qw(t,e)},UR.format.filter.intersects=function(t,e,i){return new Jw(t,e,i)},UR.format.filter.isNull=function(t){return new eT(t)},UR.format.filter.lessThan=function(t,e){return new iT(t,e)},UR.format.filter.lessThanOrEqualTo=function(t,e){return new nT(t,e)},UR.format.filter.like=function(t,e,i,n,r,s){return new tT(t,e,i,n,r,s)},UR.format.filter.not=function(t){return new rT(t)},UR.format.filter.notEqualTo=function(t,e,i){return new sT(t,e,i)},UR.format.filter.or=function(t){const e=[null].concat(Array.prototype.slice.call(arguments));return new(Function.prototype.bind.apply(oT,e))},UR.format.filter.resourceId=function(t){return new aT(t)},UR.format.filter.within=function(t,e,i){return new lT(t,e,i)},UR.format.xlink={},UR.format.xlink.readHref=ow,UR.format.xsd={},UR.format.xsd.readBoolean=Sx,UR.format.xsd.readBooleanString=Ex,UR.format.xsd.readDateTime=wx,UR.format.xsd.readDecimal=Tx,UR.format.xsd.readDecimalString=Cx,UR.format.xsd.readNonNegativeIntegerString=bx,UR.format.xsd.readPositiveInteger=Rx,UR.format.xsd.readString=Px,UR.format.xsd.writeBooleanTextNode=Ix,UR.format.xsd.writeCDATASection=Lx,UR.format.xsd.writeDateTimeTextNode=Fx,UR.format.xsd.writeDecimalTextNode=Mx,UR.format.xsd.writeNonNegativeIntegerTextNode=Ax,UR.format.xsd.writeStringTextNode=Ox,UR.functions={},UR.functions.FALSE=g,UR.functions.TRUE=d,UR.functions.VOID=f,UR.functions.memoizeOne=p,UR.functions.toPromise=m,UR.geom={},UR.geom.Circle=Iu,UR.geom.Geometry=In,UR.geom.GeometryCollection=Lu,UR.geom.LineString=Nu,UR.geom.LinearRing=rr,UR.geom.MultiLineString=ku,UR.geom.MultiPoint=Gu,UR.geom.MultiPolygon=Uu,UR.geom.Point=sr,UR.geom.Polygon=Cr,UR.geom.Polygon.circular=Rr,UR.geom.Polygon.fromCircle=Pr,UR.geom.Polygon.fromExtent=br,UR.geom.Polygon.makeRegular=Ir,UR.geom.SimpleGeometry=Ln,UR.geom.SimpleGeometry.getLayoutForStride=Fn,UR.geom.SimpleGeometry.getStrideForLayout=Mn,UR.geom.SimpleGeometry.transformGeom2D=An,UR.geom.flat={},UR.geom.flat.area={},UR.geom.flat.area.linearRing=er,UR.geom.flat.area.linearRings=ir,UR.geom.flat.area.linearRingss=nr,UR.geom.flat.center={},UR.geom.flat.center.linearRingss=ju,UR.geom.flat.closest={},UR.geom.flat.closest.arrayMaxSquaredDelta=Nn,UR.geom.flat.closest.assignClosestArrayPoint=jn,UR.geom.flat.closest.assignClosestMultiArrayPoint=Un,UR.geom.flat.closest.assignClosestPoint=Gn,UR.geom.flat.closest.maxSquaredDelta=Dn,UR.geom.flat.closest.multiArrayMaxSquaredDelta=kn,UR.geom.flat.contains={},UR.geom.flat.contains.linearRingContainsExtent=or,UR.geom.flat.contains.linearRingContainsXY=ar,UR.geom.flat.contains.linearRingsContainsXY=lr,UR.geom.flat.contains.linearRingssContainsXY=hr,UR.geom.flat.deflate={},UR.geom.flat.deflate.deflateCoordinate=Bn,UR.geom.flat.deflate.deflateCoordinates=zn,UR.geom.flat.deflate.deflateCoordinatesArray=Xn,UR.geom.flat.deflate.deflateMultiCoordinatesArray=Vn,UR.geom.flat.flip={},UR.geom.flat.flip.flipXY=ix,UR.geom.flat.geodesic={},UR.geom.flat.geodesic.greatCircleArc=function(t,e,i,n,r,s){const o=Qi("EPSG:4326"),a=Math.cos(pi(e)),l=Math.sin(pi(e)),h=Math.cos(pi(n)),c=Math.sin(pi(n)),u=Math.cos(pi(i-t)),d=Math.sin(pi(i-t)),g=l*c+a*h*u;return Q_((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[fi(pi(t)+Math.atan2(Math.sin(m)*o*a,s-l*Math.sin(_))),fi(_)]}),cn(o,r),s)},UR.geom.flat.geodesic.meridian=ty,UR.geom.flat.geodesic.parallel=ey,UR.geom.flat.inflate={},UR.geom.flat.inflate.inflateCoordinates=Jn,UR.geom.flat.inflate.inflateCoordinatesArray=Qn,UR.geom.flat.inflate.inflateMultiCoordinatesArray=tr,UR.geom.flat.interiorpoint={},UR.geom.flat.interiorpoint.getInteriorPointOfArray=cr,UR.geom.flat.interiorpoint.getInteriorPointsOfMultiArray=ur,UR.geom.flat.interpolate={},UR.geom.flat.interpolate.interpolatePoint=Mu,UR.geom.flat.interpolate.lineStringCoordinateAtM=Au,UR.geom.flat.interpolate.lineStringsCoordinateAtM=Ou,UR.geom.flat.intersectsextent={},UR.geom.flat.intersectsextent.intersectsLineString=gr,UR.geom.flat.intersectsextent.intersectsLineStringArray=fr,UR.geom.flat.intersectsextent.intersectsLinearRing=pr,UR.geom.flat.intersectsextent.intersectsLinearRingArray=mr,UR.geom.flat.intersectsextent.intersectsLinearRingMultiArray=_r,UR.geom.flat.length={},UR.geom.flat.length.lineStringLength=Du,UR.geom.flat.length.linearRingLength=function(t,e,i,n){let r=Du(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},UR.geom.flat.orient={},UR.geom.flat.orient.inflateEnds=Tr,UR.geom.flat.orient.linearRingIsClockwise=xr,UR.geom.flat.orient.linearRingsAreOriented=vr,UR.geom.flat.orient.linearRingssAreOriented=Sr,UR.geom.flat.orient.orientLinearRings=Er,UR.geom.flat.orient.orientLinearRingsArray=wr,UR.geom.flat.reverse={},UR.geom.flat.reverse.coordinates=yr,UR.geom.flat.segments={},UR.geom.flat.segments.forEach=dr,UR.geom.flat.simplify={},UR.geom.flat.simplify.douglasPeucker=$n,UR.geom.flat.simplify.douglasPeuckerArray=Wn,UR.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=Wn(t,e,h,n,r,s,o,c),a.push(c),e=h[h.length-1]}return o},UR.geom.flat.simplify.quantize=Hn,UR.geom.flat.simplify.quantizeArray=Kn,UR.geom.flat.simplify.quantizeMultiArray=qn,UR.geom.flat.simplify.radialDistance=Zn,UR.geom.flat.simplify.simplifyLineString=function(t,e,i,n,r,s,o){return o=void 0!==o?o:[],s||(i=Zn(t,e,i,n,r,o,0),t=o,e=0,n=2),o.length=$n(t,e,i,n,r,o,0),o},UR.geom.flat.simplify.snap=Yn,UR.geom.flat.straightchunk={},UR.geom.flat.straightchunk.matchingChunk=u_,UR.geom.flat.textpath={},UR.geom.flat.textpath.drawTextOnPath=m_,UR.geom.flat.topology={},UR.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&&!!er(t,e,i,n)},UR.geom.flat.transform={},UR.geom.flat.transform.rotate=Cn,UR.geom.flat.transform.scale=Rn,UR.geom.flat.transform.transform2D=Tn,UR.geom.flat.transform.translate=bn,UR.has={},UR.has.CREATE_IMAGE_BITMAP=gt,UR.has.DEVICE_PIXEL_RATIO=ct,UR.has.FIREFOX=st,UR.has.IMAGE_DECODE=dt,UR.has.MAC=ht,UR.has.PASSIVE_EVENT_LISTENERS=ft,UR.has.SAFARI=ot,UR.has.SAFARI_BUG_237906=at,UR.has.WEBKIT=lt,UR.has.WORKER_OFFSCREEN_CANVAS=ut,UR.interaction={},UR.interaction.DblClickDragZoom=class extends ah{constructor(t){const e=t||{};super(e),e.stopDown&&(this.stopDown=e.stopDown),this.scaleDeltaByPixel_=e.delta?e.delta:.01,this.duration_=void 0!==e.duration?e.duration:250,this.handlingDownUpSequence_=!1,this.handlingDoubleDownSequence_=!1,this.doubleTapTimeoutId_=void 0,this.trackedPointers_={},this.targetPointers=[]}handleEvent(t){if(!t.originalEvent)return!0;let e=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence_){if(t.type==Nl.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==Nl.POINTERUP){const e=this.handleUpEvent(t);this.handlingDownUpSequence_=e}}else if(t.type==Nl.POINTERDOWN)if(this.handlingDoubleDownSequence_){this.handlingDoubleDownSequence_=!1;const i=this.handleDownEvent(t);this.handlingDownUpSequence_=i,e=this.stopDown(i)}else e=this.stopDown(!1),this.waitForDblTap_();return!e}handleDragEvent(t){let e=1;const i=this.targetPointers[0],n=this.down_.originalEvent,r=i.clientY-n.clientY;void 0!==this.lastDistance_&&(e=1-(this.lastDistance_-r)*this.scaleDeltaByPixel_),this.lastDistance_=r,1!=e&&(this.lastScaleDelta_=e);const s=t.map,o=s.getView();s.render(),o.adjustResolutionInternal(e)}handleDownEvent(t){if(1==this.targetPointers.length){const e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.down_=t,this.handlingDownUpSequence_||e.getView().beginInteraction(),!0}return!1}handleUpEvent(t){if(0==this.targetPointers.length){const e=t.map.getView(),i=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,i),this.handlingDownUpSequence_=!1,this.handlingDoubleDownSequence_=!1,!1}return!0}stopDown(t){return t}updateTrackedPointers_(t){if(function(t){const e=t.type;return e===Nl.POINTERDOWN||e===Nl.POINTERDRAG||e===Nl.POINTERUP}(t)){const e=t.originalEvent,i=e.pointerId.toString();t.type==Nl.POINTERUP?delete this.trackedPointers_[i]:(t.type==Nl.POINTERDOWN||i in this.trackedPointers_)&&(this.trackedPointers_[i]=e),this.targetPointers=Object.values(this.trackedPointers_)}}waitForDblTap_(){void 0!==this.doubleTapTimeoutId_?(clearTimeout(this.doubleTapTimeoutId_),this.doubleTapTimeoutId_=void 0):(this.handlingDoubleDownSequence_=!0,this.doubleTapTimeoutId_=setTimeout(this.endInteraction_.bind(this),250))}endInteraction_(){this.handlingDoubleDownSequence_=!1,this.doubleTapTimeoutId_=void 0}},UR.interaction.DoubleClickZoom=ch,UR.interaction.DragAndDrop=class extends ah{constructor(t){t=t||{},super({handleEvent:d}),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?Qi(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=pn(),!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 uy(cy,t,l,s));break}}}registerListeners_(){const t=this.getMap();if(t){const e=this.target?this.target:t.getViewport();this.dropListenKeys_=[A(e,b,this.handleDrop,this),A(e,C,this.handleStop,this),A(e,R,this.handleStop,this),A(e,b,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(D),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(L,this.handleResult_.bind(this,i)),this.readAsBuffer_?n.readAsArrayBuffer(i):n.readAsText(i)}}handleStop(t){t.stopPropagation(),t.preventDefault(),t.dataTransfer.dropEffect="copy"}},UR.interaction.DragAndDrop.DragAndDropEvent=uy,UR.interaction.DragBox=Nh,UR.interaction.DragBox.DragBoxEvent=Dh,UR.interaction.DragPan=Ph,UR.interaction.DragRotate=Ih,UR.interaction.DragRotateAndZoom=class extends uh{constructor(t){super(t=t||{}),this.condition_=t.condition?t.condition:Th,this.lastAngle_=void 0,this.lastMagnitude_=void 0,this.lastScaleDelta_=0,this.duration_=void 0!==t.duration?t.duration:400}handleDragEvent(t){if(!Rh(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(!Rh(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!!Rh(t)&&(!!this.condition_(t)&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,this.lastMagnitude_=void 0,!0))}},UR.interaction.DragZoom=kh,UR.interaction.Draw=class extends uh{constructor(t){const e=t;e.stopDown||(e.stopDown=g),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:d,this.geometryLayout_=t.geometryLayout?t.geometryLayout:"XY";let i=t.geometryFunction;if(!i){const t=this.mode_;if("Circle"===t)i=(t,e,i)=>{const n=e||new Iu([NaN,NaN]),r=_n(t[0],i),s=Mi(r,_n(t[t.length-1],i));n.setCenterAndRadius(r,Math.sqrt(s),this.geometryLayout_);const o=pn();return o&&n.transform(i,o),n};else{let e;"Point"===t?e=sr:"LineString"===t?e=Nu:"Polygon"===t&&(e=Cr),i=(i,n,r)=>(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 J_({source:new Ju({useSpatialIndex:!1,wrapX:!!t.wrapX&&t.wrapX}),style:t.style?t.style:Cy(),updateWhileInteracting:!0}),this.geometryName_=t.geometryName,this.condition_=t.condition?t.condition:Eh,this.freehandCondition_,t.freehand?this.freehandCondition_=yh:this.freehandCondition_=t.freehandCondition?t.freehandCondition:Th,this.traceCondition_,this.setTrace(t.trace||!1),this.traceState_={active:!1},this.traceSource_=t.traceSource||t.source||null,this.addChangeListener(oh,this.updateState_)}setTrace(t){let e;e=t?!0===t?yh:t:vh,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===Nl.POINTERMOVE,i=!0;if(!this.freehand_&&this.lastDragTime_&&t.type===Nl.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===Nl.POINTERDRAG&&null!==this.sketchFeature_?(this.addToDrawing_(t.coordinate),i=!1):this.freehand_&&t.type===Nl.POINTERDOWN?i=!1:e&&this.getPointerCount()<2?(i=t.type===Nl.POINTERMOVE,i&&this.freehand_?(this.handlePointerMove_(t),this.shouldHandle_&&t.originalEvent.preventDefault()):("mouse"===t.originalEvent.pointerType||t.type===Nl.POINTERDRAG&&void 0===this.downTimeout_)&&this.handlePointerMove_(t)):t.type===Nl.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((()=>{this.handlePointerMove_(new Dl(Nl.POINTERMOVE,t.map,t.originalEvent,!1,t.frameState))}),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=Kt([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)xy(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(_y(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(_y(t.coordinates,e))}n.length&&this.appendCoordinates(n)}updateTrace_(t){const e=this.traceState_;if(!e.active)return;if(-1===e.targetIndex&&Ai(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=wy(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=Ty(h.coordinates,l);Ai(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=yy(t,i,n);yy(t,i,n-e)<r&&(l-=e)}else{const r=yy(t,i,n);yy(t,i,n+e)<r&&(l+=e)}}return vy.index=a,vy.endIndex=l,vy}(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=Ty(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 Mt(new sr(t)),this.updateSketchFeatures_()}createOrUpdateCustomSketchLine_(t){this.sketchLine_||(this.sketchLine_=new Mt);const e=t.getLinearRing(0);let i=this.sketchLine_.getGeometry();i?(i.setFlatCoordinates(e.getLayout(),e.getFlatCoordinates()),i.changed()):(i=new Nu(e.getFlatCoordinates(),e.getLayout()),this.sketchLine_.setGeometry(i))}startDrawing_(t){const e=this.getMap().getView().getProjection(),i=Mn(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 Mt(new Nu(this.sketchLineCoords_)));const n=this.geometryFunction_(this.sketchCoords_,void 0,e);this.sketchFeature_=new Mt,this.geometryName_&&this.sketchFeature_.setGeometryName(this.geometryName_),this.sketchFeature_.setGeometry(n),this.updateSketchFeatures_(),this.dispatchEvent(new py(dy,this.sketchFeature_))}modifyDrawing_(t){const e=this.getMap(),i=this.sketchFeature_.getGeometry(),n=e.getView().getProjection(),r=Mn(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_;return"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():this.sketchFeature_}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 null;let e=this.sketchCoords_;const i=t.getGeometry(),n=this.getMap().getView().getProjection();return"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 Gu([e])):"MultiLineString"===this.type_?t.setGeometry(new ku([e])):"MultiPolygon"===this.type_&&t.setGeometry(new Uu([e])),this.dispatchEvent(new py(gy,t)),this.features_&&this.features_.push(t),this.source_&&this.source_.addFeature(t),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 py(fy,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.sketchFeature_=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 Mt(new sr(i)),this.updateSketchFeatures_(),this.dispatchEvent(new py(dy,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)}},UR.interaction.Draw.DrawEvent=py,UR.interaction.Draw.createBox=function(){return function(t,e,i){const n=Kt([t[0],t[t.length-1]].map((function(t){return _n(t,i)}))),r=[[xe(n),ve(n),Pe(n),be(n),xe(n)]];e?e.setCoordinates(r):e=new Cr(r);const s=pn();return s&&e.transform(i,s),e}},UR.interaction.Draw.createRegularPolygon=function(t,e){return function(i,n,r){const s=_n(i[0],r),o=_n(i[i.length-1],r),a=Math.sqrt(Mi(s,o));n=n||Pr(new Iu(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)}Ir(n,s,a,l);const h=pn();return h&&n.transform(r,h),n}},UR.interaction.Extent=class extends uh{constructor(t){super(t=t||{}),this.on,this.once,this.un,this.condition_=t.condition?t.condition:yh,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 J_({source:new Ju({useSpatialIndex:!1,wrapX:!!t.wrapX}),style:t.boxStyle?t.boxStyle:Py(),updateWhileAnimating:!0,updateWhileInteracting:!0}),this.vertexOverlay_=new J_({source:new Ju({useSpatialIndex:!1,wrapX:!!t.wrapX}),style:t.pointerStyle?t.pointerStyle:Iy(),updateWhileAnimating:!0,updateWhileInteracting:!0}),t.extent&&this.setExtent(t.extent)}snapToVertex_(t,e){const i=e.getCoordinateFromPixelInternal(t),n=function(t,e){return Oi(i,t)-Oi(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=Ri(i,o);const l=e.getPixelFromCoordinateInternal(a);if(Ai(t,l)<=this.pixelTolerance_){const t=e.getPixelFromCoordinateInternal(o[0]),i=e.getPixelFromCoordinateInternal(o[1]),n=Mi(l,t),r=Mi(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(br(t)):e.setGeometry(void 0):(e=new Mt(t?br(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 Mt(new sr(t)),this.vertexFeature_=e,this.vertexOverlay_.getSource().addFeature(e);return e}handleEvent(t){return!t.originalEvent||!this.condition_(t)||(t.type!=Nl.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_=Ly(s(r)):null!==t?this.pointerHandler_=Fy(s([t,n[1]]),s([t,n[3]])):null!==e&&(this.pointerHandler_=Fy(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_=Ly(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!==ye(e)||this.setExtent(null),!1}setMap(t){this.extentOverlay_.setMap(t),this.vertexOverlay_.setMap(t),super.setMap(t)}getExtent(){return yn(this.getExtentInternal(),this.getMap().getView().getProjection())}getExtentInternal(){return this.extent_}setExtent(t){this.extent_=t||null,this.createOrUpdateExtentFeature_(t),this.dispatchEvent(new by(this.extent_))}},UR.interaction.Extent.ExtentEvent=by,UR.interaction.Interaction=ah,UR.interaction.Interaction.pan=lh,UR.interaction.Interaction.zoomByDelta=hh,UR.interaction.KeyboardPan=zh,UR.interaction.KeyboardZoom=Xh,UR.interaction.Link=class extends ah{constructor(t){let e;super(),e=!0===(t=Object.assign({animate:!0,params:["x","y","z","r","l"],replace:!1,prefix:""},t||{})).animate?{duration:250}:t.animate?t.animate:null,this.animationOptions_=e,this.params_=t.params.reduce(((t,e)=>(t[e]=!0,t)),{}),this.replace_=t.replace,this.prefix_=t.prefix,this.listenerKeys_=[],this.initial_=!0,this.updateState_=this.updateState_.bind(this),this.trackedCallbacks_={},this.trackedValues_={}}getParamName_(t){return this.prefix_?this.prefix_+t:t}get_(t,e){return t.get(this.getParamName_(e))}set_(t,e,i){e in this.params_&&t.set(this.getParamName_(e),i)}delete_(t,e){e in this.params_&&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(A(t,Vl,this.updateUrl_,this),A(t.getLayerGroup(),v,this.updateUrl_,this),A(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)D(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=new URL(window.location.href).searchParams;for(const e in this.trackedCallbacks_){const i=t.get(e);e in this.trackedCallbacks_&&i!==this.trackedValues_[e]&&(this.trackedValues_[e]=i,this.trackedCallbacks_[e](i))}const e=this.getMap();if(!e)return;const i=e.getView();if(!i)return;let n=!1;const r={},s=My(this.get_(t,"z"));"z"in this.params_&&Oy(s,i.getZoom())&&(n=!0,r.zoom=s);const o=My(this.get_(t,"r"));"r"in this.params_&&Oy(o,i.getRotation())&&(n=!0,r.rotation=o);const a=[My(this.get_(t,"x")),My(this.get_(t,"y"))];var l,h;("x"in this.params_||"y"in this.params_)&&(l=a,h=i.getCenter(),Oy(l[0],h[0])||Oy(l[1],h[1]))&&(n=!0,r.center=a),n&&(!this.initial_&&this.animationOptions_?i.animate(Object.assign(r,this.animationOptions_)):(r.center&&i.setCenter(r.center),"zoom"in r&&i.setZoom(r.zoom),"rotation"in r&&i.setRotation(r.rotation)));const c=e.getAllLayers(),u=this.get_(t,"l");if("l"in this.params_&&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)}}}track(t,e){this.trackedCallbacks_[t]=e;const i=new URL(window.location.href).searchParams.get(t);return this.trackedValues_[t]=i,i}update(t,e){const i=new URL(window.location.href),n=i.searchParams;null===e?n.delete(t):n.set(t,e),t in this.trackedValues_&&(this.trackedValues_[t]=e),this.updateHistory_(i)}updateUrl_(){const t=this.getMap();if(!t)return;const e=t.getView();if(!e)return;const i=e.getCenter(),n=e.getZoom(),r=e.getRotation(),s=t.getAllLayers(),o=new Array(s.length);for(let t=0,e=s.length;t<e;++t)o[t]=s[t].getVisible()?"1":"0";const a=new URL(window.location.href),l=a.searchParams;this.set_(l,"x",Ay(i[0])),this.set_(l,"y",Ay(i[1])),this.set_(l,"z",Ay(n)),this.set_(l,"r",Ay(r)),this.set_(l,"l",o.join("")),this.updateHistory_(a),this.initial_=!1}updateHistory_(t){t.href!==window.location.href&&(this.initial_||this.replace_?window.history.replaceState(history.state,"",t):window.history.pushState(null,"",t))}},UR.interaction.Modify=class extends uh{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:bh,this.defaultDeleteCondition_=function(t){return fh(t)&&Sh(t)},this.deleteCondition_=t.deleteCondition?t.deleteCondition:this.defaultDeleteCondition_,this.insertVertexCondition_=t.insertVertexCondition?t.insertVertexCondition:yh,this.vertexFeature_=null,this.vertexSegments_=null,this.lastPixel_=[0,0],this.ignoreNextSingleClick_=!1,this.featuresBeingModified_=null,this.rBush_=new Pu,this.pixelTolerance_=void 0!==t.pixelTolerance?t.pixelTolerance:10,this.snappedToVertex_=!1,this.changingFeature_=!1,this.dragSegments_=[],this.overlay_=new J_({source:new Ju({useSpatialIndex:!1,wrapX:!!t.wrapX}),style:t.style?t.style:Xy(),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 Z(this.source_.getFeatures()),this.source_.addEventListener(Vu,this.handleSourceAdd_.bind(this)),this.source_.addEventListener(Zu,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(X,this.handleFeatureAdd_.bind(this)),this.features_.addEventListener(V,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(v,this.boundHandleFeatureChange_)}willModifyFeatures_(t,e){if(!this.featuresBeingModified_){this.featuresBeingModified_=new Z;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 jy(ky,this.featuresBeingModified_,t))}}removeFeature_(t){this.removeFeatureSegmentData_(t),this.vertexFeature_&&0===this.features_.getLength()&&(this.overlay_.getSource().removeFeature
2387(this.vertexFeature_),this.vertexFeature_=null),t.removeEventListener(v,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(Kt(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(Kt(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(Kt(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(Kt(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(ae(i),n);let o=e;const a=pn();if(a&&this.getMap()){const t=this.getMap().getView().getProjection();o=o.clone().transform(a,t),o=Pr(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 Mt(new sr(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!=Nl.POINTERMOVE||this.handlingDownUpSequence||this.handlePointerMove_(t),this.vertexFeature_&&this.deleteCondition_(t)&&(e=!(t.type!=Nl.SINGLECLICK||!this.ignoreNextSingleClick_)||this.removePoint()),t.type==Nl.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=Ai(_n(l.getCenter(),i),_n(e,i));const r=pn();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=Kt([s]),a=this.rBush_.getInExtent(o),l={};a.sort(Uy);for(let i=0,o=a.length;i<o;++i){const o=a[i],h=o.segment;let c=U(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(!Ii(h[0],s)||l[c][0])if(!Ii(h[1],s)||l[c][1])U(h)in this.vertexSegments_&&!l[c][0]&&
vendor: 5,550 bytes, line 2387
2387!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{Ii(zy(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(ae(e),r);let o=n;const a=pn();if(a){const e=t.map.getView().getProjection();o=o.clone().transform(a,e),o=Pr(o).transform(e,a)}this.rBush_.update(o.getExtent(),s)}else this.rBush_.update(Kt(i.segment),i)}return this.featuresBeingModified_&&(this.dispatchEvent(new jy(Gy,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 By(n,t,r)-By(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)=>{i&&"Point"===i.getType()&&(i=new sr(mn(i.getCoordinates(),r)));const n=i||t.getGeometry();if(t instanceof Mt&&this.features_.getArray().includes(t)){a=n;const e=t.getGeometry().getFlatCoordinates().slice(0,2);o=[{feature:t,geometry:a,segment:[e,e]}]}return!0}),{layerFilter:i})}if(!o){const t=yn(qt(xn(ae(n,Dy),r),e.getView().getResolution()*this.pixelTolerance_,Dy),r);o=this.rBush_.getInExtent(t)}if(o&&o.length>0){const i=o.sort(s)[0],l=i.segment;let h=zy(n,i,r);const c=e.getPixelFromCoordinate(h);let u=Ai(t,c);if(a||u<=this.pixelTolerance_){const t={};if(t[U(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=Mi(c,n),a=Mi(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[U(i.geometry)]=!0;for(let e=1,i=o.length;e<i;++e){const i=o[e].segment;if(!(Ii(l[0],i[0])&&Ii(l[1],i[1])||Ii(l[0],i[1])&&Ii(l[1],i[0])))break;{const n=U(o[e].geometry);n in d||(d[n]=!0,t[U(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(Kt(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(Kt(c.segment),c),this.dragSegments_.push([c,0]),this.ignoreNextSingleClick_=!0}removePoint(){if(this.lastPointerEvent_&&this.lastPointerEvent_.type!=Nl.POINTERDRAG){const t=this.lastPointerEvent_;this.willModifyFeatures_(t,this.dragSegments_);const e=this.removeVertex_();return this.featuresBeingModified_&&this.dispatchEvent(new jy(Gy,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=U(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(Kt(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||c(r.depth,i))&&r.index>
2387e&&(r.index+=n)}))}},UR.interaction.Modify.ModifyEvent=jy,UR.interaction.MouseWheelZoom=Vh,UR.interaction.PinchRotate=$h,UR.interaction.PinchZoom=Wh,UR.interaction.Pointer=uh,UR.interaction.Pointer.centroid=dh,UR.interaction.Select=Zy,UR.interaction.Select.SelectEvent=$y,UR.interaction.Snap=class extends uh{constructor(t){const e=t=t||{};e.handleDownEvent||(e.handleDownEvent=d),e.stopDown||(e.stopDown=g),super(e),this.on,this.once,this.un,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 Pu,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=U(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(Kt(r[0]),{feature:t,segment:r[0]});else if(r.length>1){const e=r.map((t=>Kt(t))),i=r.map((e=>({feature:t,segment:e})));this.rBush_.load(e,i)}}}e&&(this.featureChangeListenerKeys_[i]=A(t,v,this.handleFeatureChange_,this))}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,this.dispatchEvent(new Hy(Yy,{vertex:t.coordinate,vertexPixel:t.pixel,feature:e.feature,segment:e.segment}))),super.handleEvent(t)}handleFeatureAdd_(t){const e=Ky(t);e&&this.addFeature(e)}handleFeatureRemove_(t){const e=Ky(t);e&&this.removeFeature(e)}handleFeatureChange_(t){const e=t.target;if(this.handlingDownUpSequence){const t=U(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=U(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&&(D(this.featureChangeListenerKeys_[n]),delete this.featureChangeListenerKeys_[n])}setMap(t){const e=this.getMap(),i=this.featuresListenerKeys_,n=this.getFeatures_();e&&(i.forEach(D),i.length=0,this.rBush_.clear(),Object.values(this.featureChangeListenerKeys_).forEach(D),this.featureChangeListenerKeys_={}),super.setMap(t),t&&(this.features_?i.push(A(this.features_,X,this.handleFeatureAdd_,this),A(this.features_,V,this.handleFeatureRemove_,this)):this.source_&&i.push(A(this.source_,Vu,this.handleFeatureAdd_,this),A(this.source_,Zu,this.handleFeatureRemove_,this)),n.forEach((t=>this.addFeature(t))))}snapTo(t,e,i){const n=i.getView().getProjection(),r=_n(e,n),s=yn(qt(Kt([r]),i.getView().getResolution()*this.pixelTolerance_),n),o=this.rBush_.getInExtent(s),a=o.length;if(0===a)return null;let l,h,c=1/0,u=null;const d=this.pixelTolerance_*this.pixelTolerance_,g=()=>{if(l){const e=i.getPixelFromCoordinate(l);if(Mi(t,e)<=d)return{vertex:l,vertexPixel:[Math.round(e[0]),Math.round(e[1])],feature:h,segment:u}}return null};if(this.vertex_){for(let t=0;t<a;++t){const e=o[t];"Circle"!==e.feature.getGeometry().getType()&&e.segment.forEach((t=>{const i=_n(t,n),s=Mi(r,i);s<c&&(l=t,c=s,h=e.feature)}))}const t=g();if(t)return t}if(this.edge_){for(let t=0;t<a;++t){let e=null;const i=o[t];if("Circle"===i.feature.getGeometry().getType()){let t=i.feature.getGeometry();const s=pn();s&&(t=t.clone().transform(s,n)),e=Ci(r,t)}else{const[t,s]=i.segment;s&&(qy[0]=_n(t,n),qy[1]=_n(s,n),e=Ri(r,qy))}if(e){const t=Mi(r,e);t<c&&(l=mn(e,n),u="Circle"===i.feature.getGeometry().getType()?null:i.segment,c=t,h=i.feature)}}const t=g();if(t)return t}return null}
2387updateFeature_(t){this.removeFeature(t,!1),this.addFeature(t,!1)}segmentCircleGeometry_(t,e){const i=this.getMap().getView().getProjection();let n=e;const r=pn();r&&(n=n.clone().transform(r,i));const s=Pr(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))}}},UR.interaction.Translate=class extends uh{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=d;this.layerFilter_=e,this.filter_=t.filter&&!this.features_?t.filter:d,this.hitTolerance_=t.hitTolerance?t.hitTolerance:0,this.condition_=t.condition?t.condition:yh,this.lastFeature_=null,this.addChangeListener(oh,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 Z([this.lastFeature_]);return this.dispatchEvent(new ex(Jy,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 Z([this.lastFeature_]);return this.dispatchEvent(new ex(tx,e,t.coordinate,this.startCoordinate_,t)),this.startCoordinate_=null,!0}return!1}handleDragEvent(t){if(this.lastCoordinate_){const e=t.coordinate,i=t.map.getView().getProjection(),n=_n(e,i),r=_n(this.lastCoordinate_,i),s=n[0]-r[0],o=n[1]-r[1],a=this.features_||new Z([this.lastFeature_]),l=pn();a.forEach((function(t){const e=t.getGeometry();l?(e.transform(l,i),e.translate(s,o),e.transform(i,l)):e.translate(s,o),t.setGeometry(e)})),this.lastCoordinate_=e,this.dispatchEvent(new ex(Qy,a,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,((t,e)=>{if(t instanceof Mt&&this.filter_(t,e)&&(!this.features_||this.features_.getArray().includes(t)))return t}),{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")}}},UR.interaction.Translate.TranslateEvent=ex,UR.interaction.defaults={},UR.interaction.defaults.defaults=Zh,UR.layer={},UR.layer.Base=as,UR.layer.BaseImage=lg,UR.layer.BaseTile=yg,UR.layer.BaseVector=Rl,UR.layer.Flow=q_,UR.layer.Graticule=class extends J_{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:iy,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?bi.bind(this,"EW"):t.lonLabelFormatter,this.latLabelFormatter_=null==t.latLabelFormatter?bi.bind(this,"NS"):t.latLabelFormatter,this.lonLabelPosition_=null==t.lonLabelPosition?0:t.lonLabelPosition,this.latLabelPosition_=null==t.latLabelPosition?1:t.latLabelPosition,this.lonLabelStyleBase_=ne
vendor: 12,294 bytes, line 2387
2387w fa({text:void 0!==t.lonLabelStyle?t.lonLabelStyle.clone():new Ea({font:"12px Calibri,sans-serif",textBaseline:"bottom",fill:new da({color:"rgba(0,0,0,1)"}),stroke:new ga({color:"rgba(255,255,255,1)",width:3})})}),this.lonLabelStyle_=t=>{const e=t.get("graticule_label");return this.lonLabelStyleBase_.getText().setText(e),this.lonLabelStyleBase_},this.latLabelStyleBase_=new fa({text:void 0!==t.latLabelStyle?t.latLabelStyle.clone():new Ea({font:"12px Calibri,sans-serif",textAlign:"right",fill:new da({color:"rgba(0,0,0,1)"}),stroke:new ga({color:"rgba(255,255,255,1)",width:3})})}),this.latLabelStyle_=t=>{const e=t.get("graticule_label");return this.latLabelStyleBase_.getText().setText(e),this.latLabelStyleBase_},this.meridiansLabels_=[],this.parallelsLabels_=[],this.addEventListener(hs,this.drawLabels_.bind(this))),this.intervals_=void 0!==t.intervals?t.intervals:ny,this.setSource(new Ju({loader:this.loaderFunction.bind(this),strategy:this.strategyFunction.bind(this),features:new Z,overlaps:!1,useSpatialIndex:!1,wrapX:t.wrapX})),this.featurePool_=[],this.lineStyle_=new fa({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()&&Ne(i,this.projection_),this.loadedExtent_&&(ce(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=Re(this.getExtent()||[-1/0,-1/0,1/0,1/0],t);if(this.renderedExtent_&&he(this.renderedExtent_,r)&&this.renderedResolution_===e)return;if(this.renderedExtent_=r,this.renderedResolution_=e,Fe(r))return;const s=Se(r),o=e*e/4;(!this.projection_||!ln(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 Mt,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(Le(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 sr([]),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(Le(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 sr([]),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=Se(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=Ie(c);if(this.getSource().getWrapX()&&this.projection_.canWrapX()&&!ee(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=Dc(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=Ie(o);this.getSource().getWrapX()&&this.projection_.canWrapX()&&!ee(o,t)&&(Ie(t)>=a?(t[0]=o[0],t[2]=o[2]):s=!0);const l=[ci(e[0],this.minX_,this.maxX_),ci(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=ci(h[0],this.minLon_,this.maxLon_),u=ci(h[1],this.minLat_,this.maxLat_);const d=this.maxLines_;let g,f,p,m,_=t;s||(_=[ci(t[0],this.minX_,this.maxX_),ci(t[1],this.minY_,this.maxY_),ci(t[2],this.minX_,this.maxX_),ci(t[3],this.minY_,this.maxY_)]);const y=De(_,this.toLonLatTransform_,void 0,8);let x=y[3],v=y[2],S=y[1],E=y[0];if(s||(te(_,this.bottomLeft_)&&(E=this.minLon_,S=this.minLat_),te(_,this.bottomRight_)&&(v=this.maxLon_,S=this.minLat_),te(_,this.topLeft_)&&(E=this.minLon_,x=this.maxLat_),te(_,this.topRight_)&&(v=this.maxLon_,x=this.maxLat_),x=ci(x,u,this.maxLat_),v=ci(v,c,this.maxLon_),S=ci(S,this.minLat_,u),E=ci(E,this.minLon_,c)),c=Math.floor(c/r)*r,m=ci(c,this.minLon_,this.maxLon_),f=this.addMeridian_(m,S,x,n,t,0),g=0,s)for(;(m-=r)>=E&&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=ci(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=ci(u,this.minLat_,this.maxLat_),f=this.addParallel_(p,E,v,n,t,0),g=0;p!=this.minLat_&&g++<d;)p=Math.max(p-r,this.minLat_),f=this.addParallel_(p,E,v,n,t,f);for(p=ci(u,this.minLat_,this.maxLat_),g=0;p!=this.maxLat_&&g++<d;)p=Math.min(p+r,this.maxLat_),f=this.addParallel_(p,E,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=ci(this.intervals_[t]/2,0,90),l=ci(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=ty(t,e,i,this.projection_,n);let o=this.meridians_[r];return o?(o.setFlatCoordinates("XY",s),o.changed()):(o=new Nu(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=ci(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=ey(t,e,i,this.projection_,n);let o=this.parallels_[r];return o?(o.setFlatCoordinates("XY",s),o.changed()):o=new Nu(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=ci(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=Qi("EPSG:4326"),i=t.getWorldExtent();this.maxLat_=i[3],this.maxLon_=i[2],this.minLat_=i[1],this.minLon_=i[0];const n=cn(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_=cn(e,t);const r=De([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_(Se(t.getExtent())),isNaN(this.projectionCenterLonLat_[1])&&(this.projectionCenterLonLat_[1]=Math.abs(this.maxLat_)>=Math.abs(this.minLat_)?this.maxLat_:this.minLat_),this.projection_=t}},UR.layer.Group=Al,UR.layer.Group.GroupEvent=Fl,UR.layer.Heatmap=class extends Rl{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(sy,this.handleGradientChanged_),this.setGradient(t.gradient?t.gradient:ay),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?t=>t.get(i):i,this.setRenderOrder(null)}getBlur(){return this.get(ry)}getGradient(){return this.get(sy)}getRadius(){return this.get(oy)}handleGradientChanged_(){this.gradient_=function(t){const e=1,i=256,n=pt(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(ry,t)}setGradient(t){this.set(sy,t)}setRadius(t){this.set(oy,t)}createRenderer(){const t=(new Jp).addAttribute("float a_prop_weight").addVarying("v_prop_weight","float","a_prop_weight").addUniform("float u_size").addUniform("float u_blurSlope").setSymbolSizeExpression("vec2(u_size)").setSymbolColorExpression("vec4(smoothstep(0., 1., (1. - length(coordsPx * 2. / v_quadSizePx)) * u_blurSlope) * v_prop_weight)");return new Sm(this,{className:this.getClassName(),attributes:[{name:"weight",callback:t=>{const e=this.weightFunction_(t);return void 0!==e?ci(e,0,1):1}}],uniforms:{u_size:()=>2*(this.get(oy)+this.get(ry)),u_blurSlope:()=>this.get(oy)/Math.max(1,this.get(ry))},hitDetectionEnabled:!0,vertexShader:t.getSymbolVertexShader(),fragmentShader:t.getSymbolFragmentShader(),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:()=>this.gradient_,u_opacity:()=>this.getOpacity()}}]})}renderDeclutter(){}},UR.layer.Image=pg,UR.layer.Layer=Ns,UR.layer.Layer.inView=ks,UR.layer.Tile=Tg,UR.layer.Vector=J_,UR.layer.VectorImage=class extends Rl{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 k_(this)}},UR.layer.VectorTile=class extends Rl{constructor(t){t=t||{};const e=Object.assign({},t);delete e.preload;const i=void 0===t.cacheSize?0:t.cacheSize;delete t.cacheSize,delete e.useInterimTilesOnError,super(e),this.on,this.once,this.un,this.cacheSize_=i;const n=t.renderMode||"hybrid";Ft("hybrid"==n||"vector"==n,"`renderMode` must be `'hybrid'` or `'vector'`"),this.renderMode_=n,this.setPreload(t.preload?t.preload:0),this.setUseInterimTilesOnError(void 0===t.useInterimTilesOnError||t.useInterimTilesOnError),this.getBackgroun
2387d,this.setBackground}createRenderer(){return new U_(this,{cacheSize:this.cacheSize_})}getFeatures(t){return super.getFeatures(t)}getFeaturesInExtent(t){return this.getRenderer().getFeaturesInExtent(t)}getRenderMode(){return this.renderMode_}getPreload(){return this.get(mg)}getUseInterimTilesOnError(){return this.get(_g)}setPreload(t){this.set(mg,t)}setUseInterimTilesOnError(t){this.set(_g,t)}},UR.layer.WebGLPoints=class extends Ns{constructor(t){super(Object.assign({},t)),this.parseResult_=cm(t.style),this.styleVariables_=t.style.variables||{},this.hitDetectionDisabled_=!!t.disableHitDetection}createRenderer(){const t=Object.keys(this.parseResult_.attributes).map((t=>({name:t,...this.parseResult_.attributes[t]})));return new Sm(this,{vertexShader:this.parseResult_.builder.getSymbolVertexShader(),fragmentShader:this.parseResult_.builder.getSymbolFragmentShader(),hitDetectionEnabled:!this.hitDetectionDisabled_,uniforms:this.parseResult_.uniforms,attributes:t})}updateStyleVariables(t){Object.assign(this.styleVariables_,t),this.changed()}},UR.layer.WebGLTile=hy,UR.loadingstrategy={},UR.loadingstrategy.all=vc,UR.loadingstrategy.bbox=function(t,e){return[t]},UR.loadingstrategy.tile=function(t){return function(e,i,n){const r=t.getZForResolution(Sn(i,n)),s=t.getTileRangeForExtentAndZ(xn(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(yn(t.getTileCoordExtent(a),n));return o}},UR.math={},UR.math.ceil=Si,UR.math.clamp=ci,UR.math.floor=vi,UR.math.lerp=_i,UR.math.modulo=mi,UR.math.round=xi,UR.math.solveLinearSystem=gi,UR.math.squaredDistance=di,UR.math.squaredSegmentDistance=ui,UR.math.toDegrees=fi,UR.math.toFixed=yi,UR.math.toRadians=pi,UR.net={},UR.net.ClientError=wc,UR.net.ResponseError=Ec,UR.net.getJSON=Tc,UR.net.jsonp=Sc,UR.net.overrideXHR=function(t){"undefined"!=typeof XMLHttpRequest&&(pc=XMLHttpRequest),global.XMLHttpRequest=t},UR.net.resolveUrl=Cc,UR.net.restoreXHR=function(){global.XMLHttpRequest=pc},UR.obj={},UR.obj.clear=_,UR.obj.isEmpty=y,UR.proj={},UR.proj.Projection=Be,UR.proj.Units={},UR.proj.Units.METERS_PER_UNIT=Ue,UR.proj.Units.fromCode=je,UR.proj.addCommon=wn,UR.proj.addCoordinateTransforms=on,UR.proj.addEquivalentProjections=en,UR.proj.addEquivalentTransforms=nn,UR.proj.addProjection=qi,UR.proj.addProjections=Ji,UR.proj.clearAllProjections=function(){ni(),ai()},UR.proj.clearUserProjection=function(){gn=null},UR.proj.cloneTransform=Hi,UR.proj.createProjection=rn,UR.proj.createSafeCoordinateTransform=En,UR.proj.createTransformFromCoordinateTransform=sn,UR.proj.disableCoordinateWarning=Yi,UR.proj.epsg3857={},UR.proj.epsg3857.EXTENT=Ve,UR.proj.epsg3857.HALF_SIZE=Xe,UR.proj.epsg3857.MAX_SAFE_Y=We,UR.proj.epsg3857.PROJECTIONS=Ye,UR.proj.epsg3857.RADIUS=ze,UR.proj.epsg3857.WORLD_EXTENT=$e,UR.proj.epsg3857.fromEPSG4326=He,UR.proj.epsg3857.toEPSG4326=Ke,UR.proj.epsg4326={},UR.proj.epsg4326.EXTENT=Je,UR.proj.epsg4326.METERS_PER_UNIT=Qe,UR.proj.epsg4326.PROJECTIONS=ei,UR.proj.epsg4326.RADIUS=qe,UR.proj.equivalent=ln,UR.proj.fromLonLat=function(t,e){return Yi(),un(t,"EPSG:4326",void 0!==e?e:"EPSG:3857")},UR.proj.fromUserCoordinate=_n,UR.proj.fromUserExtent=xn,UR.proj.fromUserResolution=Sn,UR.proj.get=Qi,UR.proj.getPointResolution=tn,UR.proj.getTransform=cn,UR.proj.getTransformFromProjections=hn,UR.proj.getUserProjection=pn,UR.proj.identityTransform=Ki,UR.proj.proj4={},UR.proj.proj4.epsgLookupMapTiler=function(t){return async function(e){const i=await fetch(`https://api.maptiler.com/coordinates/search/code:${e}.json?transformations=true&exports=true&key=${t}`);if(!i.ok)throw new Error(`Unexpected response from maptiler.com: ${i.status}`);return i.json().then((t=>{const i=t.results;if(i?.length>0){const t=i.filter((t=>"EPSG"===t.id?.authority&&t.id?.code===e))[0];if(t){const e=t.transformations;if(e?.length>0){const i=t.default_transformation;if(e.filter((t=>t.id?.authority===i?.authority&&t.id?.code===i?.code&&0===t.grids?.length)).length>0)return t.exports?.proj4;const n=e.filter((t=>0===t.grids?.length&&"EPSG"===t.target_crs?.authority&&4326===t.target_crs?.code&&!1===t.deprecated&&!0===t.usable)).sort(((t,e)=>t.accuracy-e.accuracy))[0]?.exports?.proj4;if(n)return n}return t.exports?.proj4}}}))}},UR.proj.proj4.fromEPSGCode=async function(t){"string"==typeof t&&(t=parseInt(t.split(":").pop(),10));const e=B_;if(!e)throw new Error("Proj4 must be registered first with register(proj4)");const i="EPSG:"+t;return e.defs(i)||(e.defs(i,await X_(t)),z_(e)),Qi(i)},UR.proj.proj4.getEPSGLookup=function(){return X_},UR.proj.proj4.isRegistered=function(){return!!B_},UR.proj.proj4.register=z_,UR.proj.proj4.setEPSGLookup=function(t){X_=t},UR.proj.proj4.unregister=function(){B_=null},UR.proj.projections={},UR.proj.projections.add=si,UR.proj.projections.clear=ni,UR.proj.projections.get=ri,UR.proj.setUserProjection=fn,UR.proj.toLonLat=an,UR.proj.toUserCoordinate=mn,UR.proj.toUserExtent=yn,UR.proj.toUserResolution=vn,UR.proj.transform=un,UR.proj.transformExtent=dn,UR.proj.transformWithProjections=function(t,e,
2387i){return hn(e,i)(t)},UR.proj.transforms={},UR.proj.transforms.add=li,UR.proj.transforms.clear=ai,UR.proj.transforms.get=hi,UR.proj.transforms.remove=function(t,e){const i=t.getCode(),n=e.getCode(),r=oi[i][n];return delete oi[i][n],y(oi[i])&&delete oi[i],r},UR.proj.useGeographic=function(){fn("EPSG:4326")},UR.render={},UR.render.Box=Lh,UR.render.Event=Il,UR.render.Feature=zu,UR.render.Feature.toFeature=function(t,e){const i=t.getId(),n=Xu(t),r=t.getProperties(),s=new Mt;return void 0!==e&&s.setGeometryName(e),s.setGeometry(n),void 0!==i&&s.setId(i),s.setProperties(r,!0),s},UR.render.Feature.toGeometry=Xu,UR.render.VectorContext=Rc,UR.render.canvas={},UR.render.canvas.Builder=o_,UR.render.canvas.BuilderGroup=p_,UR.render.canvas.Executor=R_,UR.render.canvas.ExecutorGroup=L_,UR.render.canvas.ExecutorGroup.ALL=b_,UR.render.canvas.ExecutorGroup.DECLUTTER=P_,UR.render.canvas.ExecutorGroup.NON_DECLUTTER=I_,UR.render.canvas.ExecutorGroup.getPixelIndexArray=M_,UR.render.canvas.ImageBuilder=a_,UR.render.canvas.Immediate=bc,UR.render.canvas.Instruction={},UR.render.canvas.Instruction.beginPathInstruction=r_,UR.render.canvas.Instruction.closePathInstruction=s_,UR.render.canvas.Instruction.fillInstruction=i_,UR.render.canvas.Instruction.strokeInstruction=n_,UR.render.canvas.LineStringBuilder=l_,UR.render.canvas.PolygonBuilder=h_,UR.render.canvas.TextBuilder=g_,UR.render.canvas.TextBuilder.TEXT_ALIGN=d_,UR.render.canvas.ZIndexContext=cg,UR.render.canvas.checkedFonts=Qo,UR.render.canvas.defaultFillStyle=Vo,UR.render.canvas.defaultFont=Xo,UR.render.canvas.defaultLineCap=$o,UR.render.canvas.defaultLineDash=Wo,UR.render.canvas.defaultLineDashOffset=0,UR.render.canvas.defaultLineJoin=Zo,UR.render.canvas.defaultLineWidth=1,UR.render.canvas.defaultMiterLimit=Yo,UR.render.canvas.defaultPadding=Jo,UR.render.canvas.defaultStrokeStyle=Ho,UR.render.canvas.defaultTextAlign=Ko,UR.render.canvas.defaultTextBaseline=qo,UR.render.canvas.drawImageOrLabel=ha,UR.render.canvas.getTextDimensions=la,UR.render.canvas.hitdetect={},UR.render.canvas.hitdetect.HIT_DETECT_RESOLUTION=A_,UR.render.canvas.hitdetect.createHitDetectionImageData=O_,UR.render.canvas.hitdetect.hitDetect=D_,UR.render.canvas.measureAndCacheTextWidth=aa,UR.render.canvas.measureTextHeight=ra,UR.render.canvas.measureTextWidth=oa,UR.render.canvas.registerFont=na,UR.render.canvas.rotateAtOffset=function(t,e,i,n){0!==e&&(t.translate(i,n),t.rotate(e),t.translate(-i,-n))},UR.render.canvas.style={},UR.render.canvas.style.buildRuleSet=rl,UR.render.canvas.style.buildStyle=sl,UR.render.canvas.style.flatStylesToStyleFunction=nl,UR.render.canvas.style.rulesToStyleFunction=il,UR.render.canvas.textHeights=ia,UR.render.getRenderPixel=function(t,e){return Ut(t.inversePixelTransform,e.slice(0))},UR.render.getVectorContext=Dc,UR.render.toContext=function(t,e){const i=t.canvas,n=(e=e||{}).pixelRatio||ct,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=zt([1,0,0,1,0,0],n,n);return new bc(t,n,s,o,0)},UR.render.webgl={},UR.render.webgl.MixedGeometryBatch=Qp,UR.render.webgl.VectorStyleRenderer=jm,UR.render.webgl.renderinstructions={},UR.render.webgl.renderinstructions.generateLineStringRenderInstructions=Cm,UR.render.webgl.renderinstructions.generatePointRenderInstructions=Tm,UR.render.webgl.renderinstructions.generatePolygonRenderInstructions=Rm,UR.render.webgl.renderinstructions.getCustomAttributesSize=wm,UR.render.webgl.utils={},UR.render.webgl.utils.LINESTRING_ANGLE_COSINE_CUTOFF=cp,UR.render.webgl.utils.colorDecodeId=pp,UR.render.webgl.utils.colorEncodeId=fp,UR.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},UR.render.webgl.utils.writeLineSegmentToBuffers=function(t,e,i,n,r,s,o,a,l,h,c){const u=10+a.length,d=s.length/u,g=[t[e+0],t[e+1]],f=[t[i],t[i+1]],p=t[e+2],m=t[i+2],_=Ut(l,[...g]),y=Ut(l,[...f]);function x(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(ci(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}let v=-1,S=-1,E=c;const w=null!==r;
2387if(null!==n){v=x(_,y,Ut(l,[...[t[n],t[n+1]]])),Math.cos(v)<=cp&&(E+=Math.tan((v-Math.PI)/2))}if(w){S=x(y,_,Ut(l,[...[t[r],t[r+1]]])),Math.cos(S)<=cp&&(E+=Math.tan((Math.PI-S)/2))}function T(t,e){return 0===e?1e4*t:Math.sign(e)*(1e4*t+Math.abs(e))}return s.push(g[0],g[1],p,f[0],f[1],m,v,S,h,T(0,c)),s.push(...a),s.push(g[0],g[1],p,f[0],f[1],m,v,S,h,T(1,c)),s.push(...a),s.push(g[0],g[1],p,f[0],f[1],m,v,S,h,T(2,c)),s.push(...a),s.push(g[0],g[1],p,f[0],f[1],m,v,S,h,T(3,c)),s.push(...a),o.push(d,d+1,d+2,d+1,d+3,d+2),{length:h+Math.sqrt((y[0]-_[0])*(y[0]-_[0])+(y[1]-_[1])*(y[1]-_[1])),angle:E}},UR.render.webgl.utils.writePointFeatureToBuffers=function(t,e,i,n,r,s){const o=3+r,a=t[e+0],l=t[e+1],h=up;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 gp(i,c,a,l,0),h.length&&i.set(h,c+3),c+=o,gp(i,c,a,l,1),h.length&&i.set(h,c+3),c+=o,gp(i,c,a,l,2),h.length&&i.set(h,c+3),c+=o,gp(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,dp.vertexPosition=c,dp.indexPosition=u,dp},UR.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=jf(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},UR.renderer={},UR.renderer.Composite=Ll,UR.renderer.Layer=hg,UR.renderer.Map=bl,UR.renderer.canvas={},UR.renderer.canvas.ImageLayer=fg,UR.renderer.canvas.Layer=gg,UR.renderer.canvas.Layer.canvasPool=ug,UR.renderer.canvas.TileLayer=wg,UR.renderer.canvas.VectorImageLayer=k_,UR.renderer.canvas.VectorLayer=N_,UR.renderer.canvas.VectorTileLayer=U_,UR.renderer.vector={},UR.renderer.vector.defaultOrder=Lc,UR.renderer.vector.getSquaredTolerance=Fc,UR.renderer.vector.getTolerance=Mc,UR.renderer.vector.renderFeature=Ac,UR.renderer.webgl={},UR.renderer.webgl.FlowLayer=pm,UR.renderer.webgl.Layer=vp,UR.renderer.webgl.PointsLayer=Sm,UR.renderer.webgl.TileLayer=Mp,UR.renderer.webgl.TileLayer.Attributes=Lp,UR.renderer.webgl.TileLayer.Uniforms=Ip,UR.renderer.webgl.TileLayerBase=Pp,UR.renderer.webgl.TileLayerBase.Uniforms=Sp,UR.renderer.webgl.TileLayerBase.getCacheKey=bp,UR.renderer.webgl.TileLayerBase.newTileRepresentationLookup=wp,UR.renderer.webgl.VectorLayer=class extends vp{constructor(t,e){super(t,{uniforms:{[Um.RENDER_EXTENT]:[0,0,0,0],[Um.PATTERN_ORIGIN]:[0,0],[Um.GLOBAL_ALPHA]:1},postProcesses:e.postProcesses}),this.hitDetectionEnabled_=!e.disableHitDetection,this.hitRenderTarget_,this.sourceRevision_=-1,this.previousExtent_=[1/0,1/0,-1/0,-1/0],this.currentTransform_=[1,0,0,1,0,0],this.tmpCoords_=[0,0],this.tmpTransform_=[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.currentFrameStateTransform_=[1,0,0,1,0,0],this.styles_=[],this.styleRenderers_=[],this.buffers_=[],this.applyOptions_(e),this.batch_=new Qp,this.initialFeaturesAdded_=!1,this.sourceListenKeys_=null}addInitialFeatures_(t){const e=this.getLayer().getSource(),i=pn();let n;i&&(n=hn(i,t.viewState.projection)),this.batch_.addFeatures(e.getFeatures(),n),this.sourceListenKeys_=[A(e,Vu,this.handleSourceFeatureAdded_.bind(this,n)),A(e,$u,this.handleSourceFeatureChanged_,this),A(e,Zu,this.handleSourceFeatureDelete_,this),A(e,Wu,this.handleSourceFeatureClear_,this)]}applyOptions_(t){this.styles_=Array.isArray(t.style)?t.style:[t.style]}createRenderers_(){this.buffers_=[],this.styleRenderers_=this.styles_.map((t=>new jm(t,this.helper,this.hitDetectionEnabled_)))}reset(t){this.applyOptions_(t),this.helper&&this.createRenderers_(),super.reset(t)}afterHelperCreated(){this.styleRenderers_.length?this.styleRenderers_.forEach(((t,e)=>t.setHelper(this.helper,this.buffers_[e]))):this.createRenderers_(),this.hitDetectionEnabled_&&(this.hitRenderTarget_=new Gf(this.helper))}handleSourceFeatureAdded_(t,e){const i=e.feature;this.batch_.addFeature(i,t)}handleSourceFeatureChanged_(t){const e=t.feature;this.batch_.changeFeature(e)}handleSourceFeatureDelete_(t){const e=t.feature;
2387this.batch_.removeFeature(e)}handleSourceFeatureClear_(){this.batch_.clear()}applyUniforms_(t){jt(this.tmpTransform_,this.currentFrameStateTransform_),kt(this.tmpTransform_,t),this.helper.setUniformMatrixValue(Um.PROJECTION_MATRIX,bf(this.tmpMat4_,this.tmpTransform_)),$t(this.tmpTransform_,this.tmpTransform_),this.helper.setUniformMatrixValue(Um.SCREEN_TO_WORLD_MATRIX,bf(this.tmpMat4_,this.tmpTransform_)),this.tmpCoords_[0]=0,this.tmpCoords_[1]=0,$t(this.tmpTransform_,t),Ut(this.tmpTransform_,this.tmpCoords_),this.helper.setUniformFloatVec2(Um.PATTERN_ORIGIN,this.tmpCoords_)}renderFrame(t){const e=this.helper.getGL();this.preRender(e,t);const[i,n,r]=vm(t,this.getLayer());this.helper.prepareDraw(t),this.renderWorlds(t,!1,i,n,r),this.helper.finalizeDraw(t);const s=this.helper.getCanvas(),o=t.layerStatesArray[t.layerIndex].opacity;return o!==parseFloat(s.style.opacity)&&(s.style.opacity=String(o)),this.hitDetectionEnabled_&&(this.renderWorlds(t,!0,i,n,r),this.hitRenderTarget_.clearCachedData()),this.postRender(e,t),s}prepareFrameInternal(t){this.initialFeaturesAdded_||(this.addInitialFeatures_(t),this.initialFeaturesAdded_=!0);const e=this.getLayer(),i=e.getSource(),n=t.viewState,r=!t.viewHints[gs]&&!t.viewHints[fs],s=!he(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 Rl?e.getRenderBuffer():0,a=qt(t.extent,o*s),l=pn();l?i.loadFeatures(yn(a,l),vn(s,r),l):i.loadFeatures(a,s,r),this.ready=!1;const h=this.helper.makeProjectionTransform(t,[1,0,0,1,0,0]),c=this.styleRenderers_.map(((t,e)=>t.generateBuffers(this.batch_,h).then((t=>{this.buffers_[e]&&this.disposeBuffers(this.buffers_[e]),this.buffers_[e]=t}))));Promise.all(c).then((()=>{this.ready=!0,this.getLayer().changed()})),this.previousExtent_=t.extent.slice()}return!0}renderWorlds(t,e,i,n,r){let s=i;e&&(this.hitRenderTarget_.setSize([Math.floor(t.size[0]/2),Math.floor(t.size[1]/2)]),this.helper.prepareDrawToRenderTarget(t,this.hitRenderTarget_,!0));do{this.helper.makeProjectionTransform(t,this.currentFrameStateTransform_),Xt(this.currentFrameStateTransform_,s*r,0);for(let i=0,n=this.styleRenderers_.length;i<n;i++){const n=this.styleRenderers_[i],r=this.buffers_[i];r&&n.render(r,t,(()=>{this.applyUniforms_(r.invertVerticesTransform),this.helper.applyHitDetectionUniform(e)}
2387))}}while(++s<n)}forEachFeatureAtCoordinate(t,e,i,n,r){if(Ft(this.hitDetectionEnabled_,"`forEachFeatureAtCoordinate` cannot be used on a WebGL layer if the hit detection logic has been disabled using the `disableHitDetection: true` option."),!this.styleRenderers_.length||!this.hitDetectionEnabled_)return;const s=Ut(e.coordinateToPixelTransform,t.slice()),o=this.hitRenderTarget_.readPixel(s[0]/2,s[1]/2),a=pp([o[0]/255,o[1]/255,o[2]/255,o[3]/255]),l=this.batch_.getFeatureFromRef(a);return l?n(l,this.getLayer(),null):void 0}disposeBuffers(t){t.pointBuffers&&t.pointBuffers.filter(Boolean).forEach((t=>this.helper.deleteBuffer(t))),t.lineStringBuffers&&t.lineStringBuffers.filter(Boolean).forEach((t=>this.helper.deleteBuffer(t))),t.polygonBuffers&&t.polygonBuffers.filter(Boolean).forEach((t=>this.helper.deleteBuffer(t)))}disposeInternal(){this.buffers_.forEach((t=>{this.disposeBuffers(t)})),this.sourceListenKeys_&&(this.sourceListenKeys_.forEach((function(t){D(t)})),this.sourceListenKeys_=null),super.disposeInternal()}},UR.renderer.webgl.VectorLayer.Uniforms=Um,UR.renderer.webgl.VectorTileLayer=class extends Pp{constructor(t,e){super(t,{cacheSize:e.cacheSize,uniforms:{[Bm.PATTERN_ORIGIN]:[0,0],[Bm.TILE_MASK_TEXTURE]:()=>this.tileMaskTarget_.getTexture()}}),this.hitDetectionEnabled_=!e.disableHitDetection,this.styles_=[],this.styleRenderers_=[],this.currentFrameStateTransform_=[1,0,0,1,0,0],this.tmpTransform_=[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.tileMaskTarget_=null,this.tileMaskIndices_=new Sf(jg,Ug),this.tileMaskIndices_.fromArray([0,1,3,1,2,3]),this.tileMaskAttributes_=[{name:zm.POSITION,size:2,type:If.FLOAT}],this.tileMaskProgram_,this.applyOptions_(e)}reset(t){super.reset(t),this.applyOptions_(t),this.helper&&(this.createRenderers_(),this.initTileMask_())}applyOptions_(t){this.styles_=Array.isArray(t.style)?t.style:[t.style]}createRenderers_(){function t(t){const e=t.getFragmentDiscardExpression(),i=`texture2D(${Bm.TILE_MASK_TEXTURE}, gl_FragCoord.xy / u_pixelRatio / u_viewportSizePx).r * 50. > ${Bm.TILE_ZOOM_LEVEL} + 0.5`;t.setFragmentDiscardExpression("false"!==e?`(${e}) || (${i})`:i),t.addUniform(`sampler2D ${Bm.TILE_MASK_TEXTURE}`),t.addUniform(`float ${Bm.TILE_ZOOM_LEVEL}`)}this.styleRenderers_=this.styles_.map((e=>{let i;if("builder"in e)t(e.builder),i=e;else{const n=cm(e);t(n.builder),i={builder:n.builder,attributes:n.attributes,uniforms:n.uniforms}}return new jm(i,this.helper,this.hitDetectionEnabled_)}))}initTileMask_(){this.tileMaskTarget_=new Gf(this.helper);const t=(new Jp).setFillColorExpression(`vec4(${Bm.TILE_ZOOM_LEVEL} / 50., 0., 0., 1.)`).addUniform(`float ${Bm.TILE_ZOOM_LEVEL}`);this.tileMaskProgram_=this.helper.getProgram(t.getFillFragmentShader(),t.getFillVertexShader()),this.helper.flushBufferData(this.tileMaskIndices_)}afterHelperCreated(){this.createRenderers_(),this.initTileMask_()}createTileRepresentation(t){const e=new tm(t,this.styleRenderers_),i=()=>{e.ready&&(this.getLayer().changed(),e.removeEventListener(v,i))};return e.addEventListener(v,i),e}beforeTilesRender(t,e){super.beforeTilesRender(t,!0),this.helper.makeProjectionTransform(t,this.currentFrameStateTransform_)}beforeTilesMaskRender(t){this.helper.makeProjectionTransform(t,this.currentFrameStateTransform_);const e=t.pixelRatio,i=t.size;return this.tileMaskTarget_.setSize([i[0]*e,i[1]*e]),this.helper.prepareDrawToRenderTarget(t,this.tileMaskTarget_,!0,!0),this.helper.useProgram(this.tileMaskProgram_,t),jt(this.tmpTransform_,this.currentFrameStateTransform_),this.helper.setUniformMatrixValue(Bm.PROJECTION_MATRIX,bf(this.tmpMat4_,this.tmpTransform_)),$t(this.tmpTransform_,this.currentFrameStateTransform_),this.helper.setUniformMatrixValue(Bm.SCREEN_TO_WORLD_MATRIX,bf(this.tmpMat4_,this.tmpTransform_)),!0}renderTileMask(t,e,i,n){if(!t.ready)return;this.helper.setUniformFloatValue(Bm.DEPTH,n),this.helper.setUniformFloatValue(Bm.TILE_ZOOM_LEVEL,e),this.helper.setUniformFloatVec4(Bm.RENDER_EXTENT,i),this.helper.setUniformFloatValue(Bm.GLOBAL_ALPHA,1),this.helper.bindBuffer(t.maskVertices),this.helper.bindBuffer(this.tileMaskIndices_),this.helper.enableAttributes(this.tileMaskAttributes_);const r=this.tileMaskIndices_.getSize();this.helper.drawElements(0,r)}applyUniforms_(t,e,i,n,r){jt(this.tmpTransform_,this.currentFrameStateTransform_),kt(this.tmpTransform_,i),this.helper.setUniformMatrixValue(Bm.PROJECTION_MATRIX,bf(this.tmpMat4_,this.tmpTransform_)),$t(this.tmpTransform_,this.currentFrameStateTransform_),this.helper.setUniformMatrixValue(Bm.SCREEN_TO_WORLD_MATRIX,bf(this.tmpMat4_,this.tmpTransform_)),this.helper.setUniformFloatValue(Bm.GLOBAL_ALPHA,t),this.helper.setUniformFloatValue(Bm.DEPTH,r),this.helper.setUniformFloatValue(Bm.TILE_ZOOM_LEVEL,n),this.helper.setUniformFloatVec4(Bm.RENDER_EXTENT,e)}renderTile(t,e,i,n,r,s,o,a,l,h,c){const u=Re(a,n,a),d=t.tile.getTileCoord()[0];for(let e=0,n=this.styleRenderers_.length;e<n;e++){const n=this.styleRenderers_[e],r=t.buffers[e];n.render(r,i,(()=>{this.applyUniforms_(c,u,r.invertVerticesTransform,d,l)}))}}renderDeclutter(t){}disposeInternal(){super.disposeInternal()}},UR.renderer.webgl.VectorTileLayer.Attributes=zm,UR.renderer.webgl.VectorTileLayer.Uniforms=Bm,UR.reproj={},UR.reproj.DataTile=Qu,UR.reproj.Image=Td,UR.reproj.Tile=Wc,UR.reproj.Triangulation=$c,UR.reproj.calculateSourceExtentResolution=Bc,UR.reproj.calculateSourceResolution=Uc,UR.reproj.canvasPool=kc,UR.reproj.common={},UR.reproj.common.ERROR_THRESHOLD=Vc,UR.reproj.render=zc,UR.resolution={},UR.resolution.fromResolutionLike=Xc,UR.resolutionconstraint={},UR.resolutionconstraint.createMinMaxResolution=Ts,UR.resolutionconstraint.createSnapToPower=ws,UR.resolutionconstraint.createSnapToResolutions=Es,UR.rotationconstraint={},UR.rotationconstraint.createSnapToN=bs,UR.rotationconstraint.createSnapToZero=Ps,UR.rotationconstraint.disable=Cs,UR.rotationconstraint.none=Rs,UR.size={}
vendor: 31,315 bytes, line 2387
2387,UR.size.buffer=function(t,e,i){return void 0===i&&(i=[0,0]),i[0]=t[0]+2*e,i[1]=t[1]+2*e,i},UR.size.hasArea=eo,UR.size.scale=io,UR.size.toSize=no,UR.source={},UR.source.BingMaps=class extends Tu{constructor(t){const e=void 0!==t.hidpi&&t.hidpi;super({cacheSize:t.cacheSize,crossOrigin:"anonymous",interpolate:t.interpolate,projection:Qi("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,this.placeholderTiles_=t.placeholderTiles;const i="https://dev.virtualearth.net/REST/v1/Imagery/Metadata/"+this.imagerySet_+"?uriScheme=https&include=ImageryProviders&key="+this.apiKey_+"&c="+this.culture_;fetch(i).then((t=>t.json())).then((t=>this.handleImageryMetadataResponse(t)))}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=lu(this.getProjection()),r=this.hidpi_?2:1,s=e.imageWidth==e.imageHeight?e.imageWidth/r:[e.imageWidth/r,e.imageHeight/r],o=su({extent:n,minZoom:e.zoomMin,maxZoom:i,tileSize:s});this.tileGrid=o;const a=this.culture_,l=this.hidpi_,h=this.placeholderTiles_;if(this.tileUrlFunction=Su(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)return;rc(t[0],t[1],t[2],i);const s=new URL(n.replace("{quadkey}",Ru(i))),o=s.searchParams;return l&&(o.set("dpi","d1"),o.set("device","mobile")),!0===h?o.delete("n"):!1===h&&o.set("n","z"),s.toString()}}))),e.imageryProviders){const t=hn(Qi("EPSG:4326"),this.getProjection());this.setAttributions((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(Le(De([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}))}this.setState("ready")}},UR.source.BingMaps.quadKey=Ru,UR.source.CartoDB=class extends bu{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)}},UR.source.Cluster=class extends Ju{constructor(t){super({attributions:(t=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 Ft(!e||"Point"===e.getType(),"The default `geometryFunction` can only handle `Point` or null geometries"),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(v,this.boundRefresh_),this.source=t,t&&t.addEventListener(v,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(!(U(s)in n)){const i=this.geometryFunction(s);if(i){ae(i.getCoordinates(),t),qt(t,e,t);const r=this.source.getFeaturesInExtent(t).filter((function(t){const e=U(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?Ti(i,n.getCoordinates()):t.splice(e,1)}Fi(i,1/t.length);const n=Se(e),r=this.interpolationRatio,s=new sr([i[0]*(1-r)+n[0]*r,i[1]*(1-r)+n[1]*r]);return this.createCustomCluster_?this.createCustomCluster_(s,t):new Mt({geometry:s,features:t})}},UR.source.DataTile=td,UR.source.GeoTIFF=gd,UR.source.Google=class extends Tu{constructor(t){const e=!!t.highDpi;super({attributionsCollapsible:t.attributionsCollapsible,cacheSize:t.cacheSize,crossOrigin:"anonymous",interpolate:t.interpolate,projection:"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.apiKey_=t.key,this.error_=null;const i={mapType:t.mapType||"roadmap",language:t.language||"en-US",region:t.region||"US"};t.imageFormat&&(i.imageFormat=t.imageFormat),t.scale&&(i.scale=t.scale),e&&(i.highDpi=!0),t.layerTypes&&(i.layerTypes=t.layerTypes),t.styles&&(i.styles=t.styles),!0===t.overlay&&(i.overlay=!0),t.apiOptions&&(i.apiOptions=t.apiOptions),this.sessionTokenRequest_=i,this.sessionTokenValue_,this.sessionRefreshId_,this.previousViewportAttribution_,this.previousViewportExtent_,this.createSession_()}getError(){return this.error_}fetchSessionToken(t,e){return fetch(t,e)}async createSession_(){const t="https://tile.googleapis.com/v1/createSession?key="+this.apiKey_,e={method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(this.sessionTokenRequest_)},i=await this.fetchSessionToken(t,e);if(!i.ok){try{const t=await i.json();this.error_=new Error(t.error.message)}catch{this.error_=new Error("Error fetching session token")}return void this.setState("error")}const n=await i.json(),r=this.getTilePixelRatio(1),s=[n.tileWidth/r,n.tileHeight/r];this.tileGrid=su({extent:lu(this.getProjection()),maxZoom:22,tileSize:s});const o=n.session;this.sessionTokenValue_=o;const a=this.apiKey_;this.tileUrlFunction=function(t,e,i){return`https://tile.googleapis.com/v1/2dtiles/${t[0]}/${t[1]}/${t[2]}?session=${o}&key=${a}`};const l=1e3*parseInt(n.expiry,10),h=Math.max(l-Date.now()-6e4,1);this.sessionRefreshId_=setTimeout((()=>this.createSession_()),h),this.setAttributions(this.fetchAttributions_.bind(this)),this.setState("ready")}async fetchAttributions_(t){if(t.viewHints[gs]||t.viewHints[fs]||t.animate)return this.previousViewportAttribution_;const[e,i]=an(xe(t.extent),t.viewState.projection),[n,r]=an(Pe(t.extent),t.viewState.projection),s=`zoom=${this.getTileGrid().getZForResolution(t.viewState.resolution,this.zDirection)}&north=${r}&south=${i}&east=${n}&west=${e}`;if(this.previousViewportExtent_==s)return this.previousViewportAttribution_;this.previousViewportExtent_=s;const o=`https://tile.googleapis.com/tile/v1/viewport?session=${this.sessionTokenValue_}&key=${this.apiKey_}&${s}`;return this.previousViewportAttribution_=await fetch(o).then((t=>t.json())).then((t=>t.copyright)),this.previousViewportAttribution_}disposeInternal(){clearTimeout(this.sessionRefreshId_),super.disposeInternal()}},UR.source.IIIF=class extends Tu{constructor(t){const e=t||{};let i=e.url||"";i+=i.lastIndexOf("/")===i.length-1||""===i?"":"/";const n=e.version||md,r=e.sizes||[],s=e.size;Ft(null!=s&&Array.isArray(s)&&2==s.length&&!isNaN(s[0])&&s[0]>0&&!isNaN(s[1])&&s[1]>0,"Missing or invalid `size`");const o=s[0],a=s[1],l=e.tileSize,h=e.tilePixelRatio||1,c=e.format||"jpg",u=e.quality||(e.version==pd?"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=_s,x=_s),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 Qc({tileSize:[y,x],extent:f,origin:be(f),resolutions:d}),E=fd.bind(null,no(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:E,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],E=t[2],w=d[f];if(!(void 0===S||void 0===E||void 0===w||S<0||Math.ceil(o/w/y)<=S||E<0||Math.ceil(a/w/x)<=E)){if(_||m){const t=S*y*w,e=E*x*w;let i=y*w,r=x*w,s=y,c=x;if(t+i>o&&(i=o-t),e+r>a&&(r=a-e),t+y*w>o&&(s=Math.floor((o-t+w-1)/w)),e+x*w>a&&(c=Math.floor((a-e+w-1)/w)),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:"+wd(t/o*100)+","+wd(e/a*100)+","+wd(i/o*100)+","+wd(r/a*100)}n!=_d||_&&!g.includes("sizeByWh")?!_||g.includes("sizeByW")?h=s+",":g.includes("sizeByH")?h=","+c:g.includes("sizeByWh")?h=s+","+c:g.includes("sizeByPct")&&(h="pct:"+wd(100/w)):h=s+","+c}else if(l="full",p){const t=r[f][0],e=r[f][1];h=n==_d?t==o&&e==a?"max":t+","+e:t==o?"full":t+","}else h=n==_d?"max":"full";return i+l+"/"+h+"/0/"+u+"."+c}},transition:e.transition}),this.zDirection=e.zDirection}},UR.source.Image=Ld,UR.source.Image.ImageSourceEvent=Id,UR.source.Image.defaultImageLoadFunction=Fd,UR.source.Image.getRequestExtent=Md,UR.source.ImageArcGISRest=class extends Ld{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:Fd,this.params_=Object.assign({},t.params),this.imageSize_=[0,0],this.renderedRevision_=0,this.ratio_=void 0!==t.ratio?t.ratio:1.5,this.loaderProjection_=null}getParams(){return this.params_}getImageInternal(t,e,i,n){return void 0===this.url_?null:(this.loader&&this.loaderProjection_===n||(this.loaderProjection_=n,this.loader=Od({crossOrigin:this.crossOrigin_,params:this.params_,projection:n,hidpi:this.hidpi_,url:this.url_,ratio:this.ratio_,load:(t,e)=>(this.image.setImage(t),this.imageLoadFunction_(this.image,e),Zr(t))})),super.getImageInternal(t,e,i,n))}getImageLoadFunction(){return this.imageLoadFunction_}getUrl(){return this.url_}setImageLoadFunction(t){this.imageLoadFunction_=t,this.changed()}setUrl(t){t!=this.url_&&(this.url_=t,this.loader=null,this.changed())}updateParams(t){Object.assign(this.params_,t),this.changed()}changed(){this.image=null,super.changed()}},UR.source.ImageCanvas=class extends Ld{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&&ee(r.getExtent(),t))return r;Ae(t=t.slice(),this.ratio_);const s=[Ie(t)/e*i,Ce(t)/e*i],o=this.canvasFunction_.call(this,t,e,i,s,n);return o&&(r=new Yr(t,e,i,o)),this.canvas_=r,this.renderedRevision_=this.getRevision(),r}},UR.source.ImageMapGuide=class extends Ld{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_=Object.assign({},t.params),this.url_=t.url,this.imageLoadFunction_=void 0!==t.imageLoadFunction?t.imageLoadFunction:Fd,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.renderedRevision_=0,this.loaderProjection_=null}getParams(){return this.params_}getImageInternal(t,e,i,n){return void 0===this.url_?null:(this.loader&&this.loaderProjection_===n||(this.loaderProjection_=n,this.loader=Nd({crossOrigin:this.crossOrigin_,params:this.params_,hidpi:this.hidpi_,metersPerUnit:this.metersPerUnit_,url:this.url_,useOverlay:this.useOverlay_,ratio:this.ratio_,load:(t,e)=>(this.image.setImage(t),this.imageLoadFunction_(this.image,e),Zr(t))})),super.getImageInternal(t,e,i,n))}getImageLoadFunction(){return this.imageLoadFunction_}updateParams(t){Object.assign(this.params_,t),this.changed()}setImageLoadFunction(t){this.imageLoadFunction_=t,this.changed()}changed(){this.image=null,super.changed()}},UR.source.ImageStatic=class extends Ld{constructor(t){const e=void 0!==t.crossOrigin?t.crossOrigin:null,i=void 0!==t.imageLoadFunction?t.imageLoadFunction:Fd;super({attributions:t.attributions,interpolate:t.interpolate,projection:Qi(t.projection)}),this.url_=t.url,this.imageExtent_=t.imageExtent,this.image=null,this.image=new Xr(this.imageExtent_,void 0,1,kd({url:t.url,imageExtent:t.imageExtent,crossOrigin:e,load:(t,e)=>(this.image.setImage(t),i(this.image,e),Zr(t))})),this.image.addEventListener(v,this.handleImageChange.bind(this))}getImageExtent(){return this.imageExtent_}getImageInternal(t,e,i,n){return Le(t,this.image.getExtent())?this.image:null}getUrl(){return this.url_}},UR.source.ImageTile=class extends td{constructor(t){let e,i=(t=t||{}).loader;t.url&&(i=Bd(t.url),e=Xd(t.url));const n=i?t.state:"loading",r=void 0===t.wrapX||t.wrapX;super({loader:i,key:e,attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,maxZoom:t.maxZoom,minZoom:t.minZoom,tileSize:t.tileSize,gutter:t.gutter,maxResolution:t.maxResolution,projection:t.projection,tileGrid:t.tileGrid,state:n,wrapX:r,transition:t.transition,interpolate:!1!==t.interpolate,crossOrigin:t.crossOrigin})}setUrl(t){const e=Bd(t);this.setLoader(e),this.setKey(Xd(t)),"ready"!==this.getState()&&this.setState("ready")}},UR.source.ImageWMS=class extends Ld{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:Fd,this.params_=Object.assign({},t.params),this.serverType_=t.serverType,this.hidpi_=void 0===t.hidpi||t.hidpi,this.renderedRevision_=0,this.ratio_=void 0!==t.ratio?t.ratio:1.5,this.loaderProjection_=null}getFeatureInfoUrl(t,e,i,n){const r=Qi(i),s=this.getProjection();s&&s!==r&&(e=Uc(s,r,t,e),t=un(t,r,s));return Kd({url:this.url_,params:{...this.params_,...n},projection:s||r},t,e)}getLegendUrl(t,e){return qd({url:this.url_,params:{...this.params_,...e}},t)}getParams(){return this.params_}getImageInternal(t,e,i,n){return void 0===this.url_?null:(this.loader&&this.loaderProjection_===n||(this.loaderProjection_=n,this.loader=Hd({crossOrigin:this.crossOrigin_,params:this.params_,projection:n,serverType:this.serverType_,hidpi:this.hidpi_,url:this.url_,ratio:this.ratio_,load:(t,e)=>(this.image.setImage(t),this.imageLoadFunction_(this.image,e),Zr(t))})),super.getImageInternal(t,e,i,n))}getImageLoadFunction(){return this.imageLoadFunction_}getUrl(){return this.url_}setImageLoadFunction(t){this.imageLoadFunction_=t,this.changed()}setUrl(t){t!=this.url_&&(this.url_=t,this.loader=null,this.changed())}updateParams(t){Object.assign(this.params_,t),this.changed()}changed(){this.image=null,super.changed()}},UR.source.OGCMapTile=class extends Tu{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,collections:t.collections}).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){Wi(t),this.setState("error")}},UR.source.OGCVectorTile=class extends sg{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,collections:t.collections}).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){Wi(t),this.setState("error")}},UR.source.OSM=class extends bu{constructor(t){let e;e=void 0!==(t=t||{}).attributions?t.attributions:[ag];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,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileLoadFunction:t.tileLoadFunction,transition:t.transition,url:n,wrapX:t.wrapX,zDirection:t.zDirection})}},UR.source.OSM.ATTRIBUTION=ag,UR.source.Raster=Fg,UR.source.Raster.Processor=bg,UR.source.Raster.RasterSourceEvent=Lg,UR.source.Source=Kc,UR.source.StadiaMaps=class extends bu{constructor(t){const e=t.layer.indexOf("-"),i=-1==e?t.layer:t.layer.slice(0,e),n=Ng[i]||{minZoom:0,maxZoom:20,retina:!0},r=Dg[t.layer],s=t.apiKey?"?api_key="+t.apiKey:"",o=n.retina&&t.retina?"@2x":"",a=void 0!==t.url?t.url:"https://tiles.stadiamaps.com/tiles/"+t.layer+"/{z}/{x}/{y}"+o+"."+r.extension+s,l=['&copy; <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a>','&copy; <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a>',ag];t.layer.startsWith("stamen_")&&l.splice(1,0,'&copy; <a href="https://stamen.com/" target="_blank">Stamen Design</a>'),super({attributions:l,cacheSize:t.cacheSize,crossOrigin:"anonymous",interpolate:t.interpolate,maxZoom:void 0!==t.maxZoom?t.maxZoom:n.maxZoom,minZoom:void 0!==t.minZoom?t.minZoom:n.minZoom,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileLoadFunction:t.tileLoadFunction,transition:t.transition,url:a,tilePixelRatio:o?2:1,wrapX:t.wrapX,zDirection:t.zDirection})}},UR.source.Tile=hu,UR.source.Tile.TileSourceEvent=cu,UR.source.TileArcGISRest=class extends Tu{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_=Object.assign({},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;let a;if(1==o.length)a=o[0];else{a=o[mi(lc(t),o.length)]}return Ad(a,i,(this.tileGrid||this.getTileGridForProjection(r)).getResolution(t[0]),n,r,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=no(n.getTileSize(t[0]),this.tmpSize);1!=e&&(s=io(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)}},UR.source.TileDebug=class extends bu{constructor(t){super({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=no(this.tileGrid.getTileSize(i)),r=pt(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)}})}},UR.source.TileImage=Tu,UR.source.TileJSON=class extends Tu{constructor(t){if(super({attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,projection:Qi("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)Sc(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{if(!t.tileJSON)throw new Error("Either `url` or `tileJSON` options must be provided");this.handleTileJSONResponse(t.tileJSON)}}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=Qi("EPSG:4326"),i=this.getProjection();let n;if(void 0!==t.bounds){const r=hn(e,i);n=De(t.bounds,r)}const r=lu(i),s=t.minzoom||0,o=su({extent:r,maxZoom:t.maxzoom||22,minZoom:s,tileSize:this.tileSize_});if(this.tileGrid=o,this.tileUrlFunction=vu(t.tiles,o),t.attribution&&!this.getAttributions()){const e=void 0!==n?n:r;this.setAttributions((function(i){return Le(e,i.extent)?[t.attribution]:null}))}this.tileJSON_=t,this.setState("ready")}handleTileJSONError(){this.setState("error")}},UR.source.TileWMS=class extends Tu{constructor(t){t=t||{};const e=Object.assign({},t.params);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: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=Qi(i),s=this.getProjection()||r;let o=this.getTileGrid();o||(o=this.getTileGridForProjection(s));const a=un(t,r,s),l=Uc(s,r,t,e),h=o.getZForResolution(l,this.zDirection),c=o.getResolution(h),u=o.getTileCoordForCoordAndZ(a,h);if(o.getResolutions().length<=u[0])return;let d=o.getTileCoordExtent(u,this.tmpExtent_);const g=this.gutter_;0!==g&&(d=qt(d,c*g,d));const f={QUERY_LAYERS:this.params_.LAYERS};Object.assign(f,Yd(this.params_,"GetFeatureInfo"),n);const p=Math.floor((a[0]-d[0])/c),m=Math.floor((d[3]-a[1])/c);return f[this.v13_?"I":"X"]=p,f[this.v13_?"J":"Y"]=m,this.getRequestUrl_(u,d,1,s||r,f)}getLegendUrl(t,e){if(void 0===this.urls[0])return;const i={SERVICE:"WMS",VERSION:Vd,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),uu(this.urls[0],i)}getGutter(){return this.gutter_}getParams(){return this.params_}getRequestUrl_(t,e,i,n,r){const s=this.urls;if(!s)return;let o;if(1==s.length)o=s[0];else{o=s[mi(lc(t),s.length)]}return Zd(e,(this.tileGrid||this.getTileGridForProjection(n)).getResolution(t[0]),i,n,o,r,this.serverType_)}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||Vd;this.v13_=wi(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_);const o=this.gutter_;0!==o&&(s=qt(s,r*o,s));const a=Object.assign({},Yd(this.params_,"GetMap"));return this.getRequestUrl_(t,s,e,i,a)}},UR.source.UTFGrid=class extends hu{constructor(t){if(super({projection:Qi("EPSG:3857"),state:"loading",wrapX:void 0===t.wrapX||t.wrapX,zDirection:t.zDirection}),this.preemptive_=void 0===t.preemptive||t.preemptive,this.tileUrlFunction_=Eu,this.template_=void 0,this.jsonp_=t.jsonp||!1,t.url)if(this.jsonp_)Sc(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{if(!t.tileJSON)throw new Error("Either `url` or `tileJSON` options must be provided");this.handleTileJSONResponse(t.tileJSON)}}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=Qi("EPSG:4326"),i=this.getProjection();let n;if(void 0!==t.bounds){const r=hn(e,i);n=De(t.bounds,r)}const r=lu(i),s=t.minzoom||0,o=su({extent:r,maxZoom:t.maxzoom||22,minZoom:s});this.tileGrid=o,this.template_=t.template;const a=t.grids;if(a){if(this.tileUrlFunction_=vu(a,o),t.attribution){const e=void 0!==n?n:r;this.setAttributions((function(i){return Le(e,i.extent)?[t.attribution]:null}))}this.setState("ready")}else this.setState("error")}getTile(t,e,i,n,r){const s=[t,e,i],o=this.getTileCoordForTileUrlFunction(s,r),a=this.tileUrlFunction_(o,n,r);return new kg(s,void 0!==a?Y:J,void 0!==a?a:"",this.tileGrid.getTileCoordExtent(s),this.preemptive_,this.jsonp_)}},UR.source.UTFGrid.CustomTile=kg,UR.source.UrlTile=wu,UR.source.Vector=Ju,UR.source.Vector.VectorSourceEvent=qu,UR.source.VectorTile=sg,UR.source.VectorTile.defaultLoadFunction=og,UR.source.WMTS=class extends Tu{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=yu(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_()
2387),n&&n.length>0&&(this.tileUrlFunction=Su(n.map(this.createFromWMTSTemplate.bind(this))))}setUrls(t){this.urls=t;const e=t.join("\n");this.setTileUrlFunction(Su(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_(){const t=this.urls?this.urls.slice(0):[];for(const e in this.dimensions_)t.push(e+"-"+this.dimensions_[e]);return t.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?uu(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)return;const a={TileMatrix:n.getMatrixId(i[0]),TileCol:i[1],TileRow:i[2]};Object.assign(a,r);let l=t;return l="KVP"==e?uu(l,a):l.replace(/\{(\w+?)\}/g,(function(t,e){return a[e]})),l}}},UR.source.WMTS.optionsFromCapabilities=function(t,e){const i=t.Contents.Layer,n=i?.find((function(t){return t.Identifier==e.layer}));if(!n)return null;const r=t.Contents.TileMatrixSet;let s;s=n.TileMatrixSetLink.length>1?"projection"in e?n.TileMatrixSetLink.findIndex((function(t){const i=r.find((function(e){return e.Identifier==t.TileMatrixSet})).SupportedCRS,n=Qi(i),s=Qi(e.projection);return n&&s?ln(n,s):i==e.projection})):n.TileMatrixSetLink.findIndex((function(t){return t.TileMatrixSet==e.matrixSet})):0,s<0&&(s=0);const o=n.TileMatrixSetLink[s].TileMatrixSet,a=n.TileMatrixSetLink[s].TileMatrixSetLimits;let l=n.Format[0];"format"in e&&(l=e.format),s=n.Style.findIndex((function(t){return"style"in e?t.Title==e.style:t.isDefault})),s<0&&(s=0);const h=n.Style[s].Identifier,c={};"Dimension"in n&&n.Dimension.forEach((function(t,e,i){const n=t.Identifier;let r=t.Default;void 0===r&&(r=t.Value[0]),c[n]=r}));const u=t.Contents.TileMatrixSet.find((function(t){return t.Identifier==o}));let d;const g=u.SupportedCRS;if(g&&(d=Qi(g)),"projection"in e){const t=Qi(e.projection);t&&(d&&!ln(t,d)||(d=t))}let f=!1;const p=d.getAxisOrientation().startsWith("ne");let m=u.TileMatrix[0],_={MinTileCol:0,MinTileRow:0,MaxTileCol:m.MatrixWidth-1,MaxTileRow:m.MatrixHeight-1};if(a){_=a[a.length-1];const t=u.TileMatrix.find((t=>t.Identifier===_.TileMatrix||u.Identifier+":"+t.Identifier===_.TileMatrix));t&&(m=t)}const y=28e-5*m.ScaleDenominator/d.getMetersPerUnit(),x=p?[m.TopLeftCorner[1],m.TopLeftCorner[0]]:m.TopLeftCorner,v=m.TileWidth*y,S=m.TileHeight*y;let E=u.BoundingBox;E&&p&&(E=[E[1],E[0],E[3],E[2]]);let w=[x[0]+v*_.MinTileCol,x[1]-S*(1+_.MaxTileRow),x[0]+v*(1+_.MaxTileCol),x[1]-S*_.MinTileRow];if(void 0!==E&&!ee(E,w)){const t=n.WGS84BoundingBox,e=Qi("EPSG:4326").getExtent();if(w=E,t)f=t[0]===e[0]&&t[2]===e[2];else{const t=dn(E,u.SupportedCRS,"EPSG:4326");f=t[0]-1e-10<=e[0]&&t[2]+1e-10>=e[2]}}const T=eu(u,w,a),C=[];let R=e.requestEncoding;if(R=void 0!==R?R:"","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}
vendor: 7,592 bytes, line 2387
2387)).AllowedValues.Value;if(""===R&&(R=i[0]),"KVP"!==R)break;i.includes("KVP")&&C.push(e[t].href)}else e[t].href&&(R="KVP",C.push(e[t].href))}return 0===C.length&&(R="REST",n.ResourceURL.forEach((function(t){"tile"===t.resourceType&&(l=t.format,C.push(t.template))}))),{urls:C,layer:e.layer,matrixSet:o,format:l,projection:d,requestEncoding:R,tileGrid:T,style:h,dimensions:c,wrapX:f,crossOrigin:e.crossOrigin}},UR.source.XYZ=bu,UR.source.Zoomify=class extends Tu{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||_s;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:throw new Error("Unknown `tierSizeCalculation` configured")}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 Qc({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=yu(d);let f=a*n;const p=Su(g.map((function(t){return function(e,i,n){if(!e)return;const r=e[0],s=e[1],a=e[2],l=s+a*o[r][0],h={z:r,x:s,y:a,tileIndex:l,TileGroup:"TileGroup"+((l+c[r])/f|0)};return t.replace(/\{(\w+?)\}/g,(function(t,e){return h[e]}))}}))),m=fd.bind(null,no(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(Se(u.getExtent()),h[h.length-1]),1,null),y=new Image;y.addEventListener("error",(()=>{f=a,this.changed()})),y.src=_}},UR.source.Zoomify.CustomTile=fd,UR.source.arcgisRest={},UR.source.arcgisRest.createLoader=Od,UR.source.arcgisRest.getRequestUrl=Ad,UR.source.common={},UR.source.common.DECIMALS=Cd,UR.source.common.DEFAULT_WMS_VERSION="1.3.0",UR.source.mapguide={},UR.source.mapguide.createLoader=Nd,UR.source.ogcTileUtil={},UR.source.ogcTileUtil.appendCollectionsQueryParam=tg,UR.source.ogcTileUtil.getMapTileUrlTemplate=eg,UR.source.ogcTileUtil.getTileSetInfo=rg,UR.source.ogcTileUtil.getVectorTileUrlTemplate=ig,UR.source.sourcesFromTileGrid=function(t,e){const i=new nc(32),n=t.getExtent();return function(r,s){i.expireCache(),n&&(r=Re(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}},UR.source.static={},UR.source.static.createLoader=kd,UR.source.wms={},UR.source.wms.DEFAULT_VERSION=Vd,UR.source.wms.createLoader=Hd,UR.source.wms.getFeatureInfoUrl=Kd,UR.source.wms.getImageSrc=Zd,UR.source.wms.getLegendUrl=qd,UR.source.wms.getRequestParams=Yd,UR.source.wms.getRequestUrl=Wd,UR.sphere={},UR.sphere.DEFAULT_RADIUS=Gi,UR.sphere.getArea=function t(e,i){const n=(i=i||{}).radius||Gi,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(Bi(o[0],n)),l=1,h=o.length;l<h;++l)d-=Math.abs(Bi(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(Bi(a[0],n)),c=1,u=a.length;c<u;++c)d-=Math.abs(Bi(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},UR.sphere.getDistance=ji,UR.sphere.getLength=function t(e,i){const n=(i=i||{}).radius||Gi,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=Ui(o,n);break;case"MultiLineString":case"Polygon":for(o=e.getCoordinates(),l=0,h=o.length;l<h;++l)d+=Ui(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+=Ui(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},UR.sphere.offset=zi,UR.string={},UR.string.compareVersions=wi,UR.string.padNumber=Ei,UR.structs={},UR.structs.LRUCache=nc,UR.structs.PriorityQueue=Jl,UR.structs.PriorityQueue.DROP=ql,UR.structs.RBush=Pu,UR.style={},UR.style.Circle=ua,UR.style.Fill=da,UR.style.Icon=Sa,UR.style.IconImage=Fo,UR.style.IconImage.get=Mo,UR.style.IconImageCache=bo,UR.style.IconImageCache.getCacheKey=Po,UR.style.IconImageCache.shared=Io,UR.style.Image=ro,UR.style.RegularShape=ca,UR.style.Stroke=ga,UR.style.Style=fa,UR.style.Style.createDefaultStyle=_a,UR.style.Style.createEditingStyle=ya,UR.style.Style.toFunction=pa,UR.style.Text=Ea,UR.style.flat={},UR.style.flat.createDefaultStyle=Hp,UR.tilecoord={},UR.tilecoord.createOrUpdate=rc,UR.tilecoord.fromKey=ac,UR.tilecoord.getCacheKeyForTileKey=function(t){const[e,i,n]=t.substring(t.lastIndexOf("/")+1,t.length).split(",").map(Number);return sc(e,i,n)},UR.tilecoord.getKey=oc,UR.tilecoord.getKeyZXY=sc,UR.tilecoord.hash=lc,UR.tilecoord.hashZXY=hc,UR.tilecoord.withinExtentAndZ=cc,UR.tilegrid={},UR.tilegrid.TileGrid=Qc,UR.tilegrid.WMTS=tu,UR.tilegrid.WMTS.createFromCapabilitiesMatrixSet=eu,UR.tilegrid.common={},UR.tilegrid.common.DEFAULT_MAX_ZOOM=ms,UR.tilegrid.common.DEFAULT_TILE_SIZE=_s,UR.tilegrid.createForExtent=ru,UR.tilegrid.createForProjection=au,UR.tilegrid.createXYZ=su,UR.tilegrid.extentFromProjection=lu,UR.tilegrid.getForProjection=iu,UR.tilegrid.wrapX=nu,UR.tileurlfunction={},UR.tileurlfunction.createFromTemplate=xu,UR.tileurlfunction.createFromTemplates=vu,UR.tileurlfunction.createFromTileUrlFunctions=Su,UR.tileurlfunction.nullTileUrlFunction=Eu,UR.transform={},UR.transform.apply=Ut,UR.transform.compose=Vt,UR.transform.composeCssTransform=function(t,e,i,n,r,s,o){return Yt(Vt([1,0,0,1,0,0],t,e,i,n,r,s,o))},UR.transform.create=Dt,UR.transform.determinant=Wt,UR.transform.invert=function(t){return $t(t,t)},UR.transform.makeInverse=$t,UR.transform.makeScale=function(t,e,i){return Gt(t,e,0,0,i,0,0)},UR.transform.multiply=kt,UR.transform.reset=Nt,UR.transform.rotate=Bt,UR.transform.scale=zt,UR.transform.set=Gt,UR.transform.setFromArray=jt,UR.transform.toString=Yt,UR.transform.translate=Xt,UR.uri={},UR.uri.appendParams=uu,UR.uri.expandUrl=yu,UR.uri.pickUrl=_u,UR.uri.renderXYZTemplate=mu,UR.util={},UR.util.VERSION="10.2.1",UR.util.abstract=G,UR.util.getUid=U,UR.vec={},UR.vec.mat4={},UR.vec.mat4.create=Rf,UR.vec.mat4.fromTransform=bf,UR.webgl={},UR.webgl.ARRAY_BUFFER=Gg,UR.webgl.BaseTileRepresentation=xf,UR.webgl.Buffer=Sf,UR.webgl.Buffer.getArrayClassForType=Ef,UR.webgl.DYNAMIC_DRAW=Bg,UR.webgl.ELEMENT_ARRAY_BUFFER=jg,UR.webgl.FLOAT=zg,UR.webgl.Helper=Af,UR.webgl.Helper.computeAttributesStride=Of,UR.webgl.PaletteTexture=Nf,UR.webgl.PostProcessingPass=Cf,UR.webgl.RenderTarget=Gf,UR.webgl.STATIC_DRAW=Ug,UR.webgl.STREAM_DRAW=35040,UR.webgl.ShaderBuilder={},UR.webgl.ShaderBuilder.COMMON_HEADER=Kp,UR.webgl.ShaderBuilder.ShaderBuilder=Jp,UR.webgl.TileGeometry=tm,UR.webgl.TileTexture=xp,UR.webgl.UNSIGNED_BYTE=5121,UR.webgl.UNSIGNED_INT=5125,UR.webgl.UNSIGNED_SHORT=5123,UR.webgl.getContext=Vg,UR.webgl.getSupp
2387ortedExtensions=function(){if(!$g){const t=Vg(document.createElement("canvas"));t&&($g=t.getSupportedExtensions())}return $g},UR.webgl.styleparser={},UR.webgl.styleparser.computeHash=sm,UR.webgl.styleparser.expressionToGlsl=em,UR.webgl.styleparser.packColor=im,UR.webgl.styleparser.parseLiteralStyle=cm,UR.xml={},UR.xml.OBJECT_PROPERTY_NODE_FACTORY=lf,UR.xml.XML_SCHEMA_INSTANCE_URI=Wg,UR.xml.createElementNS=Zg,UR.xml.getAllTextContent=Yg,UR.xml.getAllTextContent_=Hg,UR.xml.getAttributeNS=qg,UR.xml.getDocument=yf,UR.xml.getXMLSerializer=_f,UR.xml.isDocument=Kg,UR.xml.makeArrayExtender=Qg,UR.xml.makeArrayPusher=tf,UR.xml.makeArraySerializer=of,UR.xml.makeChildAppender=sf,UR.xml.makeObjectPropertyPusher=nf,UR.xml.makeObjectPropertySetter=rf,UR.xml.makeReplacer=ef,UR.xml.makeSequence=hf,UR.xml.makeSimpleNodeFactory=af,UR.xml.makeStructureNS=cf,UR.xml.parse=Jg,UR.xml.parseNode=uf,UR.xml.pushParseAndPop=df,UR.xml.pushSerializeAndPop=ff,UR.xml.registerDocument=function(t){mf=t},UR.xml.registerXMLSerializer=function(t){pf=t},UR.xml.serialize=gf,UR.VERSION=UR.util.VERSION,UR.getUid=UR.util.getUid,UR}();
2388//# sourceMappingURL=ol.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.