PageSourceSearch

https://www.phonedroid.fr/themes/hummingbird-phonedroid/assets/cache/bottom-fec714395.js

js phonedroid.fr collected 2026-10-06 17:06:48 UTC 1,251,391 bytes, 370 lines download raw bytes

vendor: 5,108 bytes, lines 1-11
1(()=>{var e,t,n={263:function(e,t){var n;
2/*!
3 * jQuery JavaScript Library v3.7.1
4 * https://jquery.com/
5 *
6 * Copyright OpenJS Foundation and other contributors
7 * Released under the MIT license
8 * https://jquery.org/license
9 *
10 * Date: 2023-08-28T13:37Z
11 */!function(t,n){"use strict";"object"==typeof e.exports?e.exports=t.document?n(t,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return n(e)}:n(t)}("undefined"!=typeof window?window:this,(function(r,o){"use strict";var i=[],a=Object.getPrototypeOf,s=i.slice,c=i.flat?function(e){return i.flat.call(e)}:function(e){return i.concat.apply([],e)},u=i.push,l=i.indexOf,d={},p=d.toString,f=d.hasOwnProperty,h=f.toString,m=h.call(Object),g={},v=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},y=function(e){return null!=e&&e===e.window},b=r.document,x={type:!0,src:!0,nonce:!0,noModule:!0};function w(e,t,n){var r,o,i=(n=n||b).createElement("script");if(i.text=e,t)for(r in x)(o=t[r]||t.getAttribute&&t.getAttribute(r))&&i.setAttribute(r,o);n.head.appendChild(i).parentNode.removeChild(i)}function j(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?d[p.call(e)]||"object":typeof e}var k="3.7.1",C=/HTML$/i,T=function(e,t){return new T.fn.init(e,t)};function S(e){var t=!!e&&"length"in e&&e.length,n=j(e);return!v(e)&&!y(e)&&("array"===n||0===t||"number"==typeof t&&t>0&&t-1 in e)}function A(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}T.fn=T.prototype={jquery:k,constructor:T,length:0,toArray:function(){return s.call(this)},get:function(e){return null==e?s.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=T.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return T.each(this,e)},map:function(e){return this.pushStack(T.map(this,(function(t,n){return e.call(t,n,t)})))},slice:function(){return this.pushStack(s.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(T.grep(this,(function(e,t){return(t+1)%2})))},odd:function(){return this.pushStack(T.grep(this,(function(e,t){return t%2})))},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:u,sort:i.sort,splice:i.splice},T.extend=T.fn.extend=function(){var e,t,n,r,o,i,a=arguments[0]||{},s=1,c=arguments.length,u=!1;for("boolean"==typeof a&&(u=a,a=arguments[s]||{},s++),"object"==typeof a||v(a)||(a={}),s===c&&(a=this,s--);s<c;s++)if(null!=(e=arguments[s]))for(t in e)r=e[t],"__proto__"!==t&&a!==r&&(u&&r&&(T.isPlainObject(r)||(o=Array.isArray(r)))?(n=a[t],i=o&&!Array.isArray(n)?[]:o||T.isPlainObject(n)?n:{},o=!1,a[t]=T.extend(u,i,r)):void 0!==r&&(a[t]=r));return a},T.extend({expando:"jQuery"+(k+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]"!==p.call(e))&&(!(t=a(e))||"function"==typeof(n=f.call(t,"constructor")&&t.constructor)&&h.call(n)===m)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},globalEval:function(e,t,n){w(e,{nonce:t&&t.nonce},n)},each:function(e,t){var n,r=0;if(S(e))for(n=e.length;r<n&&!1!==t.call(e[r],r,e[r]);r++);else for(r in e)if(!1===t.call(e[r],r,e[r]))break;return e},text:function(e){var t,n="",r=0,o=e.nodeType;if(!o)for(;t=e[r++];)n+=T.text(t);return 1===o||11===o?e.textContent:9===o?e.documentElement.textContent:3===o||4===o?e.nodeValue:n},makeArray:function(e,t){var n=t||[];return null!=e&&(S(Object(e))?T.merge(n,"string"==typeof e?[e]:e):u.call(n,e)),n},inArray:function(e,t,n){return null==t?-1:l.call(t,e,n)},isXMLDoc:function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!C.test(t||n&&n.nodeName||"HTML")},merge:function(e,t){for(var n=+t.length,r=0,o=e.length;r<n;r++)e[o++]=t[r];return e.length=o,e},grep:function(e,t,n){for(var r=[],o=0,i=e.length,a=!n;o<i;o++)!t(e[o],o)!==a&&r.push(e[o]);return r},map:function(e,t,n){var r,o,i=0,a=[];if(S(e))for(r=e.length;i<r;i++)null!=(o=t(e[i],i,n))&&a.push(o);else for(i in e)null!=(o=t(e[i],i,n))&&a.push(o);return c(a)},guid:1,support:g}),"function"==typeof Symbol&&(T.fn[Symbol.iterator]=i[Symbol.iterator]),T.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),(function(e,t){d["[object "+t+"]"]=t.toLowerCase()}));var E=i.pop,D=i.sort,P=i.splice,q="[\\x20\\t\\r\\n\\f]",N=new RegExp("^"+q+"+|((?:^|[^\\\\])(?:\\\\.)*)"+q+"+$","g");T.contains=function(e,t){var n=t&&t.parentNode;return e===n||!(!n||1!==n.nodeType||!(e.contains?e.contains(n):e.compareDocumentPosition&&16&e.compareDocumentPosition(n)))};var O=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g;function _(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e}T.escapeSelector=function(e){return(e+"").replace(O,_)};var $=b,H=u;!function(){var e,t,n,o,a,c,u,d,p,h,m=H,v=T.expando,y=0,b=0,x=ee(),w=ee(),j=ee(),k=ee(),C=function(e,t){return e===t&&(
vendor: 10,352 bytes, line 11
11a=!0),0},S="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",O="(?:\\\\[\\da-fA-F]{1,6}"+q+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",_="\\["+q+"*("+O+")(?:"+q+"*([*^$|!~]?=)"+q+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+O+"))|)"+q+"*\\]",L=":("+O+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+_+")*)|.*)\\)|)",R=new RegExp(q+"+","g"),M=new RegExp("^"+q+"*,"+q+"*"),I=new RegExp("^"+q+"*([>+~]|"+q+")"+q+"*"),F=new RegExp(q+"|>"),W=new RegExp(L),Q=new RegExp("^"+O+"$"),B={ID:new RegExp("^#("+O+")"),CLASS:new RegExp("^\\.("+O+")"),TAG:new RegExp("^("+O+"|[*])"),ATTR:new RegExp("^"+_),PSEUDO:new RegExp("^"+L),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+q+"*(even|odd|(([+-]|)(\\d*)n|)"+q+"*(?:([+-]|)"+q+"*(\\d+)|))"+q+"*\\)|)","i"),bool:new RegExp("^(?:"+S+")$","i"),needsContext:new RegExp("^"+q+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+q+"*((?:-\\d)?\\d*)"+q+"*\\)|)(?=[^-]|$)","i")},z=/^(?:input|select|textarea|button)$/i,U=/^h\d$/i,X=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,V=/[+~]/,J=new RegExp("\\\\[\\da-fA-F]{1,6}"+q+"?|\\\\([^\\r\\n\\f])","g"),G=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},Y=function(){ce()},K=pe((function(e){return!0===e.disabled&&A(e,"fieldset")}),{dir:"parentNode",next:"legend"});try{m.apply(i=s.call($.childNodes),$.childNodes),i[$.childNodes.length].nodeType}catch(e){m={apply:function(e,t){H.apply(e,s.call(t))},call:function(e){H.apply(e,s.call(arguments,1))}}}function Z(e,t,n,r){var o,i,a,s,u,l,f,h=t&&t.ownerDocument,y=t?t.nodeType:9;if(n=n||[],"string"!=typeof e||!e||1!==y&&9!==y&&11!==y)return n;if(!r&&(ce(t),t=t||c,d)){if(11!==y&&(u=X.exec(e)))if(o=u[1]){if(9===y){if(!(a=t.getElementById(o)))return n;if(a.id===o)return m.call(n,a),n}else if(h&&(a=h.getElementById(o))&&Z.contains(t,a)&&a.id===o)return m.call(n,a),n}else{if(u[2])return m.apply(n,t.getElementsByTagName(e)),n;if((o=u[3])&&t.getElementsByClassName)return m.apply(n,t.getElementsByClassName(o)),n}if(!(k[e+" "]||p&&p.test(e))){if(f=e,h=t,1===y&&(F.test(e)||I.test(e))){for((h=V.test(e)&&se(t.parentNode)||t)==t&&g.scope||((s=t.getAttribute("id"))?s=T.escapeSelector(s):t.setAttribute("id",s=v)),i=(l=le(e)).length;i--;)l[i]=(s?"#"+s:":scope")+" "+de(l[i]);f=l.join(",")}try{return m.apply(n,h.querySelectorAll(f)),n}catch(t){k(e,!0)}finally{s===v&&t.removeAttribute("id")}}}return ye(e.replace(N,"$1"),t,n,r)}function ee(){var e=[];return function n(r,o){return e.push(r+" ")>t.cacheLength&&delete n[e.shift()],n[r+" "]=o}}function te(e){return e[v]=!0,e}function ne(e){var t=c.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function re(e){return function(t){return A(t,"input")&&t.type===e}}function oe(e){return function(t){return(A(t,"input")||A(t,"button"))&&t.type===e}}function ie(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&&K(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function ae(e){return te((function(t){return t=+t,te((function(n,r){for(var o,i=e([],n.length,t),a=i.length;a--;)n[o=i[a]]&&(n[o]=!(r[o]=n[o]))}))}))}function se(e){return e&&void 0!==e.getElementsByTagName&&e}function ce(e){var n,r=e?e.ownerDocument||e:$;return r!=c&&9===r.nodeType&&r.documentElement?(u=(c=r).documentElement,d=!T.isXMLDoc(c),h=u.matches||u.webkitMatchesSelector||u.msMatchesSelector,u.msMatchesSelector&&$!=c&&(n=c.defaultView)&&n.top!==n&&n.addEventListener("unload",Y),g.getById=ne((function(e){return u.appendChild(e).id=T.expando,!c.getElementsByName||!c.getElementsByName(T.expando).length})),g.disconnectedMatch=ne((function(e){return h.call(e,"*")})),g.scope=ne((function(){return c.querySelectorAll(":scope")})),g.cssHas=ne((function(){try{return c.querySelector(":has(*,:jqfake)"),!1}catch(e){return!0}})),g.getById?(t.filter.ID=function(e){var t=e.replace(J,G);return function(e){return e.getAttribute("id")===t}},t.find.ID=function(e,t){if(void 0!==t.getElementById&&d){var n=t.getElementById(e);return n?[n]:[]}}):(t.filter.ID=function(e){var t=e.replace(J,G);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},t.find.ID=function(e,t){if(void 0!==t.getElementById&&d){var n,r,o,i=t.getElementById(e);if(i){if((n=i.getAttributeNode("id"))&&n.value===e)return[i];for(o=t.getElementsByName(e),r=0;i=o[r++];)if((n=i.getAttributeNode("id"))&&n.value===e)return[i]}return[]}}),t.find.TAG=function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):t.querySelectorAll(e)},t.find.CLASS=function(e,t){if(void 0!==t.getElementsByClassName&&d)return t.getElementsByClassName(e)},p=[],ne((function(e){var t;u.appendChild(e).innerHTML="<a id='"+v+"' href='' disabled='disabled'></a><select id='"+v+"-\r\\' disabled='disabled'><option selected=''></option></select>",e.querySelectorAll("[selected]").length||p.push("\\["+q+"*(?:value|"+S+")"),e.querySelectorAll("[id~="+v+"-]").length||p.push("~="),e.querySelectorAll("a#"+v+"+*").length||p.push(".#.+[+~]"),e.querySelectorAll(":checked").length||p.push(":checked"),(t=c.createElement("input")).setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),u.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&p.push(":enabled",":disabled"),(t=c.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||p.push("\\["+q+"*name"+q+"*="+q+"*(?:''|\"\")")})),g.cssHas||p.push(":has"),p=p.length&&new RegExp(p.join("|")),C=function(e,t){if(e===t)return a=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!g.sortDetached&&t.compareDocumentPosition(e)===n?e===c||e.ownerDocument==$&&Z.contains($,e)?-1:t===c||t.ownerDocument==$&&Z.contains($,t)?1:o?l.call(o,e)-l.call(o,t):0:4&n?-1:1)},c):c}for(e in Z.matches=function(e,t){return Z(e,null,null,t)},Z.matchesSelector=function(e,t){if(ce(e),d&&!k[t+" "]&&(!p||!p.test(t)))try{var n=h.call(e,t);if(n||g.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){k(t,!0)}return Z(t,c,null,[e]).length>0},Z.contains=function(e,t){return(e.ownerDocument||e)!=c&&ce(e),T.contains(e,t)},Z.attr=function(e,n){(e.ownerDocument||e)!=c&&ce(e);var r=t.attrHandle[n.toLowerCase()],o=r&&f.call(t.attrHandle,n.toLowerCase())?r(e,n,!d):void 0;return void 0!==o?o:e.getAttribute(n)},Z.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},T.uniqueSort=function(e){var t,n=[],r=0,i=0;if(a=!g.sortStable,o=!g.sortStable&&s.call(e,0),D.call(e,C),a){for(;t=e[i++];)t===e[i]&&(r=n.push(i));for(;r--;)P.call(e,n[r],1)}return o=null,e},T.fn.uniqueSort=function(){return this.pushStack(T.uniqueSort(s.apply(this)))},(t=T.expr={cacheLength:50,createPseudo:te,match:B,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(J,G),e[3]=(e[3]||e[4]||e[5]||"").replace(J,G),"~="===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]||Z.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]&&Z.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return B.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&W.test(n)&&(t=le(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(J,G).toLowerCase();return"*"===e?function(){return!0}:function(e){return A(e,t)}},CLASS:function(e){var t=x[e+" "];return t||(t=new RegExp("(^|"+q+")"+e+"("+q+"|$)"))&&x(e,(function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")}))},ATTR:function(e,t,n){return function(r){var o=Z.attr(r,e);return null==o?"!="===t:!t||(o+="","="===t?o===n:"!="===t?o!==n:"^="===t?n&&0===o.indexOf(n):"*="===t?n&&o.indexOf(n)>-1:"$="===t?n&&o.slice(-n.length)===n:"~="===t?(" "+o.replace(R," ")+" ").indexOf(n)>-1:"|="===t&&(o===n||o.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,o){var i="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===o?function(e){return!!e.parentNode}:function(t,n,c){var u,l,d,p,f,h=i!==a?"nextSibling":"previousSibling",m=t.parentNode,g=s&&t.nodeName.toLowerCase(),b=!c&&!s,x=!1;if(m){if(i){for(;h;){for(d=t;d=d[h];)if(s?A(d,g):1===d.nodeType)return!1;f=h="only"===e&&!f&&"nextSibling"}return!0}if(f=[a?m.firstChild:m.lastChild],a&&b){for(x=(p=(u=(l=m[v]||(m[v]={}))[e]||[])[0]===y&&u[1])&&u[2],d=p&&m.childNodes[p];d=++p&&d&&d[h]||(x=p=0)||f.pop();)if(1===d.nodeType&&++x&&d===t){l[e]=[y,p,x];break}}else if(b&&(x=p=(u=(l=t[v]||(t[v]={}))[e]||[])[0]===y&&u[1]),!1===x)for(;(d=++p&&d&&d[h]||(x=p=0)||f.pop())&&(!(s?A(d,g):1===d.nodeType)||!++x||(b&&((l=d[v]||(d[v]={}))[e]=[y,x]),d!==t)););return(x-=o)===r||x%r==0&&x/r>=0}}},PSEUDO:function(e,n){var r,o=t.pseudos[e]||t.setFilters[e.toLowerCase()]||Z.error("unsupported pseudo: "+e);return o[v]?o(n):o.length>1?(r=[e,e,"",n],t.setFilters.hasOwnProperty(e.toLowerCase())?te((function(e,t){for(var r,i=o(e,n),a=i.length;a--;)e[r=l.call(e,i[a])]=!(t[r]=i[a])})):function(e){return o(e,0,r)}):o}},pseudos:{not:te((function(e){var t=[],n=[],r=ve(e.replace(N,"$1"));return r[v]?te((function(e,t,n,o){for(var i,a=r(e,null,o,[]),s=e.length;s--;)(i=a[s])&&(e[s]=!(t[s]=i))})):function(e,o,i){return t[0]=e,r(t,null,i,n),t[0]=null,!n.pop()}})),has:te((function(e){return function(t){return Z(e,t).length>0}})),contains:te((function(e){return e=e.replace(J,G),function(t){return(t.textContent||T.text(t)).indexOf(e)>-1}})),lang:te((function(e){return Q.test(e||"")||Z.error("unsupported lang: "+e),e=e.replace(J,G).toLowerCase(),function(t){var n;do{if(n=d?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}}
vendor: 11,693 bytes, line 11
11)),target:function(e){var t=r.location&&r.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===u},focus:function(e){return e===function(){try{return c.activeElement}catch(e){}}()&&c.hasFocus()&&!!(e.type||e.href||~e.tabIndex)},enabled:ie(!1),disabled:ie(!0),checked:function(e){return A(e,"input")&&!!e.checked||A(e,"option")&&!!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!t.pseudos.empty(e)},header:function(e){return U.test(e.nodeName)},input:function(e){return z.test(e.nodeName)},button:function(e){return A(e,"input")&&"button"===e.type||A(e,"button")},text:function(e){var t;return A(e,"input")&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ae((function(){return[0]})),last:ae((function(e,t){return[t-1]})),eq:ae((function(e,t,n){return[n<0?n+t:n]})),even:ae((function(e,t){for(var n=0;n<t;n+=2)e.push(n);return e})),odd:ae((function(e,t){for(var n=1;n<t;n+=2)e.push(n);return e})),lt:ae((function(e,t,n){var r;for(r=n<0?n+t:n>t?t:n;--r>=0;)e.push(r);return e})),gt:ae((function(e,t,n){for(var r=n<0?n+t:n;++r<t;)e.push(r);return e}))}}).pseudos.nth=t.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})t.pseudos[e]=re(e);for(e in{submit:!0,reset:!0})t.pseudos[e]=oe(e);function ue(){}function le(e,n){var r,o,i,a,s,c,u,l=w[e+" "];if(l)return n?0:l.slice(0);for(s=e,c=[],u=t.preFilter;s;){for(a in r&&!(o=M.exec(s))||(o&&(s=s.slice(o[0].length)||s),c.push(i=[])),r=!1,(o=I.exec(s))&&(r=o.shift(),i.push({value:r,type:o[0].replace(N," ")}),s=s.slice(r.length)),t.filter)!(o=B[a].exec(s))||u[a]&&!(o=u[a](o))||(r=o.shift(),i.push({value:r,type:a,matches:o}),s=s.slice(r.length));if(!r)break}return n?s.length:s?Z.error(e):w(e,c).slice(0)}function de(e){for(var t=0,n=e.length,r="";t<n;t++)r+=e[t].value;return r}function pe(e,t,n){var r=t.dir,o=t.next,i=o||r,a=n&&"parentNode"===i,s=b++;return t.first?function(t,n,o){for(;t=t[r];)if(1===t.nodeType||a)return e(t,n,o);return!1}:function(t,n,c){var u,l,d=[y,s];if(c){for(;t=t[r];)if((1===t.nodeType||a)&&e(t,n,c))return!0}else for(;t=t[r];)if(1===t.nodeType||a)if(l=t[v]||(t[v]={}),o&&A(t,o))t=t[r]||t;else{if((u=l[i])&&u[0]===y&&u[1]===s)return d[2]=u[2];if(l[i]=d,d[2]=e(t,n,c))return!0}return!1}}function fe(e){return e.length>1?function(t,n,r){for(var o=e.length;o--;)if(!e[o](t,n,r))return!1;return!0}:e[0]}function he(e,t,n,r,o){for(var i,a=[],s=0,c=e.length,u=null!=t;s<c;s++)(i=e[s])&&(n&&!n(i,r,o)||(a.push(i),u&&t.push(s)));return a}function me(e,t,n,r,o,i){return r&&!r[v]&&(r=me(r)),o&&!o[v]&&(o=me(o,i)),te((function(i,a,s,c){var u,d,p,f,h=[],g=[],v=a.length,y=i||function(e,t,n){for(var r=0,o=t.length;r<o;r++)Z(e,t[r],n);return n}(t||"*",s.nodeType?[s]:s,[]),b=!e||!i&&t?y:he(y,h,e,s,c);if(n?n(b,f=o||(i?e:v||r)?[]:a,s,c):f=b,r)for(u=he(f,g),r(u,[],s,c),d=u.length;d--;)(p=u[d])&&(f[g[d]]=!(b[g[d]]=p));if(i){if(o||e){if(o){for(u=[],d=f.length;d--;)(p=f[d])&&u.push(b[d]=p);o(null,f=[],u,c)}for(d=f.length;d--;)(p=f[d])&&(u=o?l.call(i,p):h[d])>-1&&(i[u]=!(a[u]=p))}}else f=he(f===a?f.splice(v,f.length):f),o?o(null,a,f,c):m.apply(a,f)}))}function ge(e){for(var r,o,i,a=e.length,s=t.relative[e[0].type],c=s||t.relative[" "],u=s?1:0,d=pe((function(e){return e===r}),c,!0),p=pe((function(e){return l.call(r,e)>-1}),c,!0),f=[function(e,t,o){var i=!s&&(o||t!=n)||((r=t).nodeType?d(e,t,o):p(e,t,o));return r=null,i}];u<a;u++)if(o=t.relative[e[u].type])f=[pe(fe(f),o)];else{if((o=t.filter[e[u].type].apply(null,e[u].matches))[v]){for(i=++u;i<a&&!t.relative[e[i].type];i++);return me(u>1&&fe(f),u>1&&de(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(N,"$1"),o,u<i&&ge(e.slice(u,i)),i<a&&ge(e=e.slice(i)),i<a&&de(e))}f.push(o)}return fe(f)}function ve(e,r){var o,i=[],a=[],s=j[e+" "];if(!s){for(r||(r=le(e)),o=r.length;o--;)(s=ge(r[o]))[v]?i.push(s):a.push(s);s=j(e,function(e,r){var o=r.length>0,i=e.length>0,a=function(a,s,u,l,p){var f,h,g,v=0,b="0",x=a&&[],w=[],j=n,k=a||i&&t.find.TAG("*",p),C=y+=null==j?1:Math.random()||.1,S=k.length;for(p&&(n=s==c||s||p);b!==S&&null!=(f=k[b]);b++){if(i&&f){for(h=0,s||f.ownerDocument==c||(ce(f),u=!d);g=e[h++];)if(g(f,s||c,u)){m.call(l,f);break}p&&(y=C)}o&&((f=!g&&f)&&v--,a&&x.push(f))}if(v+=b,o&&b!==v){for(h=0;g=r[h++];)g(x,w,s,u);if(a){if(v>0)for(;b--;)x[b]||w[b]||(w[b]=E.call(l));w=he(w)}m.apply(l,w),p&&!a&&w.length>0&&v+r.length>1&&T.uniqueSort(l)}return p&&(y=C,n=j),x};return o?te(a):a}(a,i)),s.selector=e}return s}function ye(e,n,r,o){var i,a,s,c,u,l="function"==typeof e&&e,p=!o&&le(e=l.selector||e);if(r=r||[],1===p.length){if((a=p[0]=p[0].slice(0)).length>2&&"ID"===(s=a[0]).type&&9===n.nodeType&&d&&t.relative[a[1].type]){if(!(n=(t.find.ID(s.matches[0].replace(J,G),n)||[])[0]))return r;l&&(n=n.parentNode),e=e.slice(a.shift().value.length)}for(i=B.needsContext.test(e)?0:a.length;i--&&(s=a[i],!t.relative[c=s.type]);)if((u=t.find[c])&&(o=u(s.matches[0].replace(J,G),V.test(a[0].type)&&se(n.parentNode)||n))){if(a.splice(i,1),!(e=o.length&&de(a)))return m.apply(r,o),r;break}}return(l||ve(e,p))(o,n,!d,r,!n||V.test(e)&&se(n.parentNode)||n),r}ue.prototype=t.filters=t.pseudos,t.setFilters=new ue,g.sortStable=v.split("").sort(C).join("")===v,ce(),g.sortDetached=ne((function(e){return 1&e.compareDocumentPosition(c.createElement("fieldset"))})),T.find=Z,T.expr[":"]=T.expr.pseudos,T.unique=T.uniqueSort,Z.compile=ve,Z.select=ye,Z.setDocument=ce,Z.tokenize=le,Z.escape=T.escapeSelector,Z.getText=T.text,Z.isXML=T.isXMLDoc,Z.selectors=T.expr,Z.support=T.support,Z.uniqueSort=T.uniqueSort}();var L=function(e,t,n){for(var r=[],o=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(o&&T(e).is(n))break;r.push(e)}return r},R=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},M=T.expr.match.needsContext,I=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function F(e,t,n){return v(t)?T.grep(e,(function(e,r){return!!t.call(e,r,e)!==n})):t.nodeType?T.grep(e,(function(e){return e===t!==n})):"string"!=typeof t?T.grep(e,(function(e){return l.call(t,e)>-1!==n})):T.filter(t,e,n)}T.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?T.find.matchesSelector(r,e)?[r]:[]:T.find.matches(e,T.grep(t,(function(e){return 1===e.nodeType})))},T.fn.extend({find:function(e){var t,n,r=this.length,o=this;if("string"!=typeof e)return this.pushStack(T(e).filter((function(){for(t=0;t<r;t++)if(T.contains(o[t],this))return!0})));for(n=this.pushStack([]),t=0;t<r;t++)T.find(e,o[t],n);return r>1?T.uniqueSort(n):n},filter:function(e){return this.pushStack(F(this,e||[],!1))},not:function(e){return this.pushStack(F(this,e||[],!0))},is:function(e){return!!F(this,"string"==typeof e&&M.test(e)?T(e):e||[],!1).length}});var W,Q=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(T.fn.init=function(e,t,n){var r,o;if(!e)return this;if(n=n||W,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:Q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof T?t[0]:t,T.merge(this,T.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:b,!0)),I.test(r[1])&&T.isPlainObject(t))for(r in t)v(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(o=b.getElementById(r[2]))&&(this[0]=o,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):v(e)?void 0!==n.ready?n.ready(e):e(T):T.makeArray(e,this)}).prototype=T.fn,W=T(b);var B=/^(?:parents|prev(?:Until|All))/,z={children:!0,contents:!0,next:!0,prev:!0};function U(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}T.fn.extend({has:function(e){var t=T(e,this),n=t.length;return this.filter((function(){for(var e=0;e<n;e++)if(T.contains(this,t[e]))return!0}))},closest:function(e,t){var n,r=0,o=this.length,i=[],a="string"!=typeof e&&T(e);if(!M.test(e))for(;r<o;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(n.nodeType<11&&(a?a.index(n)>-1:1===n.nodeType&&T.find.matchesSelector(n,e))){i.push(n);break}return this.pushStack(i.length>1?T.uniqueSort(i):i)},index:function(e){return e?"string"==typeof e?l.call(T(e),this[0]):l.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(T.uniqueSort(T.merge(this.get(),T(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),T.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return L(e,"parentNode")},parentsUntil:function(e,t,n){return L(e,"parentNode",n)},next:function(e){return U(e,"nextSibling")},prev:function(e){return U(e,"previousSibling")},nextAll:function(e){return L(e,"nextSibling")},prevAll:function(e){return L(e,"previousSibling")},nextUntil:function(e,t,n){return L(e,"nextSibling",n)},prevUntil:function(e,t,n){return L(e,"previousSibling",n)},siblings:function(e){return R((e.parentNode||{}).firstChild,e)},children:function(e){return R(e.firstChild)},contents:function(e){return null!=e.contentDocument&&a(e.contentDocument)?e.contentDocument:(A(e,"template")&&(e=e.content||e),T.merge([],e.childNodes))}},(function(e,t){T.fn[e]=function(n,r){var o=T.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(o=T.filter(r,o)),this.length>1&&(z[e]||T.uniqueSort(o),B.test(e)&&o.reverse()),this.pushStack(o)}}));var X=/[^\x20\t\r\n\f]+/g;function V(e){return e}function J(e){throw e}function G(e,t,n,r){var o;try{e&&v(o=e.promise)?o.call(e).done(t).fail(n):e&&v(o=e.then)?o.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}T.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return T.each(e.match(X)||[],(function(e,n){t[n]=!0})),t}(e):T.extend({},e);var t,n,r,o,i=[],a=[],s=-1,c=function(){for(o=o||e.once,r=t=!0;a.length;s=-1)for(n=a.shift();++s<i.length;)!1===i[s].apply(n[0],n[1])&&e.stopOnFalse&&(s=i.length,n=!1);e.memory||(n=!1),t=!1,o&&(i=n?[]:"")},u={add:function(){return i&&(n&&!t&&(s=i.length-1,a.push(n)),function t(n){T.each(n,(function(n,r){v(r)?e.unique&&u.has(r)||i.push(r):r&&r.length&&"string"!==j(r)&&t(r)}))}(arguments),n&&!t&&c()),this},remove:function(){return T.each(arguments,(function(e,t){for(var n;(n=T.inArray(t,i,n))>-1;)i.splice(n,1),n<=s&&s--})),this},has:function(e){return e?T.inArray(e,i)>-1:i.length>0},empty:function(){return i&&(i=[]),this},disable:function(){return o=a=[],i=n="",this},disabled:function(){return!i},lock:function(){return o=a=[],n||t||(i=n=""),this},locked:function(){return!!o},fireWith:function(e,n){return o||(n=[e,(n=n||[]).slice?n.slice():n],a.push(n),t||c()),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!r}};return u},T.extend({Deferred:function(e){var t=[["notify","progress",T.Callbacks("memory"),T.Callbacks("memory"),2],["resolve","done",T.Callbacks("once memory"),T.Callbacks("once memory"),0,"resolved"],["reject","fail",T.Callbacks("once memory"),T.Callbacks("once memory"),1,"rejected"]],n="pending",o={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},catch:function(e){return o.then(null,e)},pipe:function(){var e=arguments;return T.Deferred((function(n){T.each(t,(function(t,r){var o=v(e[r[4]])&&e[r[4]];i[r[1]]((function(){var e=o&&o.apply(this,arguments);e&&v(e.promise)?e.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[r[0]+"With"](this,o?[e]:arguments)}))})),e=null})).promise()},then:function(e,n,o){var i=0;function a(e,t,n,o){return function(){var s=this,c=arguments,u=function(){var r,u;if(!(e<i)){if((r=n.apply(s,c))===t.promise())throw new TypeError("Thenable self
11-resolution");u=r&&("object"==typeof r||"function"==typeof r)&&r.then,v(u)?o?u.call(r,a(i,t,V,o),a(i,t,J,o)):(i++,u.call(r,a(i,t,V,o),a(i,t,J,o),a(i,t,V,t.notifyWith))):(n!==V&&(s=void 0,c=[r]),(o||t.resolveWith)(s,c))}},l=o?u:function(){try{u()}catch(r){T.Deferred.exceptionHook&&T.Deferred.exceptionHook(r,l.error),e+1>=i&&(n!==J&&(s=void 0,c=[r]),t.rejectWith(s,c))}};e?l():(T.Deferred.getErrorHook?l.error=T.Deferred.getErrorHook():T.Deferred.getStackHook&&(l.error=T.Deferred.getStackHook()),r.setTimeout(l))}}return T.Deferred((function(r){t[0][3].add(a(0,r,v(o)?o:V,r.notifyWith)),t[1][3].add(a(0,r,v(e)?e:V)),t[2][3].add(a(0,r,v(n)?n:J))})).promise()},promise:function(e){return null!=e?T.extend(e,o):o}},i={};return T.each(t,(function(e,r){var a=r[2],s=r[5];o[r[1]]=a.add,s&&a.add((function(){n=s}),t[3-e][2].disable,t[3-e][3].disable,t[0][2].lock,t[0][3].lock),a.add(r[3].fire),i[r[0]]=function(){return i[r[0]+"With"](this===i?void 0:this,arguments),this},i[r[0]+"With"]=a.fireWith})),o.promise(i),e&&e.call(i,i),i},when:function(e){var t=arguments.length,n=t,r=Array(n),o=s.call(arguments),i=T.Deferred(),a=function(e){return function(n){r[e]=this,o[e]=arguments.length>1?s.call(arguments):n,--t||i.resolveWith(r,o)}};if(t<=1&&(G(e,i.done(a(n)).resolve,i.reject,!t),"pending"===i.state()||v(o[n]&&o[n].then)))return i.then();for(;n--;)G(o[n],a(n),i.reject);return i.promise()}});var Y=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;T.Deferred.exceptionHook=function(e,t){r.console&&r.console.warn&&e&&Y.test(e.name)&&r.console.warn("jQuery.Deferred exception: "+e.message,e.stack,t)},T.readyException=function(e){r.setTimeout((function(){throw e}))};var K=T.Deferred();function Z(){b.removeEventListener("DOMContentLoaded",Z),r.removeEventListener("load",Z),T.ready()}T.fn.ready=function(e){return K.then(e).catch((function(e){T.readyException(e)})),this},T.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--T.readyWait:T.isReady)||(T.isReady=!0,!0!==e&&--T.readyWait>0||K.resolveWith(b,[T]))}}),T.ready.then=K.then,"complete"===b.readyState||"loading"!==b.readyState&&!b.documentElement.doScroll?r.setTimeout(T.ready):(b.addEventListener("DOMContentLoaded",Z),r.addEventListener("load",Z));var ee=function(e,t,n,r,o,i,a){var s=0,c=e.length,u=null==n;if("object"===j(n))for(s in o=!0,n)ee(e,t,s,n[s],!0,i,a);else if(void 0!==r&&(o=!0,v(r)||(a=!0),u&&(a?(t.call(e,r),t=null):(u=t,t=function(e,t,n){return u.call(T(e),n)})),t))for(;s<c;s++)t(e[s],n,a?r:r.call(e[s],s,t(e[s],n)));return o?e:u?t.call(e):c?t(e[0],n):i},te=/^-ms-/,ne=/-([a-z])/g;function re(e,t){return t.toUpperCase()}function oe(e){return e.replace(te,"ms-").replace(ne,re)}var ie=function(e){return 1===e.nodeType||9===e.nodeType||!+e.nodeType};function ae(){this.expando=T.expando+ae.uid++}ae.uid=1,ae.prototype={cache:function(e){var t=e[this.expando];return t||(t={},ie(e)&&(e.nodeType?e[this.expando]=t:Object.defineProperty(e,this.expando,{value:t,configurable:!0}))),t},set:function(e,t,n){var r,o=this.cache(e);if("string"==typeof t)o[oe(t)]=n;else for(r in t)o[oe(r)]=t[r];return o},get:function(e,t){return void 0===t?this.cache(e):e[this.expando]&&e[this.expando][oe(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(oe):(t=oe(t))in r?[t]:t.match(X)||[]).length;for(;n--;)delete r[t[n]]}(void 0===t||T.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&&!T.isEmptyObject(t)}};var se=new ae,ce=new ae,ue=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,le=/[A-Z]/g;function de(e,t,n){var r;if(void 0===n&&1===e.nodeType)if(r="data-"+t.replace(le,"-$&").toLowerCase(),"string"==typeof(n=e.getAttribute(r))){try{n=function(e){return"true"===e||"false"!==e&&("null"===e?null:e===+e+""?+e:ue.test(e)?JSON.parse(e):e)}(n)}catch(e){}ce.set(e,t,n)}else n=void 0;return n}T.extend({hasData:function(e){return ce.hasData(e)||se.hasData(e)},data:function(e,t,n){return ce.access(e,t,n)},removeData:function(e,t){ce.remove(e,t)},_data:function(e,t,n){return se.access(e,t,n)},_removeData:function(e,t){se.remove(e,t)}}),T.fn.extend({data:function(e,t){var n,r,o,i=this[0],a=i&&i.attributes;if(void 0===e){if(this.length&&(o=ce.get(i),1===i.nodeType&&!se.get(i,"hasDataAttrs"))){for(n=a.length;n--;)a[n]&&0===(r=a[n].name).indexOf("data-")&&(r=oe(r.slice(5)),de(i,r,o[r]));se.set(i,"hasDataAttrs",!0)}return o}return"object"==typeof e?this.each((function(){ce.set(this,e)})):ee(this,(function(t){var n;if(i&&void 0===t)return void 0!==(n=ce.get(i,e))||void 0!==(n=de(i,e))?n:void 0;this.each((function(){ce.set(this,e,t)}))}),null,t,arguments.length>1,null,!0)},removeData:function(e){return this.each((function(){ce.remove(this,e)}))}}),T.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=se.get(e,t),n&&(!r||Array.isArray(n)?r=se.access(e,t,T.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=T.queue(e,t),r=n.length,o=n.shift(),i=T._queueHooks(e,t);"inprogress"===o&&(o=n.shift(),r--),o&&("fx"===t&&n.unshift("inprogress"),delete i.stop,o.call(e,(function(){T.dequeue(e,t)}),i)),!r&&i&&i.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return se.get(e,n)||se.access(e,n,{empty:T.Callbacks("once memory").add((function(){se.remove(e,[t+"queue",n])}))})}}),T.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length<n?T.queue(this[0],e):void 0===t?this:this.each((function(){var n=T.queue(this,e,t);T._queueHooks(this,e),"fx"===e&&"inprogress"!==n[0]&&T.dequeue(this,e)}))},dequeue:function(e){return this.each((function(){T.dequeue(this,e)}))},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,t){var n,r=1,o=T.Deferred(),i=this,a=this.length,s=function(){--r||o.resolveWith(i,[i])};for("string"!=typeof e&&(t=e,e=void 0),e=e||"fx";a--;)(n=se.get(i[a],e+"queueHooks"))&&n.empty&&(r++,n.empty.add(s));return s(),o.promise(t)}});
vendor: 9,904 bytes, line 11
11var pe=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,fe=new RegExp("^(?:([+-])=|)("+pe+")([a-z%]*)$","i"),he=["Top","Right","Bottom","Left"],me=b.documentElement,ge=function(e){return T.contains(e.ownerDocument,e)},ve={composed:!0};me.getRootNode&&(ge=function(e){return T.contains(e.ownerDocument,e)||e.getRootNode(ve)===e.ownerDocument});var ye=function(e,t){return"none"===(e=t||e).style.display||""===e.style.display&&ge(e)&&"none"===T.css(e,"display")};function be(e,t,n,r){var o,i,a=20,s=r?function(){return r.cur()}:function(){return T.css(e,t,"")},c=s(),u=n&&n[3]||(T.cssNumber[t]?"":"px"),l=e.nodeType&&(T.cssNumber[t]||"px"!==u&&+c)&&fe.exec(T.css(e,t));if(l&&l[3]!==u){for(c/=2,u=u||l[3],l=+c||1;a--;)T.style(e,t,l+u),(1-i)*(1-(i=s()/c||.5))<=0&&(a=0),l/=i;l*=2,T.style(e,t,l+u),n=n||[]}return n&&(l=+l||+c||0,o=n[1]?l+(n[1]+1)*n[2]:+n[2],r&&(r.unit=u,r.start=l,r.end=o)),o}var xe={};function we(e){var t,n=e.ownerDocument,r=e.nodeName,o=xe[r];return o||(t=n.body.appendChild(n.createElement(r)),o=T.css(t,"display"),t.parentNode.removeChild(t),"none"===o&&(o="block"),xe[r]=o,o)}function je(e,t){for(var n,r,o=[],i=0,a=e.length;i<a;i++)(r=e[i]).style&&(n=r.style.display,t?("none"===n&&(o[i]=se.get(r,"display")||null,o[i]||(r.style.display="")),""===r.style.display&&ye(r)&&(o[i]=we(r))):"none"!==n&&(o[i]="none",se.set(r,"display",n)));for(i=0;i<a;i++)null!=o[i]&&(e[i].style.display=o[i]);return e}T.fn.extend({show:function(){return je(this,!0)},hide:function(){return je(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each((function(){ye(this)?T(this).show():T(this).hide()}))}});var ke,Ce,Te=/^(?:checkbox|radio)$/i,Se=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,Ae=/^$|^module$|\/(?:java|ecma)script/i;ke=b.createDocumentFragment().appendChild(b.createElement("div")),(Ce=b.createElement("input")).setAttribute("type","radio"),Ce.setAttribute("checked","checked"),Ce.setAttribute("name","t"),ke.appendChild(Ce),g.checkClone=ke.cloneNode(!0).cloneNode(!0).lastChild.checked,ke.innerHTML="<textarea>x</textarea>",g.noCloneChecked=!!ke.cloneNode(!0).lastChild.defaultValue,ke.innerHTML="<option></option>",g.option=!!ke.lastChild;var Ee={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,"",""]};function De(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?T.merge([e],n):n}function Pe(e,t){for(var n=0,r=e.length;n<r;n++)se.set(e[n],"globalEval",!t||se.get(t[n],"globalEval"))}Ee.tbody=Ee.tfoot=Ee.colgroup=Ee.caption=Ee.thead,Ee.th=Ee.td,g.option||(Ee.optgroup=Ee.option=[1,"<select multiple='multiple'>","</select>"]);var qe=/<|&#?\w+;/;function Ne(e,t,n,r,o){for(var i,a,s,c,u,l,d=t.createDocumentFragment(),p=[],f=0,h=e.length;f<h;f++)if((i=e[f])||0===i)if("object"===j(i))T.merge(p,i.nodeType?[i]:i);else if(qe.test(i)){for(a=a||d.appendChild(t.createElement("div")),s=(Se.exec(i)||["",""])[1].toLowerCase(),c=Ee[s]||Ee._default,a.innerHTML=c[1]+T.htmlPrefilter(i)+c[2],l=c[0];l--;)a=a.lastChild;T.merge(p,a.childNodes),(a=d.firstChild).textContent=""}else p.push(t.createTextNode(i));for(d.textContent="",f=0;i=p[f++];)if(r&&T.inArray(i,r)>-1)o&&o.push(i);else if(u=ge(i),a=De(d.appendChild(i),"script"),u&&Pe(a),n)for(l=0;i=a[l++];)Ae.test(i.type||"")&&n.push(i);return d}var Oe=/^([^.]*)(?:\.(.+)|)/;function _e(){return!0}function $e(){return!1}function He(e,t,n,r,o,i){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)He(e,s,n,r,t[s],i);return e}if(null==r&&null==o?(o=n,r=n=void 0):null==o&&("string"==typeof n?(o=r,r=void 0):(o=r,r=n,n=void 0)),!1===o)o=$e;else if(!o)return e;return 1===i&&(a=o,o=function(e){return T().off(e),a.apply(this,arguments)},o.guid=a.guid||(a.guid=T.guid++)),e.each((function(){T.event.add(this,t,o,r,n)}))}function Le(e,t,n){n?(se.set(e,t,!1),T.event.add(e,t,{namespace:!1,handler:function(e){var n,r=se.get(this,t);if(1&e.isTrigger&&this[t]){if(r)(T.event.special[t]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),se.set(this,t,r),this[t](),n=se.get(this,t),se.set(this,t,!1),r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n}else r&&(se.set(this,t,T.event.trigger(r[0],r.slice(1),this)),e.stopPropagation(),e.isImmediatePropagationStopped=_e)}})):void 0===se.get(e,t)&&T.event.add(e,t,_e)}T.event={global:{},add:function(e,t,n,r,o){var i,a,s,c,u,l,d,p,f,h,m,g=se.get(e);if(ie(e))for(n.handler&&(n=(i=n).handler,o=i.selector),o&&T.find.matchesSelector(me,o),n.guid||(n.guid=T.guid++),(c=g.events)||(c=g.events=Object.create(null)),(a=g.handle)||(a=g.handle=function(t){return void 0!==T&&T.event.triggered!==t.type?T.event.dispatch.apply(e,arguments):void 0}),u=(t=(t||"").match(X)||[""]).length;u--;)f=m=(s=Oe.exec(t[u])||[])[1],h=(s[2]||"").split(".").sort(),f&&(d=T.event.special[f]||{},f=(o?d.delegateType:d.bindType)||f,d=T.event.special[f]||{},l=T.extend({type:f,origType:m,data:r,handler:n,guid:n.guid,selector:o,needsContext:o&&T.expr.match.needsContext.test(o),namespace:h.join(".")},i),(p=c[f])||((p=c[f]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(e,r,h,a)||e.addEventListener&&e.addEventListener(f,a)),d.add&&(d.add.call(e,l),l.handler.guid||(l.handler.guid=n.guid)),o?p.splice(p.delegateCount++,0,l):p.push(l),T.event.global[f]=!0)},remove:function(e,t,n,r,o){var i,a,s,c,u,l,d,p,f,h,m,g=se.hasData(e)&&se.get(e);if(g&&(c=g.events)){for(u=(t=(t||"").match(X)||[""]).length;u--;)if(f=m=(s=Oe.exec(t[u])||[])[1],h=(s[2]||"").split(".").sort(),f){for(d=T.event.special[f]||{},p=c[f=(r?d.delegateType:d.bindType)||f]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=i=p.length;i--;)l=p[i],!o&&m!==l.origType||n&&n.guid!==l.guid||s&&!s.test(l.namespace)||r&&r!==l.selector&&("**"!==r||!l.selector)||(p.splice(i,1),l.selector&&p.delegateCount--,d.remove&&d.remove.call(e,l));a&&!p.length&&(d.teardown&&!1!==d.teardown.call(e,h,g.handle)||T.removeEvent(e,f,g.handle),delete c[f])}else for(f in c)T.event.remove(e,f+t[u],n,r,!0);T.isEmptyObject(c)&&se.remove(e,"handle events")}},dispatch:function(e){var t,n,r,o,i,a,s=new Array(arguments.length),c=T.event.fix(e),u=(se.get(this,"events")||Object.create(null))[c.type]||[],l=T.event.special[c.type]||{};for(s[0]=c,t=1;t<arguments.length;t++)s[t]=arguments[t];if(c.delegateTarget=this,!l.preDispatch||!1!==l.preDispatch.call(this,c)){for(a=T.event.handlers.call(this,c,u),t=0;(o=a[t++])&&!c.isPropagationStopped();)for(c.currentTarget=o.elem,n=0;(i=o.handlers[n++])&&!c.isImmediatePropagationStopped();)c.rnamespace&&!1!==i.namespace&&!c.rnamespace.test(i.namespace)||(c.handleObj=i,c.data=i.data,void 0!==(r=((T.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,s))&&!1===(c.result=r)&&(c.preventDefault(),c.stopPropagation()));return l.postDispatch&&l.postDispatch.call(this,c),c.result}},handlers:function(e,t){var n,r,o,i,a,s=[],c=t.delegateCount,u=e.target;if(c&&u.nodeType&&!("click"===e.type&&e.button>=1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&("click"!==e.type||!0!==u.disabled)){for(i=[],a={},n=0;n<c;n++)void 0===a[o=(r=t[n]).selector+" "]&&(a[o]=r.needsContext?T(o,this).index(u)>-1:T.find(o,this,null,[u]).length),a[o]&&i.push(r);i.length&&s.push({elem:u,handlers:i})}return u=this,c<t.length&&s.push({elem:u,handlers:t.slice(c)}),s},addProp:function(e,t){Object.defineProperty(T.Event.prototype,e,{enumerable:!0,configurable:!0,get:v(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[T.expando]?e:new T.Event(e)},special:{load:{noBubble:!0},click:{setup:function(e){var t=this||e;return Te.test(t.type)&&t.click&&A(t,"input")&&Le(t,"click",!0),!1},trigger:function(e){var t=this||e;return Te.test(t.type)&&t.click&&A(t,"input")&&Le(t,"click"),!0},_default:function(e){var t=e.target;return Te.test(t.type)&&t.click&&A(t,"input")&&se.get(t,"click")||A(t,"a")}},beforeunload:{postDispatch:function(e){void 0!==e.result&&e.originalEvent&&(e.originalEvent.returnValue=e.result)}}}},T.removeEvent=function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n)},T.Event=function(e,t){if(!(this instanceof T.Event))return new T.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?_e:$e,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&&T.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this[T.expando]=!0},T.Event.prototype={constructor:T.Event,isDefaultPrevented:$e,isPropagationStopped:$e,isImmediatePropagationStopped:$e,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=_e,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=_e,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=_e,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},T.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,code:!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:!0},T.event.addProp),T.each({focus:"focusin",blur:"focusout"},(function(e,t){function n(e){if(b.documentMode){var n=se.get(this,"handle"),r=T.event.fix(e);
vendor: 4,069 bytes, line 11
11r.type="focusin"===e.type?"focus":"blur",r.isSimulated=!0,n(e),r.target===r.currentTarget&&n(r)}else T.event.simulate(t,e.target,T.event.fix(e))}T.event.special[e]={setup:function(){var r;if(Le(this,e,!0),!b.documentMode)return!1;(r=se.get(this,t))||this.addEventListener(t,n),se.set(this,t,(r||0)+1)},trigger:function(){return Le(this,e),!0},teardown:function(){var e;if(!b.documentMode)return!1;(e=se.get(this,t)-1)?se.set(this,t,e):(this.removeEventListener(t,n),se.remove(this,t))},_default:function(t){return se.get(t.target,e)},delegateType:t},T.event.special[t]={setup:function(){var r=this.ownerDocument||this.document||this,o=b.documentMode?this:r,i=se.get(o,t);i||(b.documentMode?this.addEventListener(t,n):r.addEventListener(e,n,!0)),se.set(o,t,(i||0)+1)},teardown:function(){var r=this.ownerDocument||this.document||this,o=b.documentMode?this:r,i=se.get(o,t)-1;i?se.set(o,t,i):(b.documentMode?this.removeEventListener(t,n):r.removeEventListener(e,n,!0),se.remove(o,t))}}})),T.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},(function(e,t){T.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=e.relatedTarget,o=e.handleObj;return r&&(r===this||T.contains(this,r))||(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}})),T.fn.extend({on:function(e,t,n,r){return He(this,e,t,n,r)},one:function(e,t,n,r){return He(this,e,t,n,r,1)},off:function(e,t,n){var r,o;if(e&&e.preventDefault&&e.handleObj)return r=e.handleObj,T(e.delegateTarget).off(r.namespace?r.origType+"."+r.namespace:r.origType,r.selector,r.handler),this;if("object"==typeof e){for(o in e)this.off(o,t,e[o]);return this}return!1!==t&&"function"!=typeof t||(n=t,t=void 0),!1===n&&(n=$e),this.each((function(){T.event.remove(this,e,n,t)}))}});var Re=/<script|<style|<link/i,Me=/checked\s*(?:[^=]|=\s*.checked.)/i,Ie=/^\s*<!\[CDATA\[|\]\]>\s*$/g;function Fe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&T(e).children("tbody")[0]||e}function We(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Be(e,t){var n,r,o,i,a,s;if(1===t.nodeType){if(se.hasData(e)&&(s=se.get(e).events))for(o in se.remove(t,"handle events"),s)for(n=0,r=s[o].length;n<r;n++)T.event.add(t,o,s[o][n]);ce.hasData(e)&&(i=ce.access(e),a=T.extend({},i),ce.set(t,a))}}function ze(e,t,n,r){t=c(t);var o,i,a,s,u,l,d=0,p=e.length,f=p-1,h=t[0],m=v(h);if(m||p>1&&"string"==typeof h&&!g.checkClone&&Me.test(h))return e.each((function(o){var i=e.eq(o);m&&(t[0]=h.call(this,o,i.html())),ze(i,t,n,r)}));if(p&&(i=(o=Ne(t,e[0].ownerDocument,!1,e,r)).firstChild,1===o.childNodes.length&&(o=i),i||r)){for(s=(a=T.map(De(o,"script"),We)).length;d<p;d++)u=o,d!==f&&(u=T.clone(u,!0,!0),s&&T.merge(a,De(u,"script"))),n.call(e[d],u,d);if(s)for(l=a[a.length-1].ownerDocument,T.map(a,Qe),d=0;d<s;d++)u=a[d],Ae.test(u.type||"")&&!se.access(u,"globalEval")&&T.contains(l,u)&&(u.src&&"module"!==(u.type||"").toLowerCase()?T._evalUrl&&!u.noModule&&T._evalUrl(u.src,{nonce:u.nonce||u.getAttribute("nonce")},l):w(u.textContent.replace(Ie,""),u,l))}return e}function Ue(e,t,n){for(var r,o=t?T.filter(t,e):e,i=0;null!=(r=o[i]);i++)n||1!==r.nodeType||T.cleanData(De(r)),r.parentNode&&(n&&ge(r)&&Pe(De(r,"script")),r.parentNode.removeChild(r));return e}T.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,o,i,a,s,c,u,l=e.cloneNode(!0),d=ge(e);if(!(g.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||T.isXMLDoc(e)))for(a=De(l),r=0,o=(i=De(e)).length;r<o;r++)s=i[r],c=a[r],u=void 0,"input"===(u=c.nodeName.toLowerCase())&&Te.test(s.type)?c.checked=s.checked:"input"!==u&&"textarea"!==u||(c.defaultValue=s.defaultValue);if(t)if(n)for(i=i||De(e),a=a||De(l),r=0,o=i.length;r<o;r++)Be(i[r],a[r]);else Be(e,l);return(a=De(l,"script")).length>0&&Pe(a,!d&&De(e,"script")),l},cleanData:function(e){for(var t,n,r,o=T.event.special,i=0;void 0!==(n=e[i]);i++)if(ie(n)){if(t=n[se.expando]){if(t.events)for(r in t.events)
vendor: 10,907 bytes, line 11
11o[r]?T.event.remove(n,r):T.removeEvent(n,r,t.handle);n[se.expando]=void 0}n[ce.expando]&&(n[ce.expando]=void 0)}}}),T.fn.extend({detach:function(e){return Ue(this,e,!0)},remove:function(e){return Ue(this,e)},text:function(e){return ee(this,(function(e){return void 0===e?T.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 ze(this,arguments,(function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Fe(this,e).appendChild(e)}))},prepend:function(){return ze(this,arguments,(function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Fe(this,e);t.insertBefore(e,t.firstChild)}}))},before:function(){return ze(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this)}))},after:function(){return ze(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&&(T.cleanData(De(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map((function(){return T.clone(this,e,t)}))},html:function(e){return ee(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&&!Re.test(e)&&!Ee[(Se.exec(e)||["",""])[1].toLowerCase()]){e=T.htmlPrefilter(e);try{for(;n<r;n++)1===(t=this[n]||{}).nodeType&&(T.cleanData(De(t,!1)),t.innerHTML=e);t=0}catch(e){}}t&&this.empty().append(e)}),null,e,arguments.length)},replaceWith:function(){var e=[];return ze(this,arguments,(function(t){var n=this.parentNode;T.inArray(this,e)<0&&(T.cleanData(De(this)),n&&n.replaceChild(t,this))}),e)}}),T.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(e,t){T.fn[e]=function(e){for(var n,r=[],o=T(e),i=o.length-1,a=0;a<=i;a++)n=a===i?this:this.clone(!0),T(o[a])[t](n),u.apply(r,n.get());return this.pushStack(r)}}));var Xe=new RegExp("^("+pe+")(?!px)[a-z%]+$","i"),Ve=/^--/,Je=function(e){var t=e.ownerDocument.defaultView;return t&&t.opener||(t=r),t.getComputedStyle(e)},Ge=function(e,t,n){var r,o,i={};for(o in t)i[o]=e.style[o],e.style[o]=t[o];for(o in r=n.call(e),t)e.style[o]=i[o];return r},Ye=new RegExp(he.join("|"),"i");function Ke(e,t,n){var r,o,i,a,s=Ve.test(t),c=e.style;return(n=n||Je(e))&&(a=n.getPropertyValue(t)||n[t],s&&a&&(a=a.replace(N,"$1")||void 0),""!==a||ge(e)||(a=T.style(e,t)),!g.pixelBoxStyles()&&Xe.test(a)&&Ye.test(t)&&(r=c.width,o=c.minWidth,i=c.maxWidth,c.minWidth=c.maxWidth=c.width=a,a=n.width,c.width=r,c.minWidth=o,c.maxWidth=i)),void 0!==a?a+"":a}function Ze(e,t){return{get:function(){if(!e())return(this.get=t).apply(this,arguments);delete this.get}}}!function(){function e(){if(l){u.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",l.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",me.appendChild(u).appendChild(l);var e=r.getComputedStyle(l);n="1%"!==e.top,c=12===t(e.marginLeft),l.style.right="60%",a=36===t(e.right),o=36===t(e.width),l.style.position="absolute",i=12===t(l.offsetWidth/3),me.removeChild(u),l=null}}function t(e){return Math.round(parseFloat(e))}var n,o,i,a,s,c,u=b.createElement("div"),l=b.createElement("div");l.style&&(l.style.backgroundClip="content-box",l.cloneNode(!0).style.backgroundClip="",g.clearCloneStyle="content-box"===l.style.backgroundClip,T.extend(g,{boxSizingReliable:function(){return e(),o},pixelBoxStyles:function(){return e(),a},pixelPosition:function(){return e(),n},reliableMarginLeft:function(){return e(),c},scrollboxSize:function(){return e(),i},reliableTrDimensions:function(){var e,t,n,o;return null==s&&(e=b.createElement("table"),t=b.createElement("tr"),n=b.createElement("div"),e.style.cssText="position:absolute;left:-11111px;border-collapse:separate",t.style.cssText="box-sizing:content-box;border:1px solid",t.style.height="1px",n.style.height="9px",n.style.display="block",me.appendChild(e).appendChild(t).appendChild(n),o=r.getComputedStyle(t),s=parseInt(o.height,10)+parseInt(o.borderTopWidth,10)+parseInt(o.borderBottomWidth,10)===t.offsetHeight,me.removeChild(e)),s}}))}();var et=["Webkit","Moz","ms"],tt=b.createElement("div").style,nt={};function rt(e){var t=T.cssProps[e]||nt[e];return t||(e in tt?e:nt[e]=function(e){for(var t=e[0].toUpperCase()+e.slice(1),n=et.length;n--;)if((e=et[n]+t)in tt)return e}(e)||e)}var ot=/^(none|table(?!-c[ea]).+)/,it={position:"absolute",visibility:"hidden",display:"block"},at={letterSpacing:"0",fontWeight:"400"};function st(e,t,n){var r=fe.exec(t);return r?Math.max(0,r[2]-(n||0))+(r[3]||"px"):t}function ct(e,t,n,r,o,i){var a="width"===t?1:0,s=0,c=0,u=0;if(n===(r?"border":"content"))return 0;for(;a<4;a+=2)"margin"===n&&(u+=T.css(e,n+he[a],!0,o)),r?("content"===n&&(c-=T.css(e,"padding"+he[a],!0,o)),"margin"!==n&&(c-=T.css(e,"border"+he[a]+"Width",!0,o))):(c+=T.css(e,"padding"+he[a],!0,o),"padding"!==n?c+=T.css(e,"border"+he[a]+"Width",!0,o):s+=T.css(e,"border"+he[a]+"Width",!0,o));return!r&&i>=0&&(c+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-i-c-s-.5))||0),c+u}function ut(e,t,n){var r=Je(e),o=(!g.boxSizingReliable()||n)&&"border-box"===T.css(e,"boxSizing",!1,r),i=o,a=Ke(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if(Xe.test(a)){if(!n)return a;a="auto"}return(!g.boxSizingReliable()&&o||!g.reliableTrDimensions()&&A(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===T.css(e,"display",!1,r))&&e.getClientRects().length&&(o="border-box"===T.css(e,"boxSizing",!1,r),(i=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+ct(e,t,n||(o?"border":"content"),i,r,a)+"px"}function lt(e,t,n,r,o){return new lt.prototype.init(e,t,n,r,o)}T.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Ke(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,i,a,s=oe(t),c=Ve.test(t),u=e.style;if(c||(t=rt(s)),a=T.cssHooks[t]||T.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(o=a.get(e,!1,r))?o:u[t];"string"===(i=typeof n)&&(o=fe.exec(n))&&o[1]&&(n=be(e,t,o),i="number"),null!=n&&n==n&&("number"!==i||c||(n+=o&&o[3]||(T.cssNumber[s]?"":"px")),g.clearCloneStyle||""!==n||0!==t.indexOf("background")||(u[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(c?u.setProperty(t,n):u[t]=n))}},css:function(e,t,n,r){var o,i,a,s=oe(t);return Ve.test(t)||(t=rt(s)),(a=T.cssHooks[t]||T.cssHooks[s])&&"get"in a&&(o=a.get(e,!0,n)),void 0===o&&(o=Ke(e,t,r)),"normal"===o&&t in at&&(o=at[t]),""===n||n?(i=parseFloat(o),!0===n||isFinite(i)?i||0:o):o}}),T.each(["height","width"],(function(e,t){T.cssHooks[t]={get:function(e,n,r){if(n)return!ot.test(T.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?ut(e,t,r):Ge(e,it,(function(){return ut(e,t,r)}))},set:function(e,n,r){var o,i=Je(e),a=!g.scrollboxSize()&&"absolute"===i.position,s=(a||r)&&"border-box"===T.css(e,"boxSizing",!1,i),c=r?ct(e,t,r,s,i):0;return s&&a&&(c-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(i[t])-ct(e,t,"border",!1,i)-.5)),c&&(o=fe.exec(n))&&"px"!==(o[3]||"px")&&(e.style[t]=n,n=T.css(e,t)),st(0,n,c)}}})),T.cssHooks.marginLeft=Ze(g.reliableMarginLeft,(function(e,t){if(t)return(parseFloat(Ke(e,"marginLeft"))||e.getBoundingClientRect().left-Ge(e,{marginLeft:0},(function(){return e.getBoundingClientRect().left})))+"px"})),T.each({margin:"",padding:"",border:"Width"},(function(e,t){T.cssHooks[e+t]={expand:function(n){for(var r=0,o={},i="string"==typeof n?n.split(" "):[n];r<4;r++)o[e+he[r]+t]=i[r]||i[r-2]||i[0];return o}},"margin"!==e&&(T.cssHooks[e+t].set=st)})),T.fn.extend({css:function(e,t){return ee(this,(function(e,t,n){var r,o,i={},a=0;if(Array.isArray(t)){for(r=Je(e),o=t.length;a<o;a++)i[t[a]]=T.css(e,t[a],!1,r);return i}return void 0!==n?T.style(e,t,n):T.css(e,t)}),e,t,arguments.length>1)}}),T.Tween=lt,lt.prototype={constructor:lt,init:function(e,t,n,r,o,i){this.elem=e,this.prop=n,this.easing=o||T.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=i||(T.cssNumber[n]?"":"px")},cur:function(){var e=lt.propHooks[this.prop];return e&&e.get?e.get(this):lt.propHooks._default.get(this)},run:function(e){var t,n=lt.propHooks[this.prop];return this.options.duration?this.pos=t=T.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):lt.propHooks._default.set(this),this}},lt.prototype.init.prototype=lt.prototype,lt.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=T.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){T.fx.step[e.prop]?T.fx.step[e.prop](e):1!==e.elem.nodeType||!T.cssHooks[e.prop]&&null==e.elem.style[rt(e.prop)]?e.elem[e.prop]=e.now:T.style(e.elem,e.prop,e.now+e.unit)}}},lt.propHooks.scrollTop=lt.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},T.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},T.fx=lt.prototype.init,T.fx.step={};var dt,pt,ft=/^(?:toggle|show|hide)$/,ht=/queueHooks$/;function mt(){pt&&(!1===b.hidden&&r.requestAnimationFrame?r.requestAnimationFrame(mt):r.setTimeout(mt,T.fx.interval),T.fx.tick())}function gt(){return r.setTimeout((function(){dt=void 0})),dt=Date.now()}function vt(e,t){var n,r=0,o={height:e};for(t=t?1:0;r<4;r+=2-t)o["margin"+(n=he[r])]=o["padding"+n]=e;return t&&(o.opacity=o.width=e),o}function yt(e,t,n){for(var r,o=(bt.tweeners[t]||[]).concat(bt.tweeners["*"]),i=0,a=o.length;i<a;i++)if(r=o[i].call(n,t,e))return r}function bt(e,t,n){var r,o,i=0,a=bt.prefilters.length,s=T.Deferred().always((function(){delete c.elem})),c=function(){if(o)return!1;for(var t=dt||gt(),n=Math.max(0,u.startTime+u.duration-t),r=1-(n/u.duration||0),i=0,a=u.tweens.length;i<a;i++)u.tweens[i].run(r);return s.notifyWith(e,[u,r,n]),r<1&&a?n:(a||s.notifyWith(e,[u,1,0]),s.resolveWith(e,[u]),!1)},u=s.promise({elem:e,props:T.extend({},t),opts:T.extend(!0,{specialEasing:{},easing:T.easing._default},n),originalProperties:t,originalOptions:n,startTime:dt||gt(),duration:n.duration,tweens:[],createTween:function(t,n){var r=T.Tween(e,u.opts,t,n,u.opts.specialEasing[t]||u.o
vendor: 1,609 bytes, line 11
11pts.easing);return u.tweens.push(r),r},stop:function(t){var n=0,r=t?u.tweens.length:0;if(o)return this;for(o=!0;n<r;n++)u.tweens[n].run(1);return t?(s.notifyWith(e,[u,1,0]),s.resolveWith(e,[u,t])):s.rejectWith(e,[u,t]),this}}),l=u.props;for(!function(e,t){var n,r,o,i,a;for(n in e)if(o=t[r=oe(n)],i=e[n],Array.isArray(i)&&(o=i[1],i=e[n]=i[0]),n!==r&&(e[r]=i,delete e[n]),(a=T.cssHooks[r])&&"expand"in a)for(n in i=a.expand(i),delete e[r],i)n in e||(e[n]=i[n],t[n]=o);else t[r]=o}(l,u.opts.specialEasing);i<a;i++)if(r=bt.prefilters[i].call(u,e,l,u.opts))return v(r.stop)&&(T._queueHooks(u.elem,u.opts.queue).stop=r.stop.bind(r)),r;return T.map(l,yt,u),v(u.opts.start)&&u.opts.start.call(e,u),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always),T.fx.timer(T.extend(c,{elem:e,anim:u,queue:u.opts.queue})),u}T.Animation=T.extend(bt,{tweeners:{"*":[function(e,t){var n=this.createTween(e,t);return be(n.elem,e,fe.exec(t),n),n}]},tweener:function(e,t){v(e)?(t=e,e=["*"]):e=e.match(X);for(var n,r=0,o=e.length;r<o;r++)n=e[r],bt.tweeners[n]=bt.tweeners[n]||[],bt.tweeners[n].unshift(t)},prefilters:[function(e,t,n){var r,o,i,a,s,c,u,l,d="width"in t||"height"in t,p=this,f={},h=e.style,m=e.nodeType&&ye(e),g=se.get(e,"fxshow");for(r in n.queue||(null==(a=T._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--,T.queue(e,"fx").length||a.empty.fire()}))}))),t)if(o=t[r],ft.test(o)){if(delete t[r],i=i||"toggle"===o,o===(m?"hide":"show")){if("show"!==o||
vendor: 23,644 bytes, line 11
11!g||void 0===g[r])continue;m=!0}f[r]=g&&g[r]||T.style(e,r)}if((c=!T.isEmptyObject(t))||!T.isEmptyObject(f))for(r in d&&1===e.nodeType&&(n.overflow=[h.overflow,h.overflowX,h.overflowY],null==(u=g&&g.display)&&(u=se.get(e,"display")),"none"===(l=T.css(e,"display"))&&(u?l=u:(je([e],!0),u=e.style.display||u,l=T.css(e,"display"),je([e]))),("inline"===l||"inline-block"===l&&null!=u)&&"none"===T.css(e,"float")&&(c||(p.done((function(){h.display=u})),null==u&&(l=h.display,u="none"===l?"":l)),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]}))),c=!1,f)c||(g?"hidden"in g&&(m=g.hidden):g=se.access(e,"fxshow",{display:u}),i&&(g.hidden=!m),m&&je([e],!0),p.done((function(){for(r in m||je([e]),se.remove(e,"fxshow"),f)T.style(e,r,f[r])}))),c=yt(m?g[r]:0,r,p),r in g||(g[r]=c.start,m&&(c.end=c.start,c.start=0))}],prefilter:function(e,t){t?bt.prefilters.unshift(e):bt.prefilters.push(e)}}),T.speed=function(e,t,n){var r=e&&"object"==typeof e?T.extend({},e):{complete:n||!n&&t||v(e)&&e,duration:e,easing:n&&t||t&&!v(t)&&t};return T.fx.off?r.duration=0:"number"!=typeof r.duration&&(r.duration in T.fx.speeds?r.duration=T.fx.speeds[r.duration]:r.duration=T.fx.speeds._default),null!=r.queue&&!0!==r.queue||(r.queue="fx"),r.old=r.complete,r.complete=function(){v(r.old)&&r.old.call(this),r.queue&&T.dequeue(this,r.queue)},r},T.fn.extend({fadeTo:function(e,t,n,r){return this.filter(ye).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var o=T.isEmptyObject(e),i=T.speed(t,n,r),a=function(){var t=bt(this,T.extend({},e),i);(o||se.get(this,"finish"))&&t.stop(!0)};return a.finish=a,o||!1===i.queue?this.each(a):this.queue(i.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&&this.queue(e||"fx",[]),this.each((function(){var t=!0,o=null!=e&&e+"queueHooks",i=T.timers,a=se.get(this);if(o)a[o]&&a[o].stop&&r(a[o]);else for(o in a)a[o]&&a[o].stop&&ht.test(o)&&r(a[o]);for(o=i.length;o--;)i[o].elem!==this||null!=e&&i[o].queue!==e||(i[o].anim.stop(n),t=!1,i.splice(o,1));!t&&n||T.dequeue(this,e)}))},finish:function(e){return!1!==e&&(e=e||"fx"),this.each((function(){var t,n=se.get(this),r=n[e+"queue"],o=n[e+"queueHooks"],i=T.timers,a=r?r.length:0;for(n.finish=!0,T.queue(this,e,[]),o&&o.stop&&o.stop.call(this,!0),t=i.length;t--;)i[t].elem===this&&i[t].queue===e&&(i[t].anim.stop(!0),i.splice(t,1));for(t=0;t<a;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish}))}}),T.each(["toggle","show","hide"],(function(e,t){var n=T.fn[t];T.fn[t]=function(e,r,o){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(vt(t,!0),e,r,o)}})),T.each({slideDown:vt("show"),slideUp:vt("hide"),slideToggle:vt("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(e,t){T.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}})),T.timers=[],T.fx.tick=function(){var e,t=0,n=T.timers;for(dt=Date.now();t<n.length;t++)(e=n[t])()||n[t]!==e||n.splice(t--,1);n.length||T.fx.stop(),dt=void 0},T.fx.timer=function(e){T.timers.push(e),T.fx.start()},T.fx.interval=13,T.fx.start=function(){pt||(pt=!0,mt())},T.fx.stop=function(){pt=null},T.fx.speeds={slow:600,fast:200,_default:400},T.fn.delay=function(e,t){return e=T.fx&&T.fx.speeds[e]||e,t=t||"fx",this.queue(t,(function(t,n){var o=r.setTimeout(t,e);n.stop=function(){r.clearTimeout(o)}}))},function(){var e=b.createElement("input"),t=b.createElement("select").appendChild(b.createElement("option"));e.type="checkbox",g.checkOn=""!==e.value,g.optSelected=t.selected,(e=b.createElement("input")).value="t",e.type="radio",g.radioValue="t"===e.value}();var xt,wt=T.expr.attrHandle;T.fn.extend({attr:function(e,t){return ee(this,T.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each((function(){T.removeAttr(this,e)}))}}),T.extend({attr:function(e,t,n){var r,o,i=e.nodeType;if(3!==i&&8!==i&&2!==i)return void 0===e.getAttribute?T.prop(e,t,n):(1===i&&T.isXMLDoc(e)||(o=T.attrHooks[t.toLowerCase()]||(T.expr.match.bool.test(t)?xt:void 0)),void 0!==n?null===n?void T.removeAttr(e,t):o&&"set"in o&&void 0!==(r=o.set(e,n,t))?r:(e.setAttribute(t,n+""),n):o&&"get"in o&&null!==(r=o.get(e,t))?r:null==(r=T.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!g.radioValue&&"radio"===t&&A(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,o=t&&t.match(X);if(o&&1===e.nodeType)for(;n=o[r++];)e.removeAttribute(n)}}),xt={set:function(e,t,n){return!1===t?T.removeAttr(e,n):e.setAttribute(n,n),n}},T.each(T.expr.match.bool.source.match(/\w+/g),(function(e,t){var n=wt[t]||T.find.attr;wt[t]=function(e,t,r){var o,i,a=t.toLowerCase();return r||(i=wt[a],wt[a]=o,o=null!=n(e,t,r)?a:null,wt[a]=i),o}}));var jt=/^(?:input|select|textarea|button)$/i,kt=/^(?:a|area)$/i;function Ct(e){return(e.match(X)||[]).join(" ")}function Tt(e){return e.getAttribute&&e.getAttribute("class")||""}function St(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(X)||[]}T.fn.extend({prop:function(e,t){return ee(this,T.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each((function(){delete this[T.propFix[e]||e]}))}}),T.extend({prop:function(e,t,n){var r,o,i=e.nodeType;if(3!==i&&8!==i&&2!==i)return 1===i&&T.isXMLDoc(e)||(t=T.propFix[t]||t,o=T.propHooks[t]),void 0!==n?o&&"set"in o&&void 0!==(r=o.set(e,n,t))?r:e[t]=n:o&&"get"in o&&null!==(r=o.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=T.find.attr(e,"tabindex");return t?parseInt(t,10):jt.test(e.nodeName)||kt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),g.optSelected||(T.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)}}),T.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){T.propFix[this.toLowerCase()]=this})),T.fn.extend({addClass:function(e){var t,n,r,o,i,a;return v(e)?this.each((function(t){T(this).addClass(e.call(this,t,Tt(this)))})):(t=St(e)).length?this.each((function(){if(r=Tt(this),n=1===this.nodeType&&" "+Ct(r)+" "){for(i=0;i<t.length;i++)o=t[i],n.indexOf(" "+o+" ")<0&&(n+=o+" ");a=Ct(n),r!==a&&this.setAttribute("class",a)}})):this},removeClass:function(e){var t,n,r,o,i,a;return v(e)?this.each((function(t){T(this).removeClass(e.call(this,t,Tt(this)))})):arguments.length?(t=St(e)).length?this.each((function(){if(r=Tt(this),n=1===this.nodeType&&" "+Ct(r)+" "){for(i=0;i<t.length;i++)for(o=t[i];n.indexOf(" "+o+" ")>-1;)n=n.replace(" "+o+" "," ");a=Ct(n),r!==a&&this.setAttribute("class",a)}})):this:this.attr("class","")},toggleClass:function(e,t){var n,r,o,i,a=typeof e,s="string"===a||Array.isArray(e);return v(e)?this.each((function(n){T(this).toggleClass(e.call(this,n,Tt(this),t),t)})):"boolean"==typeof t&&s?t?this.addClass(e):this.removeClass(e):(n=St(e),this.each((function(){if(s)for(i=T(this),o=0;o<n.length;o++)r=n[o],i.hasClass(r)?i.removeClass(r):i.addClass(r);else void 0!==e&&"boolean"!==a||((r=Tt(this))&&se.set(this,"__className__",r),this.setAttribute&&this.setAttribute("class",r||!1===e?"":se.get(this,"__className__")||""))})))},hasClass:function(e){var t,n,r=0;for(t=" "+e+" ";n=this[r++];)if(1===n.nodeType&&(" "+Ct(Tt(n))+" ").indexOf(t)>-1)return!0;return!1}});var At=/\r/g;T.fn.extend({val:function(e){var t,n,r,o=this[0];return arguments.length?(r=v(e),this.each((function(n){var o;1===this.nodeType&&(null==(o=r?e.call(this,n,T(this).val()):e)?o="":"number"==typeof o?o+="":Array.isArray(o)&&(o=T.map(o,(function(e){return null==e?"":e+""}))),(t=T.valHooks[this.type]||T.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,o,"value")||(this.value=o))}))):o?(t=T.valHooks[o.type]||T.valHooks[o.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(o,"value"))?n:"string"==typeof(n=o.value)?n.replace(At,""):null==n?"":n:void 0}}),T.extend({valHooks:{option:{get:function(e){var t=T.find.attr(e,"value");return null!=t?t:Ct(T.text(e))}},select:{get:function(e){var t,n,r,o=e.options,i=e.selectedIndex,a="select-one"===e.type,s=a?null:[],c=a?i+1:o.length;for(r=i<0?c:a?i:0;r<c;r++)if(((n=o[r]).selected||r===i)&&!n.disabled&&(!n.parentNode.disabled||!A(n.parentNode,"optgroup"))){if(t=T(n).val(),a)return t;s.push(t)}return s},set:function(e,t){for(var n,r,o=e.options,i=T.makeArray(t),a=o.length;a--;)((r=o[a]).selected=T.inArray(T.valHooks.option.get(r),i)>-1)&&(n=!0);return n||(e.selectedIndex=-1),i}}}}),T.each(["radio","checkbox"],(function(){T.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=T.inArray(T(e).val(),t)>-1}},g.checkOn||(T.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}));var Et=r.location,Dt={guid:Date.now()},Pt=/\?/;T.parseXML=function(e){var t,n;if(!e||"string"!=typeof e)return null;try{t=(new r.DOMParser).parseFromString(e,"text/xml")}catch(e){}return n=t&&t.getElementsByTagName("parsererror")[0],t&&!n||T.error("Invalid XML: "+(n?T.map(n.childNodes,(function(e){return e.textContent})).join("\n"):e)),t};var qt=/^(?:focusinfocus|focusoutblur)$/,Nt=function(e){e.stopPropagation()};T.extend(T.event,{trigger:function(e,t,n,o){var i,a,s,c,u,l,d,p,h=[n||b],m=f.call(e,"type")?e.type:e,g=f.call(e,"namespace")?e.namespace.split("."):[];if(a=p=s=n=n||b,3!==n.nodeType&&8!==n.nodeType&&!qt.test(m+T.event.triggered)&&(m.indexOf(".")>-1&&(g=m.split("."),m=g.shift(),g.sort()),u=m.indexOf(":")<0&&"on"+m,(e=e[T.expando]?e:new T.Event(m,"object"==typeof e&&e)).isTrigger=o?2:3,e.namespace=g.join("."),e.rnamespace=e.namespace?new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,e.result=void 0,e.target||(e.target=n),t=null==t?[e]:T.makeArray(t,[e]),d=T.event.special[m]||{},o||!d.trigger||!1!==d.trigger.apply(n,t))){if(!o&&!d.noBubble&&!y(n)){for(c=d.delegateType||m,qt.test(c+m)||(a=a.parentNode);a;a=a.parentNode)h.push(a),s=a;s===(n.ownerDocument||b)&&h.push(s.defaultView||s.parentWindow||r)}for(i=0;(a=h[i++])&&!e.isPropagationStopped();)p=a,e.type=i>1?c:d.bindType||m,(l=(se.get(a,"events")||Object.create(null))[e.type]&&se.get(a,"handle"))&&l.apply(a,t),(l=u&&a[u])&&l.apply&&ie(a)&&(e.result=l.apply(a,t),!1===e.result&&e.preventDefault());return e.type=m,o||e.isDefaultPrevented()||d._default&&!1!==d._default.apply(h.pop(),t)||!ie(n)||u&&v(n[m])&&!y(n)&&((s=n[u])&&(n[u]=null),T.event.triggered=m,e.isPropagationStopped()&&p.addEventListener(m,Nt),n[m](),e.isPropagationStopped()&&p.removeEventListener(m,Nt),T.event.triggered=void 0,s&&(n[u]=s)),e.result}},simulate:function(e,t,n){var r=T.extend(new T.Event,n,{type:e,isSimulated:!0});T.event.trigger(r,null,t)}}),T.fn.extend({trigger:function(e,t){return this.each((function(){T.event.trigger(e,t,this)}))},triggerHandler:function(e,t){var n=this[0];if(n)return T.event.trigger(e,t,n,!0)}});var Ot=/\[\]$/,_t=/\r?\n/g,$t=/^(?:submit|button|image|reset|file)$/i,Ht=/^(?:input|select|textarea|keygen)/i;function Lt(e,t,n,r){var o;if(Array.isArray(t))T.each(t,(function(t,o){n||Ot.test(e)?r(e,o):Lt(e+"["+("object"==typeof o&&null!=o?t:"")+"]",o,n,r)}));else if(n||"object"!==j(t))r(e,t);else for(o in t)Lt(e+"["+o+"]",t[o],n,r)}T.param=function(e,t){var n,r=[],o=function(e,t){var n=v(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!T.isPlainObject(e))T.each(e,(function(){o(this.name,this.value)}));else for(n in e)Lt(n,e[n],t,o);return r.join("&")},T.fn.extend({serialize:function(){return T.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var e=T.prop(this,"elements");return e?T.makeArray(e):this})).filter((function(){var e=this.type;return this.name&&!T(this).is(":disabled")&&Ht.test(this.nodeName)&&!$t.test(e)&&(this.checked||!Te.test(e))})).map((function(e,t){var n=T(this).val();return null==n?null:Array.isArray(n)?T.map(n,(function(e){return{name:t.name,value:e.replace(_t,"\r\n")}})):{name:t.name,value:n.replace(_t,"\r\n")}})).get()}});var Rt=/%20/g,Mt=/#.*$/,It=/([?&])_=[^&]*/,Ft=/^(.*?):[ \t]*([^\r\n]*)$/gm,Wt=/^(?:GET|HEAD)$/,Qt=/^\/\//,Bt={},zt={},Ut="*/".concat("*"),Xt=b.createElement("a");function Vt(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,o=0,i=t.toLowerCase().match(X)||[];if(v(n))for(;r=i[o++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function Jt(e,t,n,r){var o={},i=e===zt;function a(s){var c;return o[s]=!0,T.each(e[s]||[],(function(e,s){var u=s(t,n,r);return"string"!=typeof u||i||o[u]?i?!(c=u):void 0:(t.dataTypes.unshift(u),a(u),!1)})),c}return a(t.dataTypes[0])||!o["*"]&&a("*")}function Gt(e,t){var n,r,o=T.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((o[n]?e:r||(r={}))[n]=t[n]);return r&&T.extend(!0,e,r),e}Xt.href=Et.href,T.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Et.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Et.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Ut,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":T.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Gt(Gt(e,T.ajaxSettings),t):Gt(T.ajaxSettings,e)},ajaxPrefilter:Vt(Bt),ajaxTransport:Vt(zt),ajax:function(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var n,o,i,a,s,c,u,l,d,p,f=T.ajaxSetup({},t),h=f.context||f,m=f.context&&(h.nodeType||h.jquery)?T(h):T.event,g=T.Deferred(),v=T.Callbacks("once memory"),y=f.statusCode||{},x={},w={},j="canceled",k={readyState:0,getResponseHeader:function(e){var t;if(u){if(!a)for(a={};t=Ft.exec(i);)a[t[1].toLowerCase()+" "]=(a[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=a[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return u?i:null},setRequestHeader:function(e,t){return null==u&&(e=w[e.toLowerCase()]=w[e.toLowerCase()]||e,x[e]=t),this},overrideMimeType:function(e){return null==u&&(f.mimeType=e),this},statusCode:function(e){var t;if(e)if(u)k.always(e[k.status]);else for(t in e)y[t]=[y[t],e[t]];return this},abort:function(e){var t=e||j;return n&&n.abort(t),C(0,t),this}};if(g.promise(k),f.url=((e||f.url||Et.href)+"").replace(Qt,Et.protocol+"//"),f.type=t.method||t.type||f.method||f.type,f.dataTypes=(f.dataType||"*").toLowerCase().match(X)||[""],null==f.crossDomain){c=b.createElement("a");try{c.href=f.url,c.href=c.href,f.crossDomain=Xt.protocol+"//"+Xt.host!=c.protocol+"//"+c.host}catch(e){f.crossDomain=!0}}if(f.data&&f.processData&&"string"!=typeof f.data&&(f.data=T.param(f.data,f.traditional)),Jt(Bt,f,t,k),u)return k;for(d in(l=T.event&&f.global)&&0==T.active++&&T.event.trigger("ajaxStart"),f.type=f.type.toUpperCase(),f.hasContent=!Wt.test(f.type),o=f.url.replace(Mt,""),f.hasContent?f.data&&f.processData&&0===(f.contentType||"").indexOf("application/x-www-form-urlencoded")&&(f.data=f.data.replace(Rt,"+")):(p=f.url.slice(o.length),f.data&&(f.processData||"string"==typeof f.data)&&(o+=(Pt.test(o)?"&":"?")+f.data,delete f.data),!1===f.cache&&(o=o.replace(It,"$1"),p=(Pt.test(o)?"&":"?")+"_="+Dt.guid+++p),f.url=o+p),f.ifModified&&(T.lastModified[o]&&k.setRequestHeader("If-Modified-Since",T.lastModified[o]),T.etag[o]&&k.setRequestHeader("If-None-Match",T.etag[o])),(f.data&&f.hasContent&&!1!==f.contentType||t.contentType)&&k.setRequestHeader("Content-Type",f.contentType),k.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+Ut+"; q=0.01":""):f.accepts["*"]),f.headers)k.setRequestHeader(d,f.headers[d]);if(f.beforeSend&&(!1===f.beforeSend.call(h,k,f)||u))return k.abort();if(j="abort",v.add(f.complete),k.done(f.success),k.fail(f.error),n=Jt(zt,f,t,k)){if(k.readyState=1,l&&m.trigger("ajaxSend",[k,f]),u)return k;f.async&&f.timeout>0&&(s=r.setTimeout((function(){k.abort("timeout")}),f.timeout));try{u=!1,n.send(x,C)}catch(e){if(u)throw e;C(-1,e)}}else C(-1,"No Transport");function C(e,t,a,c){var d,p,b,x,w,j=t;u||(u=!0,s&&r.clearTimeout(s),n=void 0,i=c||"",k.readyState=e>0?4:0,d=e>=200&&e<300||304===e,a&&(x=function(e,t,n){for(var r,o,i,a,s=e.contents,c=e.dataTypes;"*"===c[0];)c.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(o in s)if(s[o]&&s[o].test(r)){c.unshift(o);break}if(c[0]in n)i=c[0];else{for(o in n){if(!c[0]||e.converters[o+" "+c[0]]){i=o;break}a||(a=o)}i=i||a}if(i)return i!==c[0]&&c.unshift(i),n[i]}(f,k,a)),!d&&T.inArray("script",f.dataTypes)>-1&&T.inArray("json",f.dataTypes)<0&&(f.converters["text script"]=function(){}),x=function(e,t,n,r){var o,i,a,s,c,u={},l=e.dataTypes.slice();if(l[1])for(a in e.converters)u[a.toLowerCase()]=e.converters[a];for(i=l.shift();i;)if(e.responseFields[i]&&(n[e.responseFields[i]]=t),!c&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),c=i,i=l.shift())if("*"===i)i=c;else if("*"!==c&&c!==i){if(!(a=u[c+" "+i]||u["* "+i]))for(o in u)if((s=o.split(" "))[1]===i&&(a=u[c+" "+s[0]]||u["* "+s[0]])){!0===a?a=u[o]:!0!==u[o]&&(i=s[0],l.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 "+c+" to "+i}}}return{state:"success",data:t}}(f,x,k,d),d?(f.ifModified&&((w=k.getResponseHeader("Last-Modified"))&&(T.lastModified[o]=w),(w=k.getResponseHeader("etag"))&&(T.etag[o]=w)),204===e||"HEAD"===f.type?j="nocontent":304===e?j="notmodified":(j=x.state,p=x.data,d=!(b=x.error))):(b=j,!e&&j||(j="error",e<0&&(e=0))),k.status=e,k.statusText=(t||j)+"",d?g.resolveWith(h,[p,j,k]):g.rejectWith(h,[k,j,b]),k.statusCode(y),y=void 0,l&&m.trigger(d?"ajaxSuccess":"ajaxError",[k,f,d?p:b]),v.fireWith(h,[k,j]),l&&(m.trigger("ajaxComplete",[k,f]),--T.active||T.event.trigger("ajaxStop")))}return k},getJSON:function(e,t,n){return T.get(e,t,n,"json")},getScript:function(e,t){return T.get(e,void 0,t,"script")}}),T.each(["get","post"],(function(e,t){T[t]=function(e,n,r,o){return v(n)&&(o=o||r,r=n,n=void 0),T.ajax(T.extend({url:e,type:t,dataType:o,data:n,success:r},T.isPlainObject(e)&&e))}})),T.ajaxPrefilter((function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")})),T._evalUrl=function(e,t,n){return T.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){T.globalEval(e,t,n)}})},T.fn.extend({wrapAll:function(e){var t;return this[0]&&(v(e)&&(e=e.call(this[0])),t=T(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map((function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e})).append(this)),this},wrapInner:function(e){return v(e)?this.each((function(t){T(this).wrapInner(e.call(this,t))})):this.each((function(){var t=T(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)}))},wrap:function(e){var t=v(e);return this.each((function(n){T(this).wrapAll(t?e.call(this,n):e)}))},unwrap:function(e){return this.parent(e).not("body").each((function(){T(this).replaceWith(this.childNodes)})),this}}),T.expr.pseudos.hidden=function(e){return!T.expr.pseudos.visible(e)},T.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},T.ajaxSettings.xhr=function(){try{return new r.XMLHttpRequest}catch(e){}};var Yt={0:200,1223:204},Kt=T.ajaxSettings.xhr();g.cors=!!Kt&&"withCredentials"in Kt,g.ajax=Kt=!!Kt,T.ajaxTransport((function(e){var t,n;if(g.cors||Kt&&!e.crossDomain)return{send:function(o,i){var a,s=e.xhr();if(s.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(a in e.xhrFields)s[a]=e.xhrFields[a];for(a in e.mimeType&&s.overrideMimeType&&s.overrideMimeType(e.mimeType),e.crossDomain||o["X-Requested-With"]||(o["X-Requested-With"]="XMLHttpRequest"),o)s.setRequestHeader(a,o[a]);t=function(e){return function(){t&&(t=n=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?i(0,"error"):i(s.status,s.statusText):i(Yt[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=t(),n=s.onerror=s.ontimeout=t("error"),void 0!==s.onabort?s.onabort=n:s.onreadystatechange=function(){4===s.readyState&&r.setTimeout((function(){t&&n()}))},t=t("abort");try{s.send(e.hasContent&&e.data||null)}catch(e){if(t)throw e}},abort:function(){t&&t()}}})),T.ajaxPrefilter((function(e){e.crossDomain&&(e.contents.script=!1)})),T.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 T.globalEval(e),e}}}),T.ajaxPrefilter("script",(function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")})),T.ajaxTransport("script",(function(e){var t,n;if(e.crossDomain||e.scriptAttrs)return{send:function(r,o){t=T("<script>").attr(e.scriptAttrs||{}).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)}),b.head.appendChild(t[0])},abort:function(){n&&n()}}}));var Zt,en=[],tn=/(=)\?(?=&|$)|\?\?/;T.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=en.pop()||T.expando+"_"+Dt.guid++;return this[e]=!0,e}}),T.ajaxPrefilter("json jsonp",(function(e,t,n){var o,i,a,s=!1!==e.jsonp&&(tn.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&tn.test(e.data)&&"data");if(s||"jsonp"===e.dataTypes[0])return o=e.jsonpCallback=v(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,s?e[s]=e[s].replace(tn,"$1"+o):!1!==e.jsonp&&(e.url+=(Pt.test(e.url)?"&":"?")+e.jsonp+"="+o),e.converters["script json"]=function(){return a||T.error(o+" was not called"),a[0]},e.dataTypes[0]="json",i=r[o],r[o]=function(){a=arguments},n.always((function(){void 0===i?T(r).removeProp(o):r[o]=i,e[o]&&(e.jsonpCallback=t.jsonpCallback,en.push(o)),a&&v(i)&&i(a[0]),a=i=void 0})),"script"})),g.createHTMLDocument=((Zt=b.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Zt.childNodes.length),T.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(g.createHTMLDocument?((r=(t=b.implementation.createHTMLDocument("")).createElement("base")).href=b.location.href,t.head.appendChild(r)):t=b),i=!n&&[],(o=I.exec(e))?[t.createElement(o[1])]:(o=Ne([e],t,i),i&&i.length&&T(i).remove(),T.merge([],o.childNodes)));var r,o,i},T.fn.load=function(e,t,n){var r,o,i,a=this,s=e.indexOf(" ");return s>-1&&(r=Ct(e.slice(s)),e=e.slice(0,s)),v(t)?(n=t,t=void 0):t&&"object"==typeof t&&(o="POST"),a.length>0&&T.ajax({url:e,type:o||"GET",dataType:"html",data:t}).done((function(e){i=arguments,a.html(r?T("<div>").append(T.parseHTML(e)).find(r):e)})).always(n&&function(e,t){a.each((function(){n.apply(this,i||[e.responseText,t,e])}))}),this},T.expr.pseudos.animated=function(e){return T.grep(T.timers,(function(t){return e===t.elem})).length},T.offset={setOffset:function(e,t,n){var r,o,i,a,s,c,u=T.css(e,"position"),l=T(e),d={};"static"===u&&(e.style.position="relative"),s=l.offset(),i=T.css(e,"to
11p"),c=T.css(e,"left"),("absolute"===u||"fixed"===u)&&(i+c).indexOf("auto")>-1?(a=(r=l.position()).top,o=r.left):(a=parseFloat(i)||0,o=parseFloat(c)||0),v(t)&&(t=t.call(e,n,T.extend({},s))),null!=t.top&&(d.top=t.top-s.top+a),null!=t.left&&(d.left=t.left-s.left+o),"using"in t?t.using.call(e,d):l.css(d)}},T.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each((function(t){T.offset.setOffset(this,e,t)}));var t,n,r=this[0];return r?r.getClientRects().length?(t=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:t.top+n.pageYOffset,left:t.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],o={top:0,left:0};if("fixed"===T.css(r,"position"))t=r.getBoundingClientRect();else{for(t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===T.css(e,"position");)e=e.parentNode;e&&e!==r&&1===e.nodeType&&((o=T(e).offset()).top+=T.css(e,"borderTopWidth",!0),o.left+=T.css(e,"borderLeftWidth",!0))}return{top:t.top-o.top-T.css(r,"marginTop",!0),left:t.left-o.left-T.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var e=this.offsetParent;e&&"static"===T.css(e,"position");)e=e.offsetParent;return e||me}))}}),T.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(e,t){var n="pageYOffset"===t;T.fn[e]=function(r){return ee(this,(function(e,r,o){var i;if(y(e)?i=e:9===e.nodeType&&(i=e.defaultView),void 0===o)return i?i[t]:e[r];i?i.scrollTo(n?i.pageXOffset:o,n?o:i.pageYOffset):e[r]=o}),e,r,arguments.length)}})),T.each(["top","left"],(function(e,t){T.cssHooks[t]=Ze(g.pixelPosition,(function(e,n){if(n)return n=Ke(e,t),Xe.test(n)?T(e).position()[t]+"px":n}))})),T.each({Height:"height",Width:"width"},(function(e,t){T.each({padding:"inner"+e,content:t,"":"outer"+e},(function(n,r){T.fn[r]=function(o,i){var a=arguments.length&&(n||"boolean"!=typeof o),s=n||(!0===o||!0===i?"margin":"border");return ee(this,(function(t,n,o){var i;return y(t)?0===r.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(i=t.documentElement,Math.max(t.body["scroll"+e],i["scroll"+e],t.body["offset"+e],i["offset"+e],i["client"+e])):void 0===o?T.css(t,n,s):T.style(t,n,o,s)}),t,a?o:void 0,a)}}))})),T.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(e,t){T.fn[t]=function(e){return this.on(t,e)}})),T.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)},hover:function(e,t){return this.on("mouseenter",e).on("mouseleave",t||e)}}),T.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){T.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}));var nn=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;T.proxy=function(e,t){var n,r,o;if("string"==typeof t&&(n=e[t],t=e,e=n),v(e))return r=s.call(arguments,2),o=function(){return e.apply(t||this,r.concat(s.call(arguments)))},o.guid=e.guid=e.guid||T.guid++,o},T.holdReady=function(e){e?T.readyWait++:T.ready(!0)},T.isArray=Array.isArray,T.parseJSON=JSON.parse,T.nodeName=A,T.isFunction=v,T.isWindow=y,T.camelCase=oe,T.type=j,T.now=Date.now,T.isNumeric=function(e){var t=T.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},T.trim=function(e){return null==e?"":(e+"").replace(nn,"$1")},void 0===(n=function(){return T}.apply(t,[]))||(e.exports=n);var rn=r.jQuery,on=r.$;return T.noConflict=function(e){return r.$===T&&(r.$=on),e&&r.jQuery===T&&(r.jQuery=rn),T},void 0===o&&(r.jQuery=r.$=T),T}))},98:(e,t,n)=>{var r,o;
12/*!
13 * jQuery Migrate - v3.5.2 - 2024-07-17T22:31Z
14 * Copyright OpenJS Foundation and other contributors
15 */!function(){"use strict";r=[n(263)],o=function(e){return function(e,t){function n(e,t){var n,r=/^(\d+)\.(\d+)\.(\d+)/,o=r.exec(e)||[],i=r.exec(t)||[];for(n=1;n<=3;n++){if(+o[n]>+i[n])return 1;if(+o[n]<+i[n])return-1}return 0}function r(t){return n(e.fn.jquery,t)>=0}e.migrateVersion="3.5.2";var o=Object.create(null);e.migrateDisablePatches=function(){var e;
15for(e=0;e<arguments.length;e++)o[arguments[e]]=!0},e.migrateEnablePatches=function(){var e;for(e=0;e<arguments.length;e++)delete o[arguments[e]]},e.migrateIsPatchEnabled=function(e){return!o[e]},t.console&&t.console.log&&(e&&r("3.0.0")&&!r("5.0.0")||t.console.log("JQMIGRATE: jQuery 3.x-4.x REQUIRED"),e.migrateWarnings&&t.console.log("JQMIGRATE: Migrate plugin loaded multiple times"),t.console.log("JQMIGRATE: Migrate is installed"+(e.migrateMute?"":" with logging active")+", version "+e.migrateVersion));var i={};e.migrateDeduplicateWarnings=!0,e.migrateWarnings=[],void 0===e.migrateTrace&&(e.migrateTrace=!0);function a(n,r){var o=t.console;!e.migrateIsPatchEnabled(n)||e.migrateDeduplicateWarnings&&i[r]||(i[r]=!0,e.migrateWarnings.push(r+" ["+n+"]"),o&&o.warn&&!e.migrateMute&&(o.warn("JQMIGRATE: "+r),e.migrateTrace&&o.trace&&o.trace()))}function s(e,t,n,r,o){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){return a(r,o),n},set:function(e){a(r,o),n=e}})}function c(t,n,r,o,i){var s=t[n];t[n]=function(){return i&&a(o,i),(e.migrateIsPatchEnabled(o)?r:s||e.noop).apply(this,arguments)}}function u(e,t,n,r,o){if(!o)throw new Error("No warning message provided");return c(e,t,n,r,o)}function l(e,t,n,r){return c(e,t,n,r)}e.migrateReset=function(){i={},e.migrateWarnings.length=0},"BackCompat"===t.document.compatMode&&a("quirks","jQuery is not compatible with Quirks Mode");var d,p={},f=e.fn.init,h=e.find,m=/\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/,g=/\[(\s*[-\w]+\s*)([~|^$*]?=)\s*([-\w#]*?#[-\w#]*)\s*\]/g,v=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;for(d in l(e.fn,"init",(function(t){var n=Array.prototype.slice.call(arguments);return e.migrateIsPatchEnabled("selector-empty-id")&&"string"==typeof t&&"#"===t&&(a("selector-empty-id","jQuery( '#' ) is not a valid selector"),n[0]=[]),f.apply(this,n)}),"selector-empty-id"),e.fn.init.prototype=e.fn,l(e,"find",(function(e){var n=Array.prototype.slice.call(arguments);if("string"==typeof e&&m.test(e))try{t.document.querySelector(e)}catch(r){e=e.replace(g,(function(e,t,n,r){return"["+t+n+'"'+r+'"]'}));try{t.document.querySelector(e),a("selector-hash","Attribute selector with '#' must be quoted: "+n[0]),n[0]=e}catch(e){a("selector-hash","Attribute selector with '#' was not fixed: "+n[0])}}return h.apply(this,n)}),"selector-hash"),h)Object.prototype.hasOwnProperty.call(h,d)&&(e.find[d]=h[d]);u(e.fn,"size",(function(){return this.length}),"size","jQuery.fn.size() is deprecated and removed; use the .length property"),u(e,"parseJSON",(function(){return JSON.parse.apply(null,arguments)}),"parseJSON","jQuery.parseJSON is deprecated; use JSON.parse"),u(e,"holdReady",e.holdReady,"holdReady","jQuery.holdReady is deprecated"),u(e,"unique",e.uniqueSort,"unique","jQuery.unique is deprecated; use jQuery.uniqueSort"),s(e.expr,"filters",e.expr.pseudos,"expr-pre-pseudos","jQuery.expr.filters is deprecated; use jQuery.expr.pseudos"),s(e.expr,":",e.expr.pseudos,"expr-pre-pseudos","jQuery.expr[':'] is deprecated; use jQuery.expr.pseudos"),r("3.1.1")&&u(e,"trim",(function(e){return null==e?"":(e+"").replace(v,"$1")}),"trim","jQuery.trim is deprecated; use String.prototype.trim");r("3.2.0")&&(u(e,"nodeName",(function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}),"nodeName","jQuery.nodeName is deprecated"),u(e,"isArray",Array.isArray,"isArray","jQuery.isArray is deprecated; use Array.isArray"));r("3.3.0")&&(u(e,"isNumeric",(function(e){var t=typeof e;return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))}),"isNumeric","jQuery.isNumeric() is deprecated"),e.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),(function(e,t){p["[object "+t+"]"]=t.toLowerCase()})),u(e,"type",(function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?p[Object.prototype.toString.call(e)]||"object":typeof e}),"type","jQuery.type is deprecated"),u(e,"isFunction",(function(e){return"function"==typeof e}),"isFunction","jQuery.isFunction() is deprecated"),u(e,"isWindow",(function(e){return null!=e&&e===e.window}),"isWindow","jQuery.isWindow() is deprecated"));if(e.ajax){var y=e.ajax,b=/(=)\?(?=&|$)|\?\?/;l(e,"ajax",(function(){var e=y.apply(this,arguments);return e.promise&&(u(e,"success",e.done,"jqXHR-methods","jQXHR.success is deprecated and removed"),u(e,"error",e.fail,"jqXHR-methods","jQXHR.error is deprecated and removed"),u(e,"complete",e.always,"jqXHR-methods","jQXHR.complete is deprecated and removed")),e}),"jqXHR-methods"),r("4.0.0")||e.ajaxPrefilter("+json",(function(e){!1!==e.jsonp&&(b.test(e.url)||"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&b.test(e.data))&&a("jsonp-promotion","JSON-to-JSONP auto-promotion is deprecated")}))}var x=e.fn.removeAttr,w=e.fn.toggleClass,j=/^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$/i,k=/\S+/g;function C(e){return e.replace(/-([a-z])/g,(function(e,t){return t.toUpperCase()}))}l(e.fn,"removeAttr",(function(t){var n=this,r=!1;return e.each(t.match(k),(function(t,o){j.test(o)&&n.each((function(){if(!1!==e(this).prop(o))return r=!0,!1})),r&&(a("removeAttr-bool","jQuery.fn.removeAttr no longer sets boolean properties: "+o),n.prop(o,!1))})),x.apply(this,arguments)}),"removeAttr-bool"),l(e.fn,"toggleClass",(function(t){return void 0!==t&&"boolean"!=typeof t?w.apply(this,arguments):(a("toggleClass-bool","jQuery.fn.toggleClass( boolean ) is deprecated"),this.each((function(){var n=this.getAttribute&&this.getAttribute("class")||"";n&&e.data(this,"__className__",n),this.setAttribute&&this.setAttribute("class",n||!1===t?"":e.data(this,"__className__")||"")})))}),"toggleClass-bool");var T,S,A=!1,E=/^[a-z]/,D=/^(?:Border(?:Top|Right|Bottom|Left)?(?:Width|)|(?:Margin|Padding)?(?:Top|Right|Bottom|Left)?|(?:Min|Max)?(?:Width|Height))$/;e.swap&&e.each(["height","width","reliableMarginRight"],(function(t,n){var r=e.cssHooks[n]&&e.cssHooks[n].get;r&&(e.cssHooks[n].get=function(){var e;return A=!0,e=r.apply(this,arguments),A=!1,e})}));l(e,"swap",(function(e,t,n,r){var o,i,s={};for(i in A||a("swap","jQuery.swap() is undocumented and deprecated"),t)s[i]=e.style[i],e.style[i]=t[i];for(i in o=n.apply(e,r||[]),t)e.style[i]=s[i];return o}
15),"swap"),r("3.4.0")&&"undefined"!=typeof Proxy&&(e.cssProps=new Proxy(e.cssProps||{},{set:function(){return a("cssProps","jQuery.cssProps is deprecated"),Reflect.set.apply(this,arguments)}}));r("4.0.0")?(S={animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},"undefined"!=typeof Proxy?e.cssNumber=new Proxy(S,{get:function(){return a("css-number","jQuery.cssNumber is deprecated"),Reflect.get.apply(this,arguments)},set:function(){return a("css-number","jQuery.cssNumber is deprecated"),Reflect.set.apply(this,arguments)}}):e.cssNumber=S):S=e.cssNumber;function P(e){return E.test(e)&&D.test(e[0].toUpperCase()+e.slice(1))}T=e.fn.css,l(e.fn,"css",(function(t,n){var r,o=this;return t&&"object"==typeof t&&!Array.isArray(t)?(e.each(t,(function(t,n){e.fn.css.call(o,t,n)})),this):("number"==typeof n&&(P(r=C(t))||S[r]||a("css-number",'Number-typed values are deprecated for jQuery.fn.css( "'+t+'", value )')),T.apply(this,arguments))}),"css-number");var q=e.data;if(l(e,"data",(function(t,n,r){var o,i,s;if(n&&"object"==typeof n&&2===arguments.length){for(s in o=e.hasData(t)&&q.call(this,t),i={},n)s!==C(s)?(a("data-camelCase","jQuery.data() always sets/gets camelCased names: "+s),o[s]=n[s]):i[s]=n[s];return q.call(this,t,i),n}return n&&"string"==typeof n&&n!==C(n)&&(o=e.hasData(t)&&q.call(this,t))&&n in o?(a("data-camelCase","jQuery.data() always sets/gets camelCased names: "+n),arguments.length>2&&(o[n]=r),o[n]):q.apply(this,arguments)}),"data-camelCase"),e.fx){var N,O,_=e.Tween.prototype.run,$=function(e){return e};l(e.Tween.prototype,"run",(function(){e.easing[this.easing].length>1&&(a("easing-one-arg","'jQuery.easing."+this.easing.toString()+"' should use only one argument"),e.easing[this.easing]=$),_.apply(this,arguments)}),"easing-one-arg"),N=e.fx.interval,O="jQuery.fx.interval is deprecated",t.requestAnimationFrame&&Object.defineProperty(e.fx,"interval",{configurable:!0,enumerable:!0,get:function(){return t.document.hidden||a("fx-interval",O),e.migrateIsPatchEnabled("fx-interval")&&void 0===N?13:N},set:function(e){a("fx-interval",O),N=e}})}var H=e.fn.load,L=e.event.add,R=e.event.fix;e.event.props=[],e.event.fixHooks={},s(e.event.props,"concat",e.event.props.concat,"event-old-patch","jQuery.event.props.concat() is deprecated and removed"),l(e.event,"fix",(function(t){var n,r=t.type,o=this.fixHooks[r],i=e.event.props;if(i.length)for(a("event-old-patch","jQuery.event.props are deprecated and removed: "+i.join());i.length;)e.event.addProp(i.pop());if(o&&!o._migrated_&&(o._migrated_=!0,a("event-old-patch","jQuery.event.fixHooks are deprecated and removed: "+r),(i=o.props)&&i.length))for(;i.length;)e.event.addProp(i.pop());return n=R.call(this,t),o&&o.filter?o.filter(n,t):n}),"event-old-patch"),l(e.event,"add",(function(e,n){return e===t&&"load"===n&&"complete"===t.document.readyState&&a("load-after-event","jQuery(window).on('load'...) called after load event occurred"),L.apply(this,arguments)}),"load-after-event"),e.each(["load","unload","error"],(function(t,n){l(e.fn,n,(function(){var e=Array.prototype.slice.call(arguments,0);return"load"===n&&"string"==typeof e[0]?H.apply(this,e):(a("shorthand-removed-v3","jQuery.fn."+n+"() is deprecated"),e.splice(0,0,n),arguments.length?this.on.apply(this,e):(this.triggerHandler.apply(this,e),this))}),"shorthand-removed-v3")})),e.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(t,n){u(e.fn,n,(function(e,t){return arguments.length>0?this.on(n,null,e,t):this.trigger(n)}),"shorthand-deprecated-v3","jQuery.fn."+n+"() event shorthand is deprecated")})),e((function(){e(t.document).triggerHandler("ready")})),e.event.special.ready={setup:function(){this===t.document&&a("ready-event","'ready' event is deprecated")}},u(e.fn,"bind",(function(e,t,n){return this.on(e,null,t,n)}),"pre-on-methods","jQuery.fn.bind() is deprecated"),u(e.fn,"unbind",(function(e,t){return this.off(e,null,t)}),"pre-on-methods","jQuery.fn.unbind() is deprecated"),u(e.fn,"delegate",(function(e,t,n,r){return this.on(t,e,n,r)}),"pre-on-methods","jQuery.fn.delegate() is deprecated"),u(e.fn,"undelegate",(function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}),"pre-on-methods","jQuery.fn.undelegate() is deprecated"),u(e.fn,"hover",(function(e,t){return this.on("mouseenter",e).on("mouseleave",t||e)}),"pre-on-methods","jQuery.fn.hover() is deprecated");var M=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi,I=function(e){var n=t.document.implementation.createHTMLDocument("");return n.body.innerHTML=e,n.body&&n.body.innerHTML},F=function(e){var t=e.replace(M,"<$1></$2>");t!==e&&I(e)!==I(t)&&a("self-closed-tags","HTML tags must be properly nested and closed: "+e)};u(e,"UNSAFE_restoreLegacyHtmlPrefilter",(function(){e.migrateEnablePatches("self
vendor: 4,659 bytes, line 15
15-closed-tags")}),"legacy-self-closed-tags",'jQuery.UNSAFE_restoreLegacyHtmlPrefilter deprecated; use `jQuery.migrateEnablePatches( "self-closed-tags" )`'),l(e,"htmlPrefilter",(function(e){return F(e),e.replace(M,"<$1></$2>")}),"self-closed-tags"),e.migrateDisablePatches("self-closed-tags");var W=e.fn.offset;if(l(e.fn,"offset",(function(){var e=this[0];return!e||e.nodeType&&e.getBoundingClientRect?W.apply(this,arguments):(a("offset-valid-elem","jQuery.fn.offset() requires a valid DOM element"),arguments.length?this:void 0)}),"offset-valid-elem"),e.ajax){var Q=e.param;l(e,"param",(function(t,n){var r=e.ajaxSettings&&e.ajaxSettings.traditional;return void 0===n&&r&&(a("param-ajax-traditional","jQuery.param() no longer uses jQuery.ajaxSettings.traditional"),n=r),Q.call(this,t,n)}),"param-ajax-traditional")}if(u(e.fn,"andSelf",e.fn.addBack,"andSelf","jQuery.fn.andSelf() is deprecated and removed, use jQuery.fn.addBack()"),e.Deferred){var B=e.Deferred,z=[["resolve","done",e.Callbacks("once memory"),e.Callbacks("once memory"),"resolved"],["reject","fail",e.Callbacks("once memory"),e.Callbacks("once memory"),"rejected"],["notify","progress",e.Callbacks("memory"),e.Callbacks("memory")]];l(e,"Deferred",(function(t){var n=B(),r=n.promise();function o(){var t=arguments;return e.Deferred((function(o){e.each(z,(function(e,i){var a="function"==typeof t[e]&&t[e];n[i[1]]((function(){var e=a&&a.apply(this,arguments);e&&"function"==typeof e.promise?e.promise().done(o.resolve).fail(o.reject).progress(o.notify):o[i[0]+"With"](this===r?o.promise():this,a?[e]:arguments)}))})),t=null})).promise()}return u(n,"pipe",o,"deferred-pipe","deferred.pipe() is deprecated"),u(r,"pipe",o,"deferred-pipe","deferred.pipe() is deprecated"),t&&t.call(n,n),n}),"deferred-pipe"),e.Deferred.exceptionHook=B.exceptionHook}return e}(e,window)}.apply(t,r),void 0===o||(e.exports=o)}()}},r={};function o(e){var t=r[e];if(void 0!==t)return t.exports;var i=r[e]={exports:{}};return n[e].call(i.exports,i,i.exports,o),i.exports}o.m=n,o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var n in t)o.o(t,n)&&!o.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o.f={},o.e=e=>Promise.all(Object.keys(o.f).reduce(((t,n)=>(o.f[n](e,t),t)),[])),o.u=e=>({247:"ccf615bf752e3a708933",736:"5fd077d4d21a6cb1e86b",794:"a3cc4722cb70e7390a3c"}[e]+"-chunk.js"),o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="prestashop-core-theme-js:",o.l=(n,r,i,a)=>{if(e[n])e[n].push(r);else{var s,c;if(void 0!==i)for(var u=document.getElementsByTagName("script"),l=0;l<u.length;l++){var d=u[l];if(d.getAttribute("src")==n||d.getAttribute("data-webpack")==t+i){s=d;break}}s||(c=!0,(s=document.createElement("script")).charset="utf-8",s.timeout=120,o.nc&&s.setAttribute("nonce",o.nc),s.setAttribute("data-webpack",t+i),s.src=n),e[n]=[r];var p=(t,r)=>{s.onerror=s.onload=null,clearTimeout(f);var o=e[n];if(delete e[n],s.parentNode&&s.parentNode.removeChild(s),o&&o.forEach((e=>e(r))),t)return t(r)},f=setTimeout(p.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=p.bind(null,s.onerror),s.onload=p.bind(null,s.onload),c&&document.head.appendChild(s)}},o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;o.g.importScripts&&(e=o.g.location+"");var t=o.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");if(n.length)for(var r=n.length-1;r>-1&&(!e||!/^http(s?):/.test(e));)e=n[r--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=e})(),(()=>{var e={792:0};o.f.j=(t,n)=>{var r=o.o(e,t)?e[t]:void 0;if(0!==r)if(r)n.push(r[2]);else{var i=new Promise(((n,o)=>r=e[t]=[n,o]));n.push(r[2]=i);var a=o.p+o.u(t),s=new Error;o.l(a,(n=>{if(o.o(e,t)&&(0!==(r=e[t])&&(e[t]=void 0),r)){var i=n&&("load"===n.type?"missing":n.type),a=n&&n.target&&n.target.src;s.message="Loading chunk "+t+" failed.\n("+i+": "+a+")",s.name="ChunkLoadError",s.type=i,s.request=a,r[1](s)}}),"chunk-"+t,t)}};var t=(t,n)=>{var r,i,[a,s,c]=n,u=0;if(a.some((t=>0!==e[t]))){for(r in s)o.o(s,r)&&(o.m[r]=s[r]);if(c)c(o)}for(t&&t(n);u<a.length;u++)i=a[u],o.o(e,i)&&e[i]&&e[i][0](),e[i]=0},n=self.webpackChunkprestashop_core_theme_js=self.webpackChunkprestashop_core_theme_js||[];
15n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})(),(()=>{"use strict";var e=o(263),t=o.n(e);void 0===t().migrateMute&&(t().migrateMute=!window.prestashop.debug);o(98);const n=prestashop;var r=o.n(n);r().selectors={quantityWanted:"#quantity_wanted",product:{imageContainer:".quickview .images-container, .page-product:not(.modal-open) .row .images-container, .page-product:not(.modal-open) .product-container .images-container, .quickview .js-images-container, .page-product:not(.modal-open) .row .js-images-container, .page-product:not(.modal-open) .product-container .js-images-container",container:".product-container, .js-product-container",availability:"#product-availability, .js-product-availability",actions:".product-actions, .js-product-actions",variants:".product-variants, .js-product-variants",refresh:".product-refresh, .js-product-refresh",miniature:".js-product-miniature",minimalQuantity:".product-minimal-quantity, .js-product-minimal-quantity",addToCart:".quickview .product-add-to-cart, .page-product:not(.modal-open) .row .product-add-to-cart, .page-product:not(.modal-open) .product-container .product-add-to-cart, .quickview .js-product-add-to-cart, .page-product:not(.modal-open) .row .js-product-add-to-cart, .page-product:not(.modal-open) .product-container .js-product-add-to-cart",prices:".quickview .product-prices, .page-product:not(.modal-open) .row .product-prices, .page-product:not(.modal-open) .product-container .product-prices, .quickview .js-product-prices, .page-product:not(.modal-open) .row .js-product-prices, .page-product:not(.modal-open) .product-container .js-product-prices",inputCustomization:'.product-actions input[name="id_customization"], .js-product-actions .js-product-customization-id',customization:".quickview .product-customization, .page-product:not(.modal-open) .row .product-customization, .page-product:not(.modal-open) .product-container .product-customization, .quickview .js-product-customization, .page-product:not(.modal-open) .row .js-product-customization, .page-product:not(.modal-open) .product-container .js-product-customization",variantsUpdate:".quickview .product-variants, .page-product:not(.modal-open) .row .product-variants, .page-product:not(.modal-open) .product-container .product-variants, .quickview .js-product-variants, .page-product:not(.modal-open) .row .js-product-variants, .page-product:not(.modal-open) .js-product-container .js-product-variants",discounts:".quickview .product-discounts, .page-product:not(.modal-open) .row .product-discounts, .page-product:not(.modal-open) .product-container .product-discounts, .quickview .js-product-discounts, .page-product:not(.modal-open) .row .js-product-discounts, .page-product:not(.modal-open) .product-container .js-product-discounts",additionalInfos:".quickview .product-additional-info, .page-product:not(.modal-open) .row .product-additional-info, .page-product:not(.modal-open) .product-container .product-additional-info, .quickview .js-product-additional-info, .page-product:not(.modal-open) .row .js-product-additional-info, .page-product:not(.modal-open) .js-product-container .js-product-additional-info",details:".quickview #product-details, .page-product:not(.modal-open) #product-details, .quickview .js-product-details, .page-product:not(.modal-open) .js-product-details",flags:".quickview .product-flags, .page-product:not(.modal-open) .row .product-flags, .page-product:not(.modal-open) .product-container .product-flags, .quickview .js-product-flags, .page-product:not(.modal-open) .row .js-product-flags, .page-product:not(.modal-open) .js-product-container .js-product-flags"},listing:{quickview:".quick-view, .js-quick-view"},checkout:{form:".checkout-step form",currentStep:"js-current-step",step:".checkout-step",stepTitle:".step-title, .js-step-title",confirmationSelector:"#payment-confirmation button, .js-payment-confirmation",conditionsSelector:'#conditions-to-approve input[type="checkbox"], .js-conditions-to-approve',conditionAlertSelector:".js-alert-payment-conditions",additionalInformatonSelector:".js-additional-information",optionsForm:".js-payment-option-form",termsCheckboxSelector:'#conditions-to-approve input[name="conditions_to_approve[terms-and-conditions]"], .js-conditions-to-approve input[name="conditions_to_approve[terms-and-conditions]"]',paymentBinary:".payment-binary, .js-payment-binary",deliveryFormSelector:"#js-delivery",summarySelector:"#js-checkout-summary",deliveryStepSelector:"#checkout-delivery-step",editDeliveryButtonSelector:".js-edit-delivery",deliveryOption:".delivery-option, .js-delivery-option",cartPaymentStepRefresh:".js-cart-payment-step-refresh",editAddresses:".js-edit-addresses",deliveryAddressRadios:"#delivery-addresses input[type=radio], #invoice-addresses input[type=radio], .js-address-selector input[type=radio]",addressItem:".address-item, .js-address-item",addressesStep:"#checkout-addresses-step",addressItemChecked:".address-item:has(input[type=radio]:checked), .js-address-item:has(input[type=radio]:checked)",addressError:".js-address-error",n
15otValidAddresses:"#not-valid-addresses, .js-not-valid-addresses",invoiceAddresses:"#invoice-addresses, .js-address-selector",addressForm:".js-address-form"},cart:{detailedTotals:".cart-detailed-totals, .js-cart-detailed-totals",summaryItemsSubtotal:".cart-summary-items-subtotal, .js-cart-summary-items-subtotal",summarySubTotalsContainer:".cart-summary-subtotals-container, .js-cart-summary-subtotals-container",summaryTotals:".cart-summary-totals, .js-cart-summary-totals",summaryProducts:".cart-summary-products, .js-cart-summary-products",detailedActions:".cart-detailed-actions, .js-cart-detailed-actions",voucher:".cart-voucher, .js-cart-voucher",overview:".cart-overview",summaryTop:".cart-summary-top, .js-cart-summary-top",productCustomizationId:"#product_customization_id, .js-product-customization-id",lineProductQuantity:".js-cart-line-product-quantity"}},t()((()=>{r().emit("selectorsInit")}));var i=Object.defineProperty,a=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable,u=(e,t,n)=>t in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,l=(e,t)=>{for(var n in t||(t={}))s.call(t,n)&&u(e,n,t[n]);if(a)for(var n of a(t))c.call(t,n)&&u(e,n,t[n]);return e};function d(e){const t={};return window.location.href.replace(location.hash,"").replace(/[?&]+([^=&]+)=?([^&]*)?/gi,((e,n,r)=>{t[n]=void 0!==r?r:""})),void 0!==e?t[e]?t[e]:null:t}function p(){const e=d();if(e.updatedTransaction)return void window.location.reload();e.updatedTransaction=1;const t=Object.entries(e).map((e=>e.join("="))).join("&");window.location.href=`${window.location.pathname}?${t}`}r().checkPasswordScore=e=>{return t=void 0,n=null,r=function*(){const{zxcvbn:t,zxcvbnOptions:n}=yield o.e(736).then(o.bind(o,736)),r=yield o.e(247).then(o.bind(o,247)),i=yield o.e(794).then(o.bind(o,794)),a={translations:i.translations,graphs:r.adjacencyGraphs,dictionary:l(l({},r.dictionary),i.dictionary)};return n.setOptions(a),t(e)},new Promise(((e,o)=>{var i=e=>{try{s(r.next(e))}catch(e){o(e)}},a=e=>{try{s(r.throw(e))}catch(e){o(e)}},s=t=>t.done?e(t.value):Promise.resolve(t.value).then(i,a);s((r=r.apply(t,n)).next())}));var t,n,r},t()((()=>{r().on("updateCart",(e=>{r().cart=e.resp.cart;const n=t()(".js-cart").data("refresh-url");if(!n)return;let o={};e&&e.reason&&(o={id_product_attribute:e.reason.idProductAttribute,id_product:e.reason.idProduct}),t().post(n,o).then((e=>{t()(r().selectors.cart.detailedTotals).replaceWith(e.cart_detailed_totals),t()(r().selectors.cart.summaryItemsSubtotal).replaceWith(e.cart_summary_items_subtotal),t()(r().selectors.cart.summarySubTotalsContainer).replaceWith(e.cart_summary_subtotals_container),t()(r().selectors.cart.summaryProducts).replaceWith(e.cart_summary_products),t()(r().selectors.cart.summaryTotals).replaceWith(e.cart_summary_totals),t()(r().selectors.cart.detailedActions).replaceWith(e.cart_detailed_actions),t()(r().selectors.cart.voucher).replaceWith(e.cart_voucher),t()(r().selectors.cart.overview).replaceWith(e.cart_detailed),t()(r().selectors.cart.summaryTop).replaceWith(e.cart_summary_top),t()(r().selectors.cart.productCustomizationId).val(0),t()(r().selectors.cart.lineProductQuantity).each(((e,n)=>{const r=t()(n);r.attr("value",r.val())})),t()(r().selectors.checkout.cartPaymentStepRefresh).length&&p(),r().emit("updatedCart",{eventType:"updateCart",resp:e})})).fail((e=>{r().emit("handleError",{eventType:"updateCart",resp:e})}))}));const e=t()("body");e.on("click",'[data-button-action="add-to-cart"]',(e=>{e.preventDefault();const n=t()(e.currentTarget.form),o=`${n.serialize()}&add=1&action=update`,i=n.attr("action"),a=t()(e.currentTarget);a.prop("disabled",!0);let s=e=>{e.parents(r().selectors.product.addToCart).first().find(r().selectors.product.minimalQuantity).addClass("error"),e.parent().find("label").addClass("error")};const c=n.find("input[min]");(e=>{let n=!0;return e.each(((e,r)=>{const o=t()(r),i=parseInt(o.attr("min"),10);i&&o.val()<i&&(s(o),n=!1)})),n})(c)?t().post(i,o,null,"json").then((e=>{e.hasError?r().emit("handleError",{eventType:"addProductToCart",resp:e}):r().emit("updateCart",{reason:{idProduct:e.id_product,idProductAttribute:e.id_product_attribute,idCustomization:e.id_customization,linkAction:"add-to-cart",cart:e.cart},resp:e})})).fail((e=>{r().emit("handleError",{eventType:"addProductToCart",resp:e})})).always((()=>{setTimeout((()=>{a.prop("disabled",!1)}),1e3)})):s(c)})),e.on("submit",'[data-link-action="add-voucher"]',(e=>{e.preventDefault();const n=t()(e.currentTarget),o=n.attr("action");0===n.find("[name=action]").length&&n.append(t()("<input>",{type:"hidden",name:"ajax",value:1})),0===n.find("[name=action]").length&&n.append(t()("<input>",{type:"hidden",name:"action",value:"update"})),t().post(o,n.serialize(),null,"json").then((n=>{n.hasError?t()(".js-error").show().find(".js-error-text").text(n.errors[0]):r().emit("updateCart",{reason:e.target.dataset,resp:n})})).fail((e=>{r().emit("handleError",{eventType:"updateCart",resp:e})}))}))}));const{addressForm:f}=r().selectors.checkout,h=d("editAddress"),m=d("use_same_address");function g(){t()(r().selectors.checkout.editAddresses).on("click",(e=>{e.stopPropagation(),t()(r().selectors.checkout.addressesStep).trigger("click"),r().emit("editAddress")})),t()(r().selectors.checkout.deliveryAddressRadios).on("click",(function(){t()(r().selectors.checkout.addressItem).removeClass("selected"),t()(r().selectors.checkout.addressItemChecked).addClass("selected"),function(){const e=t()(`${f} form`),n=e.serialize(),o=new URLSearchParams(n);
15o.append("confirm-addresses",1),t().post(e.data("refresh-url"),o.toString()).fail((e=>{r().emit("handleError",{eventType:"updatedAddressForm",resp:e})}))}();const e=t()(r().selectors.checkout.addressError).prop("id").split("-").pop(),n=t()(r().selectors.checkout.notValidAddresses).val(),o=this.name.split("_").pop(),i=t()(`${r().selectors.checkout.addressError}[name=alert-${o}]`);v(!1,e,o),""!==n&&null===h&&n.split(",").indexOf(this.value)>=0?(i.show(),v(!0,this.value,o),t()(r().selectors.checkout.addressError).prop("id",`id-failure-address-${this.value}`)):i.hide();const a=t()(`${r().selectors.checkout.addressError}:visible`);y(a.length<=0)}))}t()(window).on("load",(()=>{let e=t()(`${r().selectors.checkout.addressError}:visible`);if(0===parseInt(m,10)&&t()(r().selectors.checkout.invoiceAddresses).trigger("click"),(null!==h||t()(`${r().selectors.checkout.addressForm}:visible`).length>1)&&e.hide(),e.length>0){const n=t()(r().selectors.checkout.addressError).prop("id").split("-").pop();e.each((function(){v(!0,n,t()(this).attr("name").split("-").pop())}))}e=t()(`${r().selectors.checkout.addressError}:visible`),y(e.length<=0)}));const v=function(e,n,r){const o=t()(`#id-address-${r}-address-${n} a.edit-address`),i=["text-info","address-item-invalid"];t()(`#${r}-addresses a.edit-address`).removeClass(i),o.toggleClass(i,e)},y=function(e){t()("button[name=confirm-addresses]").prop("disabled",!e)};r().checkout=r().checkout||{},r().checkout.onCheckOrderableCartResponse=(e,t)=>!0===e.errors&&(r().emit("orderConfirmationErrors",{resp:e,paymentObject:t}),!0);class b{constructor(){this.confirmationSelector=r().selectors.checkout.confirmationSelector,this.conditionsSelector=r().selectors.checkout.conditionsSelector,this.conditionAlertSelector=r().selectors.checkout.conditionAlertSelector,this.additionalInformatonSelector=r().selectors.checkout.additionalInformatonSelector,this.optionsForm=r().selectors.checkout.optionsForm,this.termsCheckboxSelector=r().selectors.checkout.termsCheckboxSelector}init(){r().on("orderConfirmationErrors",(({resp:e,paymentObject:t})=>{""!==e.cartUrl&&(location.href=e.cartUrl)}));const e=t()("body");e.on("change",`${this.conditionsSelector} input[type="checkbox"]`,t().proxy(this.toggleOrderButton,this)),e.on("change",'input[name="payment-option"]',t().proxy(this.toggleOrderButton,this)),this.toggleOrderButton(),e.on("click",`${this.confirmationSelector} button`,t().proxy(this.confirm,this)),this.getSelectedOption()||this.collapseOptions()}collapseOptions(){t()(`${this.additionalInformatonSelector}, ${this.optionsForm}`).hide()}getSelectedOption(){return t()('input[name="payment-option"]:checked').attr("id")}haveTermsBeenAccepted(){return t()(this.termsCheckboxSelector).prop("checked")}hideConfirmation(){t()(this.confirmationSelector).hide()}showConfirmation(){t()(this.confirmationSelector).show()}toggleOrderButton(){let e=!0;t()(`${this.conditionsSelector} input[type="checkbox"]`).each(((t,n)=>{n.checked||(e=!1)})),r().emit("termsUpdated",{isChecked:e}),this.collapseOptions();const n=this.getSelectedOption();if(n||(e=!1),t()(`#${n}-additional-information`).show(),t()(`#pay-with-${n}-form`).show(),t()(r().selectors.checkout.paymentBinary).hide(),t()(`#${n}`).hasClass("binary")){const r=this.getPaymentOptionSelector(n);this.hideConfirmation(),t()(r).show(),document.querySelectorAll(`${r} button, ${r} input`).forEach((t=>{e?t.removeAttribute("disabled"):t.setAttribute("disabled",!e)})),e?t()(r).removeClass("disabled"):t()(r).addClass("disabled")}else this.showConfirmation(),t()(`${this.confirmationSelector} button`).toggleClass("disabled",!e),t()(`${this.confirmationSelector} button`).attr("disabled",!e),e?t()(this.conditionAlertSelector).hide():t()(this.conditionAlertSelector).show()}getPaymentOptionSelector(e){return`.js-payment-${t()(`#${e}`).data("module-name")}`}showNativeFormErrors(){t()(`input[name=payment-option], ${this.termsCheckboxSelector}`).each((function(){this.reportValidity()}))}confirm(){return e=this,n=null,o=function*(){const e=this.getSelectedOption(),n=this.haveTermsBeenAccepted();if(void 0===e||!1===n)return void this.showNativeFormErrors();const o=yield t().post(window.prestashop.urls.pages.order,{ajax:1,action:"checkCartStillOrderable"});r().checkout.onCheckOrderableCartResponse(o,this)||(t()(`${this.confirmationSelector} button`).addClass("disabled"),t()(`#pay-with-${e}-form form`).submit())},new Promise(((t,r)=>{var i=e=>
15{try{s(o.next(e))}catch(e){r(e)}},a=e=>{try{s(o.throw(e))}catch(e){r(e)}},s=e=>e.done?t(e.value):Promise.resolve(e.value).then(i,a);s((o=o.apply(e,n)).next())}));var e,n,o}}const x=r().selectors.checkout.currentStep,w=`.${x}`;class j{constructor(){this.$steps=t()(r().selectors.checkout.step),this.$steps.off("click"),this.$clickableSteps=t()(w).prevAll().addBack(),this.$clickableSteps.addClass("-clickable")}getClickableSteps(){return this.$clickableSteps}makeCurrent(e){this.$steps.removeClass("-current"),this.$steps.removeClass(x),e.makeCurrent()}static getClickedStep(e){return new k(t()(e.target).closest(r().selectors.checkout.step))}}class k{constructor(e){this.$step=e}isUnreachable(){return this.$step.hasClass("-unreachable")}makeCurrent(){this.$step.addClass("-current"),this.$step.addClass(x)}hasContinueButton(){return t()("button.continue",this.$step).length>0}disableAllAfter(){const e=this.$step.nextAll();e.addClass("-unreachable").removeClass("-complete"),t()(r().selectors.checkout.stepTitle,e).addClass("not-allowed")}enableAllBefore(){const e=this.$step.nextAll(`${r().selectors.checkout.step}.-clickable`);e.removeClass("-unreachable").addClass("-complete"),t()(r().selectors.checkout.stepTitle,e).removeClass("not-allowed")}}function C(){g(),function(){const e=t()("body"),{deliveryFormSelector:n}=r().selectors.checkout,{summarySelector:o}=r().selectors.checkout,{deliveryStepSelector:i}=r().selectors.checkout,{editDeliveryButtonSelector:a}=r().selectors.checkout;e.on("change",`${n} input`,(e=>{const i=t()(n),a=i.serialize(),s=t()(e.currentTarget).parents(r().selectors.checkout.deliveryOption);t().post(i.data("url-update"),a).then((e=>{t()(o).replaceWith(e.preview),t()(r().selectors.checkout.cartPaymentStepRefresh).length&&p(),r().emit("updatedDeliveryForm",{dataForm:i.serializeArray(),deliveryOption:s,resp:e})})).fail((e=>{r().trigger("handleError",{eventType:"updateDeliveryOptions",resp:e})}))})),e.on("click",a,(e=>{e.stopPropagation(),t()(i).trigger("click"),r().emit("editDelivery")}))}(),function(){const e=new b;e.init()}(),function(){const e=new j;e.getClickableSteps().on("click",(t=>{const n=j.getClickedStep(t);n.isUnreachable()||(e.makeCurrent(n),n.hasContinueButton()?n.disableAllAfter():n.enableAllBefore()),r().emit("changedCheckoutStep",{event:t})}))}(),function(){const e=r().selectors.checkout.form;t()(e).on("submit",(function(e){!0===t()(this).data("disabled")&&e.preventDefault(),t()(this).data("disabled",!0),t()('button[type="submit"]',this).addClass("disabled")}))}()}t()((()=>{1===t()("#checkout").length&&C()}));let T=null;function S(e){r().emit("updateProductList",e),window.history.pushState(e,document.title,e.current_url)}function A(e,t){return"abort"!==t}function E(e){T===e&&(T=null)}t()((()=>{r().on("updateFacets",(e=>{!function(e){T&&T.abort();const n=e.indexOf("?")>=0?"&":"?",r=`${e+n}from-xhr`;T=t().ajax({url:r,dataType:"json",success:S,error:A,complete:E})}(e)}))})),t()((()=>{t()("body").on("click",r().selectors.listing.quickview,(e=>{r().emit("clickQuickView",{dataset:t()(e.target).closest(r().selectors.product.miniature).data()}),e.preventDefault()}))}));var D=Object.defineProperty,P=Object.getOwnPropertySymbols,q=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable,O=(e,t,n)=>t in e?D(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_=(e,t)=>{for(var n in t||(t={}))q.call(t,n)&&O(e,n,t[n]);if(P)for(var n of P(t))N.call(t,n)&&O(e,n,t[n]);return e};let $=null,H=null,L=!1;const R=[];let M=!1;function I(e){!function(e,n){const r=t()(`<div class="alert alert-danger ajax-error" role="alert">${n}</div>`);e.replaceWith(r)}(t()(".quickview #product-availability, .page-product:not(.modal-open) .row #product-availability, .page-product:not(.modal-open) .product-container #product-availability"),e)}function F(e,n,o){const i=t()(r().selectors.product.actions).last(),a=i.find(r().selectors.quantityWanted),s=i.find("form:first"),c=s.serialize();let u,l=d("preview");if("function"==typeof Event?u=new Event("updateRating"):(u=document.createEvent("Event"),u.initEvent("updateRating",!0,!0)),null!==l){const e=d("adtoken"),t=d("id_employee");l=`&preview=${l}&adtoken=${e}&id_employee=${t}`}else l="";if(null===o)return void I();
15if(e&&"keyup"===e.type&&a.val()===a.data("old-value"))return;a.data("old-value",a.val()),H&&clearTimeout(H);let p=30;"updatedProductQuantity"===n&&(p=750),H=setTimeout((()=>{""!==c&&($=t().ajax({url:o+(-1===o.indexOf("?")?"?":"&")+c+l,method:"POST",data:{quickview:t()(".modal.quickview.in, .modal.quickview.show").length,ajax:1,action:"refresh",quantity_wanted:"updatedProductCombination"===n?a.attr("min"):a.val()},dataType:"json",beforeSend(){null!==$&&$.abort()},error(e,n){"abort"!==n&&0===t()("section#main > .ajax-error").length&&I()},success(e){const o=t()("<div>").append(e.product_cover_thumbnails);t()(r().selectors.product.imageContainer).html()!==o.find(r().selectors.product.imageContainer).html()&&t()(r().selectors.product.imageContainer).replaceWith(e.product_cover_thumbnails),t()(r().selectors.product.prices).first().replaceWith(e.product_prices),t()(r().selectors.product.customization).first().replaceWith(e.product_customization),"updatedProductQuantity"!==n&&"updatedProductCombination"!==n||!e.id_customization?t()(r().selectors.product.inputCustomization).val(0):t()(r().selectors.cart.productCustomizationId).val(e.id_customization),t()(r().selectors.product.variantsUpdate).first().replaceWith(e.product_variants),t()(r().selectors.product.discounts).first().replaceWith(e.product_discounts),t()(r().selectors.product.additionalInfos).first().replaceWith(e.product_additional_info),t()(r().selectors.product.details).replaceWith(e.product_details),t()(r().selectors.product.flags).first().replaceWith(e.product_flags),function(e){let n=null;t()(e.product_add_to_cart).each(((e,r)=>!t()(r).hasClass("product-add-to-cart")||(n=t()(r),!1))),null===n&&I();const o=t()(r().selectors.product.addToCart),i="#product-availability",a=".product-minimal-quantity";W({$addToCartSnippet:n,$targetParent:o,targetSelector:".add"}),W({$addToCartSnippet:n,$targetParent:o,targetSelector:i}),W({$addToCartSnippet:n,$targetParent:o,targetSelector:a})}(e);const i=parseInt(e.product_minimal_quantity,10);document.dispatchEvent(u),isNaN(i)||"updatedProductQuantity"===n||(a.attr("min",i),a.val(i)),r().emit("updatedProduct",e,s.serializeArray())},complete(){$=null,H=null}}))}),p)}function W(e){const n=t()(e.$targetParent.find(e.targetSelector));if(n.length<=0)return;const r=e.$addToCartSnippet.find(e.targetSelector);r.length>0?n.replaceWith(r[0].outerHTML):n.html("")}t()((()=>{const e=t()(r().selectors.product.actions);t()("body").on("change touchspin.on.startspin",`${r().selectors.product.variants} *[name]`,(e=>{M=!0,r().emit("updateProduct",{eventType:"updatedProductCombination",event:e,resp:{},reason:{productUrl:r().urls.pages.product||""}})})),t()(e.find("form:first").serializeArray()).each(((e,{value:t,name:n})=>{R.push({value:t,name:n})})),window.addEventListener("popstate",(e=>{if(L=!0,(!e.state||e.state&&e.state.form&&0===e.state.form.length)&&!M)return;const n=t()(r().selectors.product.actions).find("form:first");e.state&&e.state.form?e.state.form.forEach((e=>{n.find(`[name="${e.name}"]`).val(e.value)})):R.forEach((e=>{n.find(`[name="${e.name}"]`).val(e.value)})),r().emit("updateProduct",{eventType:"updatedProductCombination",event:e,resp:{},reason:{productUrl:r().urls.pages.product||""}})})),t()("body").on("click",r().selectors.product.refresh,((e,t)=>{e.preventDefault();let n="updatedProductCombination";void 0!==t&&t.eventType&&(n=t.eventType),r().emit("updateProduct",{eventType:n,event:e,resp:{},reason:{productUrl:r().urls.pages.product||""}})})),r().on("updateProduct",(e=>{const{eventType:n}=e,{event:o}=e;(function(){const e=t().Deferred(),n=t()(r().selectors.product.actions),o=t()(r().selectors.quantityWanted);if(null!==r()&&null!==r().urls&&null!==r().urls.pages&&""!==r().urls.pages.product&&null!==r().urls.pages.product)return e.resolve(r().urls.pages.product),e.promise();const i={};return t()(n.find("form:first").serializeArray()).each(((e,t)=>{i[t.name]=t.value})),t().ajax({url:n.find("form:first").attr("action"),method:"POST",data:_({ajax:1,action:"productrefresh",quantity_wanted:o.val()},i),dataType:"json",success(t){const n=t.productUrl;r().page.canonical=n,e.resolve(n)},error(t,n,r){e.reject({jqXHR:t,textStatus:n,errorThrown:r})}}),e.promise()})().done((e=>F(o,n,e))).fail((()=>{0===t()("section#main > .ajax-error").length&&I()}))})),r().on("updatedProduct",((e,n)=>{if(!e.product_url||!e.id_product_attribute)return;if(t()(".modal.quickview").length)return;let r=document.title;e.product_title&&(r=e.product_title,t()(document).attr("title",r)),L||window.history.pushState({id_product_attribute:e.id_product_attribute,form:n},r,e.product_url),L=!1})),r().on("updateCart",(e=>{if(!e||!e.reason||"add-to-cart"!==e.reason.linkAction)return;t()("#quantity_wanted").val(1)})),r().on("showErrorNextToAddtoCartButton",(e=>{e&&e.errorMessage&&I(e.errorMessage)}))})),t()((()=>{var e;e={country:".js-country",address:".js-address-form"},t()("body").on("change",e.country,(n=>{const o={id_country:t()(e.country).val(),id_address:t()(`${e.address} form`).data("id-address")},i=t()(`${e.address} form`).data("refresh-url"),a=`${e.address} input`,s=t()(n.target),c=t()(`${e.address} [type="submit"]`);c.prop("disabled",!0),t().post(i,o).then((n=>{const o=[];t()(a).each((function(){o[t()(this).prop("name")]=t()(this).val()})),t()(s.closest(e.address)).replaceWith(n.address_form),t()(a).each((function(){t()(this).val(o[t()(this).prop("name")])})),r().emit("updatedAddressForm",{target:t()(e.address),resp:n})})).fail((e=>{c.prop("disabled",!1),r().emit("handleError",{eventType:"updateAddressForm",resp:e})}))}))}));const Q=2147483647,B=36,z=/^xn--/,U=/[^\0-\x7F]/,X=/[\x2E\u3002\uFF0E\uFF61]/g,V={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >
15= 0x80 (not a basic code point)","invalid-input":"Invalid input"},J=Math.floor,G=String.fromCharCode;function Y(e){throw new RangeError(V[e])}function K(e,t){const n=e.split("@");let r="";n.length>1&&(r=n[0]+"@",e=n[1]);const o=function(e,t){const n=[];let r=e.length;for(;r--;)n[r]=t(e[r]);return n}((e=e.replace(X,".")).split("."),t).join(".");return r+o}function Z(e){const t=[];let n=0;const r=e.length;for(;n<r;){const o=e.charCodeAt(n++);if(o>=55296&&o<=56319&&n<r){const r=e.charCodeAt(n++);56320==(64512&r)?t.push(((1023&o)<<10)+(1023&r)+65536):(t.push(o),n--)}else t.push(o)}return t}const ee=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},te=function(e,t,n){let r=0;for(e=n?J(e/700):e>>1,e+=J(e/t);e>455;r+=B)e=J(e/35);return J(r+36*e/(e+38))},ne=function(e){const t=[],n=e.length;let r=0,o=128,i=72,a=e.lastIndexOf("-");a<0&&(a=0);for(let n=0;n<a;++n)e.charCodeAt(n)>=128&&Y("not-basic"),t.push(e.charCodeAt(n));for(let c=a>0?a+1:0;c<n;){const a=r;for(let t=1,o=B;;o+=B){c>=n&&Y("invalid-input");const a=(s=e.charCodeAt(c++))>=48&&s<58?s-48+26:s>=65&&s<91?s-65:s>=97&&s<123?s-97:B;a>=B&&Y("invalid-input"),a>J((Q-r)/t)&&Y("overflow"),r+=a*t;const u=o<=i?1:o>=i+26?26:o-i;if(a<u)break;const l=B-u;t>J(Q/l)&&Y("overflow"),t*=l}const u=t.length+1;i=te(r-a,u,0==a),J(r/u)>Q-o&&Y("overflow"),o+=J(r/u),r%=u,t.splice(r++,0,o)}var s;return String.fromCodePoint(...t)},re=function(e){const t=[],n=(e=Z(e)).length;let r=128,o=0,i=72;for(const n of e)n<128&&t.push(G(n));const a=t.length;let s=a;
vendor: 14,733 bytes, lines 15-26
15for(a&&t.push("-");s<n;){let n=Q;for(const t of e)t>=r&&t<n&&(n=t);const c=s+1;n-r>J((Q-o)/c)&&Y("overflow"),o+=(n-r)*c,r=n;for(const n of e)if(n<r&&++o>Q&&Y("overflow"),n===r){let e=o;for(let n=B;;n+=B){const r=n<=i?1:n>=i+26?26:n-i;if(e<r)break;const o=e-r,a=B-r;t.push(G(ee(r+o%a,0))),e=J(o/a)}t.push(G(ee(e,0))),i=te(o,c,s===a),o=0,++s}++o,++r}return t.join("")},oe={version:"2.3.1",ucs2:{decode:Z,encode:e=>String.fromCodePoint(...e)},decode:ne,encode:re,toASCII:function(e){return K(e,(function(e){return U.test(e)?"xn--"+re(e):e}))},toUnicode:function(e){return K(e,(function(e){return z.test(e)?ne(e.slice(4).toLowerCase()):e}))}},ie=function(e){const n=t()(e);t().each(n,((e,t)=>{if(!t.checkValidity()){const e=t.value.split("@");oe.toASCII(e[0])===e[0]&&(t.value=oe.toASCII(t.value))}}))};o.p=window.prestashop.core_js_public_path,window.$=t(),window.jQuery=t(),t()((()=>{t()(".ps-shown-by-js").show(),t()(".ps-hidden-by-js").hide(),ie('input[type="email"]')}))})()})();/*! jQuery UI - v1.10.3 - 2013-05-03
16* http://jqueryui.com
17* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
18(function(e,t){function i(t,i){var a,n,r,o=t.nodeName.toLowerCase();return"area"===o?(a=t.parentNode,n=a.name,t.href&&n&&"map"===a.nodeName.toLowerCase()?(r=e("img[usemap=#"+n+"]")[0],!!r&&s(r)):!1):(/input|select|textarea|button|object/.test(o)?!t.disabled:"a"===o?t.href||i:i)&&s(t)}function s(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")}).length}var a=0,n=/^ui-id-\d+$/;e.ui=e.ui||{},e.extend(e.ui,{version:"1.10.3",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),e.fn.extend({focus:function(t){return function(i,s){return"number"==typeof i?this.each(function(){var t=this;setTimeout(function(){e(t).focus(),s&&s.call(t)},i)}):t.apply(this,arguments)}}(e.fn.focus),scrollParent:function(){var t;return t=e.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(e.css(this,"position"))&&/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0),/fixed/.test(this.css("position"))||!t.length?e(document):t},zIndex:function(i){if(i!==t)return this.css("zIndex",i);if(this.length)for(var s,a,n=e(this[0]);n.length&&n[0]!==document;){if(s=n.css("position"),("absolute"===s||"relative"===s||"fixed"===s)&&(a=parseInt(n.css("zIndex"),10),!isNaN(a)&&0!==a))return a;n=n.parent()}return 0},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++a)})},removeUniqueId:function(){return this.each(function(){n.test(this.id)&&e(this).removeAttr("id")})}}),e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(i){return!!e.data(i,t)}}):function(t,i,s){return!!e.data(t,s[3])},focusable:function(t){return i(t,!isNaN(e.attr(t,"tabindex")))},tabbable:function(t){var s=e.attr(t,"tabindex"),a=isNaN(s);return(a||s>=0)&&i(t,!a)}}),e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(i,s){function a(t,i,s,a){return e.each(n,function(){i-=parseFloat(e.css(t,"padding"+this))||0,s&&(i-=parseFloat(e.css(t,"border"+this+"Width"))||0),a&&(i-=parseFloat(e.css(t,"margin"+this))||0)}),i}var n="Width"===s?["Left","Right"]:["Top","Bottom"],r=s.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+s]=function(i){return i===t?o["inner"+s].call(this):this.each(function(){e(this).css(r,a(this,i)+"px")})},e.fn["outer"+s]=function(t,i){return"number"!=typeof t?o["outer"+s].call(this,t):this.each(function(){e(this).css(r,a(this,t,!0,i)+"px")})}}),e.fn.addBack||(e.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(i){return arguments.length?t.call(this,e.camelCase(i)):t.call(this)}}(e.fn.removeData)),e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),e.support.selectstart="onselectstart"in document.createElement("div"),e.fn.extend({disableSelection:function(){return this.bind((e.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),e.extend(e.ui,{plugin:{add:function(t,i,s){var a,n=e.ui[t].prototype;for(a in s)n.plugins[a]=n.plugins[a]||[],n.plugins[a].push([i,s[a]])},call:function(e,t,i){var s,a=e.plugins[t];if(a&&e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType)for(s=0;a.length>s;s++)e.options[a[s][0]]&&a[s][1].apply(e.element,i)}},hasScroll:function(t,i){if("hidden"===e(t).css("overflow"))return!1;var s=i&&"left"===i?"scrollLeft":"scrollTop",a=!1;return t[s]>0?!0:(t[s]=1,a=t[s]>0,t[s]=0,a)}})})(jQuery);;/*! jQuery UI - v1.10.3 - 2013-05-03
19* http://jqueryui.com
20* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
21(function(e,t){var i=0,s=Array.prototype.slice,n=e.cleanData;e.cleanData=function(t){for(var i,s=0;null!=(i=t[s]);s++)try{e(i).triggerHandler("remove")}catch(a){}n(t)},e.widget=function(i,s,n){var a,r,o,h,l={},u=i.split(".")[0];i=i.split(".")[1],a=u+"-"+i,n||(n=s,s=e.Widget),e.expr[":"][a.toLowerCase()]=function(t){return!!e.data(t,a)},e[u]=e[u]||{},r=e[u][i],o=e[u][i]=function(e,i){return this._createWidget?(arguments.length&&this._createWidget(e,i),t):new o(e,i)},e.extend(o,r,{version:n.version,_proto:e.extend({},n),_childConstructors:[]}),h=new s,h.options=e.widget.extend({},h.options),e.each(n,function(i,n){return e.isFunction(n)?(l[i]=function(){var e=function(){return s.prototype[i].apply(this,arguments)},t=function(e){return s.prototype[i].apply(this,e)};return function(){var i,s=this._super,a=this._superApply;return this._super=e,this._superApply=t,i=n.apply(this,arguments),this._super=s,this._superApply=a,i}}(),t):(l[i]=n,t)}),o.prototype=e.widget.extend(h,{widgetEventPrefix:r?h.widgetEventPrefix:i},l,{constructor:o,namespace:u,widgetName:i,widgetFullName:a}),r?(e.each(r._childConstructors,function(t,i){var s=i.prototype;e.widget(s.namespace+"."+s.widgetName,o,i._proto)}),delete r._childConstructors):s._childConstructors.push(o),e.widget.bridge(i,o)},e.widget.extend=function(i){for(var n,a,r=s.call(arguments,1),o=0,h=r.length;h>o;o++)for(n in r[o])a=r[o][n],r[o].hasOwnProperty(n)&&a!==t&&(i[n]=e.isPlainObject(a)?e.isPlainObject(i[n])?e.widget.extend({},i[n],a):e.widget.extend({},a):a);return i},e.widget.bridge=function(i,n){var a=n.prototype.widgetFullName||i;e.fn[i]=function(r){var o="string"==typeof r,h=s.call(arguments,1),l=this;return r=!o&&h.length?e.widget.extend.apply(null,[r].concat(h)):r,o?this.each(function(){var s,n=e.data(this,a);return n?e.isFunction(n[r])&&"_"!==r.charAt(0)?(s=n[r].apply(n,h),s!==n&&s!==t?(l=s&&s.jquery?l.pushStack(s.get()):s,!1):t):e.error("no such method '"+r+"' for "+i+" widget instance"):e.error("cannot call methods on "+i+" prior to initialization; "+"attempted to call method '"+r+"'")}):this.each(function(){var t=e.data(this,a);t?t.option(r||{})._init():e.data(this,a,new n(r,this))}),l}},e.Widget=function(){},e.Widget._childConstructors=[],e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,s){s=e(s||this.defaultElement||this)[0],this.element=e(s),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.options=e.widget.extend({},this.options,this._getCreateOptions(),t),this.bindings=e(),this.hoverable=e(),this.focusable=e(),s!==this&&(e.data(s,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===s&&this.destroy()}}),this.document=e(s.style?s.ownerDocument:s.document||s),this.window=e(this.document[0].defaultView||this.document[0].parentWindow)),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetName).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(i,s){var n,a,r,o=i;if(0===arguments.length)return e.widget.extend({},this.options);if("string"==typeof i)if(o={},n=i.split("."),i=n.shift(),n.length){for(a=o[i]=e.widget.extend({},this.options[i]),r=0;n.length-1>r;r++)a[n[r]]=a[n[r]]||{},a=a[n[r]];if(i=n.pop(),s===t)return a[i]===t?null:a[i];a[i]=s}else{if(s===t)return this.options[i]===t?null:this.options[i];o[i]=s}return this._setOptions(o),this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return this.options[e]=t,"disabled"===e&&(this.widget().toggleClass(this.widgetFullName+"-disabled ui-state-disabled",!!t).attr("aria-disabled",t),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")),this},enable:function(){return this._setOption("disabled",!1)},disable:function(){return this._setOption("disabled",!0)},_on:function(i,s,n){var a,r=this;"boolean"!=typeof i&&(n=s,s=i,i=!1),n?(s=a=e(s),this.bindings=this.bindings.add(s)):(n=s,s=this.element,a=this.widget()),e.each(n,function(n,o){function h(){return i||r.options.disabled!==!0&&!e(this).hasClass("ui-state-disabled")?("string"==typeof o?r[o]:o).apply(r,arguments):t}"string"!=typeof o&&(h.guid=o.guid=o.guid||h.guid||e.guid++);var l=n.match(/^(\w+)\s*(.*)$/),u=l[1]+r.eventNamespace,c=l[2];c?a.delegate(c,u,h):s.bind(u,h)})},_off:function(e,t){t=(t||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.unbind(t).undelegate(t)},_delay:function(e,t){function i(){return("string"==typeof e?s[e]:e).apply(s,arguments)}var s=this;return setTimeout(i,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,i,s){var n,a,r=this.options[t];if(s=s||{},i=e.Event(i),i.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),i.target=this.element[0],a=i.originalEvent)for(n in a)n in i||(i[n]=a[n]);return this.element.trigger(i,s),!(e.isFunction(r)&&r.apply(this.element[0],[i].concat(s))===!1||i.isDefaultPrevented())}},e.each({show:"fadeIn",hide:"fadeOut"},function(t,i){e.Widget.prototype["_"+t]=function(s,n,a){"string"==typeof n&&(n={effect:n});var r,o=n?n===!0||"number"==typeof n?i:n.effect||i:t;n=n||{},"number"==typeof n&&(n={duration:n}),r=!e.isEmptyObject(n),n.complete=a,n.delay&&s.delay(n.delay),r&&e.effects&&e.effects.effect[o]?s[t](n):o!==t&&s[o]?s[o](n.duration,n.easing,a):s.queue(function(i){e(this)[t](),a&&a.call(s[0]),i()})}})})(jQuery);/*! jQuery UI - v1.10.3 - 2013-05-03
22* http://jqueryui.com
23* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
24(function(e){var t=!1;e(document).mouseup(function(){t=!1}),e.widget("ui.mouse",{version:"1.10.3",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(i){return!0===e.data(i.target,t.widgetName+".preventClickEvent")?(e.removeData(i.target,t.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1):undefined}),this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName),this._mouseMoveDelegate&&e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(i){if(!t){this._mouseStarted&&this._mouseUp(i),this._mouseDownEvent=i;var s=this,n=1===i.which,a="string"==typeof this.options.cancel&&i.target.nodeName?e(i.target).closest(this.options.cancel).length:!1;return n&&!a&&this._mouseCapture(i)?(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){s.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(i)&&this._mouseDelayMet(i)&&(this._mouseStarted=this._mouseStart(i)!==!1,!this._mouseStarted)?(i.preventDefault(),!0):(!0===e.data(i.target,this.widgetName+".preventClickEvent")&&e.removeData(i.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(e){return s._mouseMove(e)},this._mouseUpDelegate=function(e){return s._mouseUp(e)},e(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate),i.preventDefault(),t=!0,!0)):!0}},_mouseMove:function(t){return e.ui.ie&&(!document.documentMode||9>document.documentMode)&&!t.button?this._mouseUp(t):this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1,this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){return e(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})})(jQuery);/*! jQuery UI - v1.10.3 - 2013-05-03
25* http://jqueryui.com
26* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
vendor: 6,139 bytes, line 27
27(function(t,e){function i(t,e,i){return[parseFloat(t[0])*(p.test(t[0])?e/100:1),parseFloat(t[1])*(p.test(t[1])?i/100:1)]}function s(e,i){return parseInt(t.css(e,i),10)||0}function n(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()}}t.ui=t.ui||{};var a,o=Math.max,r=Math.abs,h=Math.round,l=/left|center|right/,c=/top|center|bottom/,u=/[\+\-]\d+(\.[\d]+)?%?/,d=/^\w+/,p=/%$/,f=t.fn.position;t.position={scrollbarWidth:function(){if(a!==e)return a;var i,s,n=t("<div style='display:block;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),o=n.children()[0];return t("body").append(n),i=o.offsetWidth,n.css("overflow","scroll"),s=o.offsetWidth,i===s&&(s=n[0].clientWidth),n.remove(),a=i-s},getScrollInfo:function(e){var i=e.isWindow?"":e.element.css("overflow-x"),s=e.isWindow?"":e.element.css("overflow-y"),n="scroll"===i||"auto"===i&&e.width<e.element[0].scrollWidth,a="scroll"===s||"auto"===s&&e.height<e.element[0].scrollHeight;return{width:a?t.position.scrollbarWidth():0,height:n?t.position.scrollbarWidth():0}},getWithinInfo:function(e){var i=t(e||window),s=t.isWindow(i[0]);return{element:i,isWindow:s,offset:i.offset()||{left:0,top:0},scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:s?i.width():i.outerWidth(),height:s?i.height():i.outerHeight()}}},t.fn.position=function(e){if(!e||!e.of)return f.apply(this,arguments);e=t.extend({},e);var a,p,m,g,v,b,_=t(e.of),y=t.position.getWithinInfo(e.within),w=t.position.getScrollInfo(y),x=(e.collision||"flip").split(" "),k={};return b=n(_),_[0].preventDefault&&(e.at="left top"),p=b.width,m=b.height,g=b.offset,v=t.extend({},g),t.each(["my","at"],function(){var t,i,s=(e[this]||"").split(" ");1===s.length&&(s=l.test(s[0])?s.concat(["center"]):c.test(s[0])?["center"].concat(s):["center","center"]),s[0]=l.test(s[0])?s[0]:"center",s[1]=c.test(s[1])?s[1]:"center",t=u.exec(s[0]),i=u.exec(s[1]),k[this]=[t?t[0]:0,i?i[0]:0],e[this]=[d.exec(s[0])[0],d.exec(s[1])[0]]}),1===x.length&&(x[1]=x[0]),"right"===e.at[0]?v.left+=p:"center"===e.at[0]&&(v.left+=p/2),"bottom"===e.at[1]?v.top+=m:"center"===e.at[1]&&(v.top+=m/2),a=i(k.at,p,m),v.left+=a[0],v.top+=a[1],this.each(function(){var n,l,c=t(this),u=c.outerWidth(),d=c.outerHeight(),f=s(this,"marginLeft"),b=s(this,"marginTop"),D=u+f+s(this,"marginRight")+w.width,T=d+b+s(this,"marginBottom")+w.height,C=t.extend({},v),M=i(k.my,c.outerWidth(),c.outerHeight());"right"===e.my[0]?C.left-=u:"center"===e.my[0]&&(C.left-=u/2),"bottom"===e.my[1]?C.top-=d:"center"===e.my[1]&&(C.top-=d/2),C.left+=M[0],C.top+=M[1],t.support.offsetFractions||(C.left=h(C.left),C.top=h(C.top)),n={marginLeft:f,marginTop:b},t.each(["left","top"],function(i,s){t.ui.position[x[i]]&&t.ui.position[x[i]][s](C,{targetWidth:p,targetHeight:m,elemWidth:u,elemHeight:d,collisionPosition:n,collisionWidth:D,collisionHeight:T,offset:[a[0]+M[0],a[1]+M[1]],my:e.my,at:e.at,within:y,elem:c})}),e.using&&(l=function(t){var i=g.left-C.left,s=i+p-u,n=g.top-C.top,a=n+m-d,h={target:{element:_,left:g.left,top:g.top,width:p,height:m},element:{element:c,left:C.left,top:C.top,width:u,height:d},horizontal:0>s?"left":i>0?"right":"center",vertical:0>a?"top":n>0?"bottom":"middle"};u>p&&p>r(i+s)&&(h.horizontal="center"),d>m&&m>r(n+a)&&(h.vertical="middle"),h.important=o(r(i),r(s))>o(r(n),r(a))?"horizontal":"vertical",e.using.call(this,t,h)}),c.offset(t.extend(C,{using:l}))})},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,h=n-r,l=r+e.collisionWidth-a-n;e.collisionWidth>a?h>0&&0>=l?(i=t.left+h+e.collisionWidth-a-n,t.left+=h-i):t.left=l>0&&0>=h?n:h>l?n+a-e.collisionWidth:n:h>0?t.left+=h:l>0?t.left-=l: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,h=n-r,l=r+e.collisionHeight-a-n;e.collisionHeight>a?h>0&&0>=l?(i=t.top+h+e.collisionHeight-a-n,t.top+=h-i):t.top=l>0&&0>=h?n:h>l?n+a-e.collisionHeight:n:h>0?t.top+=h:l>0?t.top-=l:t.top=o(t.top-r,t.top)}},flip:{left:function(t,e){var i,s,n=e.within,a=n.offset.left+n.scrollLeft,o=n.width,h=n.isWindow?n.scrollLeft:n.offset.left,l=t.left-e.collisionPosition.marginLeft,c=l-h,u=l+e.collisionWidth-o-h,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-o-a,(0>i||r(c)>i)&&(t.left+=d+p+f)):u>0&&(s=t.left-e.collisionPosition.marginLeft+d+p+f-h,(s>0||u>r(s))&&(t.left+=d+p+f))},top:function(t,e){var i,s,n=e.within,a=n.offset.top+n.scrollTop,o=n.height,h=n.isWindow?n.scrollTop:n.offset.top,l=t.top-e.collisionPosition.marginTop,c=l-h,u=l+e.collisionHeight-o-h,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,m=-2*e.offset[1];0>c?(s=t.top+p+f+m+e.collisionHeight-o-a,t.top+p+f+m>c&&(0>s||r(c)>s)&&(t.top+=p+f+m)):u>0&&(i=t.top-e.collisionPosition.marginTop+p+f+m-h,t.top+p+f+m>u&&(i>0||u>r(i))&&(t.top+=p+f+m))}},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)}}},function(){var e,i,s,n,a,o=document.getElementsByTagName("body")[0],r=document.createElement("div");e=document.createElement(o?"div":"body"),s={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"},o&&t.extend(s,{position:"absolute",left:"-1000px",top:"-1000px"});for(a in s)e.style[a]=s[a];e.appendChild(r),i=o||document.documentElement,i.insertBefore(e,i.firstChild),r.style.cssText="position: absolute; left: 10.7432222px;",n=t(r).offset().left,t.support.offsetFractions=n>10&&11>n,e.innerHTML="",i.removeChild(e)}()})(jQuery);
vendor: 7,428 bytes, lines 27-30
27/*! jQuery UI - v1.10.3 - 2013-05-03
28* http://jqueryui.com
29* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
30(function(t){t.widget("ui.menu",{version:"1.10.3",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-carat-1-e"},menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().addClass("ui-menu ui-widget ui-widget-content ui-corner-all").toggleClass("ui-menu-icons",!!this.element.find(".ui-icon").length).attr({role:this.options.role,tabIndex:0}).bind("click"+this.eventNamespace,t.proxy(function(t){this.options.disabled&&t.preventDefault()},this)),this.options.disabled&&this.element.addClass("ui-state-disabled").attr("aria-disabled","true"),this._on({"mousedown .ui-menu-item > a":function(t){t.preventDefault()},"click .ui-state-disabled > a":function(t){t.preventDefault()},"click .ui-menu-item:has(a)":function(e){var i=t(e.target).closest(".ui-menu-item");!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.mouseHandled=!0,this.select(e),i.has(".ui-menu").length?this.expand(e):this.element.is(":focus")||(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(e){var i=t(e.currentTarget);i.siblings().children(".ui-state-active").removeClass("ui-state-active"),this.focus(e,i)},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var i=this.active||this.element.children(".ui-menu-item").eq(0);e||this.focus(t,i)},blur:function(e){this._delay(function(){t.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(e)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(e){t(e.target).closest(".ui-menu").length||this.collapseAll(e),this.mouseHandled=!1}})},_destroy:function(){this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeClass("ui-menu ui-widget ui-widget-content ui-corner-all ui-menu-icons").removeAttr("role").removeAttr("tabIndex").removeAttr("aria-labelledby").removeAttr("aria-expanded").removeAttr("aria-hidden").removeAttr("aria-disabled").removeUniqueId().show(),this.element.find(".ui-menu-item").removeClass("ui-menu-item").removeAttr("role").removeAttr("aria-disabled").children("a").removeUniqueId().removeClass("ui-corner-all ui-state-hover").removeAttr("tabIndex").removeAttr("role").removeAttr("aria-haspopup").children().each(function(){var e=t(this);e.data("ui-menu-submenu-carat")&&e.remove()}),this.element.find(".ui-menu-divider").removeClass("ui-menu-divider ui-widget-content")},_keydown:function(e){function i(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var s,n,a,o,r,h=!0;switch(e.keyCode){case t.ui.keyCode.PAGE_UP:this.previousPage(e);break;case t.ui.keyCode.PAGE_DOWN:this.nextPage(e);break;case t.ui.keyCode.HOME:this._move("first","first",e);break;case t.ui.keyCode.END:this._move("last","last",e);break;case t.ui.keyCode.UP:this.previous(e);break;case t.ui.keyCode.DOWN:this.next(e);break;case t.ui.keyCode.LEFT:this.collapse(e);break;case t.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(e);break;case t.ui.keyCode.ENTER:case t.ui.keyCode.SPACE:this._activate(e);break;case t.ui.keyCode.ESCAPE:this.collapse(e);break;default:h=!1,n=this.previousFilter||"",a=String.fromCharCode(e.keyCode),o=!1,clearTimeout(this.filterTimer),a===n?o=!0:a=n+a,r=RegExp("^"+i(a),"i"),s=this.activeMenu.children(".ui-menu-item").filter(function(){return r.test(t(this).children("a").text())}),s=o&&-1!==s.index(this.active.next())?this.active.nextAll(".ui-menu-item"):s,s.length||(a=String.fromCharCode(e.keyCode),r=RegExp("^"+i(a),"i"),s=this.activeMenu.children(".ui-menu-item").filter(function(){return r.test(t(this).children("a").text())})),s.length?(this.focus(e,s),s.length>1?(this.previousFilter=a,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter):delete this.previousFilter}h&&e.preventDefault()},_activate:function(t){this.active.is(".ui-state-disabled")||(this.active.children("a[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var e,i=this.options.icons.submenu,s=this.element.find(this.options.menus);s.filter(":not(.ui-menu)").addClass("ui-menu ui-widget ui-widget-content ui-corner-all").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var e=t(this),s=e.prev("a"),n=t("<span>").addClass("ui-menu-icon ui-icon "+i).data("ui-menu-submenu-carat",!0);s.attr("aria-haspopup","true").prepend(n),e.attr("aria-labelledby",s.attr("id"))}),e=s.add(this.element),e.children(":not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","presentation").children("a").uniqueId().addClass("ui-corner-all").attr({tabIndex:-1,role:this._itemRole()}),e.children(":not(.ui-menu-item)").each(function(){var e=t(this);/[^\-\u2014\u2013\s]/.test(e.text())||e.addClass("ui-widget-content ui-menu-divider")}),e.children(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!t.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){"icons"===t&&this.element.find(".ui-menu-icon").removeClass(this.options.icons.submenu).addClass(e.submenu),this._super(t,e)},focus:function(t,e){var i,s;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),s=this.active.children("a").addClass("ui-state-focus"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),this.active.parent().closest(".ui-menu-item").children("a:first").addClass("ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=e.children(".ui-menu"),i.length&&/^mouse/.test(t.type)&&this._startOpening(i),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(e){var i,s,n,a,o,r;this._hasScroll()&&(i=parseFloat(t.css(this.activeMenu[0],"borderTopWidth"))||0,s=parseFloat(t.css(this.activeMenu[0],"paddingTop"))||0,n=e.offset().top-this.activeMenu.offset().top-i-s,a=this.activeMenu.scrollTop(),o=this.activeMenu.height(),r=e.height(),0>n?this.activeMenu.scrollTop(a+n):n+r>o&&this.activeMenu.scrollTop(a+n-o+r))},blur:function(t,e){e||clearTimeout(this.timer),this.active&&(this.active.children("a").removeClass("ui-state-focus"),this.active=null,this._trigger("blur",t,{item:this.active}))},_startOpening:function(t){clearTimeout(this.timer),"true"===t.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(t)},this.delay))},_open:function(e){var i=t.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(e.parents(".ui-menu")).hide().attr("aria-hidden","true"),e.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(e,i){clearTimeout(this.timer),this.timer=this._delay(function(){var s=i?this.element:t(e&&e.target).closest(this.element.find(".ui-menu"));s.length||(s=this.element),this._close(s),this.blur(e),this.activeMenu=s},this.delay)},_close:function(t){t||(t=this.active?this.active.parent():this.element),t.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","fal
vendor: 4,890 bytes, lines 30-33
30se").end().find("a.ui-state-active").removeClass("ui-state-active")},collapse:function(t){var e=this.active&&this.active.parent().closest(".ui-menu-item",this.element);e&&e.length&&(this._close(),this.focus(t,e))},expand:function(t){var e=this.active&&this.active.children(".ui-menu ").children(".ui-menu-item").first();e&&e.length&&(this._open(e.parent()),this._delay(function(){this.focus(t,e)}))},next:function(t){this._move("next","first",t)},previous:function(t){this._move("prev","last",t)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(t,e,i){var s;this.active&&(s="first"===t||"last"===t?this.active["first"===t?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[t+"All"](".ui-menu-item").eq(0)),s&&s.length&&this.active||(s=this.activeMenu.children(".ui-menu-item")[e]()),this.focus(i,s)},nextPage:function(e){var i,s,n;return this.active?(this.isLastItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return i=t(this),0>i.offset().top-s-n}),this.focus(e,i)):this.focus(e,this.activeMenu.children(".ui-menu-item")[this.active?"last":"first"]())),undefined):(this.next(e),undefined)},previousPage:function(e){var i,s,n;return this.active?(this.isFirstItem()||(this._hasScroll()?(s=this.active.offset().top,n=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return i=t(this),i.offset().top-s+n>0}),this.focus(e,i)):this.focus(e,this.activeMenu.children(".ui-menu-item").first())),undefined):(this.next(e),undefined)},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(e){this.active=this.active||t(e.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(e,!0),this._trigger("select",e,i)}})})(jQuery);/*! jQuery UI - v1.10.3 - 2013-05-03
31* http://jqueryui.com
32* Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */
33(function(t){var e=0;t.widget("ui.autocomplete",{version:"1.10.3",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},pending:0,_create:function(){var e,i,s,n=this.element[0].nodeName.toLowerCase(),a="textarea"===n,o="input"===n;this.isMultiLine=a?!0:o?!1:this.element.prop("isContentEditable"),this.valueMethod=this.element[a||o?"val":"text"],this.isNewMenu=!0,this.element.addClass("ui-autocomplete-input").attr("autocomplete","off"),this._on(this.element,{keydown:function(n){if(this.element.prop("readOnly"))return e=!0,s=!0,i=!0,undefined;e=!1,s=!1,i=!1;var a=t.ui.keyCode;switch(n.keyCode){case a.PAGE_UP:e=!0,this._move("previousPage",n);break;case a.PAGE_DOWN:e=!0,this._move("nextPage",n);break;case a.UP:e=!0,this._keyEvent("previous",n);break;case a.DOWN:e=!0,this._keyEvent("next",n);break;case a.ENTER:case a.NUMPAD_ENTER:this.menu.active&&(e=!0,n.preventDefault(),this.menu.select(n));break;case a.TAB:this.menu.active&&this.menu.select(n);break;case a.ESCAPE:this.menu.element.is(":visible")&&(this._value(this.term),this.close(n),n.preventDefault());break;default:i=!0,this._searchTimeout(n)}},keypress:function(s){if(e)return e=!1,(!this.isMultiLine||this.menu.element.is(":visible"))&&s.preventDefault(),undefined;if(!i){var n=t.ui.keyCode;switch(s.keyCode){case n.PAGE_UP:this._move("previousPage",s);break;case n.PAGE_DOWN:this._move("nextPage",s);break;case n.UP:this._keyEvent("previous",s);break;case n.DOWN:this._keyEvent("next",s)}}},input:function(t){return s?(s=!1,t.preventDefault(),undefined):(this._searchTimeout(t),undefined)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(t){return this.cancelBlur?(delete this.cancelBlur,undefined):(clearTimeout(this.searching),this.close(t),this._change(t),undefined)}}),this._initSource(),this.menu=t("<ul>").addClass("ui-autocomplete ui-front").appendTo(this._appendTo()).menu({role:null}).hide().data("ui-menu"),this._on(this.menu.element,{mousedown:function(e){e.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur});var i=this.menu.element[0];t(e.target).closest(".ui-menu-item").length||this._delay(function(){var e=this;this.document.one("mousedown",function(s){s.target===e.element[0]||s.target===i||t.contains(i,s.target)||e.close()})})},menufocus:function(e,i){if(this.isNewMenu&&(this.isNewMenu=!1,e.originalEvent&&/^mouse/.test(e.originalEvent.type)))return this.menu.blur(),this.document.one("mousemove",function(){t(e.target).trigger(e.originalEvent)}),undefined;var s=i.item.data("ui-autocomplete-item");!1!==this._trigger("focus",e,{item:s}
33)?e.originalEvent&&/^key/.test(e.originalEvent.type)&&this._value(s.value):this.liveRegion.text(s.value)},menuselect:function(t,e){var i=e.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.focus(),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",t,{item:i})&&this._value(i.value),this.term=this._value(),this.close(t),this.selectedItem=i}}),this.liveRegion=t("<span>",{role:"status","aria-live":"polite"}).addClass("ui-helper-hidden-accessible").insertBefore(this.element),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(t,e){this._super(t,e),"source"===t&&this._initSource(),"appendTo"===t&&this.menu.element.appendTo(this._appendTo()),"disabled"===t&&e&&this.xhr&&this.xhr.abort()},_appendTo:function(){var e=this.options.appendTo;return e&&(e=e.jquery||e.nodeType?t(e):this.document.find(e).eq(0)),e||(e=this.element.closest(".ui-front")),e.length||(e=this.document[0].body),e},_initSource:function(){var e,i,s=this;t.isArray(this.options.source)?(e=this.options.source,this.source=function(i,s){s(t.ui.autocomplete.filter(e,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(e,n){s.xhr&&s.xhr.abort(),s.xhr=t.ajax({url:i,data:e,dataType:"json",success:function(t){n(t)},error:function(){n([])}})}):this.source=this.options.source},_searchTimeout:function(t){clearTimeout(this.searching),this.searching=this._delay(function(){this.term!==this._value()&&(this.selectedItem=null,this.search(null,t))},this.options.delay)},search:function(t,e){return t=null!=t?t:this._value(),this.term=this._value(),t.length<this.options.minLength?this.close(e):this._trigger("search",e)!==!1?this._search(t):undefined},_search:function(t){this.pending++,this.element.addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:t},this._response())},_response:function(){var t=this,i=++e;return function(s){i===e&&t.__response(s),t.pending--,t.pending||t.element.removeClass("ui-autocomplete-loading")}},__response:function(t){t&&(t=this._normalize(t)),this._trigger("response",null,{content:t}),!this.options.disabled&&t&&t.length&&!this.cancelSearch?(this._suggest(t),this._trigger("open")):this._close()},close:function(t){this.cancelSearch=!0,this._close(t)},_close:function(t){this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",t))},_change:function(t){this.previous!==this._value()&&this._trigger("change",t,{item:this.selectedItem})},_normalize:function(e){return e.length&&e[0].label&&e[0].value?e:t.map(e,function(e){return"string"==typeof e?{label:e,value:e}:t.extend({label:e.label||e.value,value:e.value||e.label},e)})},_suggest:function(e){var i=this.menu.element.empty();this._renderMenu(i,e),this.isNewMenu=!0,this.menu.refresh(),i.show(),this._resizeMenu(),i.position(t.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next()},_resizeMenu:function(){var t=this.menu.element;t.outerWidth(Math.max(t.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(e,i){var s=this;t.each(i,function(t,i){s._renderItemData(e,i)})},_renderItemData:function(t,e){return this._renderItem(t,e).data("ui-autocomplete-item",e)},_renderItem:function(e,i){return t("<li>").append(t("<a>").text(i.label)).appendTo(e)},_move:function(t,e){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(t)||this.menu.isLastItem()&&/^next/.test(t)?(this._value(this.term),this.menu.blur(),undefined):(this.menu[t](e),undefined):(this.search(null,e),undefined)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(t,e){(!this.isMultiLine||this.menu.element.is(":visible"))&&(this._move(t,e),e.preventDefault())}}),t.extend(t.ui.autocomplete,{escapeRegex:function(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(e,i){var s=RegExp(t.ui.autocomplete.escapeRegex(i),"i");return t.grep(e,function(t){return s.test(t.label||t.value||t)})}}),t.widget("ui.autocomplete",t.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(t){return t+(t>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(t){var e;this._superApply(arguments),this.options.disabled||this.cancelSearch||(e=t&&t.length?this.options.messages.results(t.length):this.options.messages.noResults,this.liveRegion.text(e))}})})(jQuery);(()=>{var mm=Object.defineProperty,vm=Object.defineProperties;var gm=Object.getOwnPropertyDescriptors;var Ia=Object.getOwnPropertySymbols;var _m=Object.prototype.hasOwnProperty,Em=Object.prototype.propertyIsEnumerable;var Ra=(ze,Me,re)=>Me in ze?mm(ze,Me,{enumerable:!0,configurable:!0,writable:!0,value:re}):ze[Me]=re,Le=(ze,Me)=>{for(var re in Me||(Me={}))_m.call(Me,re)&&Ra(ze,re,Me[re]);if(Ia)for(var re of Ia(Me))Em.call(Me,re)&&Ra(ze,re,Me[re]);return ze},Lr=(ze,Me)=>vm(ze,gm(Me));(()=>{var ze={7:J=>{"use strict";var ee=typeof Reflect=="object"?Reflect:null,he=ee&&typeof ee.apply=="function"?ee.apply:function(p,A,I){return Function.prototype.apply.call(p,A,I)},Re;ee&&typeof ee.ownKeys=="function"?Re=ee.ownKeys:Object.getOwnPropertySymbols?Re=function(p){return Object.getOwnPropertyNames(p).concat(Object.getOwnPropertySymbols(p))}:Re=function(p){return Object.getOwnPropertyNames(p)};function me(_){console&&console.warn&&console.warn(_)}var le=Number.isNaN||function(p){return p!==p};function W(){W.init.call(this)}J.exports=W,J.exports.once=T,W.EventEmitter=W,W.prototype._events=void 0,W.prototype._eventsCount=0,W.prototype._maxListeners=void 0;var rt=10;function je(_){if(typeof _!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof _)}Object.defineProperty(W,"defaultMaxListeners",{enumerable:!0,get:function(){return rt},set:function(_){if(typeof _!="number"||_<0||le(_))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+_+".");rt=_}}),W.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},W.prototype.setMaxListeners=function(p){if(typeof p!="number"||p<0||le(p))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+p+".");return this._maxListeners=p,this};function st(_){return _._maxListeners===void 0?W.defaultMaxListeners:_._maxListeners}W.prototype.getMaxListeners=function(){return st(this)},W.prototype.emit=function(p){for(var A=[],I=1;I<arguments.length;
vendor: 5,294 bytes, line 33
33I++)A.push(arguments[I]);var V=p==="error",G=this._events;if(G!==void 0)V=V&&G.error===void 0;else if(!V)return!1;if(V){var U;if(A.length>0&&(U=A[0]),U instanceof Error)throw U;var k=new Error("Unhandled error."+(U?" ("+U.message+")":""));throw k.context=U,k}var ot=G[p];if(ot===void 0)return!1;if(typeof ot=="function")he(ot,this,A);else for(var Oe=ot.length,ve=te(ot,Oe),I=0;I<Oe;++I)he(ve[I],this,A);return!0};function pe(_,p,A,I){var V,G,U;if(je(A),G=_._events,G===void 0?(G=_._events=Object.create(null),_._eventsCount=0):(G.newListener!==void 0&&(_.emit("newListener",p,A.listener?A.listener:A),G=_._events),U=G[p]),U===void 0)U=G[p]=A,++_._eventsCount;else if(typeof U=="function"?U=G[p]=I?[A,U]:[U,A]:I?U.unshift(A):U.push(A),V=st(_),V>0&&U.length>V&&!U.warned){U.warned=!0;var k=new Error("Possible EventEmitter memory leak detected. "+U.length+" "+String(p)+" listeners added. Use emitter.setMaxListeners() to increase limit");k.name="MaxListenersExceededWarning",k.emitter=_,k.type=p,k.count=U.length,me(k)}return _}W.prototype.addListener=function(p,A){return pe(this,p,A,!1)},W.prototype.on=W.prototype.addListener,W.prototype.prependListener=function(p,A){return pe(this,p,A,!0)};function Ee(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function se(_,p,A){var I={fired:!1,wrapFn:void 0,target:_,type:p,listener:A},V=Ee.bind(I);return V.listener=A,I.wrapFn=V,V}W.prototype.once=function(p,A){return je(A),this.on(p,se(this,p,A)),this},W.prototype.prependOnceListener=function(p,A){return je(A),this.prependListener(p,se(this,p,A)),this},W.prototype.removeListener=function(p,A){var I,V,G,U,k;if(je(A),V=this._events,V===void 0)return this;if(I=V[p],I===void 0)return this;if(I===A||I.listener===A)--this._eventsCount===0?this._events=Object.create(null):(delete V[p],V.removeListener&&this.emit("removeListener",p,I.listener||A));else if(typeof I!="function"){for(G=-1,U=I.length-1;U>=0;U--)if(I[U]===A||I[U].listener===A){k=I[U].listener,G=U;break}if(G<0)return this;G===0?I.shift():Q(I,G),I.length===1&&(V[p]=I[0]),V.removeListener!==void 0&&this.emit("removeListener",p,k||A)}return this},W.prototype.off=W.prototype.removeListener,W.prototype.removeAllListeners=function(p){var A,I,V;if(I=this._events,I===void 0)return this;if(I.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):I[p]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete I[p]),this;if(arguments.length===0){var G=Object.keys(I),U;for(V=0;V<G.length;++V)U=G[V],U!=="removeListener"&&this.removeAllListeners(U);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(A=I[p],typeof A=="function")this.removeListener(p,A);else if(A!==void 0)for(V=A.length-1;V>=0;V--)this.removeListener(p,A[V]);return this};function xe(_,p,A){var I=_._events;if(I===void 0)return[];var V=I[p];return V===void 0?[]:typeof V=="function"?A?[V.listener||V]:[V]:A?w(V):te(V,V.length)}W.prototype.listeners=function(p){return xe(this,p,!0)},W.prototype.rawListeners=function(p){return xe(this,p,!1)},W.listenerCount=function(_,p){return typeof _.listenerCount=="function"?_.listenerCount(p):P.call(_,p)},W.prototype.listenerCount=P;function P(_){var p=this._events;if(p!==void 0){var A=p[_];if(typeof A=="function")return 1;if(A!==void 0)return A.length}return 0}W.prototype.eventNames=function(){return this._eventsCount>0?Re(this._events):[]};function te(_,p){for(var A=new Array(p),I=0;I<p;++I)A[I]=_[I];return A}function Q(_,p){for(;p+1<_.length;p++)_[p]=_[p+1];_.pop()}function w(_){for(var p=new Array(_.length),A=0;A<p.length;++A)p[A]=_[A].listener||_[A];return p}function T(_,p){return new Promise(function(A,I){function V(U){_.removeListener(p,G),I(U)}function G(){typeof _.removeListener=="function"&&_.removeListener("error",V),A([].slice.call(arguments))}Z(_,p,G,{once:!0}),p!=="error"&&K(_,V,{once:!0})})}function K(_,p,A){typeof _.on=="function"&&Z(_,"error",p,A)}function Z(_,p,A,I){if(typeof _.on=="function")I.once?_.once(p,A):_.on(p,A);else if(typeof _.addEventListener=="function")_.addEventListener(p,function V(G){I.once&&_.removeEventListener(p,V),A(G)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof _)}},604:(J,ee,he)=>{var Re;(function(){"use strict";var me={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function le(pe){return rt(st(pe),arguments)}function W(pe,Ee){return le.apply(null,[pe].concat(Ee||[]))}function rt(pe,Ee){var se=1,xe=pe.length,P,te="",Q,w,T,K,Z,_,p,A;for(Q=0;Q<xe;Q++)if(typeof pe[Q]=="string")te+=pe[Q];else if(typeof pe[Q]=="object"){if(T=pe[Q],T.keys)for(P=Ee[se],w=0;w<T.keys.length;w++){if(P==null)throw new Error(le('[sprintf] Cannot access property "%s" of undefined value "%s"',T.keys[w],T.keys[w-1]));P=P[T.keys[w]]}
33else T.param_no?P=Ee[T.param_no]:P=Ee[se++];if(me.not_type.test(T.type)&&me.not_primitive.test(T.type)&&P instanceof Function&&(P=P()),me.numeric_arg.test(T.type)&&typeof P!="number"&&isNaN(P))throw new TypeError(le("[sprintf] expecting number but found %T",P));switch(me.number.test(T.type)&&(p=P>=0),T.type){case"b":P=parseInt(P,10).toString(2);break;case"c":P=String.fromCharCode(parseInt(P,10));break;case"d":case"i":P=parseInt(P,10);break;case"j":P=JSON.stringify(P,null,T.width?parseInt(T.width):0);break;case"e":P=T.precision?parseFloat(P).toExponential(T.precision):parseFloat(P).toExponential();break;case"f":P=T.precision?parseFloat(P).toFixed(T.precision):parseFloat(P);break;case"g":P=T.precision?String(Number(P.toPrecision(T.precision))):parseFloat(P);break;case"o":P=(parseInt(P,10)>>>0).toString(8);break;case"s":P=String(P),P=T.precision?P.substring(0,T.precision):P;break;case"t":P=String(!!P),P=T.precision?P.substring(0,T.precision):P;break;case"T":P=Object.prototype.toString.call(P).slice(8,-1).toLowerCase(),P=T.precision?P.substring(0,T.precision):P;break;case"u":P=parseInt(P,10)>>>0;break;case"v":P=P.valueOf(),P=T.precision?P.substring(0,T.precision):P;break;case"x":P=(parseInt(P,10)>>>0).toString(16);break;case"X":P=(parseInt(P,10)>>>0).toString(16).toUpperCase();break}me.json.test(T.type)?te+=P:(me.number.test(T.type)&&(!p||T.sign)?(A=p?"+":"-",P=P.toString().replace(me.sign,"")):A="",Z=T.pad_char?T.pad_char==="0"?"0":T.pad_char.charAt(1):" ",_=T.width-(A+P).length,K=T.width&&_>0?Z.repeat(_):"",te+=T.align?A+P+K:Z==="0"?A+K+P:K+A+P)}return te}var je=Object.create(null);function st(pe){if(je[pe])return je[pe];for(var Ee=pe,se,xe=[],P=0;Ee;){if((se=me.text.exec(Ee))!==null)xe.push(se[0]);else if((se=me.modulo.exec(Ee))!==null)xe.push("%");else if((se=me.placeholder.exec(Ee))!==null){if(se[2]){P|=1;var te=[],Q=se[2],w=[];if((w=me.key.exec(Q))!==null)for(te.push(w[1]);(Q=Q.substring(w[0].length))!=="";)if((w=me.key_access.exec(Q))!==null)te.push(w[1]);else if((w=me.index_access.exec(Q))!==null)te.push(w[1]);else throw new SyntaxError("[sprintf] failed to parse named argument key");else throw new SyntaxError("[sprintf] failed to parse named argument key");se[2]=te}else P|=2;if(P===3)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");xe.push({placeholder:se[0],param_no:se[1],keys:se[2],sign:se[3],pad_char:se[4],align:se[5],width:se[6],precision:se[7],type:se[8]})}else throw new SyntaxError("[sprintf] unexpected placeholder");Ee=Ee.substring(se[0].length)}return je[pe]=xe}ee.sprintf=le,ee.vsprintf=W,typeof window!="undefined"&&(window.sprintf=le,window.vsprintf=W,Re=function(){return{sprintf:le,vsprintf:W}}.call(ee,he,ee,J),Re!==void 0&&(J.exports=Re))})()},935:(J,ee)=>{var he,Re,me;(function(le){Re=[],he=le,me=typeof he=="function"?he.apply(ee,Re):he,me!==void 0&&(J.exports=me)})(function(){"use strict";var le=["decimals","thousand","mark","prefix","suffix","encoder","decoder","negativeBefore","negative","edit","undo"];function W(w){return w.split("").reverse().join("")}function rt(w,T){return w.substring(0,T.length)===T}function je(w,T){return w.slice(-1*T.length)===T}function st(w,T,K){if((w[T]||w[K])&&w[T]===w[K])throw new Error(T)}function pe(w){return typeof w=="number"&&isFinite(w)}function Ee(w,T){return w=w.toString().split("e"),w=Math.round(+(w[0]+"e"+(w[1]?+w[1]+T:T))),w=w.toString().split("e"),(+(w[0]+"e"+(w[1]?+w[1]-T:-T))).toFixed(T)}function se(w,T,K,Z,_,p,A,I,V,G,U,k){var ot=k,Oe,ve,Ge,mn="",Qe="";return p&&(k=p(k)),pe(k)?(w!==!1&&parseFloat(k.toFixed(w))===0&&(k=0),k<0&&(Oe=!0,k=Math.abs(k)),w!==!1&&(k=Ee(k,w)),k=k.toString(),k.indexOf(".")!==-1?(ve=k.split("."),Ge=ve[0],K&&(mn=K+ve[1])):Ge=k,T&&(Ge=W(Ge).match(/.{1,3}/g),Ge=W(Ge.join(W(T)))),Oe&&I&&(Qe+=I),Z&&(Qe+=Z),Oe&&V&&(Qe+=V),Qe+=Ge,Qe+=mn,_&&(Qe+=_),G&&(Qe=G(Qe,ot)),Qe):!1}function xe(w,T,K,Z,_,p,A,I,V,G,U,k){var ot=k,Oe,ve="";return U&&(k=U(k)),!k||typeof k!="string"||(I&&rt(k,I)&&(k=k.replace(I,""),Oe=!0),Z&&rt(k,Z)&&(k=k.replace(Z,"")),V&&rt(k,V)&&(k=k.replace(V,""),Oe=!0),_&&je(k,_)&&(k=k.slice(0,-1*_.length)),T&&(k=k.split(T).join("")),K&&(k=k.replace(K,".")),Oe&&(ve+="-"),ve+=k,ve=ve.replace(/[^0-9\.\-.]/g,""),ve==="")||(ve=Number(ve),A&&(ve=A(ve)),!pe(ve))?!1:ve}function P(w){var T,K,Z,_={};for(w.suffix===void 0&&(w.suffix=w.postfix),T=0;T<le.length;T+=1)if(K=le[T],Z=w[K],Z===void 0)K==="negative"&&!_.negativeBefore?_[K]="-":K==="mark"&&_.thous
33and!=="."?_[K]=".":_[K]=!1;else if(K==="decimals")if(Z>=0&&Z<8)_[K]=Z;else throw new Error(K);else if(K==="encoder"||K==="decoder"||K==="edit"||K==="undo")if(typeof Z=="function")_[K]=Z;else throw new Error(K);else if(typeof Z=="string")_[K]=Z;else throw new Error(K);return st(_,"mark","thousand"),st(_,"prefix","negative"),st(_,"prefix","negativeBefore"),_}function te(w,T,K){var Z,_=[];for(Z=0;Z<le.length;Z+=1)_.push(w[le[Z]]);return _.push(K),T.apply("",_)}function Q(w){if(!(this instanceof Q))return new Q(w);typeof w=="object"&&(w=P(w),this.to=function(T){return te(w,se,T)},this.from=function(T){return te(w,xe,T)})}return Q})}},Me={};function re(J){var ee=Me[J];if(ee!==void 0)return ee.exports;var he=Me[J]={exports:{}};return ze[J](he,he.exports,re),he.exports}re.n=J=>{var ee=J&&J.__esModule?()=>J.default:()=>J;return re.d(ee,{a:ee}),ee},re.d=(J,ee)=>{for(var he in ee)re.o(ee,he)&&!re.o(J,he)&&Object.defineProperty(J,he,{enumerable:!0,get:ee[he]})},re.o=(J,ee)=>Object.prototype.hasOwnProperty.call(J,ee),re.r=J=>{typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(J,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(J,"__esModule",{value:!0})};var Mr={};(()=>{"use strict"})(),(()=>{"use strict";re.r(Mr),re.d(Mr,{components:()=>sm,default:()=>am,events:()=>Pn,helpers:()=>om,selectors:()=>im});var J={};re.r(J),re.d(J,{afterMain:()=>Js,afterRead:()=>Gs,afterWrite:()=>to,applyStyles:()=>Rr,arrow:()=>lo,auto:()=>Un,basePlacements:()=>Bt,beforeMain:()=>Qs,beforeRead:()=>Ys,beforeWrite:()=>Zs,bottom:()=>$e,clippingParents:()=>Ws,computeStyles:()=>Vr,createPopper:()=>Kr,createPopperBase:()=>sl,createPopperLite:()=>al,detectOverflow:()=>Qt,end:()=>Wt,eventListeners:()=>Fr,flip:()=>vo,hide:()=>Eo,left:()=>ke,main:()=>Xs,modifierPhases:()=>no,offset:()=>bo,placements:()=>Nr,popper:()=>Kt,popperGenerator:()=>Kn,popperOffsets:()=>Wr,preventOverflow:()=>yo,read:()=>zs,reference:()=>Ks,right:()=>qe,start:()=>It,top:()=>Pe,variationPlacements:()=>Dr,viewport:()=>kr,write:()=>eo});const ee={header:'[data-ps-ref="header"]'},he={range:".js-faceted-slider",rangeContainer:".js-faceted-slider-container",rangeValues:".js-faceted-values",filterSlider:".js-faceted-filter-slider",offCanvasFaceted:"#offcanvas-faceted",colorLabel:'[data-ps-ref="color-label"]'},Re=".js-page-loader",me={searchFilterToggler:"#search_filter_toggler, .js-search-toggler",searchFiltersWrapper:"#search_filters_wrapper",searchFilterControls:"#search_filter_controls",searchFilters:"#search-filters",activeSearchFilters:"#js-active-search-filters",listTop:"#js-product-list-top",product:".js-product",list:"#js-product-list",listBottom:"#js-product-list-bottom",listHeader:"#js-product-list-header",listFooter:"#js-product-list-footer",searchFiltersClearAll:".js-search-filters-clear-all",searchLink:".js-search-link",paginationLink:".js-pager-link"},le={container:".js-cart-container",summaryContainer:".js-cart-summary",overview:".js-cart",voucherCode:".js-voucher-code",voucherInput:".js-voucher-input",voucherAccordion:".js-voucher-accordion",productQuantity:".js-cart-list .js-quantity-button",productItem:".js-cart-item",productItemQuantityInput:".js-cart-line-product-quantity",removeFromCart:".js-remove-from-cart",alertPlaceholder:".js-cart-update-alert",deleteLinkAction:"delete-from-cart",removeVoucherLinkAction:"remove-voucher",voucherContainer:'[data-ps-ref="voucher-container"]',voucherAccordionButton:'[data-ps-ref="voucher-accordion-button"]',voucherForm:'[data-ps-ref="voucher-form"]',voucherList:'[data-ps-ref="voucher-list"]',voucherError:'[data-ps-ref="voucher-error"]'},W={modal:"#blockcart-modal"},rt={currencySelector:".js-currency-selector"},je={languageSelector:".js-language-selector"},st={searchCanvas:".js-search-offcanvas",searchWidget:".js-search-widget",searchDropdown:".js-search-dropdown",searchResults:".js-search-results",searchTemplate:".js-search-template",searchInput:".js-search-input",searchIcon:".js-search-icon",searchClear:".js-search-clear",searchResultLink:'[data-ps-ref="searchbar-result-link"]'},pe={steps:{item:".js-step-item",current:".js-current-step",button:'[data-ps-ref="step-button"]',shownResponsiveStep:".checkout-steps__step-mobile:not(.d-none)",specificStep:n=>`.checkout-steps__step-mobile[data-step="${n}"]`,specificStepContent:n=>`#${n}`,backButton:n=>`.js-step-item button[data-bs-target="#${n}"]`},actionsButtons:".js-back, .js-edit-addresses, .js-edit-shipping",termsLink:".js-terms a",checkoutModal:"#checkout-modal",carrierExtraContentWrapper:".js-carrier-extra",carrierExtraContentWrapperActive:".js-carrier-extra[data-active]",carrierExtraContent:".js-carrier-extra-content",summaryContainer:".js-checkout-summary"},Ee={checkout:{element:".progress-ring",circle:".progress-ring__circle",backgroundCircle:".progress-ring__background-circle"},text:".progress-ring text"},se={openChildsButton:".js-menu-open-child",backTitle:".js-menu-back-title",backButton:".js-back-button",menuCanvas:".js-menu-canvas",menuCurrent:".menu--current",specificParent:n=>`.menu--parent[data-depth="${n}"]`,specificChild:n=>`.menu[data-id="${n}"]`},xe={checkbox:".js-password-form__check",passwordWrapper:".js-password-form__input-wrapper"},P={visiblePassword:'[data-ps-action="toggle-password"]'},te={consent:'[data-ps-ref="gdpr-consent"]',consentWrapper:'[data-ps-component="gdpr"]',checkbox:'[data-ps-ref="gdpr-checkbox"]',submitButton:'[data-ps-ref="gdpr-submit"]'},Q={wrapper:'[data-ps-ref="emailalerts"]',content:'[data-ps-ref="emailalerts-content"]',submitButton:'[data-ps-action="emailalerts-subscribe"]',emailInput:'[data-ps-ref="emailalerts-email"]',alertsContainer:'[data-ps-target="emailalerts-alerts"]',deleteButton:'[data-ps-action="emailalerts-delete"]',product:'[data-ps-ref="emailalerts-product"]',productList:'[data-ps-ref="emailalerts-product-list"]',noAlerts:'[data-ps-ref="emailalerts-account-no-alerts"]'},w={container:'[data-ps-ref="desktop-menu-container"]',menuTree:'[data-ps-ref="desktop-menu-tree"]',menuItem:'[data-ps-ref="desktop-menu-item"]',menuLink:'[data-ps-ref="desktop-menu-link"]',dropdownToggle:'[data-ps-ref="desktop-menu-dropdown-toggle"]',subMenu:'[data-ps-ref="desktop-submenu"]',subMenuLeft:'[data-ps-ref="desktop-submenu-left"]',subMenuLeftItem:'[data-ps-ref="desktop-submenu-left-item"]',subMenuRight:'[data-ps-ref="desktop-submenu-right"]',subMenuRightItems:'[data-ps-ref="desktop-submenu-right-items"]'},T={default:".js-quantity-button",idProductInput:'input[name="id_product"]',modal:".modal-dialog .js-quantity-button",increment:".js-increment-button",decrement:".js-decrement-button",quantityWanted:".js-quantity-wanted",confirm:".confirmation",icon:".material-icons",spinner:".spinner-border",alert:n=>
33`#js-product-line-alert--${n}`},p={layout:ee,qtyInput:T,alert:{selector:"#notifications .container",alert:".alert",heading:".alert-heading",body:".alert-body",icon:".material-icons",close:".btn-close"},toast:{container:"#js-toast-container",template:".js-toast-template",toast:".toast",body:".toast-body",close:".btn-close"},product:{container:'[data-ps-ref="product-container"]',images:".js-images-container",carousel:".js-product-carousel",miniature:".js-product-miniature",thumbnail:".js-thumb-container",productImagesModal:'[data-ps-ref="product-images-modal"]',productImagesModalCarousel:'[data-ps-ref="product-images-modal-carousel"]',activeThumbail:n=>`[data-ps-ref="product-thumbnail-item"]:nth-child(${n+1}) [data-ps-ref="product-thumbnail"]`,productAvailability:'[data-ps-ref="product-availability"]',rightSection:'[data-ps-ref="product-right"]'},order:{returnForm:".js-order-return-form",returnFormSelectAll:'[data-ps-ref="select-all-products"]',returnFormProductsTable:'[data-ps-ref="order-return-products-table"]',returnFormProductCheckbox:'[data-ps-ref="select-product"]'},modalBody:".modal-body",pageCms:".js-page-content-cms",quickview:'[data-ps-action="open-quickview"]',quickviewModal:'[data-ps-ref="quickview-modal"]',quickviewModalStatus:'[data-ps-target="quickview-modal-status"]',quickviewButton:'[data-ps-ref="quickview-button"]',modalContainer:'[data-ps-target="modal-container"]',blockcartModal:'[data-ps-ref="blockcart-modal"]',blockcartModalStatus:'[data-ps-target="blockcart-modal-status"]',addToCartButton:'[data-ps-ref="add-to-cart"]',facetedsearch:he,pageLoader:Re,listing:me,cart:le,progressRing:Ee,checkout:pe,blockcart:W,currencySelector:rt,languageSelector:je,searchBar:st,mobileMenu:se,guestPasswordToggle:xe,visiblePassword:P,desktopMenu:w,formValidation:{default:'[data-ps-action="form-validation"]',submitButton:'[data-ps-action="form-validation-submit"]'},passwordPolicy:{template:'[data-ps-ref="password-feedback-template"]',field:'[data-ps-ref="password-field"]',input:'[data-ps-ref="password-policy-input"]',feedbackContainer:'[data-ps-ref="password-feedback-container"]',feedbackTarget:'[data-ps-target="password-feedback-target"]',hint:'[data-ps-ref="password-strength-hints"]',requirementScore:'[data-ps-ref="password-requirements-score"]',requirementLength:'[data-ps-ref="password-requirements-length"]',requirementScoreMessage:'[data-ps-ref="password-requirements-score-message"]',requirementLengthMessage:'[data-ps-ref="password-requirements-length-message"]',requirementScoreIcon:'[data-ps-ref="password-requirements-score-icon"]',requirementLengthIcon:'[data-ps-ref="password-requirements-length-icon"]',progressBar:'[data-ps-ref="password-strength-progress-bar"]',invalidMessage:'[data-ps-ref="password-invalid-message"]',validMessage:'[data-ps-ref="password-valid-message"]',lengthMessage:'[data-ps-ref="password-length-message"]',announceValidity:'[data-ps-target="password-announce-validity"]'},emailAlerts:Q,gdpr:te},A={quickviewOpened:"quickviewOpened",clickQuickview:"clickQuickview",handleError:"handleError",responsiveUpdate:"responsiveUpdate",updateCart:"updateCart",updatedCart:"updatedCart",updateProductList:"updateProductList",updateProduct:"updateProduct",updatedProduct:"updatedProduct",updateFacets:"updateFacets",updatedDeliveryForm:"updatedDeliveryForm",combinationFocusRestored:"combinationFocusRestored"};var I=re(7);const V=()=>{Object.assign(window.prestashop,I.EventEmitter.prototype)};function G(n,e){const t=n.innerHTML;n.innerHTML="",e.innerHTML=t}var U;(function(n){n.Range="range",n.Steps="steps",n.Positions="positions",n.Count="count",n.Values="values"})(U||(U={}));var k;(function(n){n[n.None=-1]="None",n[n.NoValue=0]="NoValue",n[n.LargeValue=1]="LargeValue",n[n.SmallValue=2]="SmallValue"})(k||(k={}));function ot(n){return Oe(n)&&typeof n.from=="function"}function Oe(n){return typeof n=="object"&&typeof n.to=="function"}function ve(n){n.parentElement.removeChild(n)}function Ge(n){return n!=null}function mn(n){n.preventDefault()}function Qe(n){return n.filter(function(e){return this[e]?!1:this[e]=!0},{})}function xa(n,e){return Math.round(n/e)*e}function $a(n,e){var t=n.getBoundingClientRect(),r=n.ownerDocument,s=r.documentElement,o=qs(r);return/webkit.*Chrome.*Mobile/i.test(navigator.userAgent)&&(o.x=0),e?t.top+o.y-s.clientTop:t.left+o.x-s.clientLeft}function Xe(n){return typeof n=="number"&&!isNaN(n)&&isFinite(n)}function xs(n,e,t){t>0&&(Te(n,e),setTimeout(function(){Fn(n,e)},t))}function $s(n){return Math.max(Math.min(n,100),0)}function Vn(n){return Array.isArray(n)?n:[n]}function qa(n){n=String(n);var e=n.split(".");return e.length>1?e[1].length:0}function Te(n,e){n.classList&&!/\s/.test(e)?n.classList.add(e):n.className+=" "+e}function Fn(n,e){n.classList&&!/\s/.test(e)?n.classList.remove(e):n.className=n.className.replace(new RegExp("(^|\\b)"+e.split(" ").join("|")+"(\\b|$)","gi")," ")}function Va(n,e){return n.classList?n.classList.contains(e):new RegExp("\\b"+e+"\\b").test(n.className)}function qs(n){var e=window.pageXOffset!==void 0,t=(n.compatMode||"")==="CSS1Compat",r=e?window.pageXOffset:t?n.documentElement.scrollLeft:n.body.scrollLeft,s=e?window.pageYOffset:t?n.documentElement.scrollTop:n.body.scrollTop;return{x:r,y:s}}function Fa(){return window.navigator.pointerEnabled?{start:"pointerdown",move:"pointermove",end:"pointerup"}:window.navigator.msPointerEnabled?{start:"MSPointerDown",move:"MSPointerMove",end:"MSPointerUp"}
33:{start:"mousedown touchstart",move:"mousemove touchmove",end:"mouseup touchend"}}function Ua(){var n=!1;try{var e=Object.defineProperty({},"passive",{get:function(){n=!0}});window.addEventListener("test",null,e)}catch(t){}return n}function ja(){return window.CSS&&CSS.supports&&CSS.supports("touch-action","none")}function Or(n,e){return 100/(e-n)}function Pr(n,e,t){return e*100/(n[t+1]-n[t])}function Ha(n,e){return Pr(n,n[0]<0?e+Math.abs(n[0]):e-n[0],0)}function Ba(n,e){return e*(n[1]-n[0])/100+n[0]}function vn(n,e){for(var t=1;n>=e[t];)t+=1;return t}function Wa(n,e,t){if(t>=n.slice(-1)[0])return 100;var r=vn(t,n),s=n[r-1],o=n[r],i=e[r-1],a=e[r];return i+Ha([s,o],t)/Or(i,a)}function Ka(n,e,t){if(t>=100)return n.slice(-1)[0];var r=vn(t,e),s=n[r-1],o=n[r],i=e[r-1],a=e[r];return Ba([s,o],(t-i)*Or(i,a))}function Ya(n,e,t,r){if(r===100)return r;var s=vn(r,n),o=n[s-1],i=n[s];return t?r-o>(i-o)/2?i:o:e[s-1]?n[s-1]+xa(r-n[s-1],e[s-1]):r}var Vs=function(){function n(e,t,r){this.xPct=[],this.xVal=[],this.xSteps=[],this.xNumSteps=[],this.xHighestCompleteStep=[],this.xSteps=[r||!1],this.xNumSteps=[!1],this.snap=t;var s,o=[];for(Object.keys(e).forEach(function(i){o.push([Vn(e[i]),i])}),o.sort(function(i,a){return i[0][0]-a[0][0]}),s=0;s<o.length;s++)this.handleEntryPoint(o[s][1],o[s][0]);for(this.xNumSteps=this.xSteps.slice(0),s=0;s<this.xNumSteps.length;s++)this.handleStepPoint(s,this.xNumSteps[s])}return n.prototype.getDistance=function(e){for(var t=[],r=0;r<this.xNumSteps.length-1;r++)t[r]=Pr(this.xVal,e,r);return t},n.prototype.getAbsoluteDistance=function(e,t,r){var s=0;if(e<this.xPct[this.xPct.length-1])for(;e>this.xPct[s+1];)s++;else e===this.xPct[this.xPct.length-1]&&(s=this.xPct.length-2);!r&&e===this.xPct[s+1]&&s++,t===null&&(t=[]);var o,i=1,a=t[s],c=0,l=0,d=0,g=0;for(r?o=(e-this.xPct[s])/(this.xPct[s+1]-this.xPct[s]):o=(this.xPct[s+1]-e)/(this.xPct[s+1]-this.xPct[s]);a>0;)c=this.xPct[s+1+g]-this.xPct[s+g],t[s+g]*i+100-o*100>100?(l=c*o,i=(a-100*o)/t[s+g],o=1):(l=t[s+g]*c/100*i,i=0),r?(d=d-l,this.xPct.length+g>=1&&g--):(d=d+l,this.xPct.length-g>=1&&g++),a=t[s+g]*i;return e+d},n.prototype.toStepping=function(e){return e=Wa(this.xVal,this.xPct,e),e},n.prototype.fromStepping=function(e){return Ka(this.xVal,this.xPct,e)},n.prototype.getStep=function(e){return e=Ya(this.xPct,this.xSteps,this.snap,e),e},n.prototype.getDefaultStep=function(e,t,r){var s=vn(e,this.xPct);return(e===100||t&&e===this.xPct[s-1])&&(s=Math.max(s-1,1)),(this.xVal[s]-this.xVal[s-1])/r},n.prototype.getNearbySteps=function(e){var t=vn(e,this.xPct);return{stepBefore:{startValue:this.xVal[t-2],step:this.xNumSteps[t-2],highestStep:this.xHighestCompleteStep[t-2]},thisStep:{startValue:this.xVal[t-1],step:this.xNumSteps[t-1],highestStep:this.xHighestCompleteStep[t-1]},stepAfter:{startValue:this.xVal[t],step:this.xNumSteps[t],highestStep:this.xHighestCompleteStep[t]}}},n.prototype.countStepDecimals=function(){var e=this.xNumSteps.map(qa);return Math.max.apply(null,e)},n.prototype.hasNoSize=function(){return this.xVal[0]===this.xVal[this.xVal.length-1]},n.prototype.convert=function(e){return this.getStep(this.toStepping(e))},n.prototype.handleEntryPoint=function(e,t){var r;if(e==="min"?r=0:e==="max"?r=100:r=parseFloat(e),!Xe(r)||!Xe(t[0]))throw new Error("noUiSlider: 'range' value isn't numeric.");this.xPct.push(r),this.xVal.push(t[0]);var s=Number(t[1]);r?this.xSteps.push(isNaN(s)?!1:s):isNaN(s)||(this.xSteps[0]=s),this.xHighestCompleteStep.push(0)},n.prototype.handleStepPoint=function(e,t){if(t){if(this.xVal[e]===this.xVal[e+1]){this.xSteps[e]=this.xHighestCompleteStep[e]=this.xVal[e];return}this.xSteps[e]=Pr([this.xVal[e],this.xVal[e+1]],t,0)/Or(this.xPct[e],this.xPct[e+1]);var r=(this.xVal[e+1]-this.xVal[e])/this.xNumSteps[e],s=Math.ceil(Number(r.toFixed(3))-1),o=this.xVal[e]+this.xNumSteps[e]*s;this.xHighestCompleteStep[e]=o}},n}(),Fs={to:function(n){return n===void 0?"":n.toFixed(2)},from:Number},Us={target:"target",base:"base",origin:"origin",handle:"handle",handleLower:"handle-lower",handleUpper:"handle-upper",touchArea:"touch-area",horizontal:"horizontal",vertical:"vertical",background:"background",connect:"connect",connects:"connects",ltr:"ltr",rtl:"rtl",textDirectionLtr:"txt-dir-ltr",textDirectionRtl:"txt-dir-rtl",draggable:"draggable",drag:"state-drag",tap:"state-tap",active:"active",tooltip:"tooltip",pips:"pips",pipsHorizontal:"pips-horizontal",pipsVertical:"pips-vertical",marker:"marker",markerHorizontal:"marker-horizontal",markerVertical:"marker-vertical",markerNormal:"marker-normal",markerLarge:"marker-large",markerSub:"marker-sub",value:"value",valueHorizontal:"value-horizontal",valueVertical:"value-vertical",valueNormal:"value-normal",valueLarge:"value-large",valueSub:"value-sub"},yt={tooltips:".__tooltips",aria:".__aria"};function za(n,e){if(!Xe(e))throw new Error("noUiSlider: 'step' is not numeric.");n.singleStep=e}function Ga(n,e){if(!Xe(e))throw new Error("noUiSlider: 'keyboardPageMultiplier' is not numeric.");n.keyboardPageMultiplier=e}function Qa(n,e){if(!Xe(e))throw new Error("noUiSlider: 'keyboardMultiplier' is not numeric.");n.keyboardMultiplier=e}function Xa(n,e){if(!Xe(e))throw new Error("noUiSlider: 'keyboardDefaultStep' is not numeric.");n.keyboardDefaultStep=e}function Ja(n,e){if(typeof e!="object"||Array.isArray(e))throw new Error("noUiSlider: 'range' is not an object.");if(e.min===void 0||e.max===void 0)throw new Error("noUiSlider: Missing 'min' or 'max' in 'range'.");n.spectrum=new Vs(e,n.snap||!1,n.singleStep)}function Za(n,e){if(e=Vn(e),!Array.isArray(e)||!e.length)throw new Error("noUiSlider: 'start' option is incorrect.");n.handles=e.length,n.start=e}function ec(n,e){if(typeof e!="boolean")throw new Error("noUiSlider: 'snap' option must be a boolean.");n.snap=e}function tc(n,e){if(typeof e!="boolean")throw new Error("noUiSlider: 'animate' option must be a boolean.");n.animate=e}function nc(n,e){if(typeof e!="number")throw new Error("noUiSlider: 'animationDuration' option must be a number.");n.animationDuration=e}function js(n,e){var t=[!1],r;
33if(e==="lower"?e=[!0,!1]:e==="upper"&&(e=[!1,!0]),e===!0||e===!1){for(r=1;r<n.handles;r++)t.push(e);t.push(!1)}else{if(!Array.isArray(e)||!e.length||e.length!==n.handles+1)throw new Error("noUiSlider: 'connect' option doesn't match handle count.");t=e}n.connect=t}function rc(n,e){switch(e){case"horizontal":n.ort=0;break;case"vertical":n.ort=1;break;default:throw new Error("noUiSlider: 'orientation' option is invalid.")}}function Hs(n,e){if(!Xe(e))throw new Error("noUiSlider: 'margin' option must be numeric.");e!==0&&(n.margin=n.spectrum.getDistance(e))}function sc(n,e){if(!Xe(e))throw new Error("noUiSlider: 'limit' option must be numeric.");if(n.limit=n.spectrum.getDistance(e),!n.limit||n.handles<2)throw new Error("noUiSlider: 'limit' option is only supported on linear sliders with 2 or more handles.")}function oc(n,e){var t;if(!Xe(e)&&!Array.isArray(e))throw new Error("noUiSlider: 'padding' option must be numeric or array of exactly 2 numbers.");if(Array.isArray(e)&&!(e.length===2||Xe(e[0])||Xe(e[1])))throw new Error("noUiSlider: 'padding' option must be numeric or array of exactly 2 numbers.");if(e!==0){for(Array.isArray(e)||(e=[e,e]),n.padding=[n.spectrum.getDistance(e[0]),n.spectrum.getDistance(e[1])],t=0;t<n.spectrum.xNumSteps.length-1;t++)if(n.padding[0][t]<0||n.padding[1][t]<0)throw new Error("noUiSlider: 'padding' option must be a positive number(s).");var r=e[0]+e[1],s=n.spectrum.xVal[0],o=n.spectrum.xVal[n.spectrum.xVal.length-1];if(r/(o-s)>1)throw new Error("noUiSlider: 'padding' option must not exceed 100% of the range.")}}function ic(n,e){switch(e){case"ltr":n.dir=0;break;case"rtl":n.dir=1;break;default:throw new Error("noUiSlider: 'direction' option was not recognized.")}}function ac(n,e){if(typeof e!="string")throw new Error("noUiSlider: 'behaviour' must be a string containing options.");var t=e.indexOf("tap")>=0,r=e.indexOf("drag")>=0,s=e.indexOf("fixed")>=0,o=e.indexOf("snap")>=0,i=e.indexOf("hover")>=0,a=e.indexOf("unconstrained")>=0,c=e.indexOf("invert-connects")>=0,l=e.indexOf("drag-all")>=0,d=e.indexOf("smooth-steps")>=0;if(s){if(n.handles!==2)throw new Error("noUiSlider: 'fixed' behaviour must be used with 2 handles");Hs(n,n.start[1]-n.start[0])}if(c&&n.handles!==2)throw new Error("noUiSlider: 'invert-connects' behaviour must be used with 2 handles");if(a&&(n.margin||n.limit))throw new Error("noUiSlider: 'unconstrained' behaviour cannot be used with margin or limit");n.events={tap:t||o,drag:r,dragAll:l,smoothSteps:d,fixed:s,snap:o,hover:i,unconstrained:a,invertConnects:c}}function cc(n,e){if(e!==!1)if(e===!0||Oe(e)){n.tooltips=[];for(var t=0;t<n.handles;t++)n.tooltips.push(e)}else{if(e=Vn(e),e.length!==n.handles)throw new Error("noUiSlider: must pass a formatter for all handles.");e.forEach(function(r){if(typeof r!="boolean"&&!Oe(r))throw new Error("noUiSlider: 'tooltips' must be passed a formatter or 'false'.")}),n.tooltips=e}}function lc(n,e){if(e.length!==n.handles)throw new Error("noUiSlider: must pass a attributes for all handles.");n.handleAttributes=e}function uc(n,e){if(!Oe(e))throw new Error("noUiSlider: 'ariaFormat' requires 'to' method.");n.ariaFormat=e}function dc(n,e){if(!ot(e))throw new Error("noUiSlider: 'format' requires 'to' and 'from' methods.");n.format=e}function fc(n,e){if(typeof e!="boolean")throw new Error("noUiSlider: 'keyboardSupport' option must be a boolean.");n.keyboardSupport=e}function pc(n,e){n.documentElement=e}function hc(n,e){if(typeof e!="string"&&e!==!1)throw new Error("noUiSlider: 'cssPrefix' must be a string or `false`.");n.cssPrefix=e}function mc(n,e){if(typeof e!="object")throw new Error("noUiSlider: 'cssClasses' must be an object.");typeof n.cssPrefix=="string"?(n.cssClasses={},Object.keys(e).forEach(function(t){n.cssClasses[t]=n.cssPrefix+e[t]})):n.cssClasses=e}function Bs(n){var e={margin:null,limit:null,padding:null,animate:!0,animationDuration:300,ariaFormat:Fs,format:Fs},t={step:{r:!1,t:za},keyboardPageMultiplier:{r:!1,t:Ga},keyboardMultiplier:{r:!1,t:Qa},keyboardDefaultStep:{r:!1,t:Xa},start:{r:!0,t:Za},connect:{r:!0,t:js},direction:{r:!0,t:ic},snap:{r:!1,t:ec},animate:{r:!1,t:tc},animationDuration:{r:!1,t:nc},range:{r:!0,t:Ja},orientation:{r:!1,t:rc},margin:{r:!1,t:Hs},limit:{r:!1,t:sc},padding:{r:!1,t:oc},behaviour:{r:!0,t:ac},ariaFormat:{r:!1,t:uc},format:{r:!1,t:dc},tooltips:{r:!1,t:cc},keyboardSupport:{r:!0,t:fc},documentElement:{r:!1,t:pc},cssPrefix:{r:!0,t:hc}
33,cssClasses:{r:!0,t:mc},handleAttributes:{r:!1,t:lc}},r={connect:!1,direction:"ltr",behaviour:"tap",orientation:"horizontal",keyboardSupport:!0,cssPrefix:"noUi-",cssClasses:Us,keyboardPageMultiplier:5,keyboardMultiplier:1,keyboardDefaultStep:10};n.format&&!n.ariaFormat&&(n.ariaFormat=n.format),Object.keys(t).forEach(function(c){if(!Ge(n[c])&&r[c]===void 0){if(t[c].r)throw new Error("noUiSlider: '"+c+"' is required.");return}t[c].t(e,Ge(n[c])?n[c]:r[c])}),e.pips=n.pips;var s=document.createElement("div"),o=s.style.msTransform!==void 0,i=s.style.transform!==void 0;e.transformRule=i?"transform":o?"msTransform":"webkitTransform";var a=[["left","top"],["right","bottom"]];return e.style=a[e.dir][e.ort],e}function vc(n,e,t){var r=Fa(),s=ja(),o=s&&Ua(),i=n,a,c,l,d,g,v,m=e.spectrum,C=[],E=[],S=[],O=0,x={},B=!1,R=n.ownerDocument,N=e.documentElement||R.documentElement,$=R.body,H=R.dir==="rtl"||e.ort===1?0:100;function z(u,f){var h=R.createElement("div");return f&&Te(h,f),u.appendChild(h),h}function ue(u,f){var h=z(u,e.cssClasses.origin),y=z(h,e.cssClasses.handle);if(z(y,e.cssClasses.touchArea),y.setAttribute("data-handle",String(f)),e.keyboardSupport&&(y.setAttribute("tabindex","0"),y.addEventListener("keydown",function(M){return Ps(M,f)})),e.handleAttributes!==void 0){var L=e.handleAttributes[f];Object.keys(L).forEach(function(M){y.setAttribute(M,L[M])})}return y.setAttribute("role","slider"),y.setAttribute("aria-orientation",e.ort?"vertical":"horizontal"),f===0?Te(y,e.cssClasses.handleLower):f===e.handles-1&&Te(y,e.cssClasses.handleUpper),h.handle=y,h}function ne(u,f){return f?z(u,e.cssClasses.connect):!1}function ye(u,f){c=z(f,e.cssClasses.connects),l=[],d=[],d.push(ne(c,u[0]));for(var h=0;h<e.handles;h++)l.push(ue(f,h)),S[h]=h,d.push(ne(c,u[h+1]))}function Fe(u){Te(u,e.cssClasses.target),e.dir===0?Te(u,e.cssClasses.ltr):Te(u,e.cssClasses.rtl),e.ort===0?Te(u,e.cssClasses.horizontal):Te(u,e.cssClasses.vertical);var f=getComputedStyle(u).direction;return f==="rtl"?Te(u,e.cssClasses.textDirectionRtl):Te(u,e.cssClasses.textDirectionLtr),z(u,e.cssClasses.base)}function Se(u,f){return!e.tooltips||!e.tooltips[f]?!1:z(u.firstChild,e.cssClasses.tooltip)}function ut(){return i.hasAttribute("disabled")}function tt(u){var f=l[u];return f.hasAttribute("disabled")}function De(u){u!=null?(l[u].setAttribute("disabled",""),l[u].handle.removeAttribute("tabindex")):(i.setAttribute("disabled",""),l.forEach(function(f){f.handle.removeAttribute("tabindex")}))}function Ue(u){u!=null?(l[u].removeAttribute("disabled"),l[u].handle.setAttribute("tabindex","0")):(i.removeAttribute("disabled"),l.forEach(function(f){f.removeAttribute("disabled"),f.handle.setAttribute("tabindex","0")}))}function Mt(){v&&(kt("update"+yt.tooltips),v.forEach(function(u){u&&ve(u)}),v=null)}function dt(){Mt(),v=l.map(Se),nt("update"+yt.tooltips,function(u,f,h){if(!(!v||!e.tooltips)&&v[f]!==!1){var y=u[f];e.tooltips[f]!==!0&&(y=e.tooltips[f].to(h[f])),v[f].innerHTML=y}})}function dn(){kt("update"+yt.aria),nt("update"+yt.aria,function(u,f,h,y,L){S.forEach(function(M){var F=l[M],D=Dt(E,M,0,!0,!0,!0),oe=Dt(E,M,100,!0,!0,!0),ie=L[M],de=String(e.ariaFormat.to(h[M]));D=m.fromStepping(D).toFixed(1),oe=m.fromStepping(oe).toFixed(1),ie=m.fromStepping(ie).toFixed(1),F.children[0].setAttribute("aria-valuemin",D),F.children[0].setAttribute("aria-valuemax",oe),F.children[0].setAttribute("aria-valuenow",ie),F.children[0].setAttribute("aria-valuetext",de)})})}function kn(u){if(u.mode===U.Range||u.mode===U.Steps)return m.xVal;if(u.mode===U.Count){if(u.values<2)throw new Error("noUiSlider: 'values' (>= 2) required for mode 'count'.");for(var f=u.values-1,h=100/f,y=[];f--;)y[f]=f*h;return y.push(100),Ot(y,u.stepped)}return u.mode===U.Positions?Ot(u.values,u.stepped):u.mode===U.Values?u.stepped?u.values.map(function(L){return m.fromStepping(m.getStep(m.toStepping(L)))}):u.values:[]}function Ot(u,f){return u.map(function(h){return m.fromStepping(f?m.getStep(h):h)})}function fn(u){function f(ie,de){return Number((ie+de).toFixed(7))}var h=kn(u),y={},L=m.xVal[0],M=m.xVal[m.xVal.length-1],F=!1,D=!1,oe=0;return h=Qe(h.slice().sort(function(ie,de){return ie-de})),h[0]!==L&&(h.unshift(L),F=!0),h[h.length-1]!==M&&(h.push(M),D=!0),h.forEach(function(ie,de){var fe,X,_e,Ce=ie,we=h[de+1],Ae,Ds,Ns,Is,ka,Rs,Da,Na=u.mode===U.Steps;for(Na&&(fe=m.xNumSteps[de]),fe||(fe=we-Ce),we===void 0&&(we=Ce),fe=Math.max(fe,1e-7),X=Ce;X<=we;X=f(X,fe)){for(Ae=m.toStepping(X),Ds=Ae-oe,ka=Ds/(u.density||1),Rs=Math.round(ka),Da=Ds/Rs,_e=1;_e<=Rs;_e+=1)Ns=oe+_e*Da,y[Ns.toFixed(5)]=[m.fromStepping(Ns),0];Is=h.indexOf(X)>-1?k.LargeValue:Na?k.SmallValue:k.NoValue,!de&&F&&X!==we&&(Is=0),X===we&&D||(y[Ae.toFixed(5)]=[X,Is]),oe=Ae}}),y}function Pt(u,f,h){var y,L,M=R.createElement("div"),F=(y={}
33,y[k.None]="",y[k.NoValue]=e.cssClasses.valueNormal,y[k.LargeValue]=e.cssClasses.valueLarge,y[k.SmallValue]=e.cssClasses.valueSub,y),D=(L={},L[k.None]="",L[k.NoValue]=e.cssClasses.markerNormal,L[k.LargeValue]=e.cssClasses.markerLarge,L[k.SmallValue]=e.cssClasses.markerSub,L),oe=[e.cssClasses.valueHorizontal,e.cssClasses.valueVertical],ie=[e.cssClasses.markerHorizontal,e.cssClasses.markerVertical];Te(M,e.cssClasses.pips),Te(M,e.ort===0?e.cssClasses.pipsHorizontal:e.cssClasses.pipsVertical);function de(X,_e){var Ce=_e===e.cssClasses.value,we=Ce?oe:ie,Ae=Ce?F:D;return _e+" "+we[e.ort]+" "+Ae[X]}function fe(X,_e,Ce){if(Ce=f?f(_e,Ce):Ce,Ce!==k.None){var we=z(M,!1);we.className=de(Ce,e.cssClasses.marker),we.style[e.style]=X+"%",Ce>k.NoValue&&(we=z(M,!1),we.className=de(Ce,e.cssClasses.value),we.setAttribute("data-value",String(_e)),we.style[e.style]=X+"%",we.innerHTML=String(h.to(_e)))}}return Object.keys(u).forEach(function(X){fe(X,u[X][0],u[X][1])}),M}function Ye(){g&&(ve(g),g=null)}function bt(u){Ye();var f=fn(u),h=u.filter,y=u.format||{to:function(L){return String(Math.round(L))}};return g=i.appendChild(Pt(f,h,y)),g}function jt(){var u=a.getBoundingClientRect(),f="offset"+["Width","Height"][e.ort];return e.ort===0?u.width||a[f]:u.height||a[f]}function Ne(u,f,h,y){var L=function(F){var D=Dn(F,y.pageOffset,y.target||f);if(!D||ut()&&!y.doNotReject||Va(i,e.cssClasses.tap)&&!y.doNotReject||u===r.start&&D.buttons!==void 0&&D.buttons>1||y.hover&&D.buttons)return!1;o||D.preventDefault(),D.calcPoint=D.points[e.ort],h(D,y)},M=[];return u.split(" ").forEach(function(F){f.addEventListener(F,L,o?{passive:!0}:!1),M.push([F,L])}),M}function Dn(u,f,h){var y=u.type.indexOf("touch")===0,L=u.type.indexOf("mouse")===0,M=u.type.indexOf("pointer")===0,F=0,D=0;if(u.type.indexOf("MSPointer")===0&&(M=!0),u.type==="mousedown"&&!u.buttons&&!u.touches)return!1;if(y){var oe=function(fe){var X=fe.target;return X===h||h.contains(X)||u.composed&&u.composedPath().shift()===h};if(u.type==="touchstart"){var ie=Array.prototype.filter.call(u.touches,oe);if(ie.length>1)return!1;F=ie[0].pageX,D=ie[0].pageY}else{var de=Array.prototype.find.call(u.changedTouches,oe);if(!de)return!1;F=de.pageX,D=de.pageY}}return f=f||qs(R),(L||M)&&(F=u.clientX+f.x,D=u.clientY+f.y),u.pageOffset=f,u.points=[F,D],u.cursor=L||M,u}function Er(u){var f=u-$a(a,e.ort),h=f*100/jt();return h=$s(h),e.dir?100-h:h}function Nn(u){var f=100,h=!1;return l.forEach(function(y,L){if(!tt(L)){var M=E[L],F=Math.abs(M-u),D=F===100&&f===100,oe=F<f,ie=F<=f&&u>M;(oe||ie||D)&&(h=L,f=F)}}),h}function Os(u,f){u.type==="mouseout"&&u.target.nodeName==="HTML"&&u.relatedTarget===null&&In(u,f)}function br(u,f){if(navigator.appVersion.indexOf("MSIE 9")===-1&&u.buttons===0&&f.buttonsProperty!==0)return In(u,f);var h=(e.dir?-1:1)*(u.calcPoint-f.startCalcPoint),y=h*100/f.baseSize;xn(h>0,y,f.locations,f.handleNumbers,f.connect)}function In(u,f){f.handle&&(Fn(f.handle,e.cssClasses.active),O-=1),f.listeners.forEach(function(h){N.removeEventListener(h[0],h[1])}),O===0&&(Fn(i,e.cssClasses.drag),ks(),u.cursor&&($.style.cursor="",$.removeEventListener("selectstart",mn))),e.events.smoothSteps&&(f.handleNumbers.forEach(function(h){Ht(h,E[h],!0,!0,!1,!1)}),f.handleNumbers.forEach(function(h){ce("update",h)})),f.handleNumbers.forEach(function(h){ce("change",h),ce("set",h),ce("end",h)})}function Rn(u,f){if(!f.handleNumbers.some(tt)){var h;if(f.handleNumbers.length===1){var y=l[f.handleNumbers[0]];h=y.children[0],O+=1,Te(h,e.cssClasses.active)}u.stopPropagation();var L=[],M=Ne(r.move,N,br,{target:u.target,handle:h,connect:f.connect,listeners:L,startCalcPoint:u.calcPoint,baseSize:jt(),pageOffset:u.pageOffset,handleNumbers:f.handleNumbers,buttonsProperty:u.buttons,locations:E.slice()}),F=Ne(r.end,N,In,{target:u.target,handle:h,listeners:L,doNotReject:!0,handleNumbers:f.handleNumbers}),D=Ne("mouseout",N,Os,{target:u.target,handle:h,listeners:L,doNotReject:!0,handleNumbers:f.handleNumbers});L.push.apply(L,M.concat(F,D)),u.cursor&&($.style.cursor=getComputedStyle(u.target).cursor,l.length>1&&Te(i,e.cssClasses.drag),$.addEventListener("selectstart",mn,!1)),f.handleNumbers.forEac
33h(function(oe){ce("start",oe)})}}function yr(u){u.stopPropagation();var f=Er(u.calcPoint),h=Nn(f);h!==!1&&(e.events.snap||xs(i,e.cssClasses.tap,e.animationDuration),Ht(h,f,!0,!0),ks(),ce("slide",h,!0),ce("update",h,!0),e.events.snap?Rn(u,{handleNumbers:[h]}):(ce("change",h,!0),ce("set",h,!0)))}function wr(u){var f=Er(u.calcPoint),h=m.getStep(f),y=m.fromStepping(h);Object.keys(x).forEach(function(L){L.split(".")[0]==="hover"&&x[L].forEach(function(M){M.call(Cr,y)})})}function Ps(u,f){if(ut()||tt(f))return!1;var h=["Left","Right"],y=["Down","Up"],L=["PageDown","PageUp"],M=["Home","End"];e.dir&&!e.ort?h.reverse():e.ort&&!e.dir&&(y.reverse(),L.reverse());var F=u.key.replace("Arrow",""),D=F===L[0],oe=F===L[1],ie=F===y[0]||F===h[0]||D,de=F===y[1]||F===h[1]||oe,fe=F===M[0],X=F===M[1];if(!ie&&!de&&!fe&&!X)return!0;u.preventDefault();var _e;if(de||ie){var Ce=ie?0:1,we=Oa(f),Ae=we[Ce];if(Ae===null)return!1;Ae===!1&&(Ae=m.getDefaultStep(E[f],ie,e.keyboardDefaultStep)),oe||D?Ae*=e.keyboardPageMultiplier:Ae*=e.keyboardMultiplier,Ae=Math.max(Ae,1e-7),Ae=(ie?-1:1)*Ae,_e=C[f]+Ae}else X?_e=e.spectrum.xVal[e.spectrum.xVal.length-1]:_e=e.spectrum.xVal[0];return Ht(f,m.toStepping(_e),!0,!0),ce("slide",f),ce("update",f),ce("change",f),ce("set",f),!1}function Sr(u){u.fixed||l.forEach(function(f,h){Ne(r.start,f.children[0],Rn,{handleNumbers:[h]})}),u.tap&&Ne(r.start,a,yr,{}),u.hover&&Ne(r.move,a,wr,{hover:!0}),u.drag&&d.forEach(function(f,h){if(!(f===!1||h===0||h===d.length-1)){var y=l[h-1],L=l[h],M=[f],F=[y,L],D=[h-1,h];Te(f,e.cssClasses.draggable),u.fixed&&(M.push(y.children[0]),M.push(L.children[0])),u.dragAll&&(F=l,D=S),M.forEach(function(oe){Ne(r.start,oe,Rn,{handles:F,handleNumbers:D,connect:f})})}})}function nt(u,f){x[u]=x[u]||[],x[u].push(f),u.split(".")[0]==="update"&&l.forEach(function(h,y){ce("update",y)})}function pn(u){return u===yt.aria||u===yt.tooltips}function kt(u){var f=u&&u.split(".")[0],h=f?u.substring(f.length):u;Object.keys(x).forEach(function(y){var L=y.split(".")[0],M=y.substring(L.length);(!f||f===L)&&(!h||h===M)&&(!pn(M)||h===M)&&delete x[y]})}function ce(u,f,h){Object.keys(x).forEach(function(y){var L=y.split(".")[0];
33u===L&&x[y].forEach(function(M){M.call(Cr,C.map(e.format.to),f,C.slice(),h||!1,E.slice(),Cr)})})}function Dt(u,f,h,y,L,M,F){var D;return l.length>1&&!e.events.unconstrained&&(y&&f>0&&(D=m.getAbsoluteDistance(u[f-1],e.margin,!1),h=Math.max(h,D)),L&&f<l.length-1&&(D=m.getAbsoluteDistance(u[f+1],e.margin,!0),h=Math.min(h,D))),l.length>1&&e.limit&&(y&&f>0&&(D=m.getAbsoluteDistance(u[f-1],e.limit,!1),h=Math.min(h,D)),L&&f<l.length-1&&(D=m.getAbsoluteDistance(u[f+1],e.limit,!0),h=Math.max(h,D))),e.padding&&(f===0&&(D=m.getAbsoluteDistance(0,e.padding[0],!1),h=Math.max(h,D)),f===l.length-1&&(D=m.getAbsoluteDistance(100,e.padding[1],!0),h=Math.min(h,D))),F||(h=m.getStep(h)),h=$s(h),h===u[f]&&!M?!1:h}function hn(u,f){var h=e.ort;return(h?f:u)+", "+(h?u:f)}function xn(u,f,h,y,L){var M=h.slice(),F=y[0],D=e.events.smoothSteps,oe=[!u,u],ie=[u,!u];y=y.slice(),u&&y.reverse(),y.length>1?y.forEach(function(fe,X){var _e=Dt(M,fe,M[fe]+f,oe[X],ie[X],!1,D);_e===!1?f=0:(f=_e-M[fe],M[fe]=_e)}):oe=ie=[!0];var de=!1;y.forEach(function(fe,X){de=Ht(fe,h[fe]+f,oe[X],ie[X],!1,D)||de}),de&&(y.forEach(function(fe){ce("update",fe),ce("slide",fe)}),L!=null&&ce("drag",F))}function $n(u,f){return e.dir?100-u-f:u}function Ar(u,f){E[u]=f,C[u]=m.fromStepping(f);var h=$n(f,0)-H,y="translate("+hn(h+"%","0")+")";if(l[u].style[e.transformRule]=y,e.events.invertConnects&&E.length>1){var L=E.every(function(M,F,D){return F===0||M>=D[F-1]});if(B!==!L){pm();return}}qn(u),qn(u+1),B&&(qn(u-1),qn(u+2))}function ks(){S.forEach(function(u){var f=E[u]>50?-1:1,h=3+(l.length+f*u);l[u].style.zIndex=String(h)})}function Ht(u,f,h,y,L,M){return L||(f=Dt(E,u,f,h,y,!1,M)),f===!1?!1:(Ar(u,f),!0)}function qn(u){if(d[u]){var f=E.slice();B&&f.sort(function(D,oe){return D-oe});var h=0,y=100;u!==0&&(h=f[u-1]),u!==d.length-1&&(y=f[u]);var L=y-h,M="translate("+hn($n(h,L)+"%","0")+")",F="scale("+hn(L/100,"1")+")";d[u].style[e.transformRule]=M+" "+F}}function La(u,f){return u===null||u===!1||u===void 0||(typeof u=="number"&&(u=String(u)),u=e.format.from(u),u!==!1&&(u=m.toStepping(u)),u===!1||isNaN(u))?E[f]:u}function Tr(u,f,h){var y=Vn(u),L=E[0]===void 0;f=f===void 0?!0:f,e.animate&&!L&&xs(i,e.cssClasses.tap,e.animationDuration),S.forEach(function(D){Ht(D,La(y[D],D),!0,!1,h)});var M=S.length===1?0:1;if(L&&m.hasNoSize()&&(h=!0,E[0]=0,S.length>1)){var F=100/(S.length-1);S.forEach(function(D){E[D]=D*F})}for(;M<S.length;++M)S.forEach(function(D){Ht(D,E[D],!0,!0,h)});ks(),S.forEach(function(D){ce("update",D),y[D]!==null&&f&&ce("set",D)})}function cm(u){Tr(e.start,u)}function lm(u,f,h,y){if(u=Number(u),!(u>=0&&u<S.length))throw new Error("noUiSlider: invalid handle number, got: "+u);Ht(u,La(f,u),!0,!0,y),ce("update",u),h&&ce("set",u)}function Ma(u){if(u===void 0&&(u=!1),u)return C.length===1?C[0]:C.slice(0);var f=C.map(e.format.to);return f.length===1?f[0]:f}function um(){for(kt(yt.aria),kt(yt.tooltips),Object.keys(e.cssClasses).forEach(function(u){Fn(i,e.cssClasses[u])});i.firstChild;)i.removeChild(i.firstChild);delete i.noUiSlider}function Oa(u){var f=E[u],h=m.getNearbySteps(f),y=C[u],L=h.thisStep.step,M=null;if(e.snap)return[y-h.stepBefore.startValue||null,h.stepAfter.startValue-y||null];L!==!1&&y+L>h.stepAfter.startValue&&(L=h.stepAfter.startValue-y),y>h.thisStep.startValue?M=h.thisStep.step:h.stepBefore.step===!1?M=!1:M=y-h.stepBefore.highestStep,f===100?L=null:f===0&&(M=null);var F=m.countStepDecimals();return L!==null&&L!==!1&&(L=Number(L.toFixed(F))),M!==null&&M!==!1&&(M=Number(M.toFixed(F))),[M,L]}function dm(){return S.map(Oa)}function fm(u,f){var h=Ma(),y=["margin","limit","padding","range","animate","snap","step","format","pips","tooltips","connect"];y.forEach(function(M){u[M]!==void 0&&(t[M]=u[M])});var L=Bs(t);y.forEach(function(M){u[M]!==void 0&&(e[M]=L[M])}),m=L.spectrum,e.margin=L.margin,e.limit=L.limit,e.padding=L.padding,e.pips?bt(e.pips):Ye(),e.tooltips?dt():Mt(),E=[],Tr(Ge(u.start)?u.start:h,f),u.connect&&Pa()}function Pa(){for(;c.firstChild;)c.removeChild(c.firstChild);for(var u=0;u<=e.handles;u++)d[u]=ne(c,e.connect[u]),qn(u);Sr({drag:e.events.drag,fixed:!0})}function pm(){B=!B,js(e,e.connect.map(function(u){return!u})),Pa()}function hm(){a=Fe(i),ye(e.connect,a),Sr(e.events),Tr(e.start),e.pips&&bt(e.pips),e.tooltips&&dt(),dn()}hm();var Cr={destroy:um,steps:dm,on:nt,off:kt,get:Ma,set:Tr,setHandle:lm,reset:cm,disable:De,enable:Ue,__moveHandles:function(u,f,h){xn(u,f,E,h)},options:t,updateOptions:fm,target:i,removePips:Ye,removeTooltips:Mt,getPositions:function(){return E.slice()},getTooltips:function(){return v},getOrigins:function(){return l},pips:bt};return Cr}function gc(n,e){if(!n||!n.nodeName)throw new Error("noUiSlider: create requires a single element, got: "+n);if(n.noUiSlider)throw new Error("noUiSlider: Slider was already initialized.");var t=Bs(e),r=vc(n,t,e);return n.noUiSlider=r,r}
vendor: 6,261 bytes, line 33
33const _c={__spectrum:Vs,cssClasses:Us,create:gc};var Ec=re(935),bc=re.n(Ec);const yc={delay:250},Nt=(n,e)=>{let t;return(...r)=>{typeof t!="undefined"&&window.clearTimeout(t),t=window.setTimeout(()=>{n(...r)},e)}};var Pe="top",$e="bottom",qe="right",ke="left",Un="auto",Bt=[Pe,$e,qe,ke],It="start",Wt="end",Ws="clippingParents",kr="viewport",Kt="popper",Ks="reference",Dr=Bt.reduce(function(n,e){return n.concat([e+"-"+It,e+"-"+Wt])},[]),Nr=[].concat(Bt,[Un]).reduce(function(n,e){return n.concat([e,e+"-"+It,e+"-"+Wt])},[]),Ys="beforeRead",zs="read",Gs="afterRead",Qs="beforeMain",Xs="main",Js="afterMain",Zs="beforeWrite",eo="write",to="afterWrite",no=[Ys,zs,Gs,Qs,Xs,Js,Zs,eo,to];function it(n){return n?(n.nodeName||"").toLowerCase():null}function Ve(n){if(n==null)return window;if(n.toString()!=="[object Window]"){var e=n.ownerDocument;return e&&e.defaultView||window}return n}function Rt(n){var e=Ve(n).Element;return n instanceof e||n instanceof Element}function He(n){var e=Ve(n).HTMLElement;return n instanceof e||n instanceof HTMLElement}function Ir(n){if(typeof ShadowRoot=="undefined")return!1;var e=Ve(n).ShadowRoot;return n instanceof e||n instanceof ShadowRoot}function wc(n){var e=n.state;Object.keys(e.elements).forEach(function(t){var r=e.styles[t]||{},s=e.attributes[t]||{},o=e.elements[t];!He(o)||!it(o)||(Object.assign(o.style,r),Object.keys(s).forEach(function(i){var a=s[i];a===!1?o.removeAttribute(i):o.setAttribute(i,a===!0?"":a)}))})}function Sc(n){var e=n.state,t={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,t.popper),e.styles=t,e.elements.arrow&&Object.assign(e.elements.arrow.style,t.arrow),function(){Object.keys(e.elements).forEach(function(r){var s=e.elements[r],o=e.attributes[r]||{},i=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:t[r]),a=i.reduce(function(c,l){return c[l]="",c},{});!He(s)||!it(s)||(Object.assign(s.style,a),Object.keys(o).forEach(function(c){s.removeAttribute(c)}))})}}const Rr={name:"applyStyles",enabled:!0,phase:"write",fn:wc,effect:Sc,requires:["computeStyles"]};function at(n){return n.split("-")[0]}var xt=Math.max,jn=Math.min,Yt=Math.round;function xr(){var n=navigator.userAgentData;return n!=null&&n.brands&&Array.isArray(n.brands)?n.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function ro(){return!/^((?!chrome|android).)*safari/i.test(xr())}function zt(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!1);var r=n.getBoundingClientRect(),s=1,o=1;e&&He(n)&&(s=n.offsetWidth>0&&Yt(r.width)/n.offsetWidth||1,o=n.offsetHeight>0&&Yt(r.height)/n.offsetHeight||1);var i=Rt(n)?Ve(n):window,a=i.visualViewport,c=!ro()&&t,l=(r.left+(c&&a?a.offsetLeft:0))/s,d=(r.top+(c&&a?a.offsetTop:0))/o,g=r.width/s,v=r.height/o;return{width:g,height:v,top:d,right:l+g,bottom:d+v,left:l,x:l,y:d}}function $r(n){var e=zt(n),t=n.offsetWidth,r=n.offsetHeight;return Math.abs(e.width-t)<=1&&(t=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:n.offsetLeft,y:n.offsetTop,width:t,height:r}}function so(n,e){var t=e.getRootNode&&e.getRootNode();if(n.contains(e))return!0;if(t&&Ir(t)){var r=e;do{if(r&&n.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function ft(n){return Ve(n).getComputedStyle(n)}function Ac(n){return["table","td","th"].indexOf(it(n))>=0}function wt(n){return((Rt(n)?n.ownerDocument:n.document)||window.document).documentElement}function Hn(n){return it(n)==="html"?n:n.assignedSlot||n.parentNode||(Ir(n)?n.host:null)||wt(n)}function oo(n){return!He(n)||ft(n).position==="fixed"?null:n.offsetParent}function Tc(n){var e=/firefox/i.test(xr()),t=/Trident/i.test(xr());if(t&&He(n)){var r=ft(n);if(r.position==="fixed")return null}var s=Hn(n);for(Ir(s)&&(s=s.host);He(s)&&["html","body"].indexOf(it(s))<0;){var o=ft(s);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||e&&o.willChange==="filter"||e&&o.filter&&o.filter!=="none")return s;s=s.parentNode}return null}function gn(n){for(var e=Ve(n),t=oo(n);t&&Ac(t)&&ft(t).position==="static";)t=oo(t);return t&&(it(t)==="html"||it(t)==="body"&&ft(t).position==="static")?e:t||Tc(n)||e}function qr(n){return["top","bottom"].indexOf(n)>=0?"x":"y"}function _n(n,e,t){return xt(n,jn(e,t))}function Cc(n,e,t){var r=_n(n,e,t);return r>t?t:r}function io(){return{top:0,right:0,bottom:0,left:0}}function ao(n){return Object.assign({},io(),n)}function co(n,e){return e.reduce(function(t,r){return t[r]=n,t},{})}var Lc=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,ao(typeof e!="number"?e:co(e,Bt))};function Mc(n){var e,t=n.state,r=n.name,s=n.options,o=t.elements.arrow,i=t.modifiersData.popperOffsets,a=at(t.placement),c=qr(a),l=[ke,qe].indexOf(a)>=0,d=l?"height":"width";if(!(!o||!i)){var g=Lc(s.padding,t),v=$r(o),m=c==="y"?Pe:ke,C=c==="y"?$e:qe,E=t.rects.reference[d]+t.rects.reference[c]-i[c]-t.rects.popper[d],S=i[c]-t.rects.reference[c],O=gn(o),x=O?c==="y"?O.clientHeight||0:O.clientWidth||0:0,B=E/2-S/2,R=g[m],N=x-v[d]-g[C],$=x/2-v[d]/2+B,H=_n(R,$,N),z=c;t.modifiersData[r]=(e={},e[z]=H,e.centerOffset=H-$,e)}}function Oc(n){var e=n.state,t=n.options,r=t.element,s=r===void 0?"[data-popper-arrow]":r;s!=null&&(typeof s=="string"&&(s=e.elements.popper.querySelector(s),!s)||so(e.elements.popper,s)&&(e.elements.arrow=s))}const lo={name:"arrow",enabled:!0,phase:"main",fn:Mc,effect:Oc,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Gt(n){return n.split("-")[1]}var Pc={top:"auto",right:"auto",bottom:"auto",left:"auto"};function kc(n,e){var t=n.x,r=n.y,s=e.devicePixelRatio||1;return{x:Yt(t*s)/s||0,y:Yt(r*s)/s||0}}function uo(n){var e,t=n.popper,r=n.popperRect,s=n.placement,o=n.variation,i=n.offsets,a=n.position,c=n.gpuAcceleration,l=n.adaptive,d=n.roundOffsets,g=n.isFixed,v=i.x,m=v===void 0?0:v,C=i.y,E=C===void 0?0:C,S=typeof d=="function"?d({x:m,y:E}):{x:m,y:E};m=S.x,E=S.y;var O=i.hasOwnProperty("x"),x=i.hasOwnProperty("y"),B=ke,R=Pe,N=window;if(l){var $=gn(t),H="clientHeight",z="clientWidth";if($===Ve(t)&&($=wt(t),ft($).position!=="static"&&a==="absolute"&&(H="scrollHeight",z="scrollWidth")),$=$,s===Pe||(s===ke||s===qe)&&o===Wt){R=$e;
vendor: 11,136 bytes, line 33
33var ue=g&&$===N&&N.visualViewport?N.visualViewport.height:$[H];E-=ue-r.height,E*=c?1:-1}if(s===ke||(s===Pe||s===$e)&&o===Wt){B=qe;var ne=g&&$===N&&N.visualViewport?N.visualViewport.width:$[z];m-=ne-r.width,m*=c?1:-1}}var ye=Object.assign({position:a},l&&Pc),Fe=d===!0?kc({x:m,y:E},Ve(t)):{x:m,y:E};if(m=Fe.x,E=Fe.y,c){var Se;return Object.assign({},ye,(Se={},Se[R]=x?"0":"",Se[B]=O?"0":"",Se.transform=(N.devicePixelRatio||1)<=1?"translate("+m+"px, "+E+"px)":"translate3d("+m+"px, "+E+"px, 0)",Se))}return Object.assign({},ye,(e={},e[R]=x?E+"px":"",e[B]=O?m+"px":"",e.transform="",e))}function Dc(n){var e=n.state,t=n.options,r=t.gpuAcceleration,s=r===void 0?!0:r,o=t.adaptive,i=o===void 0?!0:o,a=t.roundOffsets,c=a===void 0?!0:a,l={placement:at(e.placement),variation:Gt(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:s,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,uo(Object.assign({},l,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:i,roundOffsets:c})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,uo(Object.assign({},l,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const Vr={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Dc,data:{}};var Bn={passive:!0};function Nc(n){var e=n.state,t=n.instance,r=n.options,s=r.scroll,o=s===void 0?!0:s,i=r.resize,a=i===void 0?!0:i,c=Ve(e.elements.popper),l=[].concat(e.scrollParents.reference,e.scrollParents.popper);return o&&l.forEach(function(d){d.addEventListener("scroll",t.update,Bn)}),a&&c.addEventListener("resize",t.update,Bn),function(){o&&l.forEach(function(d){d.removeEventListener("scroll",t.update,Bn)}),a&&c.removeEventListener("resize",t.update,Bn)}}const Fr={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Nc,data:{}};var Ic={left:"right",right:"left",bottom:"top",top:"bottom"};function Wn(n){return n.replace(/left|right|bottom|top/g,function(e){return Ic[e]})}var Rc={start:"end",end:"start"};function fo(n){return n.replace(/start|end/g,function(e){return Rc[e]})}function Ur(n){var e=Ve(n),t=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:t,scrollTop:r}}function jr(n){return zt(wt(n)).left+Ur(n).scrollLeft}function xc(n,e){var t=Ve(n),r=wt(n),s=t.visualViewport,o=r.clientWidth,i=r.clientHeight,a=0,c=0;if(s){o=s.width,i=s.height;var l=ro();(l||!l&&e==="fixed")&&(a=s.offsetLeft,c=s.offsetTop)}return{width:o,height:i,x:a+jr(n),y:c}}function $c(n){var e,t=wt(n),r=Ur(n),s=(e=n.ownerDocument)==null?void 0:e.body,o=xt(t.scrollWidth,t.clientWidth,s?s.scrollWidth:0,s?s.clientWidth:0),i=xt(t.scrollHeight,t.clientHeight,s?s.scrollHeight:0,s?s.clientHeight:0),a=-r.scrollLeft+jr(n),c=-r.scrollTop;return ft(s||t).direction==="rtl"&&(a+=xt(t.clientWidth,s?s.clientWidth:0)-o),{width:o,height:i,x:a,y:c}}function Hr(n){var e=ft(n),t=e.overflow,r=e.overflowX,s=e.overflowY;return/auto|scroll|overlay|hidden/.test(t+s+r)}function po(n){return["html","body","#document"].indexOf(it(n))>=0?n.ownerDocument.body:He(n)&&Hr(n)?n:po(Hn(n))}function En(n,e){var t;e===void 0&&(e=[]);var r=po(n),s=r===((t=n.ownerDocument)==null?void 0:t.body),o=Ve(r),i=s?[o].concat(o.visualViewport||[],Hr(r)?r:[]):r,a=e.concat(i);return s?a:a.concat(En(Hn(i)))}function Br(n){return Object.assign({},n,{left:n.x,top:n.y,right:n.x+n.width,bottom:n.y+n.height})}function qc(n,e){var t=zt(n,!1,e==="fixed");return t.top=t.top+n.clientTop,t.left=t.left+n.clientLeft,t.bottom=t.top+n.clientHeight,t.right=t.left+n.clientWidth,t.width=n.clientWidth,t.height=n.clientHeight,t.x=t.left,t.y=t.top,t}function ho(n,e,t){return e===kr?Br(xc(n,t)):Rt(e)?qc(e,t):Br($c(wt(n)))}function Vc(n){var e=En(Hn(n)),t=["absolute","fixed"].indexOf(ft(n).position)>=0,r=t&&He(n)?gn(n):n;return Rt(r)?e.filter(function(s){return Rt(s)&&so(s,r)&&it(s)!=="body"}):[]}function Fc(n,e,t,r){var s=e==="clippingParents"?Vc(n):[].concat(e),o=[].concat(s,[t]),i=o[0],a=o.reduce(function(c,l){var d=ho(n,l,r);return c.top=xt(d.top,c.top),c.right=jn(d.right,c.right),c.bottom=jn(d.bottom,c.bottom),c.left=xt(d.left,c.left),c},ho(n,i,r));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function mo(n){var e=n.reference,t=n.element,r=n.placement,s=r?at(r):null,o=r?Gt(r):null,i=e.x+e.width/2-t.width/2,a=e.y+e.height/2-t.height/2,c;switch(s){case Pe:c={x:i,y:e.y-t.height};break;case $e:c={x:i,y:e.y+e.height};break;case qe:c={x:e.x+e.width,y:a};break;case ke:c={x:e.x-t.width,y:a};break;default:c={x:e.x,y:e.y}}var l=s?qr(s):null;if(l!=null){var d=l==="y"?"height":"width";switch(o){case It:c[l]=c[l]-(e[d]/2-t[d]/2);break;case Wt:c[l]=c[l]+(e[d]/2-t[d]/2);break;default:}}return c}function Qt(n,e){e===void 0&&(e={});var t=e,r=t.placement,s=r===void 0?n.placement:r,o=t.strategy,i=o===void 0?n.strategy:o,a=t.boundary,c=a===void 0?Ws:a,l=t.rootBoundary,d=l===void 0?kr:l,g=t.elementContext,v=g===void 0?Kt:g,m=t.altBoundary,C=m===void 0?!1:m,E=t.padding,S=E===void 0?0:E,O=ao(typeof S!="number"?S:co(S,Bt)),x=v===Kt?Ks:Kt,B=n.rects.popper,R=n.elements[C?x:v],N=Fc(Rt(R)?R:R.contextElement||wt(n.elements.popper),c,d,i),$=zt(n.elements.reference),H=mo({reference:$,element:B,strategy:"absolute",placement:s}),z=Br(Object.assign({},B,H)),ue=v===Kt?z:$,ne={top:N.top-ue.top+O.top,bottom:ue.bottom-N.bottom+O.bottom,left:N.left-ue.left+O.left,right:ue.right-N.right+O.right},ye=n.modifiersData.offset;if(v===Kt&&ye){var Fe=ye[s];Object.keys(ne).forEach(function(Se){var ut=[qe,$e].indexOf(Se)>=0?1:-1,tt=[Pe,$e].indexOf(Se)>=0?"y":"x";ne[Se]+=Fe[tt]*ut})}return ne}function Uc(n,e){e===void 0&&(e={});var t=e,r=t.placement,s=t.boundary,o=t.rootBoundary,i=t.padding,a=t.flipVariations,c=t.allowedAutoPlacements,l=c===void 0?Nr:c,d=Gt(r),g=d?a?Dr:Dr.filter(function(C){return Gt(C)===d}):Bt,v=g.filter(function(C){return l.indexOf(C)>=0});v.length===0&&(v=g);var m=v.reduce(function(C,E){return C[E]=Qt(n,{placement:E,boundary:s,rootBoundary:o,padding:i})[at(E)],C},{});return Object.keys(m).sort(function(C,E){return m[C]-m[E]})}function jc(n){if(at(n)===Un)return[];var e=Wn(n);return[fo(n),e,fo(e)]}function Hc(n){var e=n.state,t=n.options,r=n.name;if(!e.modifiersData[r]._skip){for(var s=t.mainAxis,o=s===void 0?!0:s,i=t.altAxis,a=i===void 0?!0:i,c=t.fallbackPlacements,l=t.padding,d=t.boundary,g=t.rootBoundary,v=t.altBoundary,m=t.flipVariations,C=m===void 0?!0:m,E=t.allowedAutoPlacements,S=e.options.placement,O=at(S),x=O===S,B=c||(x||!C?[Wn(S)]:jc(S)),R=[S].concat(B).reduce(function(Pt,Ye){return Pt.concat(at(Ye)===Un?Uc(e,{placement:Ye,boundary:d,rootBoundary:g,padding:l,flipVariations:C,allowedAutoPlacements:E}):Ye)},[]),N=e.rects.reference,$=e.rects.popper,H=new Map,z=!0,ue=R[0],ne=0;ne<R.length;ne++){var ye=R[ne],Fe=at(ye),Se=Gt(ye)===It,ut=[Pe,$e].indexOf(Fe)>=0,tt=ut?"width":"height",De=Qt(e,{placement:ye,boundary:d,rootBoundary:g,altBoundary:v,padding:l}),Ue=ut?Se?qe:ke:Se?$e:Pe;N[tt]>$[tt]&&(Ue=Wn(Ue));var Mt=Wn(Ue),dt=[];if(o&&dt.push(De[Fe]<=0),a&&dt.push(De[Ue]<=0,De[Mt]<=0),dt.every(function(Pt){return Pt})){ue=ye,z=!1;break}H.set(ye,dt)}if(z)for(var dn=C?3:1,kn=function(Ye){var bt=R.find(function(jt){var Ne=H.get(jt);if(Ne)return Ne.slice(0,Ye).every(function(Dn){return Dn})});if(bt)return ue=bt,"break"},Ot=dn;Ot>0;Ot--){var fn=kn(Ot);if(fn==="break")break}e.placement!==ue&&(e.modifiersData[r]._skip=!0,e.placement=ue,e.reset=!0)}}const vo={name:"flip",enabled:!0,phase:"main",fn:Hc,requiresIfExists:["offset"],data:{_skip:!1}};function go(n,e,t){return t===void 0&&(t={x:0,y:0}),{top:n.top-e.height-t.y,right:n.right-e.width+t.x,bottom:n.bottom-e.height+t.y,left:n.left-e.width-t.x}}function _o(n){return[Pe,qe,$e,ke].some(function(e){return n[e]>=0})}function Bc(n){var e=n.state,t=n.name,r=e.rects.reference,s=e.rects.popper,o=e.modifiersData.preventOverflow,i=Qt(e,{elementContext:"reference"}),a=Qt(e,{altBoundary:!0}),c=go(i,r),l=go(a,s,o),d=_o(c),g=_o(l);e.modifiersData[t]={referenceClippingOffsets:c,popperEscapeOffsets:l,isReferenceHidden:d,hasPopperEscaped:g},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":g})}const Eo={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Bc};function Wc(n,e,t){var r=at(n),s=[ke,Pe].indexOf(r)>=0?-1:1,o=typeof t=="function"?t(Object.assign({},e,{placement:n})):t,i=o[0],a=o[1];return i=i||0,a=(a||0)*s,[ke,qe].indexOf(r)>=0?{x:a,y:i}:{x:i,y:a}}function Kc(n){var e=n.state,t=n.options,r=n.name,s=t.offset,o=s===void 0?[0,0]:s,i=Nr.reduce(function(d,g){return d[g]=Wc(g,e.rects,o),d},{}),a=i[e.placement],c=a.x,l=a.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=c,e.modifiersData.popperOffsets.y+=l),e.modifiersData[r]=i}const bo={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Kc};function Yc(n){var e=n.state,t=n.name;e.modifiersData[t]=mo({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const Wr={name:"popperOffsets",enabled:!0,phase:"read",fn:Yc,data:{}};function zc(n){return n==="x"?"y":"x"}function Gc(n){var e=n.state,t=n.options,r=n.name,s=t.mainAxis,o=s===void 0?!0:s,i=t.altAxis,a=i===void 0?!1:i,c=t.boundary,l=t.rootBoundary,d=t.altBoundary,g=t.padding,v=t.tether,m=v===void 0?!0:v,C=t.tetherOffset,E=C===void 0?0:C,S=Qt(e,{boundary:c,rootBoundary:l,padding:g,altBoundary:d}),O=at(e.placement),x=Gt(e.placement),B=!x,R=qr(O),N=zc(R),$=e.modifiersData.popperOffsets,H=e.rects.reference,z=e.rects.popper,ue=typeof E=="function"?E(Object.assign({},e.rects,{placement:e.placement})):E,ne=typeof ue=="number"?{mainAxis:ue,altAxis:ue}:Object.assign({mainAxis:0,altAxis:0},ue),ye=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,Fe={x:0,y:0};if($){if(o){var Se,ut=R==="y"?Pe:ke,tt=R==="y"?$e:qe,De=R==="y"?"height":"width",Ue=$[R],Mt=Ue+S[ut],dt=Ue-S[tt],dn=m?-z[De]/2:0,kn=x===It?H[De]:z[De],Ot=x===It?-z[De]:-H[De],fn=e.elements.arrow,Pt=m&&fn?$r(fn):{width:0,height:0},Ye=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:io(),bt=Ye[ut],jt=Ye[tt],Ne=_n(0,H[De],Pt[De]),Dn=B?H[De]/2-dn-Ne-bt-ne.mainAxis:kn-Ne-bt-ne.mainAxis,Er=B?-H[De]/2+dn+Ne+jt+ne.mainAxis:Ot+Ne+jt+ne.mainAxis,Nn=e.elements.arrow&&gn(e.elements.arrow),Os=Nn?R==="y"?Nn.clientTop||0:Nn.clientLeft||0:0,br=(Se=ye==null?void 0:ye[R])!=null?Se:0,In=Ue+Dn-br-Os,Rn=Ue+Er-br,yr=_n(m?jn(Mt,In):Mt,Ue,m?xt(dt,Rn):dt);$[R]=yr,Fe[R]=yr-Ue}if(a){var wr,Ps=R==="x"?Pe:ke,Sr=R==="x"?$e:qe,nt=$[N],pn=N==="y"?"height":"width",kt=nt+S[Ps],ce=nt-S[Sr],Dt=[Pe,ke].indexOf(O)!==-1,hn=(wr=ye==null?void 0:ye[N])!=null?wr:0,xn=Dt?kt:nt-H[pn]-z[pn]-hn+ne.altAxis,$n=Dt?nt+H[pn]+z[pn]-hn-ne.altAxis:ce,Ar=m&&Dt?Cc(xn,nt,$n):_n(m?xn:kt,nt,m?$n:ce);$[N]=Ar,Fe[N]=Ar-nt}e.modifiersData[r]=Fe}}const yo={name:"preventOverflow",enabled:!0,phase:"main",fn:Gc,requiresIfExists:["offset"]};function Qc(n){return{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}}function Xc(n){return n===Ve(n)||!He(n)?Ur(n):Qc(n)}
vendor: 5,762 bytes, lines 33-37
33function Jc(n){var e=n.getBoundingClientRect(),t=Yt(e.width)/n.offsetWidth||1,r=Yt(e.height)/n.offsetHeight||1;return t!==1||r!==1}function Zc(n,e,t){t===void 0&&(t=!1);var r=He(e),s=He(e)&&Jc(e),o=wt(e),i=zt(n,s,t),a={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(r||!r&&!t)&&((it(e)!=="body"||Hr(o))&&(a=Xc(e)),He(e)?(c=zt(e,!0),c.x+=e.clientLeft,c.y+=e.clientTop):o&&(c.x=jr(o))),{x:i.left+a.scrollLeft-c.x,y:i.top+a.scrollTop-c.y,width:i.width,height:i.height}}function el(n){var e=new Map,t=new Set,r=[];n.forEach(function(o){e.set(o.name,o)});function s(o){t.add(o.name);var i=[].concat(o.requires||[],o.requiresIfExists||[]);i.forEach(function(a){if(!t.has(a)){var c=e.get(a);c&&s(c)}}),r.push(o)}return n.forEach(function(o){t.has(o.name)||s(o)}),r}function tl(n){var e=el(n);return no.reduce(function(t,r){return t.concat(e.filter(function(s){return s.phase===r}))},[])}function nl(n){var e;return function(){return e||(e=new Promise(function(t){Promise.resolve().then(function(){e=void 0,t(n())})})),e}}function rl(n){var e=n.reduce(function(t,r){var s=t[r.name];return t[r.name]=s?Object.assign({},s,r,{options:Object.assign({},s.options,r.options),data:Object.assign({},s.data,r.data)}):r,t},{});return Object.keys(e).map(function(t){return e[t]})}var wo={placement:"bottom",modifiers:[],strategy:"absolute"};function So(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function Kn(n){n===void 0&&(n={});var e=n,t=e.defaultModifiers,r=t===void 0?[]:t,s=e.defaultOptions,o=s===void 0?wo:s;return function(a,c,l){l===void 0&&(l=o);var d={placement:"bottom",orderedModifiers:[],options:Object.assign({},wo,o),modifiersData:{},elements:{reference:a,popper:c},attributes:{},styles:{}},g=[],v=!1,m={state:d,setOptions:function(O){var x=typeof O=="function"?O(d.options):O;E(),d.options=Object.assign({},o,d.options,x),d.scrollParents={reference:Rt(a)?En(a):a.contextElement?En(a.contextElement):[],popper:En(c)};var B=tl(rl([].concat(r,d.options.modifiers)));return d.orderedModifiers=B.filter(function(R){return R.enabled}),C(),m.update()},forceUpdate:function(){if(!v){var O=d.elements,x=O.reference,B=O.popper;if(So(x,B)){d.rects={reference:Zc(x,gn(B),d.options.strategy==="fixed"),popper:$r(B)},d.reset=!1,d.placement=d.options.placement,d.orderedModifiers.forEach(function(ne){return d.modifiersData[ne.name]=Object.assign({},ne.data)});for(var R=0;R<d.orderedModifiers.length;R++){if(d.reset===!0){d.reset=!1,R=-1;continue}var N=d.orderedModifiers[R],$=N.fn,H=N.options,z=H===void 0?{}:H,ue=N.name;typeof $=="function"&&(d=$({state:d,options:z,name:ue,instance:m})||d)}}}},update:nl(function(){return new Promise(function(S){m.forceUpdate(),S(d)})}),destroy:function(){E(),v=!0}};if(!So(a,c))return m;m.setOptions(l).then(function(S){!v&&l.onFirstUpdate&&l.onFirstUpdate(S)});function C(){d.orderedModifiers.forEach(function(S){var O=S.name,x=S.options,B=x===void 0?{}:x,R=S.effect;if(typeof R=="function"){var N=R({state:d,name:O,instance:m,options:B}),$=function(){};g.push(N||$)}})}function E(){g.forEach(function(S){return S()}),g=[]}return m}}var sl=Kn(),ol=[Fr,Wr,Vr,Rr,bo,vo,yo,lo,Eo],Kr=Kn({defaultModifiers:ol}),il=[Fr,Wr,Vr,Rr],al=Kn({defaultModifiers:il});/*!
34  * Bootstrap v5.3.3 (https://getbootstrap.com/)
35  * Copyright 2011-2024 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
36  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
37  */const St=new Map,Yr={set(n,e,t){St.has(n)||St.set(n,new Map);const r=St.get(n);if(!r.has(e)&&r.size!==0){console.error(`Bootstrap doesn't allow more than one instance per element. Bound instance: ${Array.from(r.keys())[0]}.`);return}r.set(e,t)},get(n,e){return St.has(n)&&St.get(n).get(e)||null},remove(n,e){if(!St.has(n))return;const t=St.get(n);t.delete(e),t.size===0&&St.delete(n)}},cl=1e6,ll=1e3,zr="transitionend",Ao=n=>(n&&window.CSS&&window.CSS.escape&&(n=n.replace(/#([^\s"#']+)/g,(e,t)=>`#${CSS.escape(t)}`)),n),ul=n=>n==null?`${n}`:Object.prototype.toString.call(n).match(/\s([a-z]+)/i)[1].toLowerCase(),dl=n=>{do n+=Math.floor(Math.random()*cl);while(document.getElementById(n));return n},fl=n=>{if(!n)return 0;let{transitionDuration:e,transitionDelay:t}=window.getComputedStyle(n);const r=Number.parseFloat(e),s=Number.parseFloat(t);return!r&&!s?0:(e=e.split(",")[0],t=t.split(",")[0],(Number.parseFloat(e)+Number.parseFloat(t))*ll)},To=n=>{n.dispatchEvent(new Event(zr))},pt=n=>!n||typeof n!="object"?!1:(typeof n.jquery!="undefined"&&(n=n[0]),typeof n.nodeType!="undefined"),At=n=>pt(n)?n.jquery?n[0]:n:typeof n=="string"&&n.length>0?document.querySelector(Ao(n)):null,Xt=n=>{if(!pt(n)||n.getClientRects().length===0)return!1;const e=getComputedStyle(n).getPropertyValue("visibility")==="visible",t=n.closest("details:not([open])");if(!t)return e;if(t!==n){const r=n.closest("summary");if(r&&r.parentNode!==t||r===null)return!1}return e},Tt=n=>!n||n.nodeType!==Node.ELEMENT_NODE||n.classList.contains("disabled")?!0:typeof n.disabled!="undefined"?n.disabled:n.hasAttribute("disabled")&&n.getAttribute("disabled")!=="false",Co=n=>{if(!document.documentElement.attachShadow)return null;if(typeof n.getRootNode=="function"){const e=n.getRootNode();return e instanceof ShadowRoot?e:null}return n instanceof ShadowRoot?n:n.parentNode?Co(n.parentNode):null},Yn=()=>{},bn=n=>{n.offsetHeight},Lo=()=>window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null,Gr=[],pl=n=>{document.readyState==="loading"?(Gr.length||document.addEventListener("DOMContentLoaded",()=>{for(const e of Gr)e()}),Gr.push(n)):n()},Be=()=>document.documentElement.dir==="rtl",We=n=>{pl(()=>{const e=Lo();if(e){const t=n.NAME,r=e.fn[t];
37e.fn[t]=n.jQueryInterface,e.fn[t].Constructor=n,e.fn[t].noConflict=()=>(e.fn[t]=r,n.jQueryInterface)}})},Ie=(n,e=[],t=n)=>typeof n=="function"?n(...e):t,Mo=(n,e,t=!0)=>{if(!t){Ie(n);return}const r=5,s=fl(e)+r;let o=!1;const i=({target:a})=>{a===e&&(o=!0,e.removeEventListener(zr,i),Ie(n))};e.addEventListener(zr,i),setTimeout(()=>{o||To(e)},s)},Qr=(n,e,t,r)=>{const s=n.length;let o=n.indexOf(e);return o===-1?!t&&r?n[s-1]:n[0]:(o+=t?1:-1,r&&(o=(o+s)%s),n[Math.max(0,Math.min(o,s-1))])},hl=/[^.]*(?=\..*)\.|.*/,ml=/\..*/,vl=/::\d+$/,Xr={};let Oo=1;const Po={mouseenter:"mouseover",mouseleave:"mouseout"},gl=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function ko(n,e){return e&&`${e}::${Oo++}`||n.uidEvent||Oo++}function Do(n){const e=ko(n);return n.uidEvent=e,Xr[e]=Xr[e]||{},Xr[e]}function _l(n,e){return function t(r){return Zr(r,{delegateTarget:n}),t.oneOff&&b.off(n,r.type,e),e.apply(n,[r])}}function El(n,e,t){return function r(s){const o=n.querySelectorAll(e);for(let{target:i}=s;i&&i!==this;i=i.parentNode)for(const a of o)if(a===i)return Zr(s,{delegateTarget:i}),r.oneOff&&b.off(n,s.type,e,t),t.apply(i,[s])}}function No(n,e,t=null){return Object.values(n).find(r=>r.callable===e&&r.delegationSelector===t)}function Io(n,e,t){const r=typeof e=="string",s=r?t:e||t;let o=xo(n);return gl.has(o)||(o=n),[r,s,o]}function Ro(n,e,t,r,s){if(typeof e!="string"||!n)return;let[o,i,a]=Io(e,t,r);e in Po&&(i=(C=>function(E){if(!E.relatedTarget||E.relatedTarget!==E.delegateTarget&&!E.delegateTarget.contains(E.relatedTarget))return C.call(this,E)})(i));const c=Do(n),l=c[a]||(c[a]={}),d=No(l,i,o?t:null);if(d){d.oneOff=d.oneOff&&s;return}const g=ko(i,e.replace(hl,"")),v=o?El(n,t,i):_l(n,i);v.delegationSelector=o?t:null,v.callable=i,v.oneOff=s,v.uidEvent=g,l[g]=v,n.addEventListener(a,v,o)}function Jr(n,e,t,r,s){const o=No(e[t],r,s);o&&(n.removeEventListener(t,o,Boolean(s)),delete e[t][o.uidEvent])}function bl(n,e,t,r){const s=e[t]||{};for(const[o,i]of Object.entries(s))o.includes(r)&&Jr(n,e,t,i.callable,i.delegationSelector)}function xo(n){return n=n.replace(ml,""),Po[n]||n}const b={on(n,e,t,r){Ro(n,e,t,r,!1)},one(n,e,t,r){Ro(n,e,t,r,!0)},off(n,e,t,r){if(typeof e!="string"||!n)return;const[s,o,i]=Io(e,t,r),a=i!==e,c=Do(n),l=c[i]||{},d=e.startsWith(".");if(typeof o!="undefined"){if(!Object.keys(l).length)return;Jr(n,c,i,o,s?t:null);return}if(d)for(const g of Object.keys(c))bl(n,c,g,e.slice(1));for(const[g,v]of Object.entries(l)){const m=g.replace(vl,"");(!a||e.includes(m))&&Jr(n,c,i,v.callable,v.delegationSelector)}},trigger(n,e,t){if(typeof e!="string"||!n)return null;const r=Lo(),s=xo(e),o=e!==s;let i=null,a=!0,c=!0,l=!1;o&&r&&(i=r.Event(e,t),r(n).trigger(i),a=!i.isPropagationStopped(),c=!i.isImmediatePropagationStopped(),l=i.isDefaultPrevented());const d=Zr(new Event(e,{bubbles:a,cancelable:!0}),t);return l&&d.preventDefault(),c&&n.dispatchEvent(d),d.defaultPrevented&&i&&i.preventDefault(),d}};function Zr(n,e={}){for(const[t,r]of Object.entries(e))try{n[t]=r}catch(s){Object.defineProperty(n,t,{configurable:!0,get(){return r}})}return n}function $o(n){if(n==="true")return!0;if(n==="false")return!1;if(n===Number(n).toString())return Number(n);if(n===""||n==="null")return null;if(typeof n!="string")return n;try{return JSON.parse(decodeURIComponent(n))}catch(e){return n}}function es(n){return n.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}const ht={setDataAttribute(n,e,t){n.setAttribute(`data-bs-${es(e)}`,t)},removeDataAttribute(n,e){n.removeAttribute(`data-bs-${es(e)}`)},getDataAttributes(n){if(!n)return{};const e={},t=Object.keys(n.dataset).filter(r=>r.startsWith("bs")&&!r.startsWith("bsConfig"));for(const r of t){let s=r.replace(/^bs/,"");
vendor: 11,511 bytes, line 37
37s=s.charAt(0).toLowerCase()+s.slice(1,s.length),e[s]=$o(n.dataset[r])}return e},getDataAttribute(n,e){return $o(n.getAttribute(`data-bs-${es(e)}`))}};class yn{static get Default(){return{}}static get DefaultType(){return{}}static get NAME(){throw new Error('You have to implement the static method "NAME", for each component!')}_getConfig(e){return e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e}_mergeConfigObj(e,t){const r=pt(t)?ht.getDataAttribute(t,"config"):{};return Le(Le(Le(Le({},this.constructor.Default),typeof r=="object"?r:{}),pt(t)?ht.getDataAttributes(t):{}),typeof e=="object"?e:{})}_typeCheckConfig(e,t=this.constructor.DefaultType){for(const[r,s]of Object.entries(t)){const o=e[r],i=pt(o)?"element":ul(o);if(!new RegExp(s).test(i))throw new TypeError(`${this.constructor.NAME.toUpperCase()}: Option "${r}" provided type "${i}" but expected type "${s}".`)}}}const yl="5.3.3";class Je extends yn{constructor(e,t){super(),e=At(e),e&&(this._element=e,this._config=this._getConfig(t),Yr.set(this._element,this.constructor.DATA_KEY,this))}dispose(){Yr.remove(this._element,this.constructor.DATA_KEY),b.off(this._element,this.constructor.EVENT_KEY);for(const e of Object.getOwnPropertyNames(this))this[e]=null}_queueCallback(e,t,r=!0){Mo(e,t,r)}_getConfig(e){return e=this._mergeConfigObj(e,this._element),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}static getInstance(e){return Yr.get(At(e),this.DATA_KEY)}static getOrCreateInstance(e,t={}){return this.getInstance(e)||new this(e,typeof t=="object"?t:null)}static get VERSION(){return yl}static get DATA_KEY(){return`bs.${this.NAME}`}static get EVENT_KEY(){return`.${this.DATA_KEY}`}static eventName(e){return`${e}${this.EVENT_KEY}`}}const ts=n=>{let e=n.getAttribute("data-bs-target");if(!e||e==="#"){let t=n.getAttribute("href");if(!t||!t.includes("#")&&!t.startsWith("."))return null;t.includes("#")&&!t.startsWith("#")&&(t=`#${t.split("#")[1]}`),e=t&&t!=="#"?t.trim():null}return e?e.split(",").map(t=>Ao(t)).join(","):null},q={find(n,e=document.documentElement){return[].concat(...Element.prototype.querySelectorAll.call(e,n))},findOne(n,e=document.documentElement){return Element.prototype.querySelector.call(e,n)},children(n,e){return[].concat(...n.children).filter(t=>t.matches(e))},parents(n,e){const t=[];let r=n.parentNode.closest(e);for(;r;)t.push(r),r=r.parentNode.closest(e);return t},prev(n,e){let t=n.previousElementSibling;for(;t;){if(t.matches(e))return[t];t=t.previousElementSibling}return[]},next(n,e){let t=n.nextElementSibling;for(;t;){if(t.matches(e))return[t];t=t.nextElementSibling}return[]},focusableChildren(n){const e=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map(t=>`${t}:not([tabindex^="-"])`).join(",");return this.find(e,n).filter(t=>!Tt(t)&&Xt(t))},getSelectorFromElement(n){const e=ts(n);return e&&q.findOne(e)?e:null},getElementFromSelector(n){const e=ts(n);return e?q.findOne(e):null},getMultipleElementsFromSelector(n){const e=ts(n);return e?q.find(e):[]}},zn=(n,e="hide")=>{const t=`click.dismiss${n.EVENT_KEY}`,r=n.NAME;b.on(document,t,`[data-bs-dismiss="${r}"]`,function(s){if(["A","AREA"].includes(this.tagName)&&s.preventDefault(),Tt(this))return;const o=q.getElementFromSelector(this)||this.closest(`.${r}`);n.getOrCreateInstance(o)[e]()})},wl="alert",qo=".bs.alert",Sl=`close${qo}`,Al=`closed${qo}`,Tl="fade",Cl="show";class wn extends Je{static get NAME(){return wl}close(){if(b.trigger(this._element,Sl).defaultPrevented)return;this._element.classList.remove(Cl);const t=this._element.classList.contains(Tl);this._queueCallback(()=>this._destroyElement(),this._element,t)}_destroyElement(){this._element.remove(),b.trigger(this._element,Al),this.dispose()}static jQueryInterface(e){return this.each(function(){const t=wn.getOrCreateInstance(this);if(typeof e=="string"){if(t[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);t[e](this)}})}}zn(wn,"close"),We(wn);const Ll="button",Ml=".bs.button",Ol=".data-api",Pl="active",Vo='[data-bs-toggle="button"]',kl=`click${Ml}${Ol}`;class Gn extends Je{static get NAME(){return Ll}toggle(){this._element.setAttribute("aria-pressed",this._element.classList.toggle(Pl))}static jQueryInterface(e){return this.each(function(){const t=Gn.getOrCreateInstance(this);e==="toggle"&&t[e]()})}}b.on(document,kl,Vo,n=>{n.preventDefault();const e=n.target.closest(Vo);Gn.getOrCreateInstance(e).toggle()}),We(Gn);const Dl="swipe",Jt=".bs.swipe",Nl=`touchstart${Jt}`,Il=`touchmove${Jt}`,Rl=`touchend${Jt}`,xl=`pointerdown${Jt}`,$l=`pointerup${Jt}`,ql="touch",Vl="pen",Fl="pointer-event",Ul=40,jl={endCallback:null,leftCallback:null,rightCallback:null},Hl={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"};class Qn extends yn{constructor(e,t){super(),this._element=e,!(!e||!Qn.isSupported())&&(this._config=this._getConfig(t),this._deltaX=0,this._supportPointerEvents=Boolean(window.PointerEvent),this._initEvents())}static get Default(){return jl}static get DefaultType(){return Hl}static get NAME(){return Dl}dispose(){b.off(this._element,Jt)}_start(e){if(!this._supportPointerEvents){this._deltaX=e.touches[0].clientX;return}this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX)}_end(e){this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX-this._deltaX),this._handleSwipe(),Ie(this._config.endCallback)}_move(e){this._deltaX=e.touches&&e.touches.length>1?0:e.touches[0].clientX-this._deltaX}_handleSwipe(){const e=Math.abs(this._deltaX);if(e<=Ul)return;const t=e/this._deltaX;this._deltaX=0,t&&Ie(t>0?this._config.rightCallback:this._config.leftCallback)}_initEvents(){this._supportPointerEvents?(b.on(this._element,xl,e=>this._start(e)),b.on(this._element,$l,e=>this._end(e)),this._element.classList.add(Fl)):(b.on(this._element,Nl,e=>this._start(e)),b.on(this._element,Il,e=>this._move(e)),b.on(this._element,Rl,e=>this._end(e)))}_eventIsPointerPenTouch(e){return this._supportPointerEvents&&(e.pointerType===Vl||e.pointerType===ql)}static isSupported(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}const Bl="carousel",Ct=".bs.carousel",Fo=".data-api",Wl="ArrowLeft",Kl="ArrowRight",Yl=500,Sn="next",Zt="prev",en="left",Xn="right",zl=`slide${Ct}`,ns=`slid${Ct}`,Gl=`keydown${Ct}`,Ql=`mouseenter${Ct}`,Xl=`mouseleave${Ct}`,Jl=`dragstart${Ct}`,Zl=`load${Ct}${Fo}`,eu=`click${Ct}${Fo}`,Uo="carousel",Jn="active",tu="slide",nu="carousel-item-end",ru="carousel-item-start",su="carousel-item-next",ou="carousel-item-prev",jo=".active",Ho=".carousel-item",iu=jo+Ho,au=".carousel-item img",cu=".carousel-indicators",lu="[data-bs-slide], [data-bs-slide-to]",uu='[data-bs-ride="carousel"]',du={[Wl]:Xn,[Kl]:en},fu={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},pu={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"};class $t extends Je{constructor(e,t){super(e,t),this._interval=null,this._activeElement=null,this._isSliding=!1,this.touchTimeout=null,this._swipeHelper=null,this._indicatorsElement=q.findOne(cu,this._element),this._addEventListeners(),this._config.ride===Uo&&this.cycle()}static get Default(){return fu}static get DefaultType(){return pu}static get NAME(){return Bl}next(){this._slide(Sn)}nextWhenVisible(){!document.hidden&&Xt(this._element)&&this.next()}prev(){this._slide(Zt)}pause(){this._isSliding&&To(this._element),this._clearInterval()}cycle(){this._clearInterval(),this._updateInterval(),this._interval=setInterval(()=>this.nextWhenVisible(),this._config.interval)}_maybeEnableCycle(){if(this._config.ride){if(this._isSliding){b.one(this._element,ns,()=>this.cycle());return}this.cycle()}}to(e){const t=this._getItems();if(e>t.length-1||e<0)return;if(this._isSliding){b.one(this._element,ns,()=>this.to(e));return}const r=this._getItemIndex(this._getActive());if(r===e)return;const s=e>r?Sn:Zt;this._slide(s,t[e])}dispose(){this._swipeHelper&&this._swipeHelper.dispose(),super.dispose()}_configAfterMerge(e){return e.defaultInterval=e.interval,e}_addEventListeners(){this._config.keyboard&&b.on(this._element,Gl,e=>this._keydown(e)),this._config.pause==="hover"&&(b.on(this._element,Ql,()=>this.pause()),b.on(this._element,Xl,()=>this._maybeEnableCycle())),this._config.touch&&Qn.isSupported()&&this._addTouchEventListeners()}_addTouchEventListeners(){for(const r of q.find(au,this._element))b.on(r,Jl,s=>s.preventDefault());const t={leftCallback:()=>this._slide(this._directionToOrder(en)),rightCallback:()=>this._slide(this._directionToOrder(Xn)),endCallback:()=>{this._config.pause==="hover"&&(this.pause(),this.touchTimeout&&clearTimeout(this.touchTimeout),this.touchTimeout=setTimeout(()=>this._maybeEnableCycle(),Yl+this._config.interval))}};this._swipeHelper=new Qn(this._element,t)}_keydown(e){if(/input|textarea/i.test(e.target.tagName))return;const t=du[e.key];t&&(e.preventDefault(),this._slide(this._directionToOrder(t)))}_getItemIndex(e){return this._getItems().indexOf(e)}_setActiveIndicatorElement(e){if(!this._indicatorsElement)return;const t=q.findOne(jo,this._indicatorsElement);t.classList.remove(Jn),t.removeAttribute("aria-current");const r=q.findOne(`[data-bs-slide-to="${e}"]`,this._indicatorsElement);r&&(r.classList.add(Jn),r.setAttribute("aria-current","true"))}_updateInterval(){const e=this._activeElement||this._getActive();if(!e)return;const t=Number.parseInt(e.getAttribute("data-bs-interval"),10);this._config.interval=t||this._config.defaultInterval}_slide(e,t=null){if(this._isSliding)return;const r=this._getActive(),s=e===Sn,o=t||Qr(this._getItems(),r,s,this._config.wrap);if(o===r)return;const i=this._getItemIndex(o),a=m=>b.trigger(this._element,m,{relatedTarget:o,direction:this._orderToDirection(e),from:this._getItemIndex(r),to:i});if(a(zl).defaultPrevented||!r||!o)return;const l=Boolean(this._interval);this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(i),this._activeElement=o;const d=s?ru:nu,g=s?su:ou;o.classList.add(g),bn(o),r.classList.add(d),o.classList.add(d);const v=()=>{o.classList.remove(d,g),o.classList.add(Jn),r.classList.remove(Jn,g,d),this._isSliding=!1,a(ns)};this._queueCallback(v,r,this._isAnimated()),l&&this.cycle()}_isAnimated(){return this._element.classList.contains(tu)}_getActive(){return q.findOne(iu,this._element)}_getItems(){return q.find(Ho,this._element)}_clearInterval(){this._interval&&(clearInterval(this._interval),this._interval=null)}_directionToOrder(e){return Be()?e===en?Zt:Sn:e===en?Sn:Zt}_orderToDirection(e){return Be()?e===Zt?en:Xn:e===Zt?Xn:en}static jQueryInterface(e){return this.each(function(){const t=$t.getOrCreateInstance(this,e);if(typeof e=="number"){t.to(e);return}if(typeof e=="string"){if(t[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);t[e]()}})}}b.on(document,eu,lu,function(n){const e=q.getElementFromSelector(this);if(!e||!e.classList.contains(Uo))return;n.preventDefault();const t=$t.getOrCreateInstance(e),r=this.getAttribute("data-bs-slide-to");if(r){t.to(r),t._maybeEnableCycle();return}if(ht.getDataAttribute(this,"slide")==="next"){t.next(),t._maybeEnableCycle();return}t.prev(),t._maybeEnableCycle()}),b.on(window,Zl,()=>{const n=q.find(uu);for(const e of n)$t.getOrCreateInstance(e)}),We($t);const hu="collapse",An=".bs.collapse",mu=".data-api",vu=`show${An}`,gu=`shown${An}`,_u=`hide${An}`,Eu=`hidden${An}`,bu=`click${An}${mu}
37`,rs="show",tn="collapse",Zn="collapsing",yu="collapsed",wu=`:scope .${tn} .${tn}`,Su="collapse-horizontal",Au="width",Tu="height",Cu=".collapse.show, .collapse.collapsing",ss='[data-bs-toggle="collapse"]',Lu={parent:null,toggle:!0},Mu={parent:"(null|element)",toggle:"boolean"};class nn extends Je{constructor(e,t){super(e,t),this._isTransitioning=!1,this._triggerArray=[];const r=q.find(ss);for(const s of r){const o=q.getSelectorFromElement(s),i=q.find(o).filter(a=>a===this._element);o!==null&&i.length&&this._triggerArray.push(s)}this._initializeChildren(),this._config.parent||this._addAriaAndCollapsedClass(this._triggerArray,this._isShown()),this._config.toggle&&this.toggle()}static get Default(){return Lu}static get DefaultType(){return Mu}static get NAME(){return hu}toggle(){this._isShown()?this.hide():this.show()}show(){if(this._isTransitioning||this._isShown())return;let e=[];if(this._config.parent&&(e=this._getFirstLevelChildren(Cu).filter(a=>a!==this._element).map(a=>nn.getOrCreateInstance(a,{toggle:!1}))),e.length&&e[0]._isTransitioning||b.trigger(this._element,vu).defaultPrevented)return;for(const a of e)a.hide();const r=this._getDimension();this._element.classList.remove(tn),this._element.classList.add(Zn),this._element.style[r]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;const s=()=>{this._isTransitioning=!1,this._element.classList.remove(Zn),this._element.classList.add(tn,rs),this._element.style[r]="",b.trigger(this._element,gu)},i=`scroll${r[0].toUpperCase()+r.slice(1)}`;this._queueCallback(s,this._element,!0),this._element.style[r]=`${this._element[i]}px`}hide(){if(this._isTransitioning||!this._isShown()||b.trigger(this._element,_u).defaultPrevented)return;const t=this._getDimension();this._element.style[t]=`${this._element.getBoundingClientRect()[t]}px`,bn(this._element),this._element.classList.add(Zn),this._element.classList.remove(tn,rs);for(const s of this._triggerArray){const o=q.getElementFromSelector(s);o&&!this._isShown(o)&&this._addAriaAndCollapsedClass([s],!1)}this._isTransitioning=!0;const r=()=>{this._isTransitioning=!1,this._element.classList.remove(Zn),this._element.classList.add(tn),b.trigger(this._element,Eu)};this._element.style[t]="",this._queueCallback(r,this._element,!0)}_isShown(e=this._element){return e.classList.contains(rs)}_configAfterMerge(e){return e.toggle=Boolean(e.toggle),e.parent=At(e.parent),e}_getDimension(){return this._element.classList.contains(Su)?Au:Tu}_initializeChildren(){if(!this._config.parent)return;const e=this._getFirstLevelChildren(ss);for(const t of e){const r=q.getElementFromSelector(t);r&&this._addAriaAndCollapsedClass([t],this._isShown(r))}}_getFirstLevelChildren(e){const t=q.find(wu,this._config.parent);return q.find(e,this._config.parent).filter(r=>!t.includes(r))}_addAriaAndCollapsedClass(e,t){if(e.length)for(const r of e)r.classList.toggle(yu,!t),r.setAttribute("aria-expanded",t)}static jQueryInterface(e){const t={};return typeof e=="string"&&/show|hide/.test(e)&&(t.toggle=!1),this.each(function(){const r=nn.getOrCreateInstance(this,t);if(typeof e=="string"){if(typeof r[e]=="undefined")throw new TypeError(`No method named "${e}"`);r[e]()}})}}b.on(document,bu,ss,function(n){(n.target.tagName==="A"||n.delegateTarget&&n.delegateTarget.tagName==="A")&&n.preventDefault();for(const e of q.getMultipleElementsFromSelector(this))nn.getOrCreateInstance(e,{toggle:!1}).toggle()}),We(nn);const Bo="dropdown",qt=".bs.dropdown",os=".data-api",Ou="Escape",Wo="Tab",Pu="ArrowUp",Ko="ArrowDown",ku=2,Du=`hide${qt}`,Nu=`hidden${qt}`,Iu=`show${qt}`,Ru=`shown${qt}`,Yo=`click${qt}${os}`,zo=`keydown${qt}${os}`,xu=`keyup${qt}${os}`,rn="show",$u="dropup",qu="dropend",Vu="dropstart",Fu="dropup-center",Uu="dropdown-center",Vt='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',ju=`${Vt}.${rn}`,er=".dropdown-menu",Hu=".navbar",Bu=".navbar-nav",Wu=".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",Ku=Be()?"top-end":"top-start",Yu=Be()?"top-start":"top-end",zu=Be()?"bottom-end":"bottom-start",Gu=Be()?"bottom-start":"bottom-end",Qu=Be()?"left-start":"right-start",Xu=Be()?"right-start":"left-start",Ju="top",Zu="bottom",ed={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},td={autoClose:"(boolean|string)",boundary:"(string|element)",display:"str
37ing",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"};class ct extends Je{constructor(e,t){super(e,t),this._popper=null,this._parent=this._element.parentNode,this._menu=q.next(this._element,er)[0]||q.prev(this._element,er)[0]||q.findOne(er,this._parent),this._inNavbar=this._detectNavbar()}static get Default(){return ed}static get DefaultType(){return td}static get NAME(){return Bo}toggle(){return this._isShown()?this.hide():this.show()}show(){if(Tt(this._element)||this._isShown())return;const e={relatedTarget:this._element};if(!b.trigger(this._element,Iu,e).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(Bu))for(const r of[].concat(...document.body.children))b.on(r,"mouseover",Yn);this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(rn),this._element.classList.add(rn),b.trigger(this._element,Ru,e)}}hide(){if(Tt(this._element)||!this._isShown())return;const e={relatedTarget:this._element};this._completeHide(e)}dispose(){this._popper&&this._popper.destroy(),super.dispose()}update(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}_completeHide(e){if(!b.trigger(this._element,Du,e).defaultPrevented){if("ontouchstart"in document.documentElement)for(const r of[].concat(...document.body.children))b.off(r,"mouseover",Yn);this._popper&&this._popper.destroy(),this._menu.classList.remove(rn),this._element.classList.remove(rn),this._element.setAttribute("aria-expanded","false"),ht.removeDataAttribute(this._menu,"popper"),b.trigger(this._element,Nu,e)}}_getConfig(e){if(e=super._getConfig(e),typeof e.reference=="object"&&!pt(e.reference)&&typeof e.reference.getBoundingClientRect!="function")throw new TypeError(`${Bo.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`);return e}_createPopper(){if(typeof J=="undefined")throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org)");let e=this._element;this._config.reference==="parent"?e=this._parent:pt(this._config.reference)?e=At(this._config.reference):typeof this._config.reference=="object"&&(e=this._config.reference);const t=this._getPopperConfig();this._popper=Kr(e,this._menu,t)}_isShown(){return this._menu.classList.contains(rn)}_getPlacement(){const e=this._parent;if(e.classList.contains(qu))return Qu;if(e.classList.contains(Vu))return Xu;if(e.classList.contains(Fu))return Ju;if(e.classList.contains(Uu))return Zu;const t=getComputedStyle(this._menu).getPropertyValue("--bs-position").trim()==="end";return e.classList.contains($u)?t?Yu:Ku:t?Gu:zu}_detectNavbar(){return this._element.closest(Hu)!==null}_getOffset(){const{offset:e}=this._config;return typeof e=="string"?e.split(",").map(t=>Number.parseInt(t,10)):typeof e=="function"?t=>e(t,this._element):e}_getPopperConfig(){const e={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||this._config.display==="static")&&(ht.setDataAttribute(this._menu,"popper","static"),e.modifiers=[{name:"applyStyles",enabled:!1}]),Le(Le({},e),Ie(this._config.popperConfig,[e]))}_selectMenuItem({key:e,target:t}){const r=q.find(Wu,this._menu).filter(s=>Xt(s));r.length&&Qr(r,t,e===Ko,!r.includes(t)).focus()}static jQueryInterface(e){return this.each(function(){const t=ct.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof t[e]=="undefined")throw new TypeError(`No method named "${e}"`);t[e]()}})}static clearMenus(e){if(e.button===ku||e.type==="keyup"&&e.key!==Wo)return;const t=q.find(ju);for(const r of t){const s=ct.getInstance(r);if(!s||s._config.autoClose===!1)continue;const o=e.composedPath(),i=o.includes(s._menu);if(o.includes(s._element)||s._config.autoClose==="inside"&&!i||s._config.autoClose==="outside"&&i||s._menu.contains(e.target)&&(e.type==="keyup"&&e.key===Wo||/input|select|option|textarea|form/i.test(e.target.tagName)))continue;const a={relatedTarget:s._element};e.type==="click"&&(a.clickEvent=e),s._completeHide(a)}}static dataApiKeydownHandler(e){const t=/input|textarea/i.test(e.target.tagName),r=e.key===Ou,s=[Pu,Ko].includes(e.ke
vendor: 8,737 bytes, line 37
37y);if(!s&&!r||t&&!r)return;e.preventDefault();const o=this.matches(Vt)?this:q.prev(this,Vt)[0]||q.next(this,Vt)[0]||q.findOne(Vt,e.delegateTarget.parentNode),i=ct.getOrCreateInstance(o);if(s){e.stopPropagation(),i.show(),i._selectMenuItem(e);return}i._isShown()&&(e.stopPropagation(),i.hide(),o.focus())}}b.on(document,zo,Vt,ct.dataApiKeydownHandler),b.on(document,zo,er,ct.dataApiKeydownHandler),b.on(document,Yo,ct.clearMenus),b.on(document,xu,ct.clearMenus),b.on(document,Yo,Vt,function(n){n.preventDefault(),ct.getOrCreateInstance(this).toggle()}),We(ct);const Go="backdrop",nd="fade",Qo="show",Xo=`mousedown.bs.${Go}`,rd={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},sd={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"};class Jo extends yn{constructor(e){super(),this._config=this._getConfig(e),this._isAppended=!1,this._element=null}static get Default(){return rd}static get DefaultType(){return sd}static get NAME(){return Go}show(e){if(!this._config.isVisible){Ie(e);return}this._append();const t=this._getElement();this._config.isAnimated&&bn(t),t.classList.add(Qo),this._emulateAnimation(()=>{Ie(e)})}hide(e){if(!this._config.isVisible){Ie(e);return}this._getElement().classList.remove(Qo),this._emulateAnimation(()=>{this.dispose(),Ie(e)})}dispose(){this._isAppended&&(b.off(this._element,Xo),this._element.remove(),this._isAppended=!1)}_getElement(){if(!this._element){const e=document.createElement("div");e.className=this._config.className,this._config.isAnimated&&e.classList.add(nd),this._element=e}return this._element}_configAfterMerge(e){return e.rootElement=At(e.rootElement),e}_append(){if(this._isAppended)return;const e=this._getElement();this._config.rootElement.append(e),b.on(e,Xo,()=>{Ie(this._config.clickCallback)}),this._isAppended=!0}_emulateAnimation(e){Mo(e,this._getElement(),this._config.isAnimated)}}const od="focustrap",tr=".bs.focustrap",id=`focusin${tr}`,ad=`keydown.tab${tr}`,cd="Tab",ld="forward",Zo="backward",ud={autofocus:!0,trapElement:null},dd={autofocus:"boolean",trapElement:"element"};class ei extends yn{constructor(e){super(),this._config=this._getConfig(e),this._isActive=!1,this._lastTabNavDirection=null}static get Default(){return ud}static get DefaultType(){return dd}static get NAME(){return od}activate(){this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),b.off(document,tr),b.on(document,id,e=>this._handleFocusin(e)),b.on(document,ad,e=>this._handleKeydown(e)),this._isActive=!0)}deactivate(){this._isActive&&(this._isActive=!1,b.off(document,tr))}_handleFocusin(e){const{trapElement:t}=this._config;if(e.target===document||e.target===t||t.contains(e.target))return;const r=q.focusableChildren(t);r.length===0?t.focus():this._lastTabNavDirection===Zo?r[r.length-1].focus():r[0].focus()}_handleKeydown(e){e.key===cd&&(this._lastTabNavDirection=e.shiftKey?Zo:ld)}}const ti=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",ni=".sticky-top",nr="padding-right",ri="margin-right";class is{constructor(){this._element=document.body}getWidth(){const e=document.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}hide(){const e=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,nr,t=>t+e),this._setElementAttributes(ti,nr,t=>t+e),this._setElementAttributes(ni,ri,t=>t-e)}reset(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,nr),this._resetElementAttributes(ti,nr),this._resetElementAttributes(ni,ri)}isOverflowing(){return this.getWidth()>0}_disableOverFlow(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}_setElementAttributes(e,t,r){const s=this.getWidth(),o=i=>{if(i!==this._element&&window.innerWidth>i.clientWidth+s)return;this._saveInitialAttribute(i,t);const a=window.getComputedStyle(i).getPropertyValue(t);i.style.setProperty(t,`${r(Number.parseFloat(a))}px`)};this._applyManipulationCallback(e,o)}_saveInitialAttribute(e,t){const r=e.style.getPropertyValue(t);r&&ht.setDataAttribute(e,t,r)}_resetElementAttributes(e,t){const r=s=>{const o=ht.getDataAttribute(s,t);if(o===null){s.style.removeProperty(t);return}ht.removeDataAttribute(s,t),s.style.setProperty(t,o)};this._applyManipulationCallback(e,r)}_applyManipulationCallback(e,t){if(pt(e)){t(e);return}for(const r of q.find(e,this._element))t(r)}}const fd="modal",Ke=".bs.modal",pd=".data-api",hd="Escape",md=`hide${Ke}`,vd=`hidePrevented${Ke}`,si=`hidden${Ke}`,oi=`show${Ke}`,gd=`shown${Ke}`,_d=`resize${Ke}`,Ed=`click.dismiss${Ke}`,bd=`mousedown.dismiss${Ke}`,yd=`keydown.dismiss${Ke}`,wd=`click${Ke}${pd}`,ii="modal-open",Sd="fade",ai="show",as="modal-static",Ad=".modal.show",Td=".modal-dialog",Cd=".modal-body",Ld='[data-bs-toggle="modal"]',Md={backdrop:!0,focus:!0,keyboard:!0},Od={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"};class be extends Je{constructor(e,t){super(e,t),this._dialog=q.findOne(Td,this._element),this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._isShown=!1,this._isTransitioning=!1,this._scrollBar=new is,this._addEventListeners()}static get Default(){return Md}static get DefaultType(){return Od}static get NAME(){return fd}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){this._isShown||this._isTransitioning||b.trigger(this._element,oi,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(ii),this._adjustDialog(),this._backdrop.show(()=>this._showElement(e)))}hide(){!this._isShown||this._isTransitioning||b.trigger(this._element,md).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(ai),this._queueCallback(()=>this._hideModal(),this._element,this._isAnimated()))}dispose(){b.off(window,Ke),b.off(this._dialog,Ke),this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}handleUpdate(){this._adjustDialog()}_initializeBackDrop(){return new Jo({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}_initializeFocusTrap(){return new ei({trapElement:this._element})}_showElement(e){document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;const t=q.findOne(Cd,this._dialog);t&&(t.scrollTop=0),bn(this._element),this._element.classList.add(ai);const r=()=>{this._config.focus&&this._focustrap.activate(),this._isTransitioning=!1,b.trigger(this._element,gd,{relatedTarget:e})};this._queueCallback(r,this._dialog,this._isAnimated())}_addEventListeners(){b.on(this._element,yd,e=>{if(e.key===hd){if(this._config.keyboard){this.hide();return}this._triggerBackdropTransition()}}),b.on(window,_d,()=>{this._isShown&&!this._isTransitioning&&this._adjustDialog()}),b.on(this._element,bd,e=>{b.one(this._element,Ed,t=>{if(!(this._element!==e.target||this._element!==t.target)){if(this._config.backdrop==="static"){this._triggerBackdropTransition();return}this._config.backdrop&&this.hide()}})})}_hideModal(){this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide(()=>{document.body.classList.remove(ii),this._resetAdjustments(),this._scrollBar.reset(),b.trigger(this._element,si)})}_isAnimated(){return this._element.classList.contains(Sd)}_triggerBackdropTransition(){if(b.trigger(this._element,vd).defaultPrevented)return;const t=this._element.scrollHeight>document.documentElement.clientHeight,r=this._element.style.overflowY;r==="hidden"||this._element.classList.contains(as)||(t||(this._element.style.overflowY="hidden"),this._element.classList.add(as),this._queueCallback(()=>{this._element.classList.remove(as),this._queueCallback(()=>{this._element.style.overflowY=r},this._dialog)},this._dialog),this._element.focus())}_adjustDialog(){const e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._scrollBar.getWidth(),r=t>0;if(r&&!e){const s=Be()?"paddingLeft":"paddingRight";this._element.style[s]=`${t}px`}if(!r&&e){const s=Be()?"paddingRight":"paddingLeft";this._element.style[s]=`${t}px`}}_resetAdjustments(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}static jQueryInterface(e,t){return this.each(function(){const r=be.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof r[e]=="undefined")throw new TypeError(`No method n
37amed "${e}"`);r[e](t)}})}}b.on(document,wd,Ld,function(n){const e=q.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&n.preventDefault(),b.one(e,oi,s=>{s.defaultPrevented||b.one(e,si,()=>{Xt(this)&&this.focus()})});const t=q.findOne(Ad);t&&be.getInstance(t).hide(),be.getOrCreateInstance(e).toggle(this)}),zn(be),We(be);const Pd="offcanvas",mt=".bs.offcanvas",ci=".data-api",kd=`load${mt}${ci}`,Dd="Escape",li="show",ui="showing",di="hiding",Nd="offcanvas-backdrop",fi=".offcanvas.show",Id=`show${mt}`,Rd=`shown${mt}`,xd=`hide${mt}`,pi=`hidePrevented${mt}`,hi=`hidden${mt}`,$d=`resize${mt}`,qd=`click${mt}${ci}`,Vd=`keydown.dismiss${mt}`,Fd='[data-bs-toggle="offcanvas"]',Ud={backdrop:!0,keyboard:!0,scroll:!1},jd={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"};class vt extends Je{constructor(e,t){super(e,t),this._isShown=!1,this._backdrop=this._initializeBackDrop(),this._focustrap=this._initializeFocusTrap(),this._addEventListeners()}static get Default(){return Ud}static get DefaultType(){return jd}static get NAME(){return Pd}toggle(e){return this._isShown?this.hide():this.show(e)}show(e){if(this._isShown||b.trigger(this._element,Id,{relatedTarget:e}).defaultPrevented)return;this._isShown=!0,this._backdrop.show(),this._config.scroll||new is().hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(ui);const r=()=>{(!this._config.scroll||this._config.backdrop)&&this._focustrap.activate(),this._element.classList.add(li),this._element.classList.remove(ui),b.trigger(this._element,Rd,{relatedTarget:e})};this._queueCallback(r,this._element,!0)}hide(){if(!this._isShown||b.trigger(this._element,xd).defaultPrevented)return;this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(di),this._backdrop.hide();const t=()=>{this._element.classList.remove(li,di),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._config.scroll||new is().reset(),b.trigger(this._element,hi)};this._queueCallback(t,this._element,!0)}dispose(){this._backdrop.dispose(),this._focustrap.deactivate(),super.dispose()}_initializeBackDrop(){const e=()=>{if(this._config.backdrop==="static"){b.trigger(this._element,pi);return}this.hide()},t=Boolean(this._config.backdrop);return new Jo({className:Nd,isVisible:t,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:t?e:null})}_initializeFocusTrap(){return new ei({trapElement:this._element})}_addEventListeners(){b.on(this._element,Vd,e=>{if(e.key===Dd){if(this._config.keyboard){this.hide();return}b.trigger(this._element,pi)}})}static jQueryInterface(e){return this.each(function(){const t=vt.getOrCreateInstance(this,e);if(typeof e=="string"){if(t[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);t[e](this)}})}}b.on(document,qd,Fd,function(n){const e=q.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&n.preventDefault(),Tt(this))return;b.one(e,hi,()=>{Xt(this)&&this.focus()});const t=q.findOne(fi);t&&t!==e&&vt.getInstance(t).hide(),vt.getOrCreateInstance(e).toggle(this)}),b.on(window,kd,()=>{for(const n of q.find(fi))vt.getOrCreateInstance(n).show()}),b.on(window,$d,()=>{for(const n of q.find("[aria-modal][class*=show][class*=offcanvas-]"))getComputedStyle(n).position!=="fixed"&&vt.getOrCreateInstance(n).hide()}),zn(vt),We(vt);const mi={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],dd:[],div:[],dl:[],dt:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},Hd=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),Bd=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,Wd=(n,e)=>{const t=n.nodeName.toLowerCase();return e.includes(t)?Hd.has(t)?Boolean(Bd.test(n.nodeValue)):!0:e.filter(r=>r instanceof RegExp).some(r=>r.test(t))};function Kd(n,e,t){if(!n.length)return n;if(t&&typeof t=="function")return t(n);const s=new window.DOMParser().parseFromString(n,"text/html"),o=[].concat(...s.body.querySelectorAll("*"));for(const i of o){const a=i.nodeName.toLowerCase();if(!Object.keys(e).includes(a)){i.remove();continue}const c=[].concat(...i.attributes),l=[].concat(e["*"]||[],e[a]||[]);for(const d of c)Wd(d,l)||i.removeAttribute(d.nodeName)}return s.body.innerHTML}const Yd="TemplateFactory",zd={allowList:mi,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"<div></div>"},Gd={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},Qd={entry:"(string|element|function|null)",selector:"(string|element)"};class Xd extends yn{constructor(e){super(),this._config=this._getConfig(e)}static get Default(){return zd}static get DefaultType(){return Gd}static get NAME(){return Yd}getContent(){return Object.values(this._config.content).map(e=>
vendor: 4,419 bytes, line 37
37this._resolvePossibleFunction(e)).filter(Boolean)}hasContent(){return this.getContent().length>0}changeContent(e){return this._checkContent(e),this._config.content=Le(Le({},this._config.content),e),this}toHtml(){const e=document.createElement("div");e.innerHTML=this._maybeSanitize(this._config.template);for(const[s,o]of Object.entries(this._config.content))this._setContent(e,o,s);const t=e.children[0],r=this._resolvePossibleFunction(this._config.extraClass);return r&&t.classList.add(...r.split(" ")),t}_typeCheckConfig(e){super._typeCheckConfig(e),this._checkContent(e.content)}_checkContent(e){for(const[t,r]of Object.entries(e))super._typeCheckConfig({selector:t,entry:r},Qd)}_setContent(e,t,r){const s=q.findOne(r,e);if(s){if(t=this._resolvePossibleFunction(t),!t){s.remove();return}if(pt(t)){this._putElementInTemplate(At(t),s);return}if(this._config.html){s.innerHTML=this._maybeSanitize(t);return}s.textContent=t}}_maybeSanitize(e){return this._config.sanitize?Kd(e,this._config.allowList,this._config.sanitizeFn):e}_resolvePossibleFunction(e){return Ie(e,[this])}_putElementInTemplate(e,t){if(this._config.html){t.innerHTML="",t.append(e);return}t.textContent=e.textContent}}const Jd="tooltip",Zd=new Set(["sanitize","allowList","sanitizeFn"]),cs="fade",ef="modal",rr="show",tf=".tooltip-inner",vi=`.${ef}`,gi="hide.bs.modal",Tn="hover",ls="focus",nf="click",rf="manual",sf="hide",of="hidden",af="show",cf="shown",lf="inserted",uf="click",df="focusin",ff="focusout",pf="mouseenter",hf="mouseleave",mf={AUTO:"auto",TOP:"top",RIGHT:Be()?"left":"right",BOTTOM:"bottom",LEFT:Be()?"right":"left"},vf={allowList:mi,animation:!0,boundary:"clippingParents",container:!1,customClass:"",delay:0,fallbackPlacements:["top","right","bottom","left"],html:!1,offset:[0,6],placement:"top",popperConfig:null,sanitize:!0,sanitizeFn:null,selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',title:"",trigger:"hover focus"},gf={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"};class sn extends Je{constructor(e,t){if(typeof J=="undefined")throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");super(e,t),this._isEnabled=!0,this._timeout=0,this._isHovered=null,this._activeTrigger={},this._popper=null,this._templateFactory=null,this._newContent=null,this.tip=null,this._setListeners(),this._config.selector||this._fixTitle()}static get Default(){return vf}static get DefaultType(){return gf}static get NAME(){return Jd}enable(){this._isEnabled=!0}disable(){this._isEnabled=!1}toggleEnabled(){this._isEnabled=!this._isEnabled}toggle(){if(this._isEnabled){if(this._activeTrigger.click=!this._activeTrigger.click,this._isShown()){this._leave();return}this._enter()}}dispose(){clearTimeout(this._timeout),b.off(this._element.closest(vi),gi,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),super.dispose()}show(){if(this._element.style.display==="none")throw new Error("Please use show on visible elements");if(!(this._isWithContent()&&this._isEnabled))return;const e=b.trigger(this._element,this.constructor.eventName(af)),r=(Co(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(e.defaultPrevented||!r)return;this._disposePopper();const s=this._getTipElement();this._element.setAttribute("aria-describedby",s.getAttribute("id"));const{container:o}=this._config;if(this._element.ownerDocument.documentElement.contains(this.tip)||(o.append(s),b.trigger(this._element,this.constructor.eventName(lf))),this._popper=this._createPopper(s),s.classList.add(rr),"ontouchstart"in document.documentElement)for(const a of[].concat(...document.body.children))b.on(a,"mouseover",Yn);const i=()=>{b.trigger(this._element,this.constructor.eventName(cf)),this._isHovered===!1&&this._leave(),this._isHovered=!1};this._queueCallback(i,this.tip,this._isAnimated())}
vendor: 5,287 bytes, line 37
37hide(){if(!this._isShown()||b.trigger(this._element,this.constructor.eventName(sf)).defaultPrevented)return;if(this._getTipElement().classList.remove(rr),"ontouchstart"in document.documentElement)for(const s of[].concat(...document.body.children))b.off(s,"mouseover",Yn);this._activeTrigger[nf]=!1,this._activeTrigger[ls]=!1,this._activeTrigger[Tn]=!1,this._isHovered=null;const r=()=>{this._isWithActiveTrigger()||(this._isHovered||this._disposePopper(),this._element.removeAttribute("aria-describedby"),b.trigger(this._element,this.constructor.eventName(of)))};this._queueCallback(r,this.tip,this._isAnimated())}update(){this._popper&&this._popper.update()}_isWithContent(){return Boolean(this._getTitle())}_getTipElement(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}_createTipElement(e){const t=this._getTemplateFactory(e).toHtml();if(!t)return null;t.classList.remove(cs,rr),t.classList.add(`bs-${this.constructor.NAME}-auto`);const r=dl(this.constructor.NAME).toString();return t.setAttribute("id",r),this._isAnimated()&&t.classList.add(cs),t}setContent(e){this._newContent=e,this._isShown()&&(this._disposePopper(),this.show())}_getTemplateFactory(e){return this._templateFactory?this._templateFactory.changeContent(e):this._templateFactory=new Xd(Lr(Le({},this._config),{content:e,extraClass:this._resolvePossibleFunction(this._config.customClass)})),this._templateFactory}_getContentForTemplate(){return{[tf]:this._getTitle()}}_getTitle(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}_initializeOnDelegatedTarget(e){return this.constructor.getOrCreateInstance(e.delegateTarget,this._getDelegateConfig())}_isAnimated(){return this._config.animation||this.tip&&this.tip.classList.contains(cs)}_isShown(){return this.tip&&this.tip.classList.contains(rr)}_createPopper(e){const t=Ie(this._config.placement,[this,e,this._element]),r=mf[t.toUpperCase()];return Kr(this._element,e,this._getPopperConfig(r))}_getOffset(){const{offset:e}=this._config;return typeof e=="string"?e.split(",").map(t=>Number.parseInt(t,10)):typeof e=="function"?t=>e(t,this._element):e}_resolvePossibleFunction(e){return Ie(e,[this._element])}_getPopperConfig(e){const t={placement:e,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:`.${this.constructor.NAME}-arrow`}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:r=>{this._getTipElement().setAttribute("data-popper-placement",r.state.placement)}}]};return Le(Le({},t),Ie(this._config.popperConfig,[t]))}_setListeners(){const e=this._config.trigger.split(" ");for(const t of e)if(t==="click")b.on(this._element,this.constructor.eventName(uf),this._config.selector,r=>{this._initializeOnDelegatedTarget(r).toggle()});else if(t!==rf){const r=t===Tn?this.constructor.eventName(pf):this.constructor.eventName(df),s=t===Tn?this.constructor.eventName(hf):this.constructor.eventName(ff);b.on(this._element,r,this._config.selector,o=>{const i=this._initializeOnDelegatedTarget(o);i._activeTrigger[o.type==="focusin"?ls:Tn]=!0,i._enter()}),b.on(this._element,s,this._config.selector,o=>{const i=this._initializeOnDelegatedTarget(o);i._activeTrigger[o.type==="focusout"?ls:Tn]=i._element.contains(o.relatedTarget),i._leave()})}this._hideModalHandler=()=>{this._element&&this.hide()},b.on(this._element.closest(vi),gi,this._hideModalHandler)}_fixTitle(){const e=this._element.getAttribute("title");e&&(!this._element.getAttribute("aria-label")&&!this._element.textContent.trim()&&this._element.setAttribute("aria-label",e),this._element.setAttribute("data-bs-original-title",e),this._element.removeAttribute("title"))}_enter(){if(this._isShown()||this._isHovered){this._isHovered=!0;return}this._isHovered=!0,this._setTimeout(()=>{this._isHovered&&this.show()},this._config.delay.show)}_leave(){this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout(()=>{this._isHovered||this.hide()},this._config.delay.hide))}_setTimeout(e,t){clearTimeout(this._timeout),this._timeout=setTimeout(e,t)}_isWithActiveTrigger(){return Object.values(this._activeTrigger).includes(!0)}_getConfig(e){const t=ht.getDataAttributes(this._element);for(const r of Object.keys(t))Zd.has(r)&&delete t[r];return e=Le(Le({},t),typeof e=="object"&&e?e:{}),e=this._mergeConfigObj(e),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}_configAfterMerge(e){return e.container=e.container===!1?document.body:At(e.container),typeof e.delay=="number"&&(e.delay={show:e.delay,hide:e.delay}),typeof e.title=="number"&&(e.title=e.title.toString()),typeof e.content=="number"&&(e.content=e.content.toString()),e}_getDelegateConfig(){const e={};for(const[t,r]of Object.entries(this._config))this.constructor.Default[t]!==r&&(e[t]=r);return e.selector=!1,e.trigger="manual",e}_disposePopper(){this._popper&&(this._popper.destroy(),this._popper=null),this.tip&&(this.tip.remove(),this.tip=null)}static jQueryInterface(e){return this.each(function(){const t=sn.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof t[e]=="undefined")throw new TypeError(`No method n
37amed "${e}"`);t[e]()}})}}We(sn);const _f="popover",Ef=".popover-header",bf=".popover-body",yf=Lr(Le({},sn.Default),{content:"",offset:[0,8],placement:"right",template:'<div class="popover" role="tooltip"><div class="popover-arrow"></div><h3 class="popover-header"></h3><div class="popover-body"></div></div>',trigger:"click"}),wf=Lr(Le({},sn.DefaultType),{content:"(null|string|element|function)"});class us extends sn{static get Default(){return yf}static get DefaultType(){return wf}static get NAME(){return _f}_isWithContent(){return this._getTitle()||this._getContent()}_getContentForTemplate(){return{[Ef]:this._getTitle(),[bf]:this._getContent()}}_getContent(){return this._resolvePossibleFunction(this._config.content)}static jQueryInterface(e){return this.each(function(){const t=us.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof t[e]=="undefined")throw new TypeError(`No method named "${e}"`);t[e]()}})}}We(us);const Sf="scrollspy",ds=".bs.scrollspy",Af=".data-api",Tf=`activate${ds}`,_i=`click${ds}`,Cf=`load${ds}${Af}`,Lf="dropdown-item",on="active",Mf='[data-bs-spy="scroll"]',fs="[href]",Of=".nav, .list-group",Ei=".nav-link",Pf=`${Ei}, .nav-item > ${Ei}, .list-group-item`,kf=".dropdown",Df=".dropdown-toggle",Nf={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},If={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"};class sr extends Je{constructor(e,t){super(e,t),this._targetLinks=new Map,this._observableSections=new Map,this._rootElement=getComputedStyle(this._element).overflowY==="visible"?null:this._element,this._activeTarget=null,this._observer=null,this._previousScrollData={visibleEntryTop:0,parentScrollTop:0},this.refresh()}static get Default(){return Nf}static get DefaultType(){return If}static get NAME(){return Sf}refresh(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();for(const e of this._observableSections.values())this._observer.observe(e)}dispose(){this._observer.disconnect(),super.dispose()}_configAfterMerge(e){return e.target=At(e.target)||document.body,e.rootMargin=e.offset?`${e.offset}px 0px -30%`:e.rootMargin,typeof e.threshold=="string"&&(e.threshold=e.threshold.split(",").map(t=>Number.parseFloat(t))),e}_maybeEnableSmoothScroll(){this._config.smoothScroll&&(b.off(this._config.target,_i),b.on(this._config.target,_i,fs,e=>{const t=this._observableSections.get(e.target.hash);if(t){e.preventDefault();const r=this._rootElement||window,s=t.offsetTop-this._element.offsetTop;if(r.scrollTo){r.scrollTo({top:s,behavior:"smooth"});return}r.scrollTop=s}}))}_getNewObserver(){const e={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver(t=>this._observerCallback(t),e)}_observerCallback(e){const t=i=>this._targetLinks.get(`#${i.target.id}`),r=i=>{this._previousScrollData.visibleEntryTop=i.target.offsetTop,this._process(t(i))},s=(this._rootElement||document.documentElement).scrollTop,o=s>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=s;for(const i of e){if(!i.isIntersecting){this._activeTarget=null,this._clearActiveClass(t(i));continue}const a=i.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(o&&a){if(r(i),!s)return;continue}!o&&!a&&r(i)}}_initializeTargetsAndObservables(){this._targetLinks=new Map,this._observableSections=new Map;const e=q.find(fs,this._config.target);for(const t of e){if(!t.hash||Tt(t))continue;const r=q.findOne(decodeURI(t.hash),this._element);Xt(r)&&(this._targetLinks.set(decodeURI(t.hash),t),this._observableSections.set(t.hash,r))}}_process(e){this._activeTarget!==e&&(this._clearActiveClass(this._config.target),this._activeTarget=e,e.classList.add(on),this._activateParents(e),b.trigger(this._element,Tf,{relatedTarget:e}))}_activateParents(e){if(e.classList.contains(Lf)){q.findOne(Df,e.closest(kf)).classList.add(on);return}for(const t of q.parents(e,Of))for(const r of q.prev(t,Pf))r.classList.add(on)}_clearActiveClass(e){e.classList.remove(on);const t=q.find(`${fs}.${on}`,e);for(const r of t)r.classList.remove(on)}static jQueryInterface(e){return this.each(function(){const t=sr.getOrCreateInstance(this,e);if(typeof e=="string"){if(t[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method n
37amed "${e}"`);t[e]()}})}}b.on(window,Cf,()=>{for(const n of q.find(Mf))sr.getOrCreateInstance(n)}),We(sr);const Rf="tab",Ft=".bs.tab",xf=`hide${Ft}`,$f=`hidden${Ft}`,qf=`show${Ft}`,Vf=`shown${Ft}`,Ff=`click${Ft}`,Uf=`keydown${Ft}`,jf=`load${Ft}`,Hf="ArrowLeft",bi="ArrowRight",Bf="ArrowUp",yi="ArrowDown",ps="Home",wi="End",Ut="active",Si="fade",hs="show",Wf="dropdown",Ai=".dropdown-toggle",Kf=".dropdown-menu",ms=`:not(${Ai})`,Yf='.list-group, .nav, [role="tablist"]',zf=".nav-item, .list-group-item",Gf=`.nav-link${ms}, .list-group-item${ms}, [role="tab"]${ms}`,Ti='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',vs=`${Gf}, ${Ti}`,Qf=`.${Ut}[data-bs-toggle="tab"], .${Ut}[data-bs-toggle="pill"], .${Ut}[data-bs-toggle="list"]`;class an extends Je{constructor(e){super(e),this._parent=this._element.closest(Yf),this._parent&&(this._setInitialAttributes(this._parent,this._getChildren()),b.on(this._element,Uf,t=>this._keydown(t)))}static get NAME(){return Rf}show(){const e=this._element;if(this._elemIsActive(e))return;const t=this._getActiveElem(),r=t?b.trigger(t,xf,{relatedTarget:e}):null;b.trigger(e,qf,{relatedTarget:t}).defaultPrevented||r&&r.defaultPrevented||(this._deactivate(t,e),this._activate(e,t))}_activate(e,t){if(!e)return;e.classList.add(Ut),this._activate(q.getElementFromSelector(e));const r=()=>{if(e.getAttribute("role")!=="tab"){e.classList.add(hs);return}e.removeAttribute("tabindex"),e.setAttribute("aria-selected",!0),this._toggleDropDown(e,!0),b.trigger(e,Vf,{relatedTarget:t})};this._queueCallback(r,e,e.classList.contains(Si))}_deactivate(e,t){if(!e)return;e.classList.remove(Ut),e.blur(),this._deactivate(q.getElementFromSelector(e));const r=()=>{if(e.getAttribute("role")!=="tab"){e.classList.remove(hs);return}e.setAttribute("aria-selected",!1),e.setAttribute("tabindex","-1"),this._toggleDropDown(e,!1),b.trigger(e,$f,{relatedTarget:t})};this._queueCallback(r,e,e.classList.contains(Si))}_keydown(e){if(![Hf,bi,Bf,yi,ps,wi].includes(e.key))return;e.stopPropagation(),e.preventDefault();const t=this._getChildren().filter(s=>!Tt(s));let r;if([ps,wi].includes(e.key))r=t[e.key===ps?0:t.length-1];else{const s=[bi,yi].includes(e.key);r=Qr(t,e.target,s,!0)}r&&(r.focus({preventScroll:!0}),an.getOrCreateInstance(r).show())}_getChildren(){return q.find(vs,this._parent)}_getActiveElem(){return this._getChildren().find(e=>this._elemIsActive(e))||null}_setInitialAttributes(e,t){this._setAttributeIfNotExists(e,"role","tablist");for(const r of t)this._setInitialAttributesOnChild(r)}_setInitialAttributesOnChild(e){e=this._getInnerElement(e);const t=this._elemIsActive(e),r=this._getOuterElement(e);e.setAttribute("aria-selected",t),r!==e&&this._setAttributeIfNotExists(r,"role","presentation"),t||e.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(e,"role","tab"),this._setInitialAttributesOnTargetPanel(e)}_setInitialAttributesOnTargetPanel(e){const t=q.getElementFromSelector(e);t&&(this._setAttributeIfNotExists(t,"role","tabpanel"),e.id&&this._setAttributeIfNotExists(t,"aria-labelledby",`${e.id}`))}_toggleDropDown(e,t){const r=this._getOuterElement(e);if(!r.classList.contains(Wf))return;const s=(o,i)=>{const a=q.findOne(o,r);a&&a.classList.toggle(i,t)};s(Ai,Ut),s(Kf,hs),r.setAttribute("aria-expanded",t)}_setAttributeIfNotExists(e,t,r){e.hasAttribute(t)||e.setAttribute(t,r)}_elemIsActive(e){return e.classList.contains(Ut)}_getInnerElement(e){return e.matches(vs)?e:q.findOne(vs,e)}_getOuterElement(e){return e.closest(zf)||e}static jQueryInterface(e){return this.each(function(){const t=an.getOrCreateInstance(this);if(typeof e=="string"){if(t[e]===void 0||e.startsWith("_")||e==="constructor")throw new TypeError(`No method named "${e}"`);t[e]()}})}}b.on(document,Ff,Ti,function(n){["A","AREA"].includes(this.tagName)&&n.preventDefault(),!Tt(this)&&an.getOrCreateInstance(this).show()}),b.on(window,jf,()=>{for(const n of q.find(Qf))an.getOrCreateInstance(n)}),We(an);const Xf="toast",Lt=".bs.toast",Jf=`mouseover${Lt}`,Zf=`mouseout${Lt}`,ep=`focusin${Lt}`,tp=`focusout${Lt}`,np=`hide${Lt}`,rp=`hidden${Lt}`,sp=`show${Lt}`,op=`shown${Lt}`,ip="fade",Ci="hide",or="show",ir="showing",ap={animation:"boolean",autohide:"boolean",delay:"number"},cp={animation:!0,autohide:!0,delay:5e3};class Cn extends Je{constructor(e,t){super(e,t),this._timeout=null,this._hasMouseInteraction=!1,this._hasKeyboardInteraction=!1,this._setListeners()}static get Default(){return cp}static get DefaultType(){return ap}static get NAME(){return Xf}show(){if(b.trigger(this._element,sp).defaultPrevented)return;this._clearTimeout(),this._config.animation&&this._element.classList.add(ip);const t=()=>{this._element.classList.remove(ir),b.trigger(this._element,op),this._maybeScheduleHide()};this._element.classList.remove(Ci),bn(this._element),this._element.classList.add(or,ir),this._queueCallback(t,this._element,this._config.animation)}
37hide(){if(!this.isShown()||b.trigger(this._element,np).defaultPrevented)return;const t=()=>{this._element.classList.add(Ci),this._element.classList.remove(ir,or),b.trigger(this._element,rp)};this._element.classList.add(ir),this._queueCallback(t,this._element,this._config.animation)}dispose(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(or),super.dispose()}isShown(){return this._element.classList.contains(or)}_maybeScheduleHide(){this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout(()=>{this.hide()},this._config.delay)))}_onInteraction(e,t){switch(e.type){case"mouseover":case"mouseout":{this._hasMouseInteraction=t;break}case"focusin":case"focusout":{this._hasKeyboardInteraction=t;break}}if(t){this._clearTimeout();return}const r=e.relatedTarget;this._element===r||this._element.contains(r)||this._maybeScheduleHide()}_setListeners(){b.on(this._element,Jf,e=>this._onInteraction(e,!0)),b.on(this._element,Zf,e=>this._onInteraction(e,!1)),b.on(this._element,ep,e=>this._onInteraction(e,!0)),b.on(this._element,tp,e=>this._onInteraction(e,!1))}_clearTimeout(){clearTimeout(this._timeout),this._timeout=null}static jQueryInterface(e){return this.each(function(){const t=Cn.getOrCreateInstance(this,e);if(typeof e=="string"){if(typeof t[e]=="undefined")throw new TypeError(`No method named "${e}"`);t[e](this)}})}}zn(Cn),We(Cn);const lp={light:"alert-light",dark:"alert-dark",primary:"alert-primary",secondary:"alert-secondary",info:"alert-info",success:"alert-success",warning:"alert-warning",danger:"alert-danger"},up={light:"e88f",dark:"e88f",primary:"e88f",secondary:"e88f",info:"e88e",success:"e5ca",warning:"e002",danger:"e000"},dp=`
38  <div class="alert alert-dismissible fade d-flex align-items-center" role="alert">
39    <h4 class="alert-heading w-100 d-none"></h4>
40    <i class="material-icons flex-shrink-0 me-2"></i>
41    <div class="alert-body flex-fill"></div>
42    <button type="button" class="btn-close ms-2" data-bs-dismiss="alert"></button>
43  </div>
44`,fp={type:"info",dismissible:!0};var pp=Object.defineProperty,Li=Object.getOwnPropertySymbols,hp=Object.prototype.hasOwnProperty,mp=Object.prototype.propertyIsEnumerable,Mi=(n,e,t)=>e in n?pp(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Oi=(n,e)=>{for(var t in e||(e={}))hp.call(e,t)&&Mi(n,t,e[t]);if(Li)for(var t of Li(e))mp.call(e,t)&&Mi(n,t,e[t]);return n};const vp=(n,e)=>{let t={instance:null,element:null,show:()=>!1,hide:()=>!1,dispose:()=>!1,title:()=>!1,message:()=>!1,remove:()=>!1};const r=gp(e);if(r){const s=_p(r,e==null?void 0:e.title),o=Ep(r,n),i=new wn(r);t={instance:i,element:r,show:()=>r.isConnected?(r.classList.add("show"),!0):!1,hide:()=>r.isConnected?(r.classList.remove("show"),!0):!1,dispose:()=>r.isConnected?(i.dispose(),!0):!1,title:a=>s!=null&&s.isConnected?(a&&(s.innerHTML=a),s.innerHTML):!1,message:a=>o!=null&&o.isConnected?(a&&(o.innerHTML=a),o.innerHTML):!1,remove:()=>r.isConnected?(r.remove(),!0):!1}}return t},gp=n=>{var e;const t=Oi(Oi({},fp),n),r=(e=t.selector)!=null?e:p.alert.selector,s=document.querySelector(r);if(s){const o=document.createElement("div");o.innerHTML=dp;const i=o.querySelector(p.alert.alert);if(i){i.classList.add(lp[t.type]);const a=i.querySelector(p.alert.icon);if(a)if(t.title===void 0){const c=t.icon?t.icon:up[t.type];a.setAttribute("aria-hidden","true"),a.innerHTML=`&#x${c};`}else i.classList.add("flex-wrap"),a.classList.add("d-none");if(t.dismissible===!1){const c=i.querySelector(p.alert.close);c==null||c.classList.add("d-none")}t.classlist&&t.classlist.split(" ").forEach(c=>{c&&i.classList.add(c)}),s.appendChild(i)}return i}return console.error("The selector for alert is not valid: %c%o","color: white",r),null},_p=(n,e)=>{if(e){const t=n.querySelector(p.alert.heading);if(t)return t.innerHTML=e,t.classList.remove("d-none"),t}return null},Ep=(n,e)=>{const t=n.querySelector(p.alert.body);return t&&(t.innerHTML=e),t},ar=vp,bp={light:"bg-light-subtle border-light-subtle",dark:"bg-dark-subtle border-dark-subtle",primary:"bg-primary-subtle border-primary-subtle",secondary:"bg-secondary-subtle border-secondary-subtle",info:"bg-info-subtle border-info-subtle",success:"bg-success-subtle border-success-subtle",warning:"bg-warning-subtle border-warning-subtle",danger:"bg-danger-subtle border-danger-subtle"},yp=`
45  <div class="toast-container toast-container--fallback position-fixed top-0 end-0 p-3" id="js-toast-container">
46    <template class="js-toast-template">
47      <div class="toast toast--fallback" role="alert" aria-live="assertive" aria-atomic="true">
48        <div class="d-flex">
49          <div class="toast-body"></div>
50          <button type="button" class="btn-close me-2 m-auto d-none" data-bs-dismiss="toast"></button>
51        </div>
52      </div>
53    </template>
54  </div>
55`,wp={type:"info",autohide:!0,delay:3e3};var Sp=Object.defineProperty,Pi=Object.getOwnPropertySymbols,Ap=Object.prototype.hasOwnProperty,Tp=Object.prototype.propertyIsEnumerable,ki=(n,e,t)=>e in n?Sp(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,Di=(n,e)=>{for(var t in e||(e={}))Ap.call(e,t)&&ki(n,t,e[t]);if(Pi)for(var t of Pi(e))Tp.call(e,t)&&ki(n,t,e[t]);return n};const Cp=(n,e)=>{let t={instance:null,element:null,content:null,show:()=>!1,hide:()=>!1,dispose:()=>!1,message:()=>!1,remove:()=>!1};const r=Lp(e==null?void 0:e.template);
55if(r){Op(r,n);const s=Di(Di({},wp),e);Pp(r,s),s.autohide===!1&&kp(r);const o=r.querySelector(p.toast.body);if(o){const i=new Cn(r,{autohide:s.autohide,delay:s.delay});t={instance:i,element:r,content:o,show:()=>r.isConnected?(i.show(),!0):!1,hide:()=>r.isConnected?(i.hide(),!0):!1,dispose:()=>r.isConnected?(i.dispose(),!0):!1,message:a=>r.isConnected?(a&&(o.innerHTML=a),o.innerHTML):!1,remove:()=>r.isConnected?(r.remove(),!0):!1}}}return t},Lp=n=>{const e=document.querySelector(p.toast.container);return e?n===void 0?gs(e):Ni(e,n):Mp(n)},gs=(n,e=!0)=>{const t=n.querySelector(p.toast.template),r=t==null?void 0:t.content.cloneNode(!0),s=r==null?void 0:r.querySelector(p.toast.toast),o=s==null?void 0:s.querySelector(p.toast.body);if(s&&o)return n.appendChild(s),s;if(e){const i=Ii();if(i)return n.innerHTML=i.innerHTML,gs(n,!1)}return Ri("Failed to clone toast template.","Check the toast markup in theme or JS fallback."),null},Ni=(n,e)=>{const t=document.createElement("div");t.innerHTML=e;const r=t==null?void 0:t.querySelector(p.toast.toast),s=r==null?void 0:r.querySelector(p.toast.body);return r&&s?(n.appendChild(r),r):(Ri("The override toast template is not valid.","Reference: https://getbootstrap.com/docs/5.0/components/toasts/"),null)},Mp=n=>{const e=document.querySelector("body"),t=Ii();if(e&&t){const r=n===void 0?gs(t,!1):Ni(t,n);if(r)return t.appendChild(r),e.appendChild(t),r}return null},Ii=()=>{const n=document.createElement("div");return n.innerHTML=yp,n.querySelector(p.toast.container)},Op=(n,e)=>{const t=n.querySelector(p.toast.body);t&&(t.innerHTML=e)},Pp=(n,e)=>{let t=bp[e.type];const r=e.classlist;r&&(t=t.concat(" ",r.trim())),t.split(" ").forEach(s=>{s&&n.classList.add(s)})},kp=n=>{var e;const t=n.querySelector(p.toast.close);if(t){const r=(e=n.classList.toString().match(/(?:text-bg-)\w+/))==null?void 0:e[0],s=r==null?void 0:r.split("-").pop();s&&["dark","primary","secondary","success"].includes(s)?t.classList.add("btn-close-white"):t.classList.add("btn-close-black"),t.classList.remove("d-none")}},Ri=(n,e)=>{e?(console.group("useToast"),console.error(n),console.info(e),console.groupEnd()):console.error(n)},cr=Cp;var Dp=Object.defineProperty,xi=Object.getOwnPropertySymbols,Np=Object.prototype.hasOwnProperty,Ip=Object.prototype.propertyIsEnumerable,$i=(n,e,t)=>e in n?Dp(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,qi=(n,e)=>{for(var t in e||(e={}))Np.call(e,t)&&$i(n,t,e[t]);if(xi)for(var t of xi(e))Ip.call(e,t)&&$i(n,t,e[t]);return n};const gt={DELETE_FROM_CART:"delete-from-cart",UPDATE_PRODUCT_QUANTITY:"update-product-quantity",SUBMIT_VOUCHER:"submit-voucher",REMOVE_VOUCHER:"remove-voucher"};class Rp{constructor(){this.state={lastUpdateAction:null,storedFocusElement:null,storedFocusElementId:null}}get(e){return this.state[e]}set(e,t){this.state[e]=t}merge(e){this.state=qi(qi({},this.state),e)}}const xm=null,ge=new Rp;class xp{getStoredFocus(){return ge.get("storedFocusElement")}getStoredFocusId(){return ge.get("storedFocusElementId")}setFocus(e){e.focus(),ge.set("storedFocusElement",e),ge.set("storedFocusElementId",e.id)}storeFocus(){const e=document.activeElement;ge.set("storedFocusElement",e),ge.set("storedFocusElementId",e.id)}clearStoredFocus(){ge.set("storedFocusElement",null),ge.set("storedFocusElementId",null)}restoreFocus(e=null){let t=!1;try{const r=ge.get("storedFocusElementId"),s=ge.get("storedFocusElement");if(r){const o=document.getElementById(r);o&&(o.focus(),t=!0)}!t&&s&&document.contains(s)&&(s.focus(),t=!0),!t&&e&&document.contains(e)&&(e.focus(),t=!1),!t&&!e&&(t=!1)}catch(r){t=!1}finally{this.clearStoredFocus()}return t}}const lr=xp;var ur=(n,e,t)=>new Promise((r,s)=>{var o=c=>{try{a(t.next(c))}catch(l){s(l)}},i=c=>{try{a(t.throw(c))}catch(l){s(l)}},a=c=>c.done?r(c.value):Promise.resolve(c.value).then(o,i);a((t=t.apply(n,e)).next())});const Vi=new lr,_s="Enter",$p="Escape",qp="ArrowUp",Vp="ArrowDown",Es=(n=T.default,e=yc.delay)=>{document.querySelectorAll(n).forEach(r=>{const s=r.querySelector("input");if(s){const o=r.querySelector(T.increment),i=r.querySelector(T.decrement);if(o&&i){const a={qtyInput:s,incrementButton:o,decrementButton:i};o.addEventListener("click",()=>dr(s,1)),i.addEventListener("click",()=>dr(s,-1)),s.addEventListener("keydown",c=>{c.key===qp&&dr(s,1,!0),c.key===Vp&&dr(s,-1,!0)}),s.addEventListener("input",c=>{const l=c.target,d=Ui(l),g=ji(l.value),v=Hi(g,d);l.value!==v.toString()&&(l.value=v.toString())}),s.addEventListener("blur",c=>{const l=c.target,d=Ui(l),g=ji(l.value);l.value=Hi(g,d).toString()}),s.hasAttribute("data-update-url")&&(o.addEventListener("click",Nt(()=>ur(void 0,null,function*(){fr(a,1)}),e)),i.addEventListener("click",Nt(()=>ur(void 0,null,function*(){fr(a,-1)}),e)),s.addEventListener("keyup",c=>{const l=s.getAttribute("value");if(s.value!==l?jp(a):Ln(a),c.key===_s)if(s.value==="0"){const d=s.closest(le.productItem),g=d==null?void 0:d.querySelector(le.removeFromCart);g?g.click():fr(a,1)}else fr(a,1);c.key===$p&&Ln(a)}))}}})},Fi=n=>!Number.isNaN(n)&&Number.isInteger(n),Ui=n=>Number(n.getAttribute("min"))||1,ji=n=>Number(n.replace(/[^\d]/g,""))||0,Hi=(n,e)=>Math.max(n,e),dr=(n,e,t=!1)=>{const{mode:r}=n.dataset;if(r!=="confirmation"||t){const s=Number(n.getAttribute("value")),o=Number(n.value),i=n.dataset.updateUrl===void 0?Number(n.getAttribute("min")):0,a=Math.max(o+e,i);n.value=String(Fi(a)?a:s)}},fr=(n,e)=>ur(void 0,null,function*(){var t,r;const{prestashop:s,Theme:{events:o}}=window,{qtyInput:i}=n,{mode:a}=i.dataset;if(a==="confirmation"&&e<0)Ln(n);else{const c=Number(i.value),l=Number(i.getAttribute("value")),d=c-l;if(c===0&&i.getAttribute("min")==="1")return;if(Fi(c)&&d!==0){const g=i.dataset.updateUrl;if(g!==void 0){const v=Fp(n,e),m=v.querySelector("i:not(.d-none)"),C=v.querySelector(T.spinner);Bi(v,m,C);try{const E=yield Ki(g,d);if(E.ok){const S=yield E.json();if(S.hasError){const O=S.errors;O&&O.forEach(x=>{cr(x,{type:"danger"}).show()})}else{const O=S.errors;O&&cr(O,{type:"danger"}).show()}if(((r=(t=S.cart)==null?void 0:t.products)==null?void 0:r.length)>0){const O=S.cart.products.find(x=>S.id_product===Number(x.id_product)&&S.id_product_attribute===Number(x.id_product_attribute));if(O&&O.availability==="unavailable"&&O.allow_oosp===0&&Number(O.quantity_wanted)>Number(O.stock_quantity)){const x=Number(O.stock_quantity)-Number(O.quantity_wanted);yield Ki(O.update_quantity_url,x)}}s.emit(o.updateCart,{reason:i.dataset,resp:S}),i.value=S.quantity,i.setAttribute("value",S.quantity)}else throw E}
55catch(E){i.value=String(l);const S=E;if(S.status!==void 0){const O=`${S.statusText}: ${S.url}`,x=Up(i);ar(O,{type:"danger",selector:x}).show(),s.emit(o.handleError,{eventType:"updateProductInCart",resp:S})}}finally{Bi(v,m,C),Ln(n)}}}else Ln(n)}}),Fp=(n,e)=>{const{incrementButton:t,decrementButton:r}=n;return e>0?t:r},Up=n=>{const{alertId:e}=n.dataset;if(e){const t=T.alert(e),r=document.querySelector(t);return r&&(r.innerHTML=""),t}},Bi=(n,e,t)=>{n.toggleAttribute("disabled"),e==null||e.classList.toggle("d-none"),t==null||t.classList.toggle("d-none")},Ln=n=>{const{qtyInput:e,incrementButton:t,decrementButton:r}=n,{mode:s}=e.dataset;if(s==="confirmation"){Wi(t,r),e.dataset.mode="spin";const o=e.getAttribute("value");o&&(e.value=o)}},jp=n=>{const{qtyInput:e,incrementButton:t,decrementButton:r}=n,{mode:s}=e.dataset;s!=="confirmation"&&(Wi(t,r),e.dataset.mode="confirmation")},Wi=(n,e)=>{n.querySelectorAll("i").forEach(s=>{s.classList.toggle("d-none")}),e.querySelectorAll("i").forEach(s=>{s.classList.toggle("d-none")})},Ki=(n,e)=>ur(void 0,null,function*(){const t=new FormData;return t.append("ajax","1"),t.append("action","update"),t.append("qty",String(Math.abs(e))),t.append("op",e>0?"up":"down"),yield fetch(n,{method:"POST",headers:{Accept:"application/json, text/javascript, */*; q=0.01"},body:t})});document.addEventListener("DOMContentLoaded",()=>{const{prestashop:n,Theme:{events:e}}=window;document.addEventListener("keydown",t=>{const r=t.target;r&&(t.key===_s||t.key===" "||t.code==="Space")&&r.closest(le.productQuantity)&&(ge.set("lastUpdateAction",gt.UPDATE_PRODUCT_QUANTITY),Vi.storeFocus())}),document.addEventListener("click",t=>{const r=t.target;if(!r)return;r.closest(`${le.productQuantity} button`)&&(t.key===_s||t.key===" "||t.code==="Space")&&(ge.set("lastUpdateAction",gt.UPDATE_PRODUCT_QUANTITY),Vi.storeFocus())}),n.on(e.updatedCart,()=>{Es(le.productQuantity)}),n.on(e.quickviewOpened,()=>{Es(T.modal)})});const pr=Es,Yi=n=>{const e=n.target.closest("[data-search-url]"),t=e==null?void 0:e.dataset.searchUrl;if(!t)throw console.error("No data-search-url found for event:",n),new Error("Cannot parse search URL");return t};function Hp(n){const{Theme:e}=window,{listing:t}=e.selectors,r=(s,o)=>{const i=document.querySelector(s);if(!i||!o)return;const a=document.createElement("template");a.innerHTML=o.trim();const c=a.content.firstElementChild;c&&i.replaceWith(c)};r(t.searchFilters,n.rendered_facets),r(t.activeSearchFilters,n.rendered_active_filters),r(t.listTop,n.rendered_products_top),r(t.list,n.rendered_products),r(t.listBottom,n.rendered_products_bottom),r(t.listHeader,n.rendered_products_header),r(t.listFooter,n.rendered_products_footer)}function Bp(n,e){var t;return((t=n.closest(e))==null?void 0:t.getAttribute("href"))||null}function Wp(){const{prestashop:n}=window,{Theme:e}=window,{events:t,selectors:r}=e,{listing:s}=r,o=i=>n.emit(t.updateFacets,i);document.body.addEventListener("change",i=>{i.target.closest(`${s.searchFilters} input[data-search-url]`)&&o(Yi(i))}),document.body.addEventListener("click",i=>{var a;const c=i.target;if(c.closest(s.searchFiltersClearAll))o(Yi(i));else if(c.closest(s.searchLink)){i.preventDefault();const l=Bp(c,"a");if(!l){console.error(`Cannot find href attribute for the element ${s.searchLink}`);return}o(l)}else if(c.closest(s.paginationLink)){i.preventDefault();const l=document.querySelector(s.listHeader);l&&l.scrollIntoView({block:"start",behavior:"auto"});const d=(a=i.target.closest("button"))==null?void 0:a.getAttribute("data-ps-data");if(!d){console.error(`Cannot find href attribute for the element ${s.paginationLink}`);return}o(d)}}),document.querySelector(s.list)&&window.addEventListener("popstate",i=>{const a=i.state;a!=null&&a.current_url&&a.current_url.trim()!==""&&a.current_url!=="#"&&(window.location.href=a.current_url)}),n.on(t.updateProductList,i=>{Hp(i),pr()}),document.body.addEventListener("keydown",i=>{const a=i.target;if(a.closest(r.facetedsearch.colorLabel)&&i.key===" "){i.preventDefault();const c=a.closest(r.facetedsearch.colorLabel),l=document.getElementById(c.getAttribute("for"));l&&l.click()}})}function zi(n,e){const{prestashop:t,Theme:{events:r}}=window,s=new URL(e.target.dataset.sliderEncodedUrl,window.location.origin);let o=s.searchParams.get("q")||"";o+=[o.length>0?"/":"",e.target.dataset.sliderLabel,"-",e.target.dataset.sliderUnit,"-",n[0],"-",n[1]].join(""),s.searchParams.set("q",o),t.emit(r.updateFacets,s.href)}const hr=()=>{const{Theme:n}=window;document.querySelectorAll(n.selectors.facetedsearch.filterSlider).forEach(e
55=>{const t=e.querySelector(n.selectors.facetedsearch.rangeContainer),r=t.dataset.sliderCurrency;let s="suffix",o=t.dataset.sliderUnit,i=2,a=".",c="";const l=JSON.parse(t.dataset.sliderSpecifications);l!==null&&(l.positivePattern!==void 0&&l.positivePattern.indexOf("\xA4")===0&&(s="prefix"),l.currencySymbol!==void 0&&(o=l.currencySymbol),l.numberSymbols!==void 0&&(a=l.numberSymbols[0],c=l.numberSymbols[1]),l.minFractionDigits!==void 0&&(i=l.minFractionDigits));const d=parseInt(t.dataset.sliderMin,10),g=parseInt(t.dataset.sliderMax,10),v=t.dataset.sliderDirection==="1"?"rtl":"ltr";let m;const C=bc()({mark:a,thousand:c,decimals:i,[s]:s==="prefix"?o:` ${o}`}),E=JSON.parse(t.dataset.sliderValues);if(t.noUiSlider)t.noUiSlider.updateOptions({start:E!=null?E:[d,g],tooltips:[C,C],range:{min:d,max:g}},!0),t.noUiSlider.removeTooltips(),t.noUiSlider.on("set",(S,O,x,B,R,N)=>{zi(S,N)}),t.noUiSlider.on("update",S=>{const O=S.map(R=>s==="suffix"?`${R}${o}`:`${o}${R}`),B=m.target.closest(n.selectors.facetedsearch.filterSlider).querySelector(n.selectors.facetedsearch.rangeValues);B.innerHTML=O.join(" - ")});else{const S=t.querySelector(".noUi-base");S&&S.remove(),m=_c.create(t,{start:E!=null?E:[d,g],tooltips:[C,C],direction:v,connect:[!1,!0,!1],range:{min:d,max:g}}),m.removeTooltips(),m.on("set",(O,x,B,R,N,$)=>{zi(O,$)}),m.on("update",O=>{const x=O.map(N=>s==="suffix"?`${N}${o}`:`${o}${N}`),R=m.target.closest(n.selectors.facetedsearch.filterSlider).querySelector(n.selectors.facetedsearch.rangeValues);R.innerHTML=x.join(" - ")}),m.target.querySelectorAll(".noUi-handle").forEach(O=>{O.setAttribute("tabindex","0");const x=r?`Adjust filter range in ${r}`:`Adjust filter range' in ${o}`;O.setAttribute("aria-label",x)})}})},Gi=n=>{const{Theme:e}=window,t=document.querySelector(e.selectors.pageLoader);t&&t.classList.toggle("d-none",n)};document.addEventListener("DOMContentLoaded",()=>{const{prestashop:n,Theme:{events:e}}=window;Wp(),n.on(e.updateProductList,()=>{Gi(!0),hr()}),hr(),n.on(e.updateFacets,()=>{Gi(!1)})});var Kp=(n,e,t)=>new Promise((r,s)=>{var o=c=>{try{a(t.next(c))}catch(l){s(l)}},i=c=>{try{a(t.throw(c))}catch(l){s(l)}},a=c=>c.done?r(c.value):Promise.resolve(c.value).then(o,i);a((t=t.apply(n,e)).next())});const{prestashop:_t}=window;_t&&(_t.responsive=_t.responsive||{},_t.responsive.current_width=window.innerWidth,_t.responsive.min_width=768,_t.responsive.mobile=_t.responsive.current_width<_t.responsive.min_width);function Qi(){var n;const{prestashop:e,Theme:{events:t}}=window;if(e.responsive.mobile)Array.prototype.forEach.call(document.querySelectorAll("*[id^='_desktop_']"),r=>{const s=document.querySelector(`#${r.id}`),o=document.querySelector(`#${r.id.replace("_desktop_","_mobile_")}`);o&&s&&G(s,o)}),hr();else{Array.prototype.forEach.call(document.querySelectorAll("*[id^='_mobile_']"),s=>Kp(this,null,function*(){const o=document.querySelector(`#${s.id}`),i=document.querySelector(`#${s.id.replace("_mobile_","_desktop_")}`);i&&o&&G(o,i)}));const r=document.querySelector(he.offCanvasFaceted);r!=null&&((n=vt.getInstance(r))==null||n.hide()),hr()}e.emit(t.responsiveUpdate,{mobile:e.responsive.mobile})}function Xi(){const{prestashop:n}=window;n.responsive=n.responsive||{},n.responsive.current_width=window.innerWidth,n.responsive.min_width=768,n.responsive.mobile=n.responsive.current_width<n.responsive.min_width,window.addEventListener("resize",()=>{const e=n.responsive.current_width,t=n.responsive.min_width,r=window.innerWidth,s=e>=t&&r<t||e<t&&r>=t;n.responsive.current_width=r,n.responsive.mobile=n.responsive.current_width<n.responsive.min_width,s&&Qi()})}document.addEventListener("DOMContentLoaded",()=>{_t.responsive.mobile&&Qi()});function Ji(){const n=document.querySelector(p.modalContainer);if(!n)throw new Error(`Missing div with "${p.modalContainer}" in the DOM.`);return n}var Yp=(n,e,t)=>new Promise((r,s)=>{var o=c=>{try{a(t.next(c))}catch(l){s(l)}},i=c=>{try{a(t.throw(c))}catch(l){s(l)}},a=c=>c.done?r(c.value):Promise.resolve(c.value).then(o,i);a((t=t.apply(n,e)).next())});function Zi(){const{prestashop:n,Theme:{events:e}}=window;let t=null;function r(o){return Yp(this,null,function*(){const i=n.urls.pages.product,a=new URLSearchParams;
55Object.entries(o).forEach(([l,d])=>{d!=null&&a.append(l,String(d))});const c=yield fetch(i,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8","X-Requested-With":"XMLHttpRequest",Accept:"application/json"},body:a,credentials:"same-origin"});if(!c.ok){const l=yield c.text().catch(()=>"");throw new Error(`Quickview fetch failed: ${c.status} ${l}`)}return c.json()})}function s(o){const i=Ji();if(i)i.innerHTML=o.quickview_html;else throw new Error("Modal container not found.");const a=`quickview-modal-${o.product.id}-${o.product.id_product_attribute}`,c=document.getElementById(a);if(!c)throw new Error(`Modal element #${a} not found.`);let l="unknown";const d=v=>{(v.key==="Escape"||v.key==="Esc")&&(l="keyboard");const m=document.activeElement;m&&m.closest('[data-bs-dismiss="modal"]')&&(v.key==="Enter"||v.key===" "||v.code==="Space")&&(l="keyboard")},g=()=>{l="pointer"};c.addEventListener("shown.bs.modal",()=>{var v;document.addEventListener("keydown",d,{capture:!0}),document.addEventListener("pointerdown",g,{capture:!0});const m=c.querySelector(p.quickviewModalStatus);m&&(m.textContent=(v=m.getAttribute("data-ps-data"))!=null?v:""),n.emit(e.quickviewOpened)}),c.addEventListener("hidden.bs.modal",()=>{document.removeEventListener("keydown",d,{capture:!0}),document.removeEventListener("pointerdown",g,{capture:!0}),l==="keyboard"&&t&&document.contains(t)?t.focus():t||console.error("Last quickview opener not found."),c.remove()}),be.getOrCreateInstance(c,{focus:!0,keyboard:!0}).show()}n.on(e.clickQuickview,o=>{const i={action:"quickview",id_product:o.dataset.idProduct,id_product_attribute:o.dataset.idProductAttribute};r(i).then(a=>s(a)).catch(a=>{n.emit(e.handleError,{eventType:"clickQuickView",resp:a})})}),document.addEventListener("click",o=>{const i=o.target;if(!i)return;const a=i.closest(p.quickview);if(a){const c=a.closest(p.product.miniature);c&&(t=a,a.focus(),n.emit(e.clickQuickview,c))}}),n.on(e.updateCart,()=>{document.querySelectorAll(p.quickviewModal).forEach(o=>{(be.getInstance(o)||be.getOrCreateInstance(o)).hide()})})}const mr=n=>n.innerText!==void 0,$m={isHTMLElement:mr},zp=n=>{n.stopPropagation(),n.preventDefault();const e=n.target;Gp(e)},Gp=n=>{const{prestashop:e,Theme:{events:t}}=window,{dataset:r}=n,s=n.getAttribute("href");if(s===null)return;const o=new FormData;o.append("ajax","1"),o.append("action","update"),fetch(s,{method:"POST",body:o}).then(i=>{var a;if(e.emit(t.updateCart,{reason:r,resp:i}),n&&n.getAttribute("data-link-action")===p.cart.deleteLinkAction){ge.set("lastUpdateAction",gt.DELETE_FROM_CART);const c=document.querySelector(p.cart.alertPlaceholder),l=n.getAttribute("data-product-url"),d=n.getAttribute("data-product-name");if(c&&l&&d){const g=c.getAttribute("data-ps-data"),v=c.getAttribute("data-ps-data-close"),m=document.createElement("a");m.classList.add("alert-link"),m.setAttribute("href",l),m.textContent=d;const C=document.createElement("span");C.appendChild(m),C.append(` ${g}`);const E=document.createElement("div");E.appendChild(C);const S=ar(E.innerHTML,{type:"success",selector:p.cart.alertPlaceholder});S.element&&(S.element.setAttribute("data-ps-action","to-be-announced"),(a=S.element.querySelector(".btn-close"))==null||a.setAttribute("aria-label",`${v}`)),S.show()}}}).catch(i=>{const a=i;e.emit(t.handleError,{eventType:"updateProductInCart",errorData:a})})},ea=zp;var Qp=(n,e,t)=>new Promise((r,s)=>{var o=c=>{try{a(t.next(c))}catch(l){s(l)}},i=c=>{try{a(t.throw(c))}catch(l){s(l)}},a=c=>c.done?r(c.value):Promise.resolve(c.value).then(o,i);a((t=t.apply(n,e)).next())});const ta=()=>{const n=Nt((...a)=>Qp(void 0,null,function*(){const c=a[0];c&&c.click()}),500),e=a=>{a.stopPropagation();const c=a.target;if(mr(c)&&c.matches(p.cart.voucherCode)){const l=c,d=document.querySelector(p.cart.voucherInput),g=document.querySelector(p.cart.voucherAccordion);if(g&&d){const v=new nn(g,{toggle:!1});d.value=l.innerText,v.show()}}},t=()=>{ge.set("lastUpdateAction",gt.SUBMIT_VOUCHER)},r=a=>{const c=a.target,l=c.closest(p.cart.productItem),d=l==null?void 0:l.querySelector(p.cart.productItemQuantityInput),g=l==null?void 0:l.querySelector(p.cart.removeFromCart);d&&c.classList.contains("js-decrement-button")&&d.value==="0"&&d.getAttribute("min")==="1"&&g&&n(g),c.dataset.linkAction===p.cart.deleteLinkAction&&ea(a)},s=a=>{const c=a.target.closest(`[data-link-action="${p.cart.removeVoucherLinkAction}"]`);if(c){ge.set("lastUpdateAction",gt.REMOVE_VOUCHER),a.preventDefault();const l=new Event("click",{bubbles:!0});Object.defineProperty(l,"target",{value:c}),ea(l)}},o=()=>{const a=document.querySelectorAll(p.cart.voucherCode),c=document.querySelector(p.cart.container),l=document.querySelector(p.cart.summaryContainer),d=document.querySelector(p.checkout.summaryContainer),g=document.querySelector(p.cart.voucherForm);a.forEach(v=>{v.addEventListener("click",e)}),g&&g.addEventListener("submit",t),c&&c.addEventListener("click",r),[l,d].forEac
55h(v=>{v&&v.addEventListener("click",s)})},i=()=>{const a=document.querySelector(p.cart.summaryContainer),c=document.querySelector(p.checkout.summaryContainer),l=new MutationObserver(()=>{o()});[a,c].forEach(d=>{d&&l.observe(d,{childList:!0,subtree:!0})})};o(),i()},na={enum:"enum",percent:"percent",hidden:"hidden"},qm=null,{progressRing:Xp}=p,Jp="The circle is not linked to an SVG circle",ra=(n,e)=>{const t=document.querySelector(n);if(t){const r=t.querySelector("text"),s=t.querySelector(Xp.checkout.circle);if(s){const i=Number(s.getAttribute("r"))*2*Math.PI;return{setProgress:c=>{const l=Math.min(c,e.steps)/e.steps*100,d=i-l/100*i;if(s.style.strokeDashoffset=d.toString(),s.dataset.percent=String(l),r&&e.text!==na.hidden){const g=e.text===void 0||e.text===na.enum?`${Math.min(c,e.steps)} / ${e.steps}`:`${l}%`;r.innerHTML=g}},progressElement:t}}}return{error:new Error(Jp)}};var Zp=(n,e,t)=>new Promise((r,s)=>{var o=c=>{try{a(t.next(c))}catch(l){s(l)}},i=c=>{try{a(t.throw(c))}catch(l){s(l)}},a=c=>c.done?r(c.value):Promise.resolve(c.value).then(o,i);a((t=t.apply(n,e)).next())});const sa=()=>{const{prestashop:n}=window,{Theme:{selectors:e,events:t}}=window,{progressRing:r,checkout:s}=e,o=new lr,i=document.querySelectorAll(s.steps.item),a=document.querySelectorAll(s.actionsButtons),{setProgress:c}=ra(r.checkout.element,{steps:i.length}),l=document.querySelector(s.termsLink),d=document.querySelector(s.checkoutModal),g=(v,m)=>{const C=document.querySelector(s.steps.current),E=m==null?void 0:m.querySelector(s.steps.button);if(E==null||E.focus(),C==null||C.classList.remove("step--current","js-current-step"),m){const S=document.querySelector(s.steps.specificStep(m.dataset.step)),O=document.querySelector(s.steps.shownResponsiveStep);O==null||O.classList.add("d-none"),S==null||S.classList.remove("d-none")}v.classList.add("js-current-step","step--current")};a.forEach(v=>{const m=document.querySelector(s.steps.specificStepContent(v.dataset.step));v.addEventListener("click",C=>{C.preventDefault();const E=document.querySelector(s.steps.backButton(v.dataset.step));m&&E&&(E.click(),g(m))})}
55),i.forEach((v,m)=>{const C=document.querySelector(s.steps.specificStepContent(v.dataset.step)),E=v.querySelector("button");if(C){if(C.classList.contains("step--complete")&&v.classList.add("checkout-steps__step--success"),C.classList.contains("step--current")){v.classList.add("checkout-steps__step--current"),E==null||E.classList.add("active");const S=document.querySelector(s.steps.specificStep(v.dataset.step)),O=document.querySelector(s.steps.shownResponsiveStep);O==null||O.classList.add("d-none"),S==null||S.classList.remove("d-none"),c&&c(m+1)}else E==null||E.classList.remove("active");C.classList.contains("step--reachable")&&(E==null||E.addEventListener("click",()=>{c&&c(m+1),g(C,v)})),C.classList.contains("step--unreachable")&&(E==null||E.setAttribute("disabled","true"),E==null||E.addEventListener("click",()=>{g(C,v)}))}}),l==null||l.addEventListener("click",v=>{if(v.preventDefault(),o.storeFocus(),d){const m=new be(d);let E=v.target.getAttribute("href");E&&(E+="?content_only=1",Zp(void 0,null,function*(){try{const O=yield(yield fetch(E)).text(),x=document.createElement("div");x.innerHTML=O;const B=d.querySelector(e.modalBody),R=x.querySelector(e.pageCms);R&&B&&(B.innerHTML=R.innerHTML,m.show())}catch(S){n.emit(t.handleError,{eventType:"clickOnTermsLink",error:S})}}))}}),d==null||d.addEventListener("hidden.bs.modal",()=>{o.restoreFocus()}),n.on(t.updatedDeliveryForm,v=>{var m;const C=(m=v.deliveryOption)==null?void 0:m[0];if(!C)return;const E=C.querySelector(s.carrierExtraContentWrapper);if(!(E instanceof HTMLElement))return;document.querySelectorAll(s.carrierExtraContentWrapper).forEach(O=>{O.removeAttribute("data-active")}),E.setAttribute("data-active","")})},eh=()=>{const{returnFormSelectAll:n,returnFormProductCheckbox:e}=p.order,t=document.querySelector(n),r=document.querySelectorAll(e);t==null||t.addEventListener("click",()=>{const{checked:s}=t;r.forEach(o=>{o.disabled||(o.checked=s)})})};var th=(n,e,t)=>new Promise((r,s)=>{var o=c=>{try{a(t.next(c))}catch(l){s(l)}},i=c=>{try{a(t.throw(c))}catch(l){s(l)}},a=c=>c.done?r(c.value):Promise.resolve(c.value).then(o,i);a((t=t.apply(n,e)).next())});const oa=()=>{const{prestashop:n,Theme:{events:e}}=window,t=()=>{var i;(i=document.querySelectorAll(p.product.carousel))==null||i.forEach(a=>{a.addEventListener("slide.bs.carousel",r)})};function r(i){var a;const l=i.target.closest(p.product.images);l&&(l.querySelectorAll(p.product.thumbnail).forEach(d=>d.classList.remove("active")),(a=l.querySelector(p.product.activeThumbail(i.to)))==null||a.classList.add("active"))}t(),n.on(e.updatedProduct,t),n.on(e.quickviewOpened,t);function s(){const i=document.querySelector(p.qtyInput.quantityWanted),a=document.querySelector(p.qtyInput.increment),c=document.querySelector(p.qtyInput.decrement);if(i&&a&&c){const l=()=>th(this,null,function*(){const g=parseInt(i.value,10),v=o(i);g>=v?i.value=g.toString():i.value=v.toString(),n.emit("updateProduct",{eventType:"updatedProductQuantity"})}),d=Nt(l,500);i.addEventListener("input",()=>{d()}),i.addEventListener("blur",()=>{l()}),i.addEventListener("change",l),a.addEventListener("click",l),c.addEventListener("click",l)}}const o=i=>Number(i.getAttribute("min"))||1;s()},ia=()=>{const{Theme:n}=window,{mobileMenu:e}=n.selectors,t=document.querySelectorAll(e.openChildsButton),r=document.querySelector(e.backTitle),s=document.querySelector(e.backButton),o=document.querySelector(e.menuCanvas),i=r==null?void 0:r.innerHTML,a=()=>{var c;if(r&&s&&i){const l=document.querySelector(e.menuCurrent),d=Number(l==null?void 0:l.dataset.depth),g=d===2?0:d-1,v=document.querySelector(e.specificParent(g));d===2&&s.classList.add("d-none"),l&&l.classList.remove("js-menu-current","menu--current"),v&&(d>3?r.innerHTML=(c=v.dataset.backTitle)!=null?c:"":r.innerHTML=i,v.classList.add("js-menu-current","menu--fromLeft","menu--current"),v.classList.remove("menu--parent"))}};o==null||o.addEventListener("hidden.bs.offcanvas",()=>{const c=document.querySelector(e.menuCurrent);if(mr(c)){let l=Number(c.dataset.depth);if(l!==0)for(;l>=2;)a(),l-=1}}),t.forEach(c=>{c.addEventListener("click",()=>{const l=document.querySelector(e.menuCurrent);if(l){const d=Number(l.dataset.depth),g=c;l&&(l.classList.remove("js-menu-current","menu--current","menu--fromLeft","menu--fromRight"),l.classList.add("menu--parent"));const v=document.querySelector(e.specificChild(g.dataset.target));s==null||s.classList.remove("d-none"),d>=1&&r&&(v!=null&&v.dataset.backTitle)&&(r.innerHTML=v.dataset.backTitle),mr(v)&&(v.classList.add("js-menu-current","menu--fromRight","menu--current"),v.classList.remove("js-menu-child","menu--child"))}})}),s==null||s.addEventListener("click",()=>{a()})};var nh=(n,e,t)=>new Promise((r,s)=>{var o=c=>{try{a(t.next(c))}catch(l){s(l)}},i=c=>{try{a(t.throw(c))}catch(l){s(l)}},a=c=>c.done?r(c.value):Promise.resolve(c.value).then(o,i);a((t=t.apply(n,e)).next())});const rh=(n,e,t=10)=>nh(void 0,null,function*(){const r=new FormData;return r.append("s",e),r.append("resultsPerPage",t.toString()),(yield(yield fetch(n,{method:"POST",body:r,headers:{Accept:"application/json, text/javascript, */*; q=0.01"}})).json()).products});var sh=(n,e,t)=>new Promise((r,s)=>{var o=c=>{try{a(t.next(c))}catch(l){s(l)}},i=c=>{try{a(t.throw(c))}catch(l){s(l)}},a=c=>c.done?r(c.value):Promise.resolve(c.value).then(o,i);a((t=t.apply(n,e)).next())});const bs=()=>{const{Theme:n}=window,{searchBar:e}=n.selectors,t=document.querySelector(e.searchCanvas),r=document.querySelector(e.searchWidget),s=document.querySelector(e.searchDropdown),o=document.querySelector(e.searchResults),i=document.querySelector(e.searchTemplate),a=document.querySelector(e.searchInput),c=document.querySelector(e.searchIcon),l=document.querySelector(e.searchClear),d=r==null?void 0:r.dataset.searchControllerUrl;r==null||r.addEventListener("click",()=>{a==null||a.focus()}),c==null||c.addEventListener("click",()=>{var v;a!=null&&a.value&&((v=a==null?void 0:a.form)==null||v.submit())});const g=()=>
55{a!=null&&a.value&&(a.value="",a.dispatchEvent(new Event("input",{bubbles:!0}))),l==null||l.classList.add("d-none"),l==null||l.setAttribute("tabindex","-1"),a==null||a.focus()};if(l==null||l.addEventListener("click",g),l==null||l.addEventListener("keydown",v=>{(v.key==="Enter"||v.key===" "||v.code==="Space")&&(v.preventDefault(),g()),v.key==="Tab"&&v.shiftKey&&(v.preventDefault(),a==null||a.focus())}),a==null||a.addEventListener("focus",()=>{a!=null&&a.value&&(l==null||l.classList.remove("d-none"),l==null||l.setAttribute("tabindex","0"))}),a==null||a.addEventListener("input",()=>{a.value.trim()===""?(l==null||l.classList.add("d-none"),l==null||l.setAttribute("tabindex","-1"),s&&o&&(s.classList.add("d-none"),a.setAttribute("aria-expanded","false"),o.innerHTML="")):(l==null||l.classList.remove("d-none"),l==null||l.setAttribute("tabindex","0"))}),t==null||t.addEventListener("hidden.bs.offcanvas",()=>{s&&o&&a&&(o.innerHTML="",s.classList.add("d-none"),a.setAttribute("aria-expanded","false"))}),r&&a&&o&&s){const v=N=>{o.innerHTML="",N.forEach($=>{const H=i==null?void 0:i.content.cloneNode(!0);if(H){const z=H.querySelector("a"),ue=H.querySelector("p"),ne=H.querySelector("img");z&&ue&&ne&&(z.href=$.canonical_url,z.id=`result_product_option_${$.id_product.toString()}`,z.setAttribute("aria-label",$.name),ue.innerHTML=$.name,$.cover?(ne.src=$.cover.small.url,ne.alt=$.cover.legend):ne.innerHTML="",o.append(H))}})};let m=-1;const C=N=>{const $=o.querySelectorAll(e.searchResultLink);switch(N.key){case"ArrowDown":N.preventDefault(),m=Math.min(m+1,$.length-1),E($,m);break;case"ArrowUp":N.preventDefault(),m>0?(m=Math.max(m-1,0),E($,m)):(m=-1,a.focus());break;case"Enter":m>=0&&$[m]&&(N.preventDefault(),$[m].click());break;case"Escape":N.preventDefault(),s.classList.add("d-none"),a.setAttribute("aria-expanded","false"),a.focus(),m=-1;break;default:break}},E=(N,$)=>{N.forEach((H,z)=>{z===$?(H.focus(),H.setAttribute("aria-selected","true"),a.setAttribute("aria-activedescendant",N[$].id)):H.setAttribute("aria-selected","false")})};let S=!1,O=null;a.addEventListener("focus",()=>{a.removeAttribute("aria-activedescendant"),m=-1,S=!0,O&&(clearTimeout(O),O=null),a.value&&o&&o.children.length>0&&(s==null||s.classList.remove("d-none"),a.setAttribute("aria-expanded","true"))});const x=()=>{S=!1,O=window.setTimeout(()=>{!S&&s&&a&&(s.classList.add("d-none"),a.setAttribute("aria-expanded","false"),m=-1)},100)};a.addEventListener("blur",x),l==null||l.addEventListener("focus",()=>{S=!0,O&&(clearTimeout(O),O=null),a!=null&&a.value&&o&&o.children.length>0&&(s.classList.remove("d-none"),a.setAttribute("aria-expanded","true"))}),l==null||l.addEventListener("blur",x),window.addEventListener("click",N=>{const $=N.target;!r.contains($)&&!s.contains($)&&(s.classList.add("d-none"),a.setAttribute("aria-expanded","false"),m=-1,S=!1)});const R=Nt(()=>sh(void 0,null,function*(){if(!d||a.value.trim()==="")return;const N=yield rh(d,a.value,10);N.length>0?(v(N),l==null||l.classList.remove("d-none"),l==null||l.setAttribute("tabindex","0"),s==null||s.classList.remove("d-none"),m=-1,a.setAttribute("aria-expanded","true"),o.querySelectorAll(e.searchResultLink).forEach(H=>{H.setAttribute("role","option"),H.setAttribute("aria-selected","false"),H.setAttribute("tabindex","-1"),H.addEventListener("keydown",C),H.addEventListener("focus",()=>{S=!0,O&&(clearTimeout(O),O=null)}),H.addEventListener("blur",x)})):(o.innerHTML="",s.classList.add("d-none"),a.setAttribute("aria-expanded","false"),m=-1)}),250);a.addEventListener("input",R),a.addEventListener("keydown",N=>{if(N.key==="Tab"&&!N.shiftKey&&!(l!=null&&l.classList.contains("d-none"))&&!(s!=null&&s.classList.contains("d-none"))){N.preventDefault(),l==null||l.focus();return}["ArrowDown","ArrowUp","Enter","Escape"].includes(N.key)&&C(N)})}},vr=(n,e)=>{if(!("psData"in n.dataset))return null;const t=n.dataset.psData;if(t===void 0)return console.warn("Attribute data-ps-data is not defined."),null;try{const r=JSON.parse(t);return e(r)?r:(console.warn("Attribute data-ps-data has validation error."),null)}catch(r){return console.error("Attribute data-ps-data is not a valid JSON format.",r),null}};var oh=Object.defineProperty,ih=Object.defineProperties,ah=Object.getOwnPropertyDescriptors,gr=Object.getOwnPropertySymbols,aa=Object.prototype.hasOwnProperty,ca=Object.prototype.propertyIsEnumerable,la=(n,e,t)=>e in n?oh(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,ch=(n,e)=>{for(var t in e||(e={}))aa.call(e,t)&&la(n,t,e[t]);if(gr)for(var t of gr(e))ca.call(e,t)&&la(n,t,e[t]);return n},lh=(n,e)=>ih(n,ah(e)),uh=(n,e)=>{var t={};for(var r in n)aa.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&gr)for(var r of gr(n))e.indexOf(r)<0&&ca.call(n,r)&&(t[r]=n[r]);return t},ua=(n,e,t)=>new Promise((r,s)=>{var o=c=>{try{a(t.next(c))}catch(l){s(l)}},i=c=>{try{a(t.throw(c))}catch(l){s(l)}},a=c=>c.done?r(c.value):Promise.resolve(c.value).then(o,i);a((t=t.apply(n,e)).next())});const dh=n=>typeof n=="object"&&n!==null&&typeof n.id_product=="string"&&typeof n.id_product_attribute=="string",fh=n=>typeof n=="object"&&n!==null&&typeof n.id_product=="string"&&typeof n.id_product_attribute=="string"&&typeof n.url=="string",ph=(n,e)=>ua(void 0,null,function*(){var t,r;const{url:s}=n.dataset;if(!s)return;const o=n.querySelector(Q.emailInput),i=n.querySelector(Q.alertsContainer),a=new URLSearchParams(lh(ch({},e),{customer_email:(t=o==null?void 0:o.value)!=null?t:""}));try{const l=yield(yield fetch(s,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:a.toString()})).json();i&&(i.innerHTML="",i.classList.remove("d-none"),ar(l.message,{type:l.error?"danger":"success",selector:Q.alertsContainer}).show()),l.error||(r=n.querySelector(Q.content))==null||r.classList.add("d-none")}catch(c){console.error("[EmailAlerts] Subscribe error:",c)}}),hh=(n,e)=>ua(void 0,null,function*(){var t,r;const s=n.closest(Q.product);if(!s)return;const o=e,{url:i}=o,a=uh(o,["url"]),c=new URLSearchParams(a);try{(yield(yield fetch(i,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:c.toString()})).text())==="0"&&(s.remove(),document.querySelectorAll(Q.product).length===0&&((t=document.querySelector(Q.productList))==null||t.classList.add("d-none"),(r=document.querySelector(Q.noAlerts))==null||r.classList.remove("d-none")))}catch(l){console.error("[EmailAlerts] Unsubscribe error:",l)}}),mh=n=>{const e=n.target,t=e.closest(Q.submitButton);if(t){n.preventDefault();const s=t.closest(Q.wrapper),o=vr(t,dh);o&&s&&ph(s,o);return}const r=e.closest(Q.deleteButton);if(r){n.preventDefault();const s=vr(r,fh);s&&hh(r,s)}},vh=()=>{document.addEventListener("click",mh)};var gh=Object.defineProperty,_r=Object.getOwnPropertySymbols,da=Object.prototype.hasOwnProperty,fa=Object.prototype.propertyIsEnumerable,pa=(n,e,t)=>e in n?gh(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,_h=(n,e)=>{for(var t in e||(e={}))da.call(e,t)&&pa(n,t,e[t]);if(_r)for(var t of _r(e))fa.call(e,t)&&pa(n,t,e[t]);return n},Eh=(n,e)=>{var t={};for(var r in n)da.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&_r)for(var r of _r(n))e.indexOf(r)<0&&fa.call(n,r)&&(t[r]=n[r]);return t},bh=(n,e,t)=>new Promise((r,s)=>{var o=c=>{try{a(t.next(c))}catch(l){s(l)}},i=c=>{try{a(t.throw(c))}catch(l){s(l)}},a=c=>c.done?r(c.value):Promise.resolve(c.value).then(o,i);a((t=t.apply(n,e)).next())});const yh=n=>typeof n=="object"&&n!==null&&typeof n.id_module=="string"&&typeof n.front_controller=="string"&&typeof n.id_customer=="string"&&typeof n.customer_token=="string"&&typeof n.id_guest=="string"&&typeof n.guest_token=="string",wh=n=>{const e=vr(n,yh);return e?(e.front_controller&&(e.front_controller=e.front_controller.replace(/&amp;/g,"&")),e):null},ha=n=>{var e,t;const r=n.closest(te.consentWrapper);if(r)return(e=r.querySelector(te.submitButton))!=null?e:r.querySelector('[type="submit"]');const s=n.closest("form");return(t=s==null?void 0:s.querySelector('[type="submit"]'))!=null?t:null},ma=(n,e)=>{e.disabled=!n.checked},Sh=n=>bh(void 0,null,function*(){const e=n,{front_controller:t}=e,r=Eh(e,["front_controller"]),s=new URLSearchParams(_h({ajax:"true",action:"AddLog"},r));try{yield fetch(t,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:s.toString()})}catch(o){console.error("[GDPR] Log consent error:",o)}}),ys=()=>{document.querySelectorAll(te.consent).forEach(n=>{const e=n.querySelector(te.checkbox),t=ha(n);e&&t&&ma(e,t)})},Ah=n=>{const e=n.target;if(!e.matches(te.checkbox))return;const t=e.closest(te.consent);if(!t)return;const r=ha(t);r&&ma(e,r)},va=n=>{const e=n.querySelector(te.checkbox),t=wh(n);t&&(e!=null&&e.checked)&&Sh(t)},Th=n=>{const t=n.target.closest(te.submitButton);if(!t)return;const r=t.closest(te.consentWrapper),s=r==null?void 0:r.querySelector(te.consent);s&&va(s)},Ch=n=>{const e=n.target;if(!e.matches("form"))return;const t=e.querySelector(te.consent);t&&va(t)},Lh=()=>{ys(),document.addEventListener("change",Ah),document.addEventListener("click",Th),document.addEventListener("submit",Ch);const{prestashop:n}=window;
55n&&(n.on("updatedProduct",ys),n.on("updatedCart",ys))},ws=()=>{const{Theme:n}=window,{languageSelector:e}=n.selectors,t=document.querySelector(e.languageSelector);t==null||t.addEventListener("change",r=>{const s=r.target;window.location.href=s.value})},Ss=()=>{const{Theme:n}=window,{currencySelector:e}=n.selectors,t=document.querySelector(e.currencySelector);t==null||t.addEventListener("change",r=>{const s=r.target;window.location.href=s.value})},ga=()=>{const{Theme:n}=window,{guestPasswordToggle:e}=n.selectors,t=document.querySelector(e.checkbox),r=document.querySelector(e.passwordWrapper);t&&r&&t.addEventListener("change",()=>{const s=r.querySelector('input[type="password"]');if(t.checked)r.classList.remove("d-none");else if(r.classList.add("d-none"),s){const o=document.querySelector(n.selectors.passwordPolicy.container);s.value="",s.classList.remove("border-success","border-danger","border"),o&&o.classList.add("d-none")}})},_a=()=>{const{Theme:n}=window,{visiblePassword:e}=n.selectors;document.querySelectorAll(e.visiblePassword).forEach(r=>{const s=r==null?void 0:r.previousElementSibling;r==null||r.addEventListener("click",()=>{const o=s.getAttribute("type")==="text"?"password":"text";s.setAttribute("type",o);const i=r.firstElementChild;if(i){i.innerHTML=o==="text"?"visibility_off":"visibility";const{textHide:a,textShow:c}=r.dataset;c&&a&&r.setAttribute("aria-label",o==="text"?a:c)}})})},Mh=()=>{const{Theme:{events:n}}=window,{prestashop:e}=window;e.on(n.handleError,({resp:t})=>{t.errors&&Array.isArray(t.errors)&&t.errors.forEach(r=>{cr(r,{type:"danger"}).show()})})};var Ea=re(604),As=(n,e,t)=>new Promise((r,s)=>{var o=c=>{try{a(t.next(c))}catch(l){s(l)}},i=c=>{try{a(t.throw(c))}catch(l){s(l)}},a=c=>c.done?r(c.value):Promise.resolve(c.value).then(o,i);a((t=t.apply(n,e)).next())});const{passwordPolicy:ae}=p,Oh=n=>{try{return JSON.parse(n)}catch(e){return{}}},Ph=(n,e,t)=>{const r=n.querySelector(ae.requirementLengthIcon),s=n.querySelector(ae.requirementScoreIcon);r&&(r.classList.toggle("text-success",e),r.classList.toggle("text-danger",!e)),s&&(s.classList.toggle("text-success",t),s.classList.toggle("text-danger",!t))},kh=(n,e,t)=>{const r=Nh(e,t),s=n.querySelector(ae.progressBar);s&&(s.style.width=`${r.percentage}%`,s.classList.remove("bg-success","bg-danger"),s.classList.add(r.color))},Dh=(n,e,t,r,s)=>{var o,i;let a="";if(r){if(!s){const c=n.querySelector(ae.invalidMessage);a=`${((i=c==null?void 0:c.dataset)==null?void 0:i.psData)||"Your password is too weak"}
56`}}else{const c=n.querySelector(ae.lengthMessage);a=`${((o=c==null?void 0:c.dataset)==null?void 0:o.psData)||"Your password length is invalid"}
57`}return e.feedback.warning&&e.feedback.warning in t&&(a+=`
58${t[e.feedback.warning]}
59`),e.feedback.suggestions&&e.feedback.suggestions.forEach(c=>{c&&c in t&&(a+=a?`
60${t[c]}`:t[c])}),a},Nh=(n,e)=>{const t={0:20,1:40,2:60,3:80,4:100},s=Object.keys(t).map(Number).includes(n)?n:0;return{color:e?"bg-success":"bg-danger",percentage:t[s]}},Ts=(n,e,t)=>As(void 0,null,function*(){const r=n.value;if(r===""){e.classList.add("d-none");return}try{const{prestashop:s}=window,o=yield s.checkPasswordScore(r),i=parseInt(n.dataset.minscore||"3",10);e.classList.remove("d-none");const a=!n.validity.tooShort&&!n.validity.tooLong,c=i<=o.score;Ph(e,a,c),kh(e,o.score,a&&c);const l=e.querySelector(ae.announceValidity),d=e.querySelector(ae.validMessage);if(c&&a){if(n.setCustomValidity(""),n.reportValidity(),l&&d){const g=d.dataset.psData;g&&g!==""&&(l.textContent=g)}}else{const g=Dh(e,o,t,a,c);n.setCustomValidity(g),l&&(l.textContent=g)}}catch(s){console.error("Password validation error:",s)}}),Ih=Nt((...n)=>As(void 0,null,function*(){const e=n[0];e&&e.setAttribute("aria-live","polite")}),250),Rh=(n,e,t)=>{const r=n.querySelector(ae.requirementLength),s=n.querySelector(ae.requirementScore),o=n.querySelector(ae.requirementLengthMessage),i=n.querySelector(ae.requirementScoreMessage);if(o&&(r!=null&&r.dataset.translation)){const a=e.getAttribute("minlength")||"8",c=e.getAttribute("maxlength")||"72";o.innerText=(0,Ea.sprintf)(r.dataset.translation,a,c)}if(i&&(s!=null&&s.dataset.translation)){const a=e.dataset.minscore||"3",c=t[a]||"Strong";i.innerText=(0,Ea.sprintf)(s.dataset.translation,c)}},cn=(n,e,t=null)=>{var r;const s=(r=t==null?void 0:t.querySelector(n))!=null?r:document.querySelector(n);if(!s)throw new Error(e);return s},xh=(n,e,t)=>{const r=()=>Ts(n,e,t);n.addEventListener("input",r);const s=n.closest("form");let o=null;s&&(o=()=>As(void 0,null,function*(){yield Ts(n,e,t)}),s.addEventListener("submit",o));const i=e.querySelector(ae.announceValidity);return i&&Ih(i),{inputHandler:r,formSubmitHandler:o,form:s}},$h=()=>{let n;try{n=cn(ae.field,`The element "${ae.field}" for password policy is not found.`)}catch(g){return}const e=cn(ae.input,`The input element "${ae.input}" for password policy is not found.`,n),t=cn(ae.feedbackTarget,`The target element "${ae.feedbackTarget}" for password policy is not found.`,n),r=cn(ae.template,`The feedback template "${ae.template}" for password policy is not found.`);t.innerHTML=r.innerHTML;const s=cn(ae.feedbackContainer,`The feedback container element "${ae.feedbackContainer}" for password policy is not found.`,t),o=cn(ae.hint,`The hint element "${ae.hint}" for password policy is not found.`,n),i=Oh(o.innerHTML);Rh(s,e,i);const{inputHandler:a,formSubmitHandler:c,form:l}=xh(e,s,i);return e.value!==""&&Ts(e,s,i),{element:n,cleanup:()=>{e.removeEventListener("input",a),l&&c&&l.removeEventListener("submit",c)}}};function ba(){const{prestashop:n}=window;let e=null,t=null,r=null;function s(o){const i=Ji();i.innerHTML=o;const a=i.querySelector(p.blockcartModal);
60if(!a)throw new Error("Blockcart modal element not found in provided HTML.");let c="unknown";const l=g=>{(g.key==="Escape"||g.key==="Esc")&&(c="keyboard");const v=document.activeElement;v&&v.closest('[data-bs-dismiss="modal"]')&&(g.key==="Enter"||g.key===" "||g.code==="Space")&&(c="keyboard")},d=()=>{c="pointer"};a.addEventListener("shown.bs.modal",()=>{var g;document.addEventListener("keydown",l,{capture:!0}),document.addEventListener("pointerdown",d,{capture:!0});const v=a.querySelector(p.blockcartModalStatus);v&&(v.textContent=(g=v.getAttribute("data-ps-data"))!=null?g:"")}),a.addEventListener("hidden.bs.modal",g=>{const v=g.currentTarget;v&&n.emit(Pn.updateProduct,{reason:v.dataset,event:g}),document.removeEventListener("keydown",l,{capture:!0}),document.removeEventListener("pointerdown",d,{capture:!0}),c==="keyboard"&&e&&document.contains(e)?(e.focus(),t=null):e||console.error("Last blockcart opener not found."),a.remove()}),be.getOrCreateInstance(a,{focus:!0,keyboard:!0}).show()}n.on(Pn.clickQuickview,o=>{r=o}),document.addEventListener("click",o=>{var i,a,c,l;const d=o.target;if(!d)return;const{quickview:g,quickviewButton:v,addToCartButton:m,product:{miniature:C,container:E}}=p,S=d.closest(v)!==null,O=d.closest(m)!==null;if(S)t=d.closest(C),e=(i=t==null?void 0:t.querySelector(g))!=null?i:null;else if(O){const x=d.closest(C),B=d.closest(E);if(x)t=x,e=(a=t==null?void 0:t.querySelector(m))!=null?a:null;else if(B){const R=B;e=(c=R==null?void 0:R.querySelector(m))!=null?c:null}else t=r,e=(l=t==null?void 0:t.querySelector(g))!=null?l:null}}),n.blockcart=n.blockcart||{},n.blockcart.showModal=function(i){s(i)}}const Cs={HAS_CHILD:"data-ps-has-child",OPEN_TAB:"data-open-tab",DEPTH:"data-depth",SELECTED:'aria-selected="true"'};class qh{constructor(){this.state={isSubMenuOpen:!1,currentSubMenu:null,currentDropdownButton:null}}get isSubMenuOpen(){return this.state.isSubMenuOpen}get currentSubMenu(){return this.state.currentSubMenu}get currentDropdownButton(){return this.state.currentDropdownButton}setSubMenuOpen(e){this.state.isSubMenuOpen=e}setCurrentSubMenu(e){this.state.currentSubMenu=e}setCurrentDropdownButton(e){this.state.currentDropdownButton=e}reset(){this.state={isSubMenuOpen:!1,currentSubMenu:null,currentDropdownButton:null}}}class Et{static getMainMenuItems(){return document.querySelectorAll(`${w.container} ${w.menuLink}`)}static getDropdownButtons(){return document.querySelectorAll(`${w.container} ${w.dropdownToggle}`)}static getAllSubMenus(){return document.querySelectorAll(`${w.subMenu}`)}static getSubMenuLeftItems(){return document.querySelectorAll(`${w.subMenuLeft} > ${w.subMenuLeftItem}`)}static getSubMenuRightTabs(){return document.querySelectorAll(`${w.subMenuRight} ${w.subMenuRightItems}`)}static getActiveSubMenuLeftItem(e){return e.querySelector(`${w.subMenuLeftItem}[${Cs.SELECTED}]`)}static createMainMenuElementsArray(e){const t=[];return e.forEach(r=>{t.push(r);const s=r.closest(w.menuItem),o=s==null?void 0:s.querySelector(w.dropdownToggle);o&&t.push(o)}),t}}class Ze{static setSubMenuVisibility(e,t){e.style.display=t?"block":"none"}static setDropdownButtonState(e,t){e.setAttribute("aria-expanded",t.toString())}static setTabSelection(e,t){e.setAttribute("aria-selected",t.toString()),e.setAttribute("tabindex",t?"0":"-1"),e.classList.toggle("active",t)}static setTabPanelVisibility(e,t){e.classList.toggle("active",t),e.classList.toggle("not-active",!t)}static resetAllSubMenuStates(){const e=Et.getAllSubMenus(),t=Et.getDropdownButtons();e.forEach(r=>{this.setSubMenuVisibility(r,!1)}),t.forEach(r=>{this.setDropdownButtonState(r,!1)})}}class ln{static navigateMainMenu(e,t,r){const s=r.indexOf(e);if(s<0)return;const o=this.calculateTargetIndex(s,t,r.length),i=r[o];i&&i.focus()}static getNextSubMenuTab(e,t,r){const s=r.querySelectorAll(w.subMenuLeftItem),o=Array.from(s).indexOf(e);if(o<0)return null;const i=this.calculateTargetIndex(o,t,s.length);return s[i]}static calculateTargetIndex(e,t,r){return t==="next"?(e+1)%r:e===0?r-1:e-1}}class Vh{constructor(e){this.stateManager=e}showSubMenu(e,t){this.closeAllSubMenus(),this.positionSubMenu(e,t),this.updateSubMenuState(e,t,!0),this.initializeSubMenuTabs(t)}hideSubMenu(e,t){Ze.setSubMenuVisibility(t,!1),Ze.setDropdownButtonState(e,!1),this.stateManager.setSubMenuOpen(!1),this.stateManager.setCurrentSubMenu(null),this.stateManager.setCurrentDropdownButton(null)}closeAllSubMenus(){Ze.resetAllSubMenuStates(),this.stateManager.reset()}switchSubMenuTab(e,t){const r=t.querySelectorAll(w.subMenuLeftItem),s=t.querySelectorAll(`${w.subMenuRight} ${w.subMenuRightItems}`);r.forEach(o=>{Ze.setTabSelection(o,!1)}),e.hasAttribute(Cs.HAS_CHILD)&&Ze.setTabSelection(e,!0),s.forEac
60h(o=>{Ze.setTabPanelVisibility(o,!1)}),this.showCorrespondingRightTab(e,t)}positionSubMenu(e,t){const r=e.closest(w.menuItem);if(!r)return;const s=r.offsetHeight+r.offsetTop;t.style.top=`${s}px`}updateSubMenuState(e,t,r){Ze.setSubMenuVisibility(t,r),Ze.setDropdownButtonState(e,r),this.stateManager.setSubMenuOpen(r),this.stateManager.setCurrentSubMenu(t),this.stateManager.setCurrentDropdownButton(e)}initializeSubMenuTabs(e){const t=e.querySelectorAll(`${w.subMenuRight} ${w.subMenuRightItems}`),r=e.querySelectorAll(w.subMenuLeftItem);t.forEach(s=>{Ze.setTabPanelVisibility(s,!1)}),r.forEach((s,o)=>{Ze.setTabSelection(s,o===0),o===0&&this.showCorrespondingRightTab(s,e)})}showCorrespondingRightTab(e,t){const r=e.getAttribute(Cs.OPEN_TAB);if(!r)return;const s=t.querySelector(`#${r}`);s&&Ze.setTabPanelVisibility(s,!0)}}class Fh{constructor(e,t,r){this.stateManager=e,this.subMenuManager=t,this.allMainMenuElements=r,this.handleMainMenuLinkKeydown=s=>{const o=s.target;switch(s.key){case"ArrowRight":case"ArrowDown":s.preventDefault(),ln.navigateMainMenu(o,"next",this.allMainMenuElements);break;case"ArrowLeft":case"ArrowUp":s.preventDefault(),ln.navigateMainMenu(o,"prev",this.allMainMenuElements);break;default:}},this.handleDropdownButtonKeydown=(s,o)=>i=>{switch(i.key){case"Enter":case" ":i.preventDefault(),this.toggleSubMenu(s,o);break;case"Escape":i.preventDefault(),this.subMenuManager.hideSubMenu(s,o),s.focus();break;case"ArrowRight":i.preventDefault(),ln.navigateMainMenu(s,"next",this.allMainMenuElements);break;case"ArrowDown":if(i.preventDefault(),this.stateManager.isSubMenuOpen&&this.stateManager.currentSubMenu===o){const a=o.querySelector(w.subMenuLeftItem);a&&a.focus()}else ln.navigateMainMenu(s,"next",this.allMainMenuElements);break;case"ArrowLeft":case"ArrowUp":i.preventDefault(),ln.navigateMainMenu(s,"prev",this.allMainMenuElements);break;default:}},this.handleSubMenuTabKeydown=s=>o=>{const i=s.closest(w.subMenu);if(i)switch(o.key){case"ArrowDown":o.preventDefault(),this.navigateToSubMenuTab(s,"next",i);break;case"ArrowUp":o.preventDefault(),this.navigateToSubMenuTab(s,"prev",i
60);break;case" ":o.preventDefault(),this.subMenuManager.switchSubMenuTab(s,i);break;case"Escape":o.preventDefault(),this.handleSubMenuEscape(i);break;default:}},this.handleClickOutside=s=>{s.target.closest(w.container)||this.subMenuManager.closeAllSubMenus()},this.handleFocusOut=s=>{const o=s.target,i=s.relatedTarget;o&&o.closest(w.container)&&(!i||!i.closest(w.container))&&this.subMenuManager.closeAllSubMenus()},this.handleRightSubMenuKeydown=s=>{const i=s.target.closest(w.subMenu);if(i)switch(s.key){case"Escape":s.preventDefault(),this.handleSubMenuEscape(i);break;case"ArrowLeft":{s.preventDefault();const a=Et.getActiveSubMenuLeftItem(i);a&&a.focus();break}default:}}}toggleSubMenu(e,t){this.stateManager.isSubMenuOpen&&this.stateManager.currentSubMenu===t?this.subMenuManager.hideSubMenu(e,t):this.subMenuManager.showSubMenu(e,t)}navigateToSubMenuTab(e,t,r){const s=ln.getNextSubMenuTab(e,t,r);s&&(s.focus(),this.subMenuManager.switchSubMenuTab(s,r))}handleSubMenuEscape(e){var t;const r=(t=e.closest(w.menuItem))==null?void 0:t.querySelector(w.dropdownToggle);r&&(r.focus(),this.subMenuManager.closeAllSubMenus())}}class Uh{constructor(e,t){this.subMenuManager=e,this.eventHandlers=t}setupDropdownButton(e){const t=e.closest(w.menuItem),r=t==null?void 0:t.querySelector(w.subMenu);r&&(t==null||t.addEventListener("mouseenter",()=>this.subMenuManager.showSubMenu(e,r)),t==null||t.addEventListener("mouseleave",()=>this.subMenuManager.hideSubMenu(e,r)),e.addEventListener("keydown",this.eventHandlers.handleDropdownButtonKeydown(e,r)))}setupMainMenuLink(e){e.addEventListener("keydown",this.eventHandlers.handleMainMenuLinkKeydown)}setupSubMenuNavigation(){const e=Et.getSubMenuLeftItems(),t=Et.getSubMenuRightTabs();e.forEach(r=>{r.addEventListener("mouseenter",()=>{const s=r.closest(w.subMenu);s&&this.subMenuManager.switchSubMenuTab(r,s)}),r.addEventListener("keydown",this.eventHandlers.handleSubMenuTabKeydown(r)),r.addEventListener("focus",()=>{const s=r.closest(w.subMenu);s&&this.subMenuManager.switchSubMenuTab(r,s)})}),t.forEach(r=>{r.addEventListener("keydown",this.eventHandlers.handleRightSubMenuKeydown)})}setupGlobalEventListeners(){document.addEventListener("click",this.eventHandlers.handleClickOutside),document.addEventListener("focusout",this.eventHandlers.handleFocusOut)}}const Ls=()=>{const n=new qh,e={mainMenuItems:Et.getMainMenuItems(),dropdownButtons:Et.getDropdownButtons(),allMainMenuElements:Et.createMainMenuElementsArray(Et.getMainMenuItems())},t=new Vh(n),r=new Fh(n,t,e.allMainMenuElements),s=new Uh(t,r);e.dropdownButtons.forEach(o=>s.setupDropdownButton(o)),e.mainMenuItems.forEach(o=>s.setupMainMenuLink(o)),s.setupSubMenuNavigation(),s.setupGlobalEventListeners()},jh=n=>{const{Theme:e}=window,{formValidation:t}=e.selectors;document.querySelectorAll(n!=null?n:t.default).forEach(s=>{const o=s.querySelector(t.submitButton);o&&o.addEventListener("click",i=>{s.classList.add("was-validated"),s.checkValidity()||(i.preventDefault(),s.reportValidity())})})},Hh=()=>{const n=document.querySelector(".ps-categorytree");n&&n.querySelectorAll(".accordion-button").forEach(t=>{t.addEventListener("click",()=>{var r;const s=t.getAttribute("aria-expanded")==="true";(r=t.closest(".category-tree__item"))==null||r.classList.toggle("active",s)})})};var Bh=(n,e,t)=>new Promise((r,s)=>{var o=c=>{try{a(t.next(c))}catch(l){s(l)}},i=c=>{try{a(t.throw(c))}catch(l){s(l)}},a=c=>c.done?r(c.value):Promise.resolve(c.value).then(o,i);a((t=t.apply(n,e)).next())});const ya=()=>Bh(void 0,null,function*(){const n=document.querySelector(p.layout.header);if(n){const e=n.offsetHeight,t=16;document.documentElement.style.setProperty("--scroll-padding-top",`${e+t}px`),document.documentElement.style.setProperty("scroll-padding-top","var(--scroll-padding-top)")}}),Wh=()=>{document.documentElement.style.setProperty("scroll-padding-top","0px")},Kh=()=>{document.documentElement.style.setProperty("scroll-padding-top","var(--scroll-padding-top)")},Yh=()=>{const n=document.querySelector(p.layout.header);n&&(n.addEventListener("focusin",Wh),n.addEventListener("focusout",e=>{n.contains(e.relatedTarget)||Kh()}))},zh=()=>{window.addEventListener("load",()=>{ya(),Yh()}),window.addEventListener("resize",Nt(ya,100))},Gh=()=>{const{prestashop:n,Theme:{events:e}}=window;document.addEventListener("show.bs.modal",s=>{const o=s.target;if(!o.matches(p.product.productImagesModal))return;const i=o.querySelector(p.product.productImagesModalCarousel),a=document.querySelector(p.product.carousel);if(!i||!a)return;const c=$t.getOrCreateInstance(i),l=t(a);l!==-1&&c.to(l)}),document.addEventListener("hide.bs.modal",s=>{const o=s.target;if(!o.matches(p.product.productImagesModal))return;const i=o.querySelector(p.product.productImagesModalCarousel),a=document.querySelector(p.product.carousel);if(!i||!a)return;const c=$t.getOrCreateInstance(a),l=t(i);l!==-1&&c.to(l)});const t=s=>{const o=s.querySelectorAll(".carousel-item");return Array.from(o).findIndex(i=>i.classList.contains("active"))},r=new Map;n.on(e.updateProduct,({event:s})=>{const o=s==null?void 0:s.target;if(!o||!o.id)return;const a=!!o.closest(p.quickviewModal)?"quickview":"main";r.set(a,{id:o.id})}),n.on(e.updatedProduct,()=>{r.forEach((s,o)=>{let i=null;if(o==="quickview"?i=document.querySelector(p.quickviewModal):i=document.querySelector(p.product.container),!i)return;const a=i.querySelector(`#${s.id}`);a&&(a.focus(),n.emit(e.combinationFocusRestored,{context:o,elementId:s.id})),r.delete(o)})}
60),n.on(e.combinationFocusRestored,({context:s})=>{let o=null;if(s==="quickview"?o=document.querySelector(p.quickviewModal):o=document.querySelector(p.product.container),!o)return;const i=o.querySelector(p.product.productAvailability);i&&setTimeout(()=>{i.setAttribute("aria-live","polite")},250)})},wa=new lr,Qh=()=>{const{prestashop:n,Theme:{events:e}}=window;n.on(e.updatedCart,()=>{if(ge.get("lastUpdateAction")===gt.DELETE_FROM_CART){const t=document.querySelector(p.cart.alertPlaceholder);if(t)Array.from(t.children).forEach(r=>{const s=r;s.getAttribute("data-ps-action")==="to-be-announced"&&(s.removeAttribute("data-ps-action"),s.setAttribute("tabindex","-1"),s.focus())});else{const r=document.querySelector(p.cart.overview);r&&wa.setFocus(r)}}if(ge.get("lastUpdateAction")===gt.UPDATE_PRODUCT_QUANTITY&&wa.restoreFocus(document.querySelector(p.cart.overview)),ge.get("lastUpdateAction")===gt.SUBMIT_VOUCHER){const t=document.querySelector(p.cart.voucherError),r=document.querySelector(p.cart.voucherList),s=document.querySelector(p.cart.voucherContainer);t&&t.style.display!=="none"?t.focus():r?r.focus():s&&s.focus()}if(ge.get("lastUpdateAction")===gt.REMOVE_VOUCHER){const t=document.querySelector(p.cart.voucherAccordionButton);t&&t.focus()}ge.set("lastUpdateAction",null)})};var un=(n,e,t)=>new Promise((r,s)=>{var o=c=>{try{a(t.next(c))}catch(l){s(l)}},i=c=>{try{a(t.throw(c))}catch(l){s(l)}},a=c=>c.done?r(c.value):Promise.resolve(c.value).then(o,i);a((t=t.apply(n,e)).next())});const et=new lr,{prestashop:Sa}=window,Y={POST_REVIEW_BUTTON:"[data-ps-ref='product-post-review-button']",MODAL_REVIEW:"[data-ps-ref='product-post-review-modal']",MODAL_REVIEW_FORM:"[data-ps-ref='product-post-review-form']",MODAL_REVIEW_ERROR:"[data-ps-ref='product-post-review-error-modal']",MODAL_REVIEW_POSTED:"[data-ps-ref='product-post-review-posted-modal']",FORM_VALIDATION_BUTTON:"[data-ps-action='form-validation-submit']",FORM_FIELD:"[data-ps-ref='product-post-review-form'] [name]",COMMENTS_LIST:"[data-ps-ref='product-comments-list']",PRODUCT_LIST_REVIEW:"[data-ps-ref='product-list-review']",PRODUCT_LIST_GRADE_NUMBER:"[data-ps-ref='product-list-comments-number'] [data-ps-ref='grade-value']",PRODUCT_LIST_COMMENTS_NUMBER:"[data-ps-ref='product-list-comments-number'] [data-ps-ref='number-value']",PAGINATION:"[data-ps-ref='product-comments-pagination']",PAGINATION_ITEM:"[data-ps-ref='pagination-item']",PAGINATION_PREV:"[data-ps-ref='pagination-item'][data-ps-action='prev']",PAGINATION_NEXT:"[data-ps-ref='pagination-item'][data-ps-action='next']",GRADE_STARS:"[data-ps-ref='grade-stars']",PRODUCT_LIST_GRADE_STARS:"[data-ps-ref='product-list-review'] [data-ps-ref='grade-stars']",COMMENT_LIST_GRADE_STARS:"[data-ps-ref='product-comments-list'] [data-ps-ref='grade-stars']",USEFUL_REVIEW:"[data-ps-ref='useful-review']",NOT_USEFUL_REVIEW:"[data-ps-ref='not-useful-review']",USEFUL_REVIEW_VALUE:"[data-ps-ref='useful-review-value']",NOT_USEFUL_REVIEW_VALUE:"[data-ps-ref='not-useful-review-value']",REPORT_ABUSE:"[data-ps-ref='report-abuse']",CONFIRM_BUTTON:"[data-ps-ref='confirm-button']",REFUSE_BUTTON:"[data-ps-ref='refuse-button']",UPDATE_COMMENT_USEFULNESS_POST_ERROR:"[data-ps-ref='update-comment-usefulness-post-error']",REPORT_COMMENT_CONFIRMATION:"[data-ps-ref='report-comment-confirmation']",REPORT_COMMENT_POST_ERROR:"[data-ps-ref='report-comment-post-error']",REPORT_COMMENT_POST_SUCCESS:"[data-ps-ref='report-comment-post-success']",BS_MODAL_BODY:".modal-body"};class j{static get postReviewButtons(){return Array.from(document.querySelectorAll(Y.POST_REVIEW_BUTTON))}static get modalReview(){return document.querySelector(Y.MODAL_REVIEW)}static get modalReviewForm(){return document.querySelector(Y.MODAL_REVIEW_FORM)}static get modalReviewError(){return document.querySelector(Y.MODAL_REVIEW_ERROR)}static get modalReviewPosted(){return document.querySelector(Y.MODAL_REVIEW_POSTED)}static get gradeStars(){return document.querySelectorAll(Y.GRADE_STARS)}static get productListGradeStars(){return document.querySelectorAll(Y.PRODUCT_LIST_GRADE_STARS)}static get commentListGradeStars(){return document.querySelectorAll(Y.COMMENT_LIST_GRADE_STARS)}static getFormValidationButton(e){return e.querySelector(Y.FORM_VALIDATION_BUTTON)}static getFormField(e){return document.querySelector(`${Y.FORM_FIELD}="${e}"]`)}static get commentsList(){return document.querySelector(Y.COMMENTS_LIST)}static get pagination(){return document.querySelector(Y.PAGINATION)}static get paginationItems(){return document.querySelectorAll(Y.PAGINATION_ITEM)}static get paginationPrev(){return document.querySelector(Y.PAGINATION_PREV)}static get paginationNext(){return document.querySelector(Y.PAGINATION_NEXT)}static getPaginationPage(e){return document.querySelector(`${Y.PAGINATION_ITEM}[data-ps-data="${e}"]`)}static get productListReviews(){return document.querySelectorAll(Y.PRODUCT_LIST_REVIEW)}static getProductListGradeNumber(e){return e.querySelector(Y.PRODUCT_LIST_GRADE_NUMBER)}static getProductListCommentsNumber(e){return e.querySelector(Y.PRODUCT_LIST_COMMENTS_NUMBER)}static getUsefulReviewButtons(e){return e.querySelectorAll(Y.USEFUL_REVIEW)}static getNotUsefulReviewButtons(e){return e.querySelectorAll(Y.NOT_USEFUL_REVIEW)}static getReportAbuseButtons(e){return e.querySelectorAll(Y.REPORT_ABUSE)}static getUsefulReviewValue(e){return e.querySelector(Y.USEFUL_REVIEW_VALUE)}static getNotUsefulReviewValue(e){return e.querySelector(Y.NOT_USEFUL_REVIEW_VALUE)}static get updateCommentUsefulnessPostErrorModal(){return document.querySelector(Y.UPDATE_COMMENT_USEFULNESS_POST_ERROR)}static get reportCommentConfirmationModal(){return document.querySelector(Y.REPORT_COMMENT_CONFIRMATION)}static get reportCommentPostErrorModal(){return document.querySelector(Y.REPORT_COMMENT_POST_ERROR)}static get reportCommentPostSuccessModal(){return document.querySelector(Y.REPORT_COMMENT_POST_SUCCESS)}}class Aa{static validateForm(e){return e.checkValidity()}static clearReviewForm(){const e=j.modalReviewForm;e&&(e.reset(),e.classList.remove("was-validated"))}static submitReviewForm(e,t){return un(this,null,function*(){t.preventDefault();const r=new FormData(e);if(this.validateForm(e))try{const o=yield(yield fetch(e.action,{method:"POST",body:r})).json();o?o.success?(this.clearReviewForm(),Mn.showReviewPostedModal()):this.handleSubmissionError(o):Mn.showReviewErrorModal(window.productC
60ommentPostErrorMessage)}catch(s){Mn.showReviewErrorModal(window.productCommentPostErrorMessage)}})}static handleSubmissionError(e){if(e.errors&&Array.isArray(e.errors)){const t=document.createElement("ul");e.errors.forEach(r=>{const s=document.createElement("li");s.textContent=r,t.appendChild(s)}),Mn.showReviewErrorModal(t.outerHTML)}else{const t=e.error||window.productCommentPostErrorMessage;Mn.showReviewErrorModal(t)}}}class Mn{static showReviewPostedModal(){this.closeReviewRelatedModals();const e=j.modalReviewPosted;e&&be.getOrCreateInstance(e).show()}static showReviewErrorModal(e){this.closeReviewRelatedModals();const t=j.modalReviewError;if(t){const r=t.querySelector(Y.BS_MODAL_BODY),s=be.getOrCreateInstance(t);r&&(r.innerHTML=e),s.show()}}static closeReviewRelatedModals(){[j.modalReview,j.modalReviewPosted,j.modalReviewError].forEach(t=>{if(t){const r=be.getInstance(t);r&&r.hide()}})}}class On{static init(){const{commentsList:e}=j;e&&(this.currentPage=parseInt(e.dataset.currentPage||"1",10),this.totalPages=parseInt(e.dataset.totalPages||"0",10),this.commentsListUrl=e.dataset.listCommentsUrl||"",this.commentPrototype=e.dataset.commentItemPrototype||"",this.initCommentsListingRatingSystem(),this.initPagination())}static initCommentsListingRatingSystem(){lt.initCommentListRatingSystem(),document.addEventListener("updateRating",()=>{lt.initCommentListRatingSystem()})}static initPagination(){const{pagination:e}=j;if(!e||this.totalPages<=1){this.loadInitialComments();return}this.initPaginationListeners(),this.initOnePagePagination()}static initPaginationListeners(){const{paginationItems:e}=j;e.forEach(t=>{t.addEventListener("click",r=>{if(r.preventDefault(),t.classList.contains("disabled"))return;const s=t.getAttribute("data-ps-action"),o=t.getAttribute("data-ps-data");this.handlePageClick(s,o)})})}static handlePageClick(e,t){let r=this.currentPage;e==="prev"?r=this.currentPage-1:e==="next"?r=this.currentPage+1:e==="page"&&t&&(r=parseInt(t,10)),!(r<1||r>this.totalPages||r===this.currentPage)&&(this.currentPage=r,this.fetchComments(r),this.updatePaginationUI())}static updatePaginationUI(){for(let r=1;r<=this.totalPages;r+=1){const s=j.getPaginationPage(r);if(s){const o=r===this.currentPage;s.classList.toggle("active",o);const i=s.querySelector("button");i&&(o?i.setAttribute("aria-current","page"):i.removeAttribute("aria-current"))}}const e=j.paginationPrev;if(e){const r=e.querySelector("button");if(r){const s=this.currentPage===1;e.classList.toggle("disabled",s),r.disabled=s}}const t=j.paginationNext;if(t){const r=t.querySelector("button");if(r){const s=this.currentPage===this.totalPages;t.classList.toggle("disabled",s),r.disabled=s}}}static fetchComments(e){return un(this,null,function*(){try{const t=yield fetch(`${this.commentsListUrl}&page=${e}`);if(t.status===200){const r=yield t.text(),s=JSON.parse(r);this.populateComments(s.comments)}}catch(t){console.error("Error fetching comments:",t)}})}static populateComments(e){const{commentsList:t}=j;t&&(t.innerHTML="",e.forEach(r=>{this.addComment(r)}))}static formatCommentContent(e){return e?e.replace(/\r\n|\r|\n/g,"<br>"):""}static addComment(e){const{commentsList:t}=j;if(!t)return;let r=this.commentPrototype;if(!r)return;const s=e.customer_name||`${e.firstname} ${e.lastname}`;r=r.replace(/@COMMENT_ID@/g,e.id_product_comment.toString()),r=r.replace(/@PRODUCT_ID@/g,e.id_product.toString()),r=r.replace(/@CUSTOMER_NAME@/g,s),r=r.replace(/@COMMENT_DATE@/g,e.date_add),r=r.replace(/@COMMENT_TITLE@/g,e.title),r=r.replace(/@COMMENT_COMMENT@/g,this.formatCommentContent(e.content)),r=r.replace(/@COMMENT_USEFUL_ADVICES@/g,e.usefulness.toString()),r=r.replace(/@COMMENT_GRADE@/g,e.grade.toString()),r=r.replace(/@COMMENT_NOT_USEFUL_ADVICES@/g,(e.total_usefulness-e.usefulness).toString()),r=r.replace(/@COMMENT_TOTAL_ADVICES@/g,e.total_usefulness.toString());const o=document.createElement("div");o.innerHTML=r;const i=o.firstElementChild;i&&(t.appendChild(i),this.initCommentInteractions(i,e))}static initCommentInteractions(e,t){lt.initCommentRating(e,t.grade);const r=j.getUsefulReviewButtons(e),s=j.getNotUsefulReviewButtons(e),o=j.getReportAbuseButtons(e);r.forEach(i=>
60{i.addEventListener("click",()=>{Ms.updateCommentUsefulness(e,t.id_product_comment,1),et.storeFocus()})}),s.forEach(i=>{i.addEventListener("click",()=>{Ms.updateCommentUsefulness(e,t.id_product_comment,0),et.storeFocus()})}),o.forEach(i=>{i.addEventListener("click",()=>{Ms.confirmCommentAbuse(t.id_product_comment),et.storeFocus()})})}static initOnePagePagination(){this.totalPages>0&&(this.currentPage=1,this.updatePaginationUI(),this.fetchComments(1))}static loadInitialComments(){return un(this,null,function*(){if(this.commentsListUrl)try{const e=yield fetch(`${this.commentsListUrl}&page=1`);if(e.status===200){const t=yield e.text(),r=JSON.parse(t);this.populateComments(r.comments)}}catch(e){console.error("Error loading initial comments:",e)}})}}On.currentPage=1,On.totalPages=0,On.commentsListUrl=null,On.commentPrototype=null;class lt{static renderStars(e,t){const r=document.createElement("div");r.className="star-content",r.setAttribute("role","img"),r.setAttribute("aria-label",`${t} out of 5 stars`);for(let s=1;s<=5;s+=1){const o=document.createElement("div");o.className=s<=Math.round(t)?"star-on":"star",r.appendChild(o)}e.innerHTML="",e.appendChild(r)}static initProductRatingSystem(){const{gradeStars:e}=j;e.forEach(t=>{const r=parseFloat(t.getAttribute("data-grade")||"0");this.renderStars(t,r)})}static initProductListRatingSystem(){const{productListGradeStars:e}=j;e.forEach(t=>{const r=parseFloat(t.getAttribute("data-grade")||"0");this.renderStars(t,r)})}static initCommentListRatingSystem(){const{commentListGradeStars:e}=j;e.forEach(t=>{const r=parseFloat(t.getAttribute("data-grade")||"0");this.renderStars(t,r)})}static resetModalStars(){const e=j.modalReview;e&&e.querySelectorAll(Y.GRADE_STARS).forEach(r=>{const s=parseFloat(r.getAttribute("data-grade")||"0");this.renderStars(r,s)})}static initCommentRating(e,t){e.querySelectorAll(Y.GRADE_STARS).forEach(s=>{this.renderStars(s,t)})}}class Ms{static updateCommentUsefulness(e,t,r){return un(this,null,function*(){const{commentsList:s}=j;if(!s)return;const o=s.dataset.updateCommentUsefulnessUrl;if(o)try{const i=yield fetch(o,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:`id_product_comment=${t}&usefulness=${r}`});if(i.status===200){const a=yield i.json();a.success&&a.usefulness!==void 0&&a.total_usefulness!==void 0?this.updateUsefulnessValues(e,a.usefulness,a.total_usefulness):this.showUpdatePostCommentErrorModal(a.error||"Unknown error")}else this.showUpdatePostCommentErrorModal(window.productCommentUpdatePostErrorMessage)}catch(i){this.showUpdatePostCommentErrorModal(i instanceof Error?i.message:"Network error")}})}static updateUsefulnessValues(e,t,r){const s=j.getUsefulReviewValue(e),o=j.getNotUsefulReviewValue(e);s&&(s.textContent=t.toString()),o&&(o.textContent=(r-t).toString())}static confirmCommentAbuse(e){const t=j.reportCommentConfirmationModal;if(!t)return;be.getOrCreateInstance(t).show();const s=o=>{var i;(i=o.detail)!=null&&i.confirm&&this.confirmCommentAbuseFetch(e)};t.addEventListener("modal:confirm",s,{once:!0})}static confirmCommentAbuseFetch(e){return un(this,null,function*(){const{commentsList:t}=j;if(!t)return;const r=t.dataset.reportCommentUrl;if(r)try{const s=yield fetch(r,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:`id_product_comment=${e}`});if(s.status===200){const o=yield s.json();o.success?this.showReportCommentPostedModal():this.showReportCommentErrorModal(o.error||"Unknown error")}else this.showReportCommentErrorModal(window.productCommentAbuseReportErrorMessage)}catch(s){this.showReportCommentErrorModal(s instanceof Error?s.message:"Network error")}})}static showUpdatePostCommentErrorModal(e){const t=j.updateCommentUsefulnessPostErrorModal;if(!t)return;const r=t.querySelector(Y.BS_MODAL_BODY);r&&(r.innerHTML=e),be.getOrCreateInstance(t).show()}static showReportCommentErrorModal(e){const t=j.reportCommentPostErrorModal;if(!t)return;const r=t.querySelector("#report-comment-post-error-message");r&&(r.innerHTML=e),be.getOrCreateInstance(t).show()}static showReportCommentPostedModal(){const e=j.reportCommentPostSuccessModal;if(!e)return;be.getOrCreateInstance(e).show()}}class Xh{static init(){this.loadProductListReviews(),this.setupUpdateListener()}static setupUpdateListener(){Sa.on(Pn.updateProductList,()=>{this.loadProductListReviews()}),Sa.on(Pn.updatedProduct,()=>{this.loadProductListReviews(),lt.initProductRatingSystem()})}static loadProductListReviews(){return un(this,null,function*(){const{productListReviews:e}=j;if(e.length===0)return;const t=[];if(e.forEach(r=>{const s=parseInt(r.getAttribute("data-id")||"0",10);s>0&&t.indexOf(s)===-1&&t.push(s)}),t.length!==0)try{const r=e[0].getAttribute("data-url");if(!r)return;const s=new URL(r,window.location.href);t.forEach(c=>{s.searchParams.append("id_products[]",c.toString())});const o=yield fetch(s.toString());if(!o.ok){console.warn(`Product list reviews request failed with status ${o.status}`);return}const i=yield o.text();if(i.trim()==="")return;const a=JSON.parse(i);if(!Array.isArray(a==null?void 0:a.products)){console.warn("Unexpected product list reviews payload:",i.slice(0,200));return}this.updateProductListReviews(a)}catch(r){console.error("Error loading product list reviews:",r)}})}static updateProductListReviews(e){const{productListReviews:t}=j,r={};
60e.products.forEach(s=>{r[s.id_product]=s}),t.forEach(s=>{const o=parseInt(s.getAttribute("data-id")||"0",10),i=r[o],a=i?parseInt(String(i.comments_nb),10):0,c=i?i.average_grade:null;if(!a||c===null){this.clearProductListReview(s);return}this.updateSingleProductReview(s,{grade:Math.round(c),comments_nb:a}),s.classList.add("d-flex")})}static clearProductListReview(e){e.classList.remove("d-flex");const t=e.querySelector(Y.GRADE_STARS);t&&lt.renderStars(t,0);const r=j.getProductListCommentsNumber(e),s=j.getProductListGradeNumber(e);r&&(r.textContent="0"),s&&(s.textContent="0")}static updateSingleProductReview(e,t){const r=e.querySelector(Y.GRADE_STARS);r&&lt.renderStars(r,t.grade);const s=j.getProductListCommentsNumber(e),o=j.getProductListGradeNumber(e);s&&(s.textContent=t.comments_nb.toString()),o&&(o.textContent=t.grade.toString())}}class Jh{static init(){this.initPostReviewButton(),this.initReviewModal(),this.initReviewPostedModal(),this.initReviewErrorModal(),this.initCommentsListing(),this.initProductListReviews(),this.initConfirmationModals(),this.initCommentsModalHandler(),this.initProductRatingSystem()}static initProductRatingSystem(){lt.initProductRatingSystem(),lt.initProductListRatingSystem(),lt.initCommentListRatingSystem()}static initReviewModal(){const e=j.modalReview,t=j.modalReviewForm,r=t?j.getFormValidationButton(t):null;e&&t&&r&&t.addEventListener("submit",s=>{Aa.submitReviewForm(t,s)})}static initReviewPostedModal(){const e=j.modalReviewPosted;e&&e.addEventListener("hidden.bs.modal",()=>{const t=document.querySelector(p.product.rightSection);et.restoreFocus(t),Aa.clearReviewForm(),lt.resetModalStars()})}static initReviewErrorModal(){const e=j.modalReviewError;e&&e.addEventListener("hidden.bs.modal",()=>{const t=document.querySelector(p.product.rightSection);et.restoreFocus(t)})}static initCommentsListing(){On.init()}static initProductListReviews(){Xh.init()}static initConfirmationModals(){this.initReportCommentConfirmationModal()}static initReportCommentConfirmationModal(){const e=j.reportCommentConfirmationModal;if(!e)return;e.addEventListener("hidden.bs.modal",()=>{const s=new CustomEvent("modal:confirm",{detail:{confirm:!1},bubbles:!0});e.dispatchEvent(s)});const t=e.querySelector(Y.CONFIRM_BUTTON);t&&t.addEventListener("click",()=>{const s=new CustomEvent("modal:confirm",{detail:{confirm:!0},bubbles:!0});e.dispatchEvent(s)});const r=e.querySelector(Y.REFUSE_BUTTON);r&&r.addEventListener("click",()=>{const s=new CustomEvent("modal:confirm",{detail:{confirm:!1},bubbles:!0});e.dispatchEvent(s)})}static initPostReviewButton(){const e=j.postReviewButtons;e&&e.forEach(t=>{t.addEventListener("click",()=>{et.storeFocus()})})}static initCommentsModalHandler(){const{updateCommentUsefulnessPostErrorModal:e}=j,{reportCommentConfirmationModal:t}=j,{reportCommentPostErrorModal:r}=j,{reportCommentPostSuccessModal:s}=j;e&&e.addEventListener("hidden.bs.modal",()=>{et.restoreFocus()}),t&&t.addEventListener("hidden.bs.modal",()=>{const o=et.getStoredFocus();setTimeout(()=>{o&&!(r!=null&&r.classList.contains("show"))&&!(s!=null&&s.classList.contains("show"))&&et.setFocus(o)},250)}),r&&r.addEventListener("hidden.bs.modal",()=>{et.restoreFocus()}),s&&s.addEventListener("hidden.bs.modal",()=>{et.restoreFocus()})}}const Zh=()=>{Jh.init()};function em(){document.addEventListener("click",n=>{const e=n.target,t=e==null?void 0:e.closest('[data-button-action="buy-now"]');if(!t)return;const r=t.closest("form");r&&(Ta(r,"add","1"),Ta(r,"action","add"))})}function Ta(n,e,t){if(n.querySelector(`input[name="${e}"]`))return;const r=document.createElement("input");r.type="hidden",r.name=e,r.value=t,n.appendChild(r)}function tm(){document.addEventListener("click",n=>{const e=n.target;if(!(e!=null&&e.closest(".grc-product-summary")))return;const t=document.querySelector(".grc-product-reviews"),r=t==null?void 0:t.closest(".accordion-collapse"),s=r==null?void 0:r.closest(".accordion-item"),o=s==null?void 0:s.querySelector(".accordion-button");o&&(n.preventDefault(),o.getAttribute("aria-expanded")!=="true"&&o.click(),r==null||r.addEventListener("shown.bs.collapse",()=>Ca(s),{once:!0}),window.setTimeout(()=>Ca(s),400))})}function Ca(n){n==null||n.scrollIntoView({behavior:"smooth",block:"start"})}function nm(){const{prestashop:n}=window;n.on("updateCart",e=>{var t,r,s,o;if(((t=e==null?void 0:e.reason)==null?void 0:t.linkAction)!=="add-to-cart")return;const i=document.querySelectorAll("input.accessories_checkbox:checked");if(!i.length)return;const a=(r=document.querySelector('#add-to-cart-or-refresh input[name="token"]'))==null?void 0:r.value,c=(o=(s=n.urls)==null?void 0:s.pages)==null?void 0:o.cart;
60!a||!c||i.forEach(l=>{const d=l.value,g=l.closest("table"),v=g==null?void 0:g.querySelector(`#acc_product_${d}`),m=g==null?void 0:g.querySelector(`#accessory_qty_${d}`),C=new URLSearchParams;C.append("action","update"),C.append("ajax","1"),C.append("add","1"),C.append("id_product",d),C.append("qty",(m==null?void 0:m.value)||"1"),C.append("token",a),v!=null&&v.value&&C.append("id_product_attribute",v.value),fetch(c,{method:"POST",headers:{"X-Requested-With":"XMLHttpRequest"},body:C}).then(()=>{l.checked=!1}).catch(()=>{})})})}const rm=()=>{em(),tm(),nm()};V(),document.addEventListener("DOMContentLoaded",()=>{const{prestashop:n,Theme:{events:e}}=window;oa(),Zi(),sa(),eh(),Xi(),ta(),pr(),bs(),vh(),Lh(),ws(),Ss(),ia(),ga(),_a(),Ls(),jh(),Mh(),$h(),Hh(),zh(),ba(),Zh(),Gh(),Qh(),rm(),n.on(e.responsiveUpdate,()=>{bs(),ws(),Ss(),Ls()})});const sm={useToast:cr,useAlert:ar,useProgressRing:ra,useQuantityInput:pr},om={parseData:vr},im=p,Pn=A,am={initProductBehavior:oa,initQuickview:Zi,initCheckout:sa,initResponsiveToggler:Xi,initCart:ta,useQuantityInput:pr,initSearchbar:bs,initLanguageSelector:ws,initCurrencySelector:Ss,initMobileMenu:ia,initGuestPasswordToggle:ga,initVisiblePassword:_a,initDesktopMenu:Ls,initBlockCart:ba}})(),window.Theme=Mr})()})();/*! For license information please see front.js.LICENSE.txt */
61(()=>{var e={906:()=>{},72:e=>{"use strict";var t=[];function r(e){for(var r=-1,n=0;n<t.length;n++)if(t[n].identifier===e){r=n;break}return r}function n(e,n){for(var a={},o=[],i=0;i<e.length;i++){var c=e[i],u=n.base?c[0]+n.base:c[0],l=a[u]||0,d="".concat(u," ").concat(l);a[u]=l+1;var p=r(d),f={css:c[1],media:c[2],sourceMap:c[3],supports:c[4],layer:c[5]};if(-1!==p)t[p].references++,t[p].updater(f);else{var v=s(f,n);n.byIndex=i,t.splice(i,0,{identifier:d,updater:v,references:1})}o.push(d)}return o}function s(e,t){var r=t.domAPI(t);return r.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;r.update(e=t)}else r.remove()}}e.exports=function(e,s){var a=n(e=e||[],s=s||{});return function(e){e=e||[];for(var o=0;o<a.length;o++){var i=r(a[o]);t[i].references--}for(var c=n(e,s),u=0;u<a.length;u++){var l=r(a[u]);0===t[l].references&&(t[l].updater(),t.splice(l,1))}a=c}}},659:e=>{"use strict";var t={};e.exports=function(e,r){var n=function(e){if(void 0===t[e]){var r=document.querySelector(e);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(e){r=null}t[e]=r}return t[e]}(e);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");n.appendChild(r)}},540:e=>{"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},56:(e,t,r)=>{"use strict";e.exports=function(e){var t=r.nc;t&&e.setAttribute("nonce",t)}},825:e=>{"use strict";e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(r){!function(e,t,r){var n="";r.supports&&(n+="@supports (".concat(r.supports,") {")),r.media&&(n+="@media ".concat(r.media," {"));var s=void 0!==r.layer;s&&(n+="@layer".concat(r.layer.length>0?" ".concat(r.layer):""," {")),n+=r.css,s&&(n+="}"),r.media&&(n+="}"),r.supports&&(n+="}");var a=r.sourceMap;a&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),t.styleTagTransform(n,e,t.options)}(t,e,r)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},113:e=>{"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}}},t={};function r(n){var s=t[n];if(void 0!==s)return s.exports;var a=t[n]={exports:{}};return e[n](a,a.exports,r),a.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.nc=void 0,(()=>{"use strict";var e=r(72),t=r.n(e),n=r(825),s=r.n(n),a=r(659),o=r.n(a),i=r(56),c=r.n(i),u=r(540),l=r.n(u),d=r(113),p=r.n(d),f=r(906),v=r.n(f),m={};m.styleTagTransform=p(),m.setAttributes=c(),m.insert=o().bind(null,"head"),m.domAPI=s(),m.insertStyleElement=l(),t()(v(),m),v()&&v().locals&&v().locals,$(window).ready((()=>{const e=$(".blockreassurance_product img.svg, .blockreassurance img.svg").map((function(){return $(this).attr("src")})).toArray();e.filter(((t,r)=>
61e.indexOf(t)===r)).forEach((function(e){const t=$(`.blockreassurance_product img.svg.invisible[src="${e}"], .blockreassurance img.svg.invisible[src="${e}"]`);0!==t.length&&$.ajax({url:e,type:"GET",success(r){if($.isXMLDoc(r)){let n=$(r).find("svg");n=n.attr("data-img-url",e),n=n.removeAttr("xmlns:a"),n.find("path[fill]").attr("fill",window.psr_icon_color),n.find("path:not([fill])").css("fill",window.psr_icon_color),t.each((function(){const e=$(this).attr("id"),t=$(this).attr("class");let r=n.clone();r=void 0!==e?r.attr("id",e):r,r=void 0!==t?r.attr("class",`${t} replaced-svg`):r.attr("class"," replaced-svg"),r.removeClass("invisible"),$(this).replaceWith(r)}))}}})}))}))})()})();/**
62 * 2007-2020 PrestaShop.
63 *
64 * NOTICE OF LICENSE
65 *
66 * This source file is subject to the Academic Free License 3.0 (AFL-3.0)
67 * that is bundled with this package in the file LICENSE.txt.
68 * It is also available through the world-wide-web at this URL:
69 * https://opensource.org/licenses/AFL-3.0
70 * If you did not receive a copy of the license and are unable to
71 * obtain it through the world-wide-web, please send an email
72 * to [email protected] so we can send you a copy immediately.
73 *
74 * DISCLAIMER
75 *
76 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
77 * versions in the future. If you wish to customize PrestaShop for your
78 * needs please refer to http://www.prestashop.com for more information.
79 *
80 * @author    PrestaShop SA <[email protected]>
81 * @copyright 2007-2020 PrestaShop SA
82 * @license   https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
83 * International Registered Trademark & Property of PrestaShop SA
84 */
85$(document).ready(function(){$('.block_newsletter form').on('submit',function(){var psemailsubscriptionForm=$(this);if(typeof psemailsubscription_subscription==='undefined'){return!0}
86$('.block_newsletter_alert').remove();$.ajax({type:'POST',dataType:'JSON',url:psemailsubscription_subscription,cache:!1,data:$(this).serialize(),success:function(data){if(data.nw_error){psemailsubscriptionForm.prepend('<p class="alert alert-danger block_newsletter_alert">'+data.msg+'</p>')}else{psemailsubscriptionForm.prepend('<p class="alert alert-success block_newsletter_alert">'+data.msg+'</p>')}},error:function(err){console.log(err)}});return!1})});/**
87 * Copyright since 2007 PrestaShop SA and Contributors
88 * PrestaShop is an International Registered Trademark & Property of PrestaShop SA
89 *
90 * NOTICE OF LICENSE
91 *
92 * This source file is subject to the Academic Free License version 3.0
93 * that is bundled with this package in the file LICENSE.md.
94 * It is also available through the world-wide-web at this URL:
95 * https://opensource.org/licenses/AFL-3.0
96 * If you did not receive a copy of the license and are unable to
97 * obtain it through the world-wide-web, please send an email
98 * to [email protected] so we can send you a copy immediately.
99 *
100 * @author    PrestaShop SA and Contributors <[email protected]>
101 * @copyright Since 2007 PrestaShop SA and Contributors
102 * @license   https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
103 */
104function addNotification(productId,productAttributeId){if(typeof productId==='undefined'){var ids=$('div.js-mailalert > input[type=hidden]');productId=ids.eq(0).val();productIdAttribute=ids.eq(1).val()}
105$.ajax({type:'POST',url:$('div.js-mailalert').data('url'),data:'id_product='+productId+'&id_product_attribute='+productAttributeId+'&customer_email='+$('div.js-mailalert input[type=email]').val(),success:function(resp){resp=JSON.parse(resp);$('.js-mailalert-alerts').html('<article class="mt-1 alert alert-'+(resp.error?'danger':'success')+'" role="alert" data-alert="'+(resp.error?'error':'success')+'">'+resp.message+'</article>').show();if(!resp.error){$('div.js-mailalert > .js-mailalert-add, div.js-mailalert > input[type=email], div.js-mailalert .gdpr_consent_wrapper').hide()}}});return!1}
106$(document).on('ready',function(){const mailAlertSubmitButtonClass='.js-mailalert-add';const mailAlertWrapper=$('.js-mailalert');const mailAlertSubmitButton=mailAlertWrapper.find(mailAlertSubmitButtonClass);if(mailAlertWrapper.find('#gdpr_consent, .gdpr_consent').length){setTimeout(()=>{mailAlertSubmitButton.prop('disabled',!0);mailAlertWrapper.find('[name="psgdpr_consent_checkbox"]').on('change',function(e){e.stopPropagation();mailAlertSubmitButton.prop('disabled',!$(this).prop('checked'))})}
106,0)}
107$(document).on('click',mailAlertSubmitButtonClass,function(e){e.preventDefault();addNotification($(this).data('product'),$(this).data('product-attribute'))});$(document).on('click','.js-remove-email-alert',function(){var self=$(this);var ids=self.attr('rel').replace('js-id-emailalerts-','');ids=ids.split('-');var id_product_mail_alert=ids[0];var id_product_attribute_mail_alert=ids[1];var parent=self.closest('li');$.ajax({url:self.data('url'),type:"POST",data:{'id_product':id_product_mail_alert,'id_product_attribute':id_product_attribute_mail_alert},success:function(result){if(result=='0'){parent.fadeOut("normal",function(){parent.remove()})}}})})});/**
108 * PrestaShop module created by VEKIA, a guy from official PrestaShop community ;-)
109 *
110 * @author    VEKIA https://www.prestashop.com/forums/user/132608-vekia/
111 * @copyright 2010-2020 VEKIA
112 * @license   This program is not free software and you can't resell and redistribute it
113 *
114 * CONTACT WITH DEVELOPER
115 * [email protected]
116 */
117$(document).ready(function(){if(prestashop.page.page_name=='cart'){prestashop.on('updatedCart',function(event){$.ajax({type:"POST",url:myprestaloyaltyurl,success:function(data){$('#loylalty_cart_parent').html(data)}})});prestashop.emit('updatedCart')}});document.addEventListener('click',function(e){const submitBtn=e.target.closest('button.brevo-stock-notification-submit');if(!submitBtn){return}
118const container=submitBtn.closest('.sendinblue-back-in-stock-container');if(!container){return}
119const productId=container.getAttribute('data-product-id');const backinstockUrl=container.getAttribute('data-backinstock-url');const formWrapper=container.querySelector('.sendinblue-form');const emailInput=container.querySelector('input[name="email"]');const hiddenProductId=container.querySelector('input[name="product_id"]');const hiddenAction=container.querySelector('input[name="action"]');const messageDiv=container.querySelector('[id^="sendinblue-message-"]');if(!formWrapper||!emailInput){return}
120const email=(emailInput.value||'').trim();if(!email){if(messageDiv){messageDiv.style.display='block';messageDiv.innerHTML='<div class="alert alert-danger">Please enter a valid email address.</div>'}
121return}
122if(submitBtn.disabled){return}
123submitBtn.disabled=!0;const originalText=submitBtn.textContent;submitBtn.textContent='Subscribing...';if(messageDiv){messageDiv.style.display='none'}
124const formData=new FormData();formData.append('product_id',hiddenProductId?hiddenProductId.value:productId);formData.append('action',hiddenAction?hiddenAction.value:'subscribe');formData.append('email',email);fetch(backinstockUrl,{method:'POST',body:formData,credentials:'same-origin'}).then(response=>response.json()).then(data=>{if(messageDiv){messageDiv.style.display='block';if(data&&data.success){messageDiv.innerHTML='<div class="alert alert-success">'+(data.message||'Subscribed successfully!')+'</div>';formWrapper.style.display='none'}else{messageDiv.innerHTML='<div class="alert alert-danger">'+(data&&data.message?data.message:'Failed to subscribe. Please try again.')+'</div>'}}}).catch(()=>{if(messageDiv){messageDiv.style.display='block';messageDiv.innerHTML='<div class="alert alert-danger">An error occurred. Please try again.</div>'}}).finally(()=>{submitBtn.disabled=!1;submitBtn.textContent=originalText})});/**
125 *
126 * DISCLAIMER
127 *
128 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
129 * versions in the future. If you wish to customize PrestaShop for your
130 * needs please refer to http://www.prestashop.com for more information.
131 * We offer the best and most useful modules PrestaShop and modifications for your online store.
132 * 
133 * @author    Carlos Ucha
134 * @copyright 2010-2100 Carlos Ucha
135 * @license   see file: LICENSE.txt
136 * This program is not free software and you can't resell and redistribute it
137 *
138 * CONTACT WITH DEVELOPER
139 * [email protected]
140 */
141jQuery(document).ready(function($){var $chatbox=$('#chatbox');var $chatboxContent=$('#chatbox-content');var $chatboxMessages=$('#chatbox-messages');var $chatboxInput=$('#chatbox-input-text');var $chatboxSendButton=$('#chatbox-send-button');var $chatboxToggleButton=$('#chatbox-toggle');var $chatbotName=$('#chatbotName').val();var $customerName=$('#customerName').val();function adjustTextareaHeight(){$chatboxInput.css('height','auto');var newHeight=Math.min($chatboxInput[0].scrollHeight,150);$chatboxInput.css('height',newHeight+'px')}
142$chatboxInput.on('input',adjustTextareaHeight);var isAcceptButtonSelected=!1;var consentRequired=Number($chatbox.data('consent-required'))===1;var loadingHistory=!1;var CHAT_LOG_STORAGE_KEY='gptchatbox_chat_log';var REQUEST_POLL_INTERVAL_MS=2000;var REQUEST_POLL_MAX_ATTEMPTS=45;try{var legacySessionLog=sessionStorage.getItem('chat_log');
142if(legacySessionLog&&!localStorage.getItem(CHAT_LOG_STORAGE_KEY)){localStorage.setItem(CHAT_LOG_STORAGE_KEY,legacySessionLog);sessionStorage.removeItem('chat_log')}}catch(e){}
143var chatLog=JSON.parse(localStorage.getItem(CHAT_LOG_STORAGE_KEY)||'[]');var LAST_ACTIVITY_KEY='gptchatbox_last_activity';function updateLastActivity(){try{localStorage.setItem(LAST_ACTIVITY_KEY,new Date().toISOString())}catch(e){}}(function enforceInactivityExpiry(){try{var INACTIVITY_MS=60*60*1000;var lastActivityStr=localStorage.getItem(LAST_ACTIVITY_KEY);var lastActivity=lastActivityStr?Date.parse(lastActivityStr):NaN;var lastTs=0;if(Array.isArray(chatLog)&&chatLog.length>0){for(var i=chatLog.length-1;i>=0;i--){var ts=chatLog[i]&&chatLog[i].timestamp?Date.parse(chatLog[i].timestamp):NaN;if(!isNaN(ts)){lastTs=ts;break}}}
144var basis=!isNaN(lastActivity)?lastActivity:lastTs;if(basis&&(Date.now()-basis)>INACTIVITY_MS){localStorage.removeItem(CHAT_LOG_STORAGE_KEY);localStorage.removeItem(LAST_ACTIVITY_KEY);chatLog=[]}else if(!basis&&Array.isArray(chatLog)&&chatLog.length>0){localStorage.removeItem(CHAT_LOG_STORAGE_KEY);localStorage.removeItem(LAST_ACTIVITY_KEY);chatLog=[]}}catch(e){}})();var openLinksNewTab=String($chatbox.data('open-links-new-tab'))==='1';var emailTicketTexts={};try{var rawTicketTexts=$chatbox.attr('data-email-ticket-texts')||'';if(rawTicketTexts){try{rawTicketTexts=$('<textarea/>').html(String(rawTicketTexts)).text()}catch(e){}}
145if(rawTicketTexts&&rawTicketTexts.charAt(0)==='{'){emailTicketTexts=JSON.parse(rawTicketTexts)}}catch(e){emailTicketTexts={}}
146function tkt(key,legacyDataKey,fallbackText){try{if(emailTicketTexts&&typeof emailTicketTexts[key]==='string'&&emailTicketTexts[key]!==''){return String(emailTicketTexts[key])}
147var legacy=$chatbox.data(legacyDataKey);if(typeof legacy==='string'&&legacy!==''){return String(legacy)}}catch(e){}
148return String(fallbackText||'')}
149var emailTicketPrompt=tkt('prompt','emailTicketPrompt','');var emailTicketPlaceholder=tkt('placeholder','emailTicketPlaceholder','[email protected]');var emailTicketConfirmLabel=tkt('confirm','emailTicketConfirm','');var emailTicketCancelLabel=tkt('cancel','emailTicketCancel','');var emailTicketInvalidEmail=tkt('invalid_email','emailTicketInvalidEmail','');var emailTicketSending=tkt('sending','emailTicketSending','');var emailTicketSuccess=tkt('success','emailTicketSuccess','');var emailTicketFailure=tkt('failure','emailTicketFailure','');var waMode=Number($chatbox.data('whatsapp-mode'))===1;var waOpMode=String($chatbox.data('whatsapp-operating-mode')||'');var waPhone=String($chatbox.data('whatsapp-phone')||'');var waBg=(function(){var v=$chatbox.attr('data-wa-bg')||$chatbox.data('waBg')||$chatbox.data('wa-bg');return String(v||'#25D366')})();var waTxt=(function(){var v=$chatbox.attr('data-wa-text')||$chatbox.data('waText')||$chatbox.data('wa-text');return String(v||'#ffffff')})();var waIconEnabled=(function(){var v=$chatbox.attr('data-wa-icon');if(typeof v==='undefined'||v===null){v=$chatbox.data('waIcon')||$chatbox.data('wa-icon')}
150var n=parseInt(v,10);if(isNaN(n)){return!0}
151return n===1})();var waButtonText=String($chatbox.data('whatsapp-button')||'WhatsApp');function openWhatsAppWithMessage(text){try{var msg=String(text||'').trim();var url='https://wa.me/'+waPhone+(msg?('?text='+encodeURIComponent(msg)):'');try{window.open(url,'_blank','noopener,noreferrer')}catch(_){window.open(url,'_blank')}}catch(e){try{window.open('https://wa.me/'+waPhone,'_blank','noopener,noreferrer')}catch(_){window.open('https://wa.me/'+waPhone,'_blank')}}}
152var BATCH_SIZE=4;function gcbEndpoint(){try{if(typeof gptchatboxAjaxUrl==='string'&&gptchatboxAjaxUrl.trim()!==''){return gptchatboxAjaxUrl.trim()}
153var endpoint='index.php?fc=module&module=gptchatbox&controller=ajax';var pathname=(window.location&&window.location.pathname)?window.location.pathname:'/';if(pathname==='/'||/\/index\.php$/i.test(pathname)){return'/'+endpoint}
154var slash=pathname.lastIndexOf('/');var base=slash>=0?pathname.substring(0,slash+1):'/';return base+endpoint}catch(e){}
155return'index.php?fc=module&module=gptchatbox&controller=ajax'}
156var CONSENT_STORAGE_KEY='gptchatbox_consent_accepted';if(consentRequired){try{var consentAccepted=localStorage.getItem(CONSENT_STORAGE_KEY)==='1';if(consentAccepted){$('#chatbox-send-button').removeAttr('disabled').removeClass('disabled');$('.consent-container').hide();isAcceptButtonSelected=!0}}catch(e){}}
157if(consentRequired&&!isAcceptButtonSelected&&Array.isArray(chatLog)&&chatLog.length>0){try{localStorage.setItem(CONSENT_STORAGE_KEY,'1')}catch(e){}
158$('#chatbox-send-button').removeAttr('disabled').removeClass('disabled');$('.consent-container').hide();isAcceptButtonSelected=!0}
159if(chatLog.length>0&&!consentRequired){$('#chatbox-send-button').removeAttr('disabled').removeClass('disabled');$('.consent-container').hide();isAcceptButtonSelected=!0}
160if(consentRequired&&!isAcceptButtonSelected){$chatboxSendButton.attr('disabled','disabled').addClass('disabled')}
161function canSend(){if(consentRequired&&!isAcceptButtonSelected){return!1}
162if($chatboxSendButton.is(':disabled')){return!1}
163var userMessage=($chatboxInput.val()||'').trim();if(!userMessage){return!1}
164return!0}
165try{if(chatLog&&Array.isArray(chatLog)&&chatLog.some(function(m){return m&&m.role==='product_cards'})){localStorage.removeItem(CHAT_LOG_STORAGE_KEY);chatLog=[]}}catch(e){}
166try{if(chatLog&&Array.isArray(chatLog)){loadingHistory=!0;var lastAssistantMsg=null;chatLog.forEach(function(msg){if(msg&&typeof msg.content==='string'&&msg.role){if(msg.role==='assistant_html'){var $msgEl=$('<div></div>').addClass('gptchatbox-message response');$msgEl.html(msg.content);$chatboxMessages.append($msgEl);lastAssistantMsg=$msgEl}else{var $historyMsg=sendMessage(msg.content,msg.role==='user'?$customerName:$chatbotName);if(msg.role!=='user'&&$historyMsg){lastAssistantMsg=$historyMsg}}}});loadingHistory=!1;if(document.getElementById('chatbox-messages')){scrollToLatestMessage()}}}catch(e){console.warn('Failed to load chat_log from localStorage:',e)}
167$chatboxToggleButton.click(function(){if($chatbox.hasClass('preview-mode')){return}
168if($chatbox.hasClass('open')){$chatbox.removeClass('open');$chatbox.addClass('chatbox-closed')}else{$chatbox.removeClass('chatbox-closed');$chatbox.addClass('open');scrollToLatestMessage()}});$(document).on('click','.chatbox-close-btn',function(){if($chatbox.hasClass('preview-mode')){return}
169$chatbox.removeClass('open');$chatbox.addClass('chatbox-closed')});$chatboxSendButton.click(function(){if(waMode&&waOpMode==='replace'){var msg=($chatboxInput.val()||'').trim();openWhatsAppWithMessage(msg);return}
170if(!canSend()){return}
171sendUserMessage()});function sendUserMessage(){var userMessage=$chatboxInput.val().trim();userMessage=$("<div>").text(userMessage).html();sendMessage(userMessage,$customerName);$chatboxInput.val('');makeAjaxRequest(userMessage);updateLastActivity()}
172function makeAjaxRequest(userMessage){var requestUid=createRequestUid();var $loadingMessage=$('<div></div>').addClass('gptchatbox-message response loading');$loadingMessage.html('<div class="loading-dots"><span class="dot"></span><span class="dot"></span><span class="dot"></span></div>');$chatboxMessages.append($loadingMessage);scrollToLatestMessage();$.ajax({url:gcbEndpoint(),type:'POST',method:'POST',cache:!1,dataType:'json',data:{message:userMessage,request_uid:requestUid},success:function(response){$loadingMessage.remove();handleApiResponse(response)},error:function(xhr,status,error){if(isRecoverableTransportError(xhr)){pollRequestResult(requestUid,$loadingMessage,0);return}
173$loadingMessage.remove();var errorMessage;try{if(xhr.responseJSON&&typeof xhr.responseJSON.error==='string'){errorMessage=xhr.responseJSON.error}else if(typeof xhr.responseText==='string'&&xhr.responseText.trim().length){var ct=xhr.getResponseHeader&&xhr.getResponseHeader('Content-Type');if(ct&&ct.indexOf('application/json')!==-1){try{var parsed=JSON.parse(xhr.responseText);if(parsed&&typeof parsed.error==='string'){errorMessage=parsed.error}}catch(e){}}else if(ct&&ct.indexOf('text/html')!==-1&&/<(html|body)/i.test(xhr.responseText)){errorMessage='The chat service is temporarily unavailable due to a server timeout or gateway error. Please try again in a few moments.'}}}catch(e){}
174if(!errorMessage){if(xhr.status===502||xhr.status===504||xhr.status===524){errorMessage='The chat service is temporarily unavailable due to a server timeout or gateway error. Please try again in a few moments.'}else if(xhr.status===0){errorMessage='Network error while contacting the chat service. Please check your connection and try again.'}else if(xhr.status>=500){errorMessage='The chat service is temporarily unavailable (server error '+xhr.status+'). Please try again later.'}else if(xhr.status===200){errorMessage='The assistant returned an unexpected response. Please try again.'}else{errorMessage='AJAX request error. Status: '+xhr.status+', Error: '+error}}
175sendMessage(errorMessage,'chatbot-error')}})}
176function createRequestUid(){var ts=Date.now();var rnd=Math.floor(Math.random()*1000000000);return'gcb-'+ts+'-'+rnd}
177function isRecoverableTransportError(xhr){var code=xhr&&typeof xhr.status==='number'?xhr.status:0;return code===0||code===502||code===504||code===524}
178function pollRequestResult(requestUid,$loadingMessage,attempt){if(!requestUid){$loadingMessage.remove();sendMessage('The chat service did not return a response. Please try again.','chatbot-error');return}
179if(attempt>=REQUEST_POLL_MAX_ATTEMPTS){$loadingMessage.remove();sendMessage('The assistant is taking longer than expected. Please try again in a moment.','chatbot-error');return}
180$.ajax({url:gcbEndpoint(),type:'POST',method:'POST',cache:!1,dataType:'json',data:{action:'poll_request_result',request_uid:requestUid},success:function(resp){if(!resp||typeof resp.status!=='string'){window.setTimeout(function(){pollRequestResult(requestUid,$loadingMessage,attempt+1)},REQUEST_POLL_INTERVAL_MS);return}
181if(resp.status==='done'&&resp.response&&typeof resp.response==='object'){$loadingMessage.remove();handleApiResponse(resp.response);return}
182if(resp.status==='failed'){$loadingMessage.remove();if(typeof resp.error==='string'&&resp.error){sendMessage(resp.error,'chatbot-error')}else{sendMessage('The chat service could not complete your request. Please try again later.','chatbot-error')}
183return}
184window.setTimeout(function(){pollRequestResult(requestUid,$loadingMessage,attempt+1)},REQUEST_POLL_INTERVAL_MS)},error:function(){window.setTimeout(function(){pollRequestResult(requestUid,$loadingMessage,attempt+1)},REQUEST_POLL_INTERVAL_MS)}})}
185function handleApiResponse(response){if(!response||typeof response.answer!=='string'){sendMessage('No response from assistant.','chatbot-error');return}
186var answerText=response.answer||'';var useRawHtml=!1;if(response.product_cards_map&&typeof response.product_cards_map==='object'&&Object.keys(response.product_cards_map).length>0&&answerText.indexOf('%%GCPROD:')!==-1){answerText=buildAnswerWithInlineCards(answerText,response.product_cards_map,openLinksNewTab);useRawHtml=!0}
187var hasEmailTicketUi=!!(response.email_ticket&&typeof response.email_ticket==='object'&&String(response.email_ticket.status||'')==='needs_confirmation');var msgOpts=useRawHtml?{rawHtml:!0}:null;var $answerMsg=null;if(hasEmailTicketUi){if(String(answerText).trim()!==''){$answerMsg=sendMessage(answerText,$chatbotName,msgOpts)}else if(String(emailTicketPrompt||'').trim()!==''){$answerMsg=sendMessage(String(emailTicketPrompt).replace(/\n/g,'<br />'),$chatbotName,null)}}else if(String(answerText).trim()!==''){$answerMsg=sendMessage(answerText,$chatbotName,msgOpts)}
188if(response.whatsapp_button&&typeof response.whatsapp_button==='object'){try{var btnLabel=String(response.whatsapp_button.label||'WhatsApp');var btnUrl=String(response.whatsapp_button.url||'');if(btnUrl){var $container=$('<div></div>').addClass('gptchatbox-message response');var $btn=$('<button type="button" class="btn btn-secondary wa-btn"></button>').text(btnLabel).on('click',function(){try{window.open(btnUrl,'_blank','noopener,noreferrer')}catch(_){window.open(btnUrl,'_blank')}});if(waIconEnabled){var $icon2=$('<span class="wa-btn-icon" aria-hidden="true"></span>
188').html('<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="M20.52 3.48A11.9 11.9 0 0012 0C5.37 0 .07 5.3.07 11.93c0 2.1.55 4.13 1.61 5.93L0 24l6.27-1.64a12 12 0 005.73 1.47h.01c6.63 0 11.93-5.3 11.93-11.93 0-3.19-1.24-6.19-3.42-8.42zM12 21.47h-.01a9.5 9.5 0 01-4.84-1.33l-.35-.21-3.72.97.99-3.63-.23-.37A9.46 9.46 0 012.5 11.93C2.5 6.64 6.71 2.43 12 2.43c2.53 0 4.9.98 6.69 2.77a9.41 9.41 0 012.78 6.73c0 5.29-4.21 9.54-9.47 9.54zm5.46-7.14c-.3-.15-1.77-.87-2.04-.97-.27-.1-.46-.15-.66.15-.2.3-.76.97-.93 1.17-.17.2-.34.22-.64.07-.3-.15-1.26-.46-2.4-1.47-.89-.79-1.49-1.77-1.66-2.07-.17-.3-.02-.46.13-.61.13-.13.3-.34.45-.51.15-.17.2-.29.3-.49.1-.2.05-.37-.02-.52-.07-.15-.66-1.6-.9-2.2-.23-.55-.47-.47-.66-.48l-.56-.01c-.2 0-.52.07-.79.37-.27.3-1.04 1.02-1.04 2.48 0 1.46 1.06 2.87 1.21 3.07.15.2 2.08 3.17 5.04 4.45.7.3 1.25.47 1.68.6.7.22 1.33.19 1.83.11.56-.08 1.77-.72 2.02-1.42.25-.7.25-1.3.17-1.42-.07-.12-.27-.2-.57-.35z"/></svg>');$btn.prepend($icon2)}
189$container.append($btn);$chatboxMessages.append($container);scrollToLatestMessage()}}catch(e){}}
190if(response.email_ticket&&typeof response.email_ticket==='object'){try{var status=String(response.email_ticket.status||'');var reason=String(response.email_ticket.reason||'');var prefill=String(response.email_ticket.email_prefill||'');if(status==='needs_confirmation'){var $wrap=$('<div></div>').addClass('gptchatbox-message response gc-email-ticket');var promptHtml=$('<div>').text(emailTicketPrompt).html().replace(/\n/g,'<br/>');$wrap.append('<div>'+promptHtml+'</div>');var $input=$('<input type="email" class="form-control gc-email-ticket-input" />').attr('placeholder',emailTicketPlaceholder).val(prefill);var $btnRow=$('<div style="margin-top:8px;"></div>');var $btnConfirm=$('<button type="button" class="btn btn-primary gc-email-ticket-confirm"></button>').text(emailTicketConfirmLabel);var $btnCancel=$('<button type="button" class="btn btn-default gc-email-ticket-cancel" style="margin-left:6px;"></button>').text(emailTicketCancelLabel);$btnRow.append($btnConfirm).append($btnCancel);$wrap.append($('<div style="margin-top:8px;"></div>').append($input)).append($btnRow);$chatboxMessages.append($wrap);scrollToLatestMessage();function validEmail(v){v=String(v||'').trim();return v.length>3&&v.indexOf('@')>0&&v.indexOf('.')>0}
191$btnCancel.on('click',function(){try{$wrap.remove()}catch(e){}});$btnConfirm.on('click',function(){var email=String($input.val()||'').trim();if(!validEmail(email)){try{alert(emailTicketInvalidEmail)}catch(e){}
192return}
193$btnConfirm.prop('disabled',!0).addClass('disabled').text(emailTicketSending);$btnCancel.prop('disabled',!0).addClass('disabled');$.ajax({url:gcbEndpoint(),type:'POST',method:'POST',cache:!1,dataType:'json',data:{action:'confirm_email_ticket',email:email,reason:reason},success:function(resp){try{$wrap.remove()}catch(e){}
194if(resp&&resp.email_handoff&&typeof resp.email_handoff==='object'){try{var sentEmail=!!resp.email_handoff.sent;var $em=$('<div></div>').addClass('gptchatbox-message response');if(sentEmail){$em.html($('<div>').text(emailTicketSuccess).html())}else{$em.html($('<div>').text(emailTicketFailure).html())}
195$chatboxMessages.append($em);scrollToLatestMessage()}catch(e){}}},error:function(xhr){try{$wrap.remove()}catch(e){}
196try{if(xhr&&xhr.responseJSON&&typeof xhr.responseJSON.error==='string'){sendMessage(xhr.responseJSON.error,'chatbot-error');return}}catch(e){}
197sendMessage(emailTicketFailure,'chatbot-error')}})})}}catch(e){}}
198if(response.email_handoff&&typeof response.email_handoff==='object'){try{var sentEmail=!!response.email_handoff.sent;var $em=$('<div></div>').addClass('gptchatbox-message response');if(sentEmail){$em.html($('<div>').text(emailTicketSuccess).html())}else{$em.html($('<div>').text(emailTicketFailure).html())}
199$chatboxMessages.append($em);scrollToLatestMessage()}catch(e){}}
200updateLastActivity()}
201function storeMessageInLocalLog(content,role){try{var log=JSON.parse(localStorage.getItem(CHAT_LOG_STORAGE_KEY)||'[]');log.push({role,content,timestamp:new Date().toISOString()});localStorage.setItem(CHAT_LOG_STORAGE_KEY,JSON.stringify(log))}catch(e){console.warn('Failed to store message in localStorage:',e)}}
202function scrollToMessageTop($message){if(!$message||!$message[0]){return}
203scrollMessageToTop($message[0]);window.requestAnimationFrame(function(){scrollMessageToTop($message[0])})}
204function readThemeAndColors(){var themeMatch=$chatbox.attr('class')?$chatbox.attr('class').match(/theme-[a-z-]+/):null;var theme=themeMatch?themeMatch[0]:null;var primaryColor=(typeof $chatbox.data('primary')==='string'&&$chatbox.data('primary'))?$chatbox.data('primary'):'#0ea5e9';var secondaryColor=(typeof $chatbox.data('secondary')==='string'&&$chatbox.data('secondary'))?$chatbox.data('secondary'):'#0066cc';return{theme:theme,primaryColor:primaryColor,secondaryColor:secondaryColor}}
205function sendMessage(message,sender,options){try{var $messageElement=$('<div></div>').addClass('gptchatbox-message');var colors=readThemeAndColors();if(sender===$customerName){message=message.replace(/\n/g,'<br />');$messageElement.html(message);$messageElement.addClass("user");if(colors.theme==='theme-timeless'||colors.theme==='theme-modern'){$messageElement.attr('style','background: '+colors.secondaryColor+'15; border-color: '+colors.secondaryColor+'30;')}}else{var messageWithLinks=(options&&options.rawHtml)?message:markdownToHtml(message,openLinksNewTab);$messageElement.html(messageWithLinks);$messageElement.addClass("response");if(sender==='chatbot-error'){$messageElement.addClass("chatbot-error")}
206if(colors.theme==='theme-modern'){$messageElement.attr('style','background: '+colors.primaryColor+'15; border-color: '+colors.primaryColor+'30;')}}
207if(!loadingHistory){if(sender===$customerName){storeMessageInLocalLog(message,'user')}
207else if(sender===$chatbotName){var storeRole=(options&&options.rawHtml)?'assistant_html':'assistant';storeMessageInLocalLog(message,storeRole)}}
208$chatboxMessages.append($messageElement);if(!loadingHistory&&!(options&&options.suppressScroll)){scrollToLatestMessage()}
209return $messageElement}catch(error){console.error('An error occurred while sending the message:',error)}}
210$(document).on('keydown','#chatbox-input-text',function(event){if(event.key==='Enter'&&!event.shiftKey){event.preventDefault();if(waMode&&waOpMode==='replace'){var msg=($chatboxInput.val()||'').trim();openWhatsAppWithMessage(msg);return}
211if(!canSend()){return}
212$('#chatbox-send-button').click()}});if(waMode&&(waOpMode==='fixed'||waOpMode==='both'||waOpMode==='button')){try{var $headerContent=$chatbox.find('.chatbox-header-content');if($headerContent.length){var $closeBtn=$headerContent.find('.chatbox-close-btn');var $actions=$headerContent.find('.chatbox-actions');if($actions.length===0){$actions=$('<div class="chatbox-actions"></div>').css({display:'flex',alignItems:'center',gap:'8px',marginLeft:'auto'});$headerContent.append($actions)}
213if($closeBtn.length&&!$closeBtn.parent().is($actions)){$actions.append($closeBtn)}
214var $waTopBtn=$('#chatbox-wa-button-top');if($waTopBtn.length===0){$waTopBtn=$('<button></button>').attr('id','chatbox-wa-button-top').attr('type','button').addClass('btn').addClass('btn-secondary').addClass('wa-btn').text(waButtonText).on('click',function(){var msg=($chatboxInput.val()||'').trim();openWhatsAppWithMessage(msg)});if(waIconEnabled){var $icon=$('<span class="wa-btn-icon" aria-hidden="true"></span>').html('<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="M20.52 3.48A11.9 11.9 0 0012 0C5.37 0 .07 5.3.07 11.93c0 2.1.55 4.13 1.61 5.93L0 24l6.27-1.64a12 12 0 005.73 1.47h.01c6.63 0 11.93-5.3 11.93-11.93 0-3.19-1.24-6.19-3.42-8.42zM12 21.47h-.01a9.5 9.5 0 01-4.84-1.33l-.35-.21-3.72.97.99-3.63-.23-.37A9.46 9.46 0 012.5 11.93C2.5 6.64 6.71 2.43 12 2.43c2.53 0 4.9.98 6.69 2.77a9.41 9.41 0 012.78 6.73c0 5.29-4.21 9.54-9.47 9.54zm5.46-7.14c-.3-.15-1.77-.87-2.04-.97-.27-.1-.46-.15-.66.15-.2.3-.76.97-.93 1.17-.17.2-.34.22-.64.07-.3-.15-1.26-.46-2.4-1.47-.89-.79-1.49-1.77-1.66-2.07-.17-.3-.02-.46.13-.61.13-.13.3-.34.45-.51.15-.17.2-.29.3-.49.1-.2.05-.37-.02-.52-.07-.15-.66-1.6-.9-2.2-.23-.55-.47-.47-.66-.48l-.56-.01c-.2 0-.52.07-.79.37-.27.3-1.04 1.02-1.04 2.48 0 1.46 1.06 2.87 1.21 3.07.15.2 2.08 3.17 5.04 4.45.7.3 1.25.47 1.68.6.7.22 1.33.19 1.83.11.56-.08 1.77-.72 2.02-1.42.25-.7.25-1.3.17-1.42-.07-.12-.27-.2-.57-.35z"/></svg>');$waTopBtn.prepend($icon)}}else{$waTopBtn.text(waButtonText).removeAttr('style').addClass('wa-btn');var hasIcon=$waTopBtn.find('span.wa-btn-icon').length>0;if(waIconEnabled&&!hasIcon){$waTopBtn.prepend($('<span class="wa-btn-icon" aria-hidden="true"></span>').html('<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><path d="M20.52 3.48A11.9 11.9 0 0012 0C5.37 0 .07 5.3.07 11.93c0 2.1.55 4.13 1.61 5.93L0 24l6.27-1.64a12 12 0 005.73 1.47h.01c6.63 0 11.93-5.3 11.93-11.93 0-3.19-1.24-6.19-3.42-8.42zM12 21.47h-.01a9.5 9.5 0 01-4.84-1.33l-.35-.21-3.72.97.99-3.63-.23-.37A9.46 9.46 0 012.5 11.93C2.5 6.64 6.71 2.43 12 2.43c2.53 0 4.9.98 6.69 2.77a9.41 9.41 0 012.78 6.73c0 5.29-4.21 9.54-9.47 9.54zm5.46-7.14c-.3-.15-1.77-.87-2.04-.97-.27-.1-.46-.15-.66.15-.2.3-.76.97-.93 1.17-.17.2-.34.22-.64.07-.3-.15-1.26-.46-2.4-1.47-.89-.79-1.49-1.77-1.66-2.07-.17-.3-.02-.46.13-.61.13-.13.3-.34.45-.51.15-.17.2-.29.3-.49.1-.2.05-.37-.02-.52-.07-.15-.66-1.6-.9-2.2-.23-.55-.47-.47-.66-.48l-.56-.01c-.2 0-.52.07-.79.37-.27.3-1.04 1.02-1.04 2.48 0 1.46 1.06 2.87 1.21 3.07.15.2 2.08 3.17 5.04 4.45.7.3 1.25.47 1.68.6.7.22 1.33.19 1.83.11.56-.08 1.77-.72 2.02-1.42.25-.7.25-1.3.17-1.42-.07-.12-.27-.2-.57-.35z"/></svg>'))}else if(!waIconEnabled&&hasIcon){$waTopBtn.find('span.wa-btn-icon').remove()}}
215if($closeBtn.length){$waTopBtn.insertBefore($closeBtn)}else{$actions.append($waTopBtn)}}}catch(e){}}
216$('#accept-button').click(function(){$('#chatbox-send-button').removeAttr('disabled').removeClass('disabled');$(this).addClass('btn-selected');$('.consent-container').hide();isAcceptButtonSelected=!0;try{localStorage.setItem(CONSENT_STORAGE_KEY,'1')}catch(e){}})});function buildAnswerWithInlineCards(answerText,productCardsMap,openLinksNewTab){var parts=String(answerText).split(/(%%GCPROD:\d+%%)/);var result='';for(var i=0;i<parts.length;i++){var part=parts[i];var m=part.match(/^%%GCPROD:(\d+)%%$/);if(m){var cardHtml=productCardsMap[m[1]];result+=(cardHtml&&typeof cardHtml==='string')?cardHtml:''}else{result+=markdownToHtml(part,openLinksNewTab)}}
217return result}
218function markdownToHtml(inputText,openLinksNewTab){var targetAttr=openLinksNewTab?' target="_blank" rel="noopener"':'';var linkPlaceholders=[];var safeText=$('<div/>').text(String(inputText||'')).html().replace(/\r\n/g,'\n').replace(/\r/g,'\n').replace(/\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/g,function(match,label,url){var token='%%GCB_LINK_'+linkPlaceholders.length+'%%';linkPlaceholders.push('<a href="'+url+'"'+targetAttr+'>'+label+'</a>');return token}).replace(/(^|[\s>])((https?:\/\/[^\s<]+))/g,function(match,prefix,url){var cleanUrl=url;var suffix='';while(/[.,;:!?)]$/.test(cleanUrl)){suffix=cleanUrl.charAt(cleanUrl.length-1)+suffix;cleanUrl=cleanUrl.substring(0,cleanUrl.length-1)}
219return prefix+'<a href="'+cleanUrl+'"'+targetAttr+'>'+readableLinkLabel(cleanUrl)+'</a>'+suffix}).replace(/\*\*\*\s?([^*]+?)\s?\*\*\*/g,'<strong><em>$1</em></strong>').replace(/\*\*\s?([^*]+?)\s?\*\*/g,'<strong>$1</strong>').replace(/\*\s?([^*\n]+?)\s?\*/g,'<em>$1</em>').replace(/\n/g,'<br />');for(var i=0;i<linkPlaceholders.length;i++){safeText=safeText.replace('%%GCB_LINK_'+i+'%%',linkPlaceholders[i])}
220return safeText}
221function readableLinkLabel(url){try{var parser=document.createElement('a');parser.href=url;return parser.hostname||'abrir enlace'}catch(e){return'abrir enlace'}}
222function getChatboxScrollContainer(){return document.getElementById('chatbox-messages')}
223function isProductCardsMessage(el){return!!(el&&el.classList&&el.classList.contains('product-cards'))}
224function isShowMoreMessage(el){return!!(el&&el.querySelector&&el.querySelector('.gc-show-more-link'))}
225function scrollMessageToTop(messageEl){var container=getChatboxScrollContainer();if(!container||!messageEl){return}
226var containerRect=container.getBoundingClientRect();var messageRect=messageEl.getBoundingClientRect();container.scrollTop+=messageRect.top-containerRect.top}
227function resolveScrollTargetForLatest(container){var messages=container.querySelectorAll('.gptchatbox-message');if(!messages.length){return null}
228var last=messages[messages.length-1];if(isProductCardsMessage(last)||isShowMoreMessage(last)){var cardsEl=isProductCardsMessage(last)?last:last.previousElementSibling;if(cardsEl&&isProductCardsMessage(cardsEl)){var prev=cardsEl.previousElementSibling;if(prev&&prev.classList.contains('gptchatbox-message')){return prev}}
229for(var i=messages.length-2;i>=0;i--){if(!isProductCardsMessage(messages[i])&&!isShowMoreMessage(messages[i])){return messages[i]}}}
230return last}
231function scrollToLatestMessage(){var container=getChatboxScrollContainer();if(!container){return}
232var target=resolveScrollTargetForLatest(container);if(target){scrollMessageToTop(target)}};/**
233 * @author    Doofinder
234 * @copyright Doofinder
235 * @license   MIT
236 * @see       https://opensource.org/licenses/MIT
237 */
238class DoofinderAddToCartError extends Error{constructor(reason,status=""){const message="Error adding an item to the cart. Reason: "+reason+". Status code: "+status;super(message);this.name="DoofinderAddToCartError"}}
239let dfAddToCart=(cartOptions)=>{let IdProductCart;let IdCustomization;if(cartOptions.productID.includes('VAR-')){IdProductCart=cartOptions.group_id;IdCustomization=cartOptions.productID.replace('VAR-','')}else{IdProductCart=cartOptions.productID;IdCustomization=cartOptions.customizationID}
240let form=document.createElement("form");Object.assign(form,{method:"post",action:cartOptions.cartURL,style:"display: none;"});let quantityInput=document.createElement("input");Object.assign(quantityInput,{type:"number",name:"qty",value:cartOptions.quantity,min:1});let productAttributeInput=document.createElement("input");Object.assign(productAttributeInput,{type:"hidden",name:"id_product_attribute",value:IdCustomization});let productInput=document.createElement("input");Object.assign(productInput,{type:"hidden",name:"id_product",value:IdProductCart});let tokenInput=document.createElement("input");Object.assign(tokenInput,{type:"hidden",name:"token",value:cartOptions.cartToken});let submit=document.createElement("input");submit.setAttribute("type","submit");submit.setAttribute("data-button-action","add-to-cart");form.appendChild(quantityInput);form.appendChild(productAttributeInput);form.appendChild(productInput);form.appendChild(tokenInput);form.appendChild(submit);document.body.appendChild(form);if(typeof prestashop!=='undefined'&&typeof cartOptions.statusPromise!=='undefined'){prestashop.on('updateCart',function(event){if(typeof cartOptions.statusPromise==='undefined'||!event||!event.reason||!event.resp){return}
241if(event.resp.success){cartOptions.statusPromise.resolve("The item has been successfully added to the cart.")}else{errorList=Array.isArray(event.resp.errors)?event.resp.errors.join(", "):event.resp.errors;console.warn("Error adding to the cart: "+errorList);cartOptions.statusPromise.reject(new DoofinderAddToCartError(errorList));if(0===event.resp.quantity&&'undefined'===typeof event.reason.cart){window.location.href=cartOptions.itemLink}}});prestashop.on('handleError',function(event){if(typeof cartOptions.statusPromise==='undefined'){return}
242if(event&&event.eventType&&('updateProductInCart'===event.eventType||'updateShoppingCart'===event.eventType||'updateCart'===event.eventType||'updateProductInCart'===event.eventType||'updateProductQuantityInCart'===event.eventType||'addProductToCart'===event.eventType)){console.group(`Error of type '${event.eventType}' adding item to the cart.`);if(event.eventType==='addProductToCart'){console.error("Redirecting user to the item page.");window.location.href=item_link}
243if(0===event.resp.readyState){console.error("The connection was interrupted while adding to the cart")}
244console.groupEnd();cartOptions.statusPromise.reject(new DoofinderAddToCartError(message))}})}
245submit.click();form.remove()}
246let doofinderManageCart=(cartOptions)=>{dfAddToCart(cartOptions)};/*
247* Page Cache Ultimate, Page Cache standard and Speed pack are powered by Jpresta (jpresta . com)
248*
249*    @author    Jpresta
250*    @copyright Jpresta
251*    @license   See the license of this module in file LICENSE.txt, thank you.
252*/
253function jprestaPcGetParameterValue(e){let t="[\\?&]"+e+"=([^&#]*)";let n=new RegExp(t);let r=n.exec(window.location.href);if(r==null)return"";else return r[1]}
254function jprestaPcSplitUri(uri){let splitRegExp=new RegExp('^'+'(?:'+'([^:/?#.]+)'+':)?'+'(?://'+'(?:([^/?#]*)@)?'+'([\\w\\d\\-\\u0100-\\uffff.%]*)'+'(?:(:[0-9]+))?'+')?'+'([^?#]+)?'+'(?:(\\?[^#]*))?'+'(?:(#.*))?'+'$');let split=uri.match(splitRegExp);for(let i=1;i<8;i++){if(typeof split[i]==='undefined'){split[i]=''}}
255return{'scheme':split[1],'user_info':split[2],'domain':split[3],'port':split[4],'path':split[5],'query_data':split[6],'fragment':split[7]}}
256function jprestaPcSetCookie(cname,cvalue,ttl_minutes,path){let d=new Date();d.setTime(d.getTime()+(ttl_minutes*60*1000));let expires="expires="+d.toUTCString();document.cookie=cname+"="+cvalue+";"+expires+";path="+path}
257function jprestaPcGetCookie(cname,defaultValue){if(defaultValue===undefined){defaultValue=null}
258let name=cname+"=";let decodedCookie=decodeURIComponent(document.cookie);let ca=decodedCookie.split(';');for(let i=0;i<ca.length;i++){let c=ca[i];while(c.charAt(0)===' '){c=c.substring(1)}
259if(c.indexOf(name)===0){return c.substring(name.length,c.length)}}
260return defaultValue}
261function jprestaGetTTFB(){let timing=null;if(typeof window.performance.timing!=='undefined'){timing=window.performance.timing}else{timing=window.performance.getEntriesByType('navigation')[0]}
262return timing.responseStart-timing.requestStart}
263function jprestaIsBot(){return/bot|googlebot|crawler|spider|robot|crawling|gtmetrix|chrome-lighthouse/i.test(navigator.userAgent)}
264function jprestaGetCacheType(){let cache_type=-2;let timing=null;if(typeof window.performance.getEntriesByType=='function'){timing=window.performance.getEntriesByType('navigation')[0]}
265if(!timing&&typeof window.performance.timing!=='undefined'){timing=window.performance.timing}
266if(timing&&timing.transferSize===0){cache_type=2}else if(timing&&typeof timing.serverTiming!='undefined'){for(let i=0;i<timing.serverTiming.length;i++){if(timing.serverTiming[i].name==='jpresta_cache'){cache_type=parseInt(timing.serverTiming[i].description);break}}}
267return cache_type}
268function jprestaPcForwardDbgpagecacheParameter(){try{if(typeof prestashop!=='undefined'&&prestashop.urls&&prestashop.urls.base_url){baseDir=prestashop.urls.base_url}else if(typeof baseDir==='undefined'){baseDir=window.location.origin+'/'}
269if(window.location.href.indexOf("dbgpagecache=")>0){$("a:not(.pagecache)").each(function(){let e=$(this).attr("href");let t=this.search;let n="dbgpagecache="+jprestaPcGetParameterValue("dbgpagecache");let r=baseDir.replace("https","http");if(typeof e!=="undefined"&&e.substr(0,1)!=="#"&&(e.replace("https","http").substr(0,r.length)===r||e.indexOf('://')===-1)&&e.indexOf('javascript:')===-1&&e.indexOf('mailto:')===-1&&e.indexOf('tel:')===-1&&e.indexOf('callto:')===-1){if(t.length===0)this.search=n;else this.search+="&"+n}});console.log("Page Cache Ultimate - Parameter dbgpagecache has been added to all links")}}catch(e){console.warn("Page Cache Ultimate - Cannot forward dbgpagecache parameter on all links: "+e.message,e)}}
270jprestaPcStartsWith=function(str,search){return typeof str==='string'&&str.substr(0,search.length)===search};jprestaPcProcessDynamicModules=function(dyndatas){for(let key in dyndatas){if(key==='js'){$('body').append(dyndatas[key])}else if(jprestaPcStartsWith(key,'dyn')){try{let blockToReplace=$('#'+key);if(blockToReplace.length){let parentBlock=blockToReplace.parent();blockToReplace.replaceWith(dyndatas[key]);if(parentBlock.hasClass('elementor-widget')){try{if(window.ceFrontend?.elementsHandler?.runReadyTrigger){window.ceFrontend.elementsHandler.runReadyTrigger(parentBlock)}}catch(error){console.error('Page Cache Ultimate - Error while initializing Elementor widget '+key+': '+error)}}}}catch(error){console.error('Page Cache Ultimate - A javasript error occured during the "eval" of the refreshed content '+key+': '+error)}}}
271if(typeof pcRunDynamicModulesJs=='function'){pcRunDynamicModulesJs()}
272$('header a[href]').each(function(){$(this).attr('href',$(this).attr('href').replace(/(%26|%3F|\?|&)ajax(%3D|=)1(%26|&)page_cache_dynamics_mods(%3D|=)1(%26|&)action(%3D|=)refresh_dynamic_mods/,''))});console.timeEnd('Page Cache Ultimate - Dynamic modules have been refreshed in ')
273if(typeof prestashop!='undefined'&&typeof prestashop.emit=='function'){prestashop.emit('jprestaDynamicContentLoaded')}};function jprestaPcRefreshDynamicModules(cacheSource){try{console.time('Page Cache Ultimate - Dynamic modules have been refreshed in ')
274let dynDatas={};dynDatas.cache_source=cacheSource;dynDatas.ttfb=jprestaGetTTFB();$('.dynhook').each(function(index,domhook){let el=this;dynDatas['hk_'+index]=(el.getAttribute('id')||'')+'|'+(el.dataset.hooktype||'')+'|'+(el.dataset.module||'')+'|'+(el.dataset.hook||'')+'|'+(el.dataset.hookargs||'')});let urlparts=jprestaPcSplitUri(document.URL);let url=urlparts.scheme+'://'+urlparts.domain+urlparts.port+urlparts.path+urlparts.query_data;let indexEnd=url.indexOf('?');
274if(indexEnd>=0&&indexEnd<url.length){url+='&ajax=1&page_cache_dynamics_mods=1&action=refresh_dynamic_mods'}else{url+='?ajax=1&page_cache_dynamics_mods=1&action=refresh_dynamic_mods'}
275let headers={};if(document.referrer){headers['x-jpresta-referer']=document.referrer}
276$.ajax({url:url,type:'POST',data:dynDatas,dataType:'json',cache:!1,headers:headers,success:jprestaPcProcessDynamicModules,error:function(jqXHR,textStatus,errorThrown){let dyndatas;try{let indexStart=jqXHR.responseText.indexOf('{');let responseFixed=jqXHR.responseText.substring(indexStart,jqXHR.responseText.length);dyndatas=$.parseJSON(responseFixed);if(dyndatas!=null){jprestaPcProcessDynamicModules(dyndatas);return}}catch(err){console.error("Page Cache Ultimate - Cannot parse data of error="+err,err)}
277console.error("Page Cache Ultimate - Cannot display dynamic modules: error="+textStatus+" exception="+errorThrown);console.log("Page Cache Ultimate - Dynamic module URL: "+url)}})}catch(e){console.error("Page Cache Ultimate - Cannot display dynamic modules: "+e.message,e)}}
278function jprestaPcSendStats(cacheSource,ttfb){try{console.time('Page Cache Ultimate - Sending stats in ');let dynDatas={};dynDatas.cache_source=cacheSource;dynDatas.ttfb=ttfb;let urlparts=jprestaPcSplitUri(document.URL);let url=urlparts.scheme+'://'+urlparts.domain+urlparts.port+urlparts.path+urlparts.query_data;let indexEnd=url.indexOf('?');if(indexEnd>=0&&indexEnd<url.length){url+='&ajax=1&page_cache_dynamics_mods=1&action=refresh_dynamic_mods&stats'}else{url+='?ajax=1&page_cache_dynamics_mods=1&action=refresh_dynamic_mods&stats'}
279$.ajax({url:url,type:'POST',data:dynDatas,dataType:'json',cache:!1,error:function(jqXHR,textStatus,errorThrown){console.error("Page Cache Ultimate - Cannot display dynamic modules: error="+textStatus+" exception="+errorThrown);console.log("Page Cache Ultimate - Stats URL: "+url)},complete:function(){console.timeEnd('Page Cache Ultimate - Sending stats in ')}})}catch(e){console.error("Page Cache Ultimate - Cannot stats: "+e.message,e)}}
280let jprestaUpdateCartTryCount=0;function jprestaUpdateCart(){if(typeof prestashop!=='undefined'&&typeof prestashop.emit=='function'){if(typeof prestashop._events.updateCart=='undefined'){if(jprestaUpdateCartTryCount<10){jprestaUpdateCartTryCount++;console.log('Page Cache Ultimate - Cart is not ready, retrying...');setTimeout(jprestaUpdateCart,100);return}else{console.log('Page Cache Ultimate - Cart is not ready, NOT retrying because we tried too many times.')}}
281if(typeof jprestaUseCreativeElements=='undefined'||!jprestaUseCreativeElements){console.log('Page Cache Ultimate - Refreshing the cart (PS >= 1.7)...');setTimeout("prestashop.emit('updateCart', {reason: {linkAction: 'refresh'}, resp: {errors: []}})",10)}else{console.log('Page Cache Ultimate - Refreshing the cart (CreativeElements)...');$.ajax({url:prestashop.urls.pages.cart,method:'POST',dataType:'json',data:{ajax:1,action:'update'}}).then(function(resp){if(resp.success&&resp.cart){prestashop.emit('updateCart',{reason:{linkAction:'refresh'},resp:resp})}})}}else if(typeof ajaxCart!=='undefined'){console.log('Page Cache Ultimate - Refreshing the cart (PS 1.5/1.6)...');$.ajax({type:'POST',headers:{"cache-control":"no-cache"},url:baseUri+'?rand='+new Date().getTime(),async:!0,cache:!1,dataType:"json",data:'controller=cart&ajax=1&token='+static_token,success:function(jsonData){ajaxCart.updateCart(jsonData)}})}}
282function jprestaInitCreativeElementsWidgets(){let widgetTypes=['sign-in.default','shopping-cart.default','product-add-to-wishlist.default'];widgetTypes.forEach(function(type){$('[data-widget_type="'+type+'"]').each(function(index){let widget=$(this);let elementorId=widget.closest('[data-elementor-id]').attr('data-elementor-id');let widgetId=widget.attr('data-id');let widgetContainer=widget.children().first();widgetContainer.attr('data-hooktype','ce');widgetContainer.attr('data-hookargs',elementorId+','+widgetId);widgetContainer.addClass('dynhook');if(!widgetContainer.attr('id')){let uniqueId='dyn'+widgetId+'_'+index;widgetContainer.attr('id',uniqueId)}})})}
283window.addEventListener('load',function(event){if(jprestaIsBot()){jprestaPcSendStats(jprestaGetCacheType(),jprestaGetTTFB());return}
284if(typeof jprestaUpdateCartDirectly!='undefined'&&jprestaUpdateCartDirectly){if
284(typeof $=='function'){$(document).ready(jprestaUpdateCart)}else{jprestaUpdateCart()}}
285jprestaInitCreativeElementsWidgets();let cacheSource=jprestaGetCacheType();switch(cacheSource){case-2:jprestaPcRefreshDynamicModules(cacheSource);console.log('Page Cache Ultimate - Cannot determine the cache type :-(');break;case-1:console.log('Page Cache Ultimate - Cannot be cached');break;case 0:jprestaPcRefreshDynamicModules(cacheSource);console.log('Page Cache Ultimate - No cache was used');break;case 1:jprestaPcRefreshDynamicModules(cacheSource);console.log('Page Cache Ultimate - Server cache was used');break;case 2:jprestaPcRefreshDynamicModules(cacheSource);console.log('Page Cache Ultimate - Browser cache was used');break;case 3:jprestaPcRefreshDynamicModules(cacheSource);console.log('Page Cache Ultimate - Static cache was used');break;case 4:break}
286$('.pctype'+cacheSource).show();jprestaPcForwardDbgpagecacheParameter();let ctxUuid=jprestaPcGetCookie('jpresta_cache_context',!1);if(ctxUuid){console.log('Page Cache Ultimate - Displaying the page with context \x1B[1;4m'+ctxUuid+'\x1B[m')}});window.addEventListener('pageshow',function(event){if(event.persisted){jprestaPcSendStats(4,0);console.log('Page Cache Ultimate - Back/forward cache is used');jprestaUpdateCart()}});window.addEventListener('resize',function(event){document.cookie="jpresta_cache_context=;path=/;expires=Thu, 01 Jan 1970 00:00:00 GMT"});/**
287 * 2007-2026 PrestaShop
288 *
289 * NOTICE OF LICENSE
290 *
291 * This source file is subject to the Academic Free License (AFL 3.0)
292 * that is bundled with this package in the file LICENSE.txt.
293 * It is also available through the world-wide-web at this URL:
294 * http://opensource.org/licenses/afl-3.0.php
295 * If you did not receive a copy of the license and are unable to
296 * obtain it through the world-wide-web, please send an email
297 * to [email protected] so we can send you a copy immediately.
298 *
299 * DISCLAIMER
300 *
301 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
302 * versions in the future. If you wish to customize PrestaShop for your
303 * needs please refer to http://www.prestashop.com for more information.
304 *
305 * @author    La Poste
306 * @copyright 2007-2026 PrestaShop SA / 2024-2026 La Poste
307 * @license   http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
308 * International Registered Trademark & Property of PrestaShop SA
309 *//**
310 * MapLibre GL JS
311 * @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v4.7.1/LICENSE.txt
312 */
313!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).maplibregl=e()}(this,function(){"use strict";var t={},e={};function i(i,r,n){if(e[i]=n,"index"===i){var s="var sharedModule = {}; ("+e.shared+")(sharedModule); ("+e.worker+")(sharedModule);",a={};return e.shared(a),e.index(t,a),"undefined"!=typeof window&&t.setWorkerUrl(window.URL.createObjectURL(new Blob([s],{type:"text/javascript"}))),t}}return i("shared",0,function(t){function e(t,e,i,r){return new(i||(i=Promise))(function(n,s){function a(t){try{l(r.next(t))}catch(t){s(t)}}function o(t){try{l(r["throw"](t))}catch(t){s(t)}}function l(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i(function(t){t(e)})).then(a,o)}l((r=r.apply(t,e||[])).next())})}function i(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t["default"]:t}"function"==typeof SuppressedError&&SuppressedError;var r=n;function n(t,e){this.x=t,this.y=e}n.prototype={clone:function(){return new n(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x,i=t.y-this.y;return e*e+i*i},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[2]*this.x+t[3]*this.y;return this.x=t[0]*this.x+t[1]*this.y,this.y=e,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),i=Math.sin(t),r=i*this.x+e*this.y;return this.x=e*this.x-i*this.y,this.y=r,this}
vendor: 8,661 bytes, line 313
313,_rotateAround:function(t,e){var i=Math.cos(t),r=Math.sin(t),n=e.y+r*(this.x-e.x)+i*(this.y-e.y);return this.x=e.x+i*(this.x-e.x)-r*(this.y-e.y),this.y=n,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},n.convert=function(t){return t instanceof n?t:Array.isArray(t)?new n(t[0],t[1]):t};var s=i(r),a=o;function o(t,e,i,r){this.cx=3*t,this.bx=3*(i-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(r-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=e,this.p2x=i,this.p2y=r}o.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,e){if(void 0===e&&(e=1e-6),t<0)return 0;if(t>1)return 1;for(var i=t,r=0;r<8;r++){var n=this.sampleCurveX(i)-t;if(Math.abs(n)<e)return i;var s=this.sampleCurveDerivativeX(i);if(Math.abs(s)<1e-6)break;i-=n/s}var a=0,o=1;for(i=t,r=0;r<20&&(n=this.sampleCurveX(i),!(Math.abs(n-t)<e));r++)t>n?a=i:o=i,i=.5*(o-a)+a;return i},solve:function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}};var l=i(a);let c,h;function u(){return null==c&&(c="undefined"!=typeof OffscreenCanvas&&new OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof createImageBitmap),c}function d(){if(null==h&&(h=!1,u())){const t=5,e=new OffscreenCanvas(t,t).getContext("2d",{willReadFrequently:!0});if(e){for(let i=0;i<t*t;i++){const r=4*i;e.fillStyle=`rgb(${r},${r+1},${r+2})`,e.fillRect(i%t,Math.floor(i/t),1,1)}const i=e.getImageData(0,0,t,t).data;for(let e=0;e<t*t*4;e++)if(e%4!=3&&i[e]!==e){h=!0;break}}}return h||!1}function p(t,e,i,r){const n=new l(t,e,i,r);return t=>n.solve(t)}const f=p(.25,.1,.25,1);function m(t,e,i){return Math.min(i,Math.max(e,t))}function _(t,e,i){const r=i-e,n=((t-e)%r+r)%r+e;return n===e?i:n}function g(t,...e){for(const i of e)for(const e in i)t[e]=i[e];return t}let y=1;function x(t,e,i){const r={};for(const i in t)r[i]=e.call(this,t[i],i,t);return r}function v(t,e,i){const r={};for(const i in t)e.call(this,t[i],i,t)&&(r[i]=t[i]);return r}function b(t){return Array.isArray(t)?t.map(b):"object"==typeof t&&t?x(t,b):t}const w={};function T(t){w[t]||("undefined"!=typeof console&&console.warn(t),w[t]=!0)}function S(t,e,i){return(i.y-t.y)*(e.x-t.x)>(e.y-t.y)*(i.x-t.x)}function I(t){return"undefined"!=typeof WorkerGlobalScope&&void 0!==t&&t instanceof WorkerGlobalScope}let P=null;function A(t){return"undefined"!=typeof ImageBitmap&&t instanceof ImageBitmap}const M="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function k(t,i,r,n,s){return e(this,void 0,void 0,function*(){if("undefined"==typeof VideoFrame)throw new Error("VideoFrame not supported");const e=new VideoFrame(t,{timestamp:0});try{const a=null==e?void 0:e.format;if(!a||!a.startsWith("BGR")&&!a.startsWith("RGB"))throw new Error(`Unrecognized format ${a}`);const o=a.startsWith("BGR"),l=new Uint8ClampedArray(n*s*4);if(yield e.copyTo(l,function(t,e,i,r,n){const s=4*Math.max(-e,0),a=(Math.max(0,i)-i)*r*4+s,o=4*r,l=Math.max(0,e),c=Math.max(0,i);return{rect:{x:l,y:c,width:Math.min(t.width,e+r)-l,height:Math.min(t.height,i+n)-c},layout:[{offset:a,stride:o}]}}(t,i,r,n,s)),o)for(let t=0;t<l.length;t+=4){const e=l[t];l[t]=l[t+2],l[t+2]=e}return l}finally{e.close()}})}let C,z;const E="AbortError";function D(){return new Error(E)}const L={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function R(t){return L.REGISTERED_PROTOCOLS[t.substring(0,t.indexOf("://"))]}const B="global-dispatcher";class F extends Error{constructor(t,e,i,r){super(`AJAXError: ${e} (${t}): ${i}`),this.status=t,this.statusText=e,this.url=i,this.body=r}}const O=()=>I(self)?self.worker&&self.worker.referrer:("blob:"===window.location.protocol?window.parent:window).location.href,V=function(t,i){if(/:\/\//.test(t.url)&&!/^https?:|^file:/.test(t.url)){const e=R(t.url);if(e)return e(t,i);if(I(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:t,targetMapId:B},i)}if(!(/^file:/.test(r=t.url)||/^file:/.test(O())&&!/^\w+:/.test(r))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(t,i){return e(this,void 0,void 0,function*(){const e=new Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,cache:t.cache,referrer:O(),signal:i.signal});"json"!==t.type||e.headers.has("Accept")||e.headers.set("Accept","application/json");const r=yield fetch(e);if(!r.ok){const e=yield r.blob();throw new F(r.status,r.statusText,t.url,e)}let n;n="arrayBuffer"===t.type||"image"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text();const s=yield n;if(i.signal.aborted)throw D();return{data:s,cacheControl:r.headers.get("Cache-Control"),expires:r.headers.get("Expires")}})}(t,i);if(I(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:t,mustQueue:!0,targetMapId:B},i)}var r;return function(t,e){return new Promise((i,r)=>{var n;const s=new XMLHttpRequest;s.open(t.method||"GET",t.url,!0),"arrayBuffer"!==t.type&&"image"!==t.type||(s.responseType="arraybuffer");for(const e in t.headers)s.setRequestHeader(e,t.headers[e]);"json"===t.type&&(s.responseType="text",(null===(n=t.headers)||void 0===n?void 0:n.Accept)||s.setRequestHeader("Accept","application/json")),s.withCredentials="include"===t.credentials,s.onerror=()=>{r(new Error(s.statusText))},s.onload=()=>{if(!e.signal.aborted)if((s.status>=200&&s.status<300||0===s.status)&&null!==s.response){let e=s.response;if("json"===t.type)try{e=JSON.parse(s.response)}catch(t){return void r(t)}i({data:e,cacheControl:s.getResponseHeader("Cache-Control"),expires:s.getResponseHeader("Expires")})}else{const e=new Blob([s.response],{type:s.getResponseHeader("Content-Type")});r(new F(s.status,s.statusText,t.url,e))}},e.signal.addEventListener("abort",()=>{s.abort(),r(D())}),s.send(t.body)})}(t,i)};function N(t){if(!t||t.indexOf("://")<=0||0===t.indexOf("data:image/")||0===t.indexOf("blob:"))return!0;const e=new URL(t),i=window.location;return e.protocol===i.protocol&&e.host===i.host}function j(t,e,i){i[t]&&-1!==i[t].indexOf(e)||(i[t]=i[t]||[],i[t].push(e))}function U(t,e,i){if(i&&i[t]){const r=i[t].indexOf(e);-1!==r&&i[t].splice(r,1)}}class ${constructor(t,e={}){g(this,e),this.type=t}}class q extends ${constructor(t,e={}){super("error",g({error:t},e))}}class Z{on(t,e){return this._listeners=this._listeners||{},j(t,e,this._listeners),this}off(t,e){return U(t,e,this._listeners),U(t,e,this._oneTimeListeners),this}once(t,e){return e?(this._oneTimeListeners=this._oneTimeListeners||{},j(t,e,this._oneTimeListeners),this):new Promise(e=>this.once(t,e))}fire(t,e){"string"==typeof t&&(t=new $(t,e||{}));const i=t.type;if(this.listens(i)){t.target=this;const e=this._listeners&&this._listeners[i]?this._listeners[i].slice():[];for(const i of e)i.call(this,t);const r=this._oneTimeListeners&&this._oneTimeListeners[i]?this._oneTimeListeners[i].slice():[];for(const e of r)U(i,e,this._oneTimeListeners),e.call(this,t);const n=this._eventedParent;n&&(g(t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),n.fire(t))}else t instanceof q&&console.error(t.error);return this}listens(t){return this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)}setEventedParent(t,e){return this._eventedParent=t,this._eventedParentData=e,this}}var G={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number","default":0,period:360,units:"degrees"},pitch:{type:"number","default":0,units:"degrees"},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,"default":[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}}
313,"default":"xyz"},minzoom:{type:"number","default":0},maxzoom:{type:"number","default":22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean","default":!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,"default":[-180,-85.051129,180,85.051129]},minzoom:{type:"number","default":0},maxzoom:{type:"number","default":22},tileSize:{type:"number","default":512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},"default":"xyz"},attribution:{type:"string"},volatile:{type:"boolean","default":!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,"default":[-180,-85.051129,180,85.051129]},minzoom:{type:"number","default":0},maxzoom:{type:"number","default":22},tileSize:{type:"number","default":512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},"default":"mapbox"},redFactor:{type:"number","default":1},blueFactor:{type:"number","default":1},greenFactor:{type:"number","default":1},baseShift:{type:"number","default":0},volatile:{type:"boolean","default":!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number","default":18},attribution:{type:"string"},buffer:{type:"number","default":128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number","default":.375},cluster:{type:"boolean","default":!1},clusterRadius:{type:"number","default":50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean","default":!1},generateId:{type:"boolean","default":!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},"default":"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},"default":"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},"default":"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},"default":"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},"default":"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},"default":"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},"default":"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number","default":2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number","default":1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},"default":"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},"default":"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number","default":250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean","default":!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},"default":"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean","default":!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean","default":!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean","default":!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},"default":"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number","default":1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},"default":"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,"default":[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"}
313,"icon-rotate":{type:"number","default":0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding","default":[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean","default":!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,"default":[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},"default":"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},"default":"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},"default":"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},"default":"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted","default":"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string","default":["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number","default":16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number","default":10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number","default":1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number","default":0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},"default":"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems","default":0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},"default":"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number","default":45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}
313,"text-rotate":{type:"number","default":0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number","default":2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean","default":!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},"default":"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,"default":[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean","default":!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean","default":!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean","default":!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},"default":"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},"default":"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},"default":"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},"in":{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},"function":{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number","default":1,minimum:0},property:{type:"string","default":"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},"default":"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},"default":"rgb"},"default":{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum","default":"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array","default":[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant","default":"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant","default":.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant","default":"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant","default":"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant","default":"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant","default":.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant","default":.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant","default":.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant","default":.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,"default":1}},projection:{type:{type:"enum","default":"mercator",values:{mercator:{},globe:{}}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean","default":!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number","default":1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color","default":"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,"default":[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},"default":"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number","default":1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color","default":"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,"default":[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},"default":"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number","default":0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number","default":0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean","default":!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number","default":1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color","default":"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,"default":[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},"default":"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number","default":1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number","default":0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number","default":0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}
313,"line-blur":{type:"number","default":0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number","default":5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color","default":"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number","default":0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number","default":1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,"default":[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},"default":"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},"default":"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},"default":"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number","default":0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color","default":"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number","default":1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number","default":30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number","default":1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number","default":1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color","default":["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number","default":1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number","default":1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color","default":"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color","default":"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number","default":0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number","default":0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,"default":[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},"default":"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number","default":1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color","default":"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color","default":"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number","default":0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number","default":0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,"default":[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},"default":"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number","default":1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}
vendor: 4,670 bytes, line 313
313,"raster-hue-rotate":{type:"number","default":0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number","default":0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number","default":1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number","default":0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number","default":0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},"default":"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number","default":300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number","default":335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},"default":"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number","default":.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color","default":"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color","default":"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color","default":"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color","default":"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number","default":1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number","default":300,minimum:0,units:"milliseconds"},delay:{type:"number","default":0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};const H=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function X(t,e){const i={};for(const e in t)"ref"!==e&&(i[e]=t[e]);return H.forEach(t=>{t in e&&(i[t]=e[t])}),i}function W(t,e){if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(!W(t[i],e[i]))return!1;return!0}if("object"==typeof t&&null!==t&&null!==e){if("object"!=typeof e)return!1;if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const i in t)if(!W(t[i],e[i]))return!1;return!0}return t===e}function K(t,e){t.push(e)}function J(t,e,i){K(i,{command:"addSource",args:[t,e[t]]})}function Y(t,e,i){K(e,{command:"removeSource",args:[t]}),i[t]=!0}function Q(t,e,i,r){Y(t,i,r),J(t,e,i)}function tt(t,e,i){let r;for(r in t[i])if(Object.prototype.hasOwnProperty.call(t[i],r)&&"data"!==r&&!W(t[i][r],e[i][r]))return!1;for(r in e[i])if(Object.prototype.hasOwnProperty.call(e[i],r)&&"data"!==r&&!W(t[i][r],e[i][r]))return!1;return!0}function et(t,e,i,r,n,s){t=t||{},e=e||{};for(const a in t)Object.prototype.hasOwnProperty.call(t,a)&&(W(t[a],e[a])||i.push({command:s,args:[r,a,e[a],n]}));for(const a in e)Object.prototype.hasOwnProperty.call(e,a)&&!Object.prototype.hasOwnProperty.call(t,a)&&(W(t[a],e[a])||i.push({command:s,args:[r,a,e[a],n]}))}function it(t){return t.id}function rt(t,e){return t[e.id]=e,t}class nt{constructor(t,e,i,r){this.message=(t?`${t}: `:"")+i,r&&(this.identifier=r),null!=e&&e.__line__&&(this.line=e.__line__)}}function st(t,...e){for(const i of e)for(const e in i)t[e]=i[e];return t}
vendor: 2,403 bytes, line 313
313class at extends Error{constructor(t,e){super(e),this.message=e,this.key=t}}class ot{constructor(t,e=[]){this.parent=t,this.bindings={};for(const[t,i]of e)this.bindings[t]=i}concat(t){return new ot(this,t)}get(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(`${t} not found in scope.`)}has(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)}}const lt={kind:"null"},ct={kind:"number"},ht={kind:"string"},ut={kind:"boolean"},dt={kind:"color"},pt={kind:"object"},ft={kind:"value"},mt={kind:"collator"},_t={kind:"formatted"},gt={kind:"padding"},yt={kind:"resolvedImage"},xt={kind:"variableAnchorOffsetCollection"};function vt(t,e){return{kind:"array",itemType:t,N:e}}function bt(t){if("array"===t.kind){const e=bt(t.itemType);return"number"==typeof t.N?`array<${e}, ${t.N}>`:"value"===t.itemType.kind?"array":`array<${e}>`}return t.kind}const wt=[lt,ct,ht,ut,dt,_t,pt,vt(ft),gt,yt,xt];function Tt(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!Tt(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(const t of wt)if(!Tt(t,e))return null}return`Expected ${bt(t)} but found ${bt(e)} instead.`}function St(t,e){return e.some(e=>e.kind===t.kind)}function It(t,e){return e.some(e=>"null"===e?null===t:"array"===e?Array.isArray(t):"object"===e?t&&!Array.isArray(t)&&"object"==typeof t:e===typeof t)}function Pt(t,e){return"array"===t.kind&&"array"===e.kind?t.itemType.kind===e.itemType.kind&&"number"==typeof t.N:t.kind===e.kind}const At=.96422,Mt=.82521,kt=4/29,Ct=6/29,zt=3*Ct*Ct,Et=Ct*Ct*Ct,Dt=Math.PI/180,Lt=180/Math.PI;function Rt(t){return(t%=360)<0&&(t+=360),t}function Bt([t,e,i,r]){let n,s;const a=Ot((.2225045*(t=Ft(t))+.7168786*(e=Ft(e))+.0606169*(i=Ft(i)))/1);t===e&&e===i?n=s=a:(n=Ot((.4360747*t+.3850649*e+.1430804*i)/At),s=Ot((.0139322*t+.0971045*e+.7141733*i)/Mt));const o=116*a-16;return[o<0?0:o,500*(n-a),200*(a-s),r]}function Ft(t){return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function Ot(t){return t>Et?Math.pow(t,1/3):t/zt+kt}function Vt([t,e,i,r]){let n=(t+16)/116,s=isNaN(e)?n:n+e/500,a=isNaN(i)?n:n-i/200;return n=1*jt(n),s=At*jt(s),a=Mt*jt(a),[Nt(3.1338561*s-1.6168667*n-.4906146*a),Nt(-.9787684*s+1.9161415*n+.033454*a),Nt(.0719453*s-.2289914*n+1.4052427*a),r]}
vendor: 46,683 bytes, line 313
313function Nt(t){return(t=t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055)<0?0:t>1?1:t}function jt(t){return t>Ct?t*t*t:zt*(t-kt)}function Ut(t){return parseInt(t.padEnd(2,t),16)/255}function $t(t,e){return qt(e?t/100:t,0,1)}function qt(t,e,i){return Math.min(Math.max(e,t),i)}function Zt(t){return!t.some(Number.isNaN)}const Gt={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]};class Ht{constructor(t,e,i,r=1,n=!0){this.r=t,this.g=e,this.b=i,this.a=r,n||(this.r*=r,this.g*=r,this.b*=r,r||this.overwriteGetter("rgb",[t,e,i,r]))}static parse(t){if(t instanceof Ht)return t;if("string"!=typeof t)return;const e=function(t){if("transparent"===(t=t.toLowerCase().trim()))return[0,0,0,0];const e=Gt[t];if(e){const[t,i,r]=e;return[t/255,i/255,r/255,1]}if(t.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(t)){const e=t.length<6?1:2;let i=1;return[Ut(t.slice(i,i+=e)),Ut(t.slice(i,i+=e)),Ut(t.slice(i,i+=e)),Ut(t.slice(i,i+e)||"ff")]}if(t.startsWith("rgb")){const e=t.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(e){const[t,i,r,n,s,a,o,l,c,h,u,d]=e,p=[n||" ",o||" ",h].join("");if("  "===p||"  /"===p||",,"===p||",,,"===p){const t=[r,a,c].join(""),e="%%%"===t?100:""===t?255:0;if(e){const t=[qt(+i/e,0,1),qt(+s/e,0,1),qt(+l/e,0,1),u?$t(+u,d):1];if(Zt(t))return t}}return}}const i=t.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(i){const[t,e,r,n,s,a,o,l,c]=i,h=[r||" ",s||" ",o].join("");if("  "===h||"  /"===h||",,"===h||",,,"===h){const t=[+e,qt(+n,0,100),qt(+a,0,100),l?$t(+l,c):1];if(Zt(t))return function([t,e,i,r]){function n(r){const n=(r+t/30)%12,s=e*Math.min(i,1-i);return i-s*Math.max(-1,Math.min(n-3,9-n,1))}return t=Rt(t),e/=100,i/=100,[n(0),n(8),n(4),r]}(t)}}}(t);return e?new Ht(...e,!1):void 0}get rgb(){const{r:t,g:e,b:i,a:r}=this,n=r||1/0;return this.overwriteGetter("rgb",[t/n,e/n,i/n,r])}get hcl(){return this.overwriteGetter("hcl",function(t){const[e,i,r,n]=Bt(t),s=Math.sqrt(i*i+r*r);return[Math.round(1e4*s)?Rt(Math.atan2(r,i)*Lt):NaN,s,e,n]}(this.rgb))}get lab(){return this.overwriteGetter("lab",Bt(this.rgb))}overwriteGetter(t,e){return Object.defineProperty(this,t,{value:e}),e}toString(){const[t,e,i,r]=this.rgb;return`rgba(${[t,e,i].map(t=>Math.round(255*t)).join(",")},${r})`}}Ht.black=new Ht(0,0,0,1),Ht.white=new Ht(1,1,1,1),Ht.transparent=new Ht(0,0,0,0),Ht.red=new Ht(1,0,0,1);class Xt{constructor(t,e,i){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=i,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,e){return this.collator.compare(t,e)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class Wt{constructor(t,e,i,r,n){this.text=t,this.image=e,this.scale=i,this.fontStack=r,this.textColor=n}}class Kt{constructor(t){this.sections=t}static fromString(t){return new Kt([new Wt(t,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some(t=>0!==t.text.length||t.image&&0!==t.image.name.length)}static factory(t){return t instanceof Kt?t:Kt.fromString(t)}toString(){return 0===this.sections.length?"":this.sections.map(t=>t.text).join("")}}class Jt{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof Jt)return t;if("number"==typeof t)return new Jt([t,t,t,t]);if(Array.isArray(t)&&!(t.length<1||t.length>4)){for(const e of t)if("number"!=typeof e)return;switch(t.length){case 1:t=[t[0],t[0],t[0],t[0]];break;case 2:t=[t[0],t[1],t[0],t[1]];break;case 3:t=[t[0],t[1],t[2],t[1]]}return new Jt(t)}}toString(){return JSON.stringify(this.values)}}const Yt=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Qt{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof Qt)return t;if(Array.isArray(t)&&!(t.length<1)&&t.length%2==0){for(let e=0;e<t.length;e+=2){const i=t[e],r=t[e+1];if("string"!=typeof i||!Yt.has(i))return;if(!Array.isArray(r)||2!==r.length||"number"!=typeof r[0]||"number"!=typeof r[1])return}return new Qt(t)}}toString(){return JSON.stringify(this.values)}}class te{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new te({name:t,available:!1}):null}}function ee(t,e,i,r){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof i&&i>=0&&i<=255?void 0===r||"number"==typeof r&&r>=0&&r<=1?null:`Invalid rgba value [${[t,e,i,r].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof r?[t,e,i,r]:[t,e,i]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function ie(t){if(null===t||"string"==typeof t||"boolean"==typeof t||"number"==typeof t||t instanceof Ht||t instanceof Xt||t instanceof Kt||t instanceof Jt||t instanceof Qt||t instanceof te)return!0;if(Array.isArray(t)){for(const e of t)if(!ie(e))return!1;return!0}if("object"==typeof t){for(const e in t)if(!ie(t[e]))return!1;return!0}return!1}function re(t){if(null===t)return lt;if("string"==typeof t)return ht;if("boolean"==typeof t)return ut;if("number"==typeof t)return ct;if(t instanceof Ht)return dt;if(t instanceof Xt)return mt;if(t instanceof Kt)return _t;if(t instanceof Jt)return gt;if(t instanceof Qt)return xt;if(t instanceof te)return yt;if(Array.isArray(t)){const e=t.length;let i;for(const e of t){const t=re(e);if(i){if(i===t)continue;i=ft;break}i=t}return vt(i||ft,e)}return pt}function ne(t){const e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof Ht||t instanceof Kt||t instanceof Jt||t instanceof Qt||t instanceof te?t.toString():JSON.stringify(t)}class se{constructor(t,e){this.type=t,this.value=e}static parse(t,e){if(2!==t.length)return e.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!ie(t[1]))return e.error("invalid value");const i=t[1];let r=re(i);const n=e.expectedType;return"array"!==r.kind||0!==r.N||!n||"array"!==n.kind||"number"==typeof n.N&&0!==n.N||(r=n),new se(r,i)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class ae{constructor(t){this.name="ExpressionEvaluationError",this.message=t}toJSON(){return this.message}}const oe={string:ht,number:ct,boolean:ut,object:pt};class le{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");let i,r=1;const n=t[0];if("array"===n){let n,s;if(t.length>2){const i=t[1];if("string"!=typeof i||!(i in oe)||"object"===i)return e.error('The item type argument of "array" must be one of string, number, boolean',1);n=oe[i],r++}else n=ft;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);s=t[2],r++}i=vt(n,s)}else{if(!oe[n])throw new Error(`Types doesn't contain name = ${n}`);i=oe[n]}const s=[];for(;r<t.length;r++){const i=e.parse(t[r],r,ft);if(!i)return null;s.push(i)}return new le(i,s)}evaluate(t){for(let e=0;e<this.args.length;e++){const i=this.args[e].evaluate(t);if(!Tt(this.type,re(i)))return i;if(e===this.args.length-1)throw new ae(`Expected value to be of type ${bt(this.type)}, but found ${bt(re(i))} instead.`)}throw new Error}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}}const ce={"to-boolean":ut,"to-color":dt,"to-number":ct,"to-string":ht};class he{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const i=t[0];if(!ce[i])throw new Error(`Can't parse ${i} as it is not part of the known types`);if(("to-boolean"===i||"to-string"===i)&&2!==t.length)return e.error("Expected one argument.");const r=ce[i],n=[];for(let i=1;i<t.length;i++){const r=e.parse(t[i],i,ft);if(!r)return null;n.push(r)}return new he(r,n)}evaluate(t){switch(this.type.kind){case"boolean":return Boolean(this.args[0].evaluate(t));case"color":{let e,i;for(const r of this.args){if(e=r.evaluate(t),i=null,e instanceof Ht)return e;if("string"==typeof e){const i=t.parseColor(e);if(i)return i}else if(Array.isArray(e)&&(i=e.length<3||e.length>4?`Invalid rbga value ${JSON.stringify(e)}: expected an array containing either three or four numeric values.`:ee(e[0],e[1],e[2],e[3]),!i))return new Ht(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new ae(i||`Could not parse color from value '${"string"==typeof e?e:JSON.stringify(e)}'`)}case"padding":{let e;for(const i of this.args){e=i.evaluate(t);const r=Jt.parse(e);if(r)return r}throw new ae(`Could not parse padding from value '${"string"==typeof e?e:JSON.stringify(e)}'`)}case"variableAnchorOffsetCollection":{let e;for(const i of this.args){e=i.evaluate(t);const r=Qt.parse(e);if(r)return r}throw new ae(`Could not parse variableAnchorOffsetCollection from value '${"string"==typeof e?e:JSON.stringify(e)}'`)}case"number":{let e=null;for(const i of this.args){if(e=i.evaluate(t),null===e)return 0;const r=Number(e);if(!isNaN(r))return r}throw new ae(`Could not convert ${JSON.stringify(e)} to number.`)}case"formatted":return Kt.fromString(ne(this.args[0].evaluate(t)));case"resolvedImage":return te.fromString(ne(this.args[0].evaluate(t)));default:return ne(this.args[0].evaluate(t))}}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}}const ue=["Unknown","Point","LineString","Polygon"];class de{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?ue[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(t){let e=this._parseColorCache[t];return e||(e=this._parseColorCache[t]=Ht.parse(t)),e}}class pe{constructor(t,e,i=[],r,n=new ot,s=[]){this.registry=t,this.path=i,this.key=i.map(t=>`[${t}]`).join(""),this.scope=n,this.errors=s,this.expectedType=r,this._isConstant=e}parse(t,e,i,r,n={}){return e?this.concat(e,i,r)._parse(t,n):this._parse(t,n)}_parse(t,e){function i(t,e,i){return"assert"===i?new le(e,[t]):"coerce"===i?new he(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const r=t[0];if("string"!=typeof r)return this.error(`Expression name must be a string, but found ${typeof r} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const n=this.registry[r];if(n){let r=n.parse(t,this);if(!r)return null;if(this.expectedType){const t=this.expectedType,n=r.type;if("string"!==t.kind&&"number"!==t.kind&&"boolean"!==t.kind&&"object"!==t.kind&&"array"!==t.kind||"value"!==n.kind)if("color"!==t.kind&&"formatted"!==t.kind&&"resolvedImage"!==t.kind||"value"!==n.kind&&"string"!==n.kind)if("padding"!==t.kind||"value"!==n.kind&&"number"!==n.kind&&"array"!==n.kind)if("variableAnchorOffsetCollection"!==t.kind||"value"!==n.kind&&"array"!==n.kind){if(this.checkSubtype(t,n))return null}else r=i(r,t,e.typeAnnotation||"coerce");else r=i(r,t,e.typeAnnotation||"coerce");else r=i(r,t,e.typeAnnotation||"coerce");else r=i(r,t,e.typeAnnotation||"assert")}if(!(r instanceof se)&&"resolvedImage"!==r.type.kind&&this._isConstant(r)){const e=new de;try{r=new se(r.type,r.evaluate(e))}catch(t){return this.error(t.message),null}}return r}return this.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(void 0===t?"'undefined' value invalid. Use null instead.":"object"==typeof t?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof t} instead.`)}concat(t,e,i){const r="number"==typeof t?this.path.concat(t):this.path,n=i?this.scope.concat(i):this.scope;return new pe(this.registry,this._isConstant,r,e||null,n,this.errors)}error(t,...e){const i=`${this.key}${e.map(t=>`[${t}]`).join("")}`;this.errors.push(new at(i,t))}checkSubtype(t,e){const i=Tt(t,e);return i&&this.error(i),i}}class fe{constructor(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(const e of this.bindings)t(e[1]);t(this.result)}static parse(t,e){if(t.length<4)return e.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);const i=[];for(let r=1;r<t.length-1;r+=2){const n=t[r];if("string"!=typeof n)return e.error(`Expected string, but found ${typeof n} instead.`,r);if(/[^a-zA-Z0-9_]/.test(n))return e.error("Variable names must contain only alphanumeric characters or '_'.",r);const s=e.parse(t[r+1],r+1);if(!s)return null;i.push([n,s])}const r=e.parse(t[t.length-1],t.length-1,e.expectedType,i);return r?new fe(i,r):null}outputDefined(){return this.result.outputDefined()}}class me{constructor(t,e){this.type=e.type,this.name=t,this.boundExpression=e}static parse(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");const i=t[1];return e.scope.has(i)?new me(i,e.scope.get(i)):e.error(`Unknown variable "${i}". Make sure "${i}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(t){return this.boundExpression.evaluate(t)}eachChild(){}outputDefined(){return!1}}class _e{constructor(t,e,i){this.type=t,this.index=e,this.input=i}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,ct),r=e.parse(t[2],2,vt(e.expectedType||ft));return i&&r?new _e(r.type.itemType,i,r):null}evaluate(t){const e=this.index.evaluate(t),i=this.input.evaluate(t);if(e<0)throw new ae(`Array index out of bounds: ${e} < 0.`);if(e>=i.length)throw new ae(`Array index out of bounds: ${e} > ${i.length-1}.`);if(e!==Math.floor(e))throw new ae(`Array index must be an integer, but found ${e} instead.`);return i[e]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}}class ge{constructor(t,e){this.type=ut,this.needle=t,this.haystack=e}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,ft),r=e.parse(t[2],2,ft);return i&&r?St(i.type,[ut,ht,ct,lt,ft])?new ge(i,r):e.error(`Expected first argument to be of type boolean, string, number or null, but found ${bt(i.type)} instead`):null}evaluate(t){const e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!i)return!1;if(!It(e,["boolean","string","number","null"]))throw new ae(`Expected first argument to be of type boolean, string, number or null, but found ${bt(re(e))} instead.`);if(!It(i,["string","array"]))throw new ae(`Expected second argument to be of type array or string, but found ${bt(re(i))} instead.`);return i.indexOf(e)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}}class ye{constructor(t,e,i){this.type=ct,this.needle=t,this.haystack=e,this.fromIndex=i}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,ft),r=e.parse(t[2],2,ft);if(!i||!r)return null;if(!St(i.type,[ut,ht,ct,lt,ft]))return e.error(`Expected first argument to be of type boolean, string, number or null, but found ${bt(i.type)} instead`);if(4===t.length){const n=e.parse(t[3],3,ct);return n?new ye(i,r,n):null}return new ye(i,r)}evaluate(t){const e=this.needle.evaluate(t),i=this.haystack.evaluate(t);if(!It(e,["boolean","string","number","null"]))throw new ae(`Expected first argument to be of type boolean, string, number or null, but found ${bt(re(e))} instead.`);let r;if(this.fromIndex&&(r=this.fromIndex.evaluate(t)),It(i,["string"])){const t=i.indexOf(e,r);return-1===t?-1:[...i.slice(0,t)].length}if(It(i,["array"]))return i.indexOf(e,r);throw new ae(`Expected second argument to be of type array or string, but found ${bt(re(i))} instead.`)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}}class xe{constructor(t,e,i,r,n,s){this.inputType=t,this.type=e,this.input=i,this.cases=r,this.outputs=n,this.otherwise=s}static parse(t,e){if(t.length<5)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return e.error("Expected an even number of arguments.");let i,r;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);const n={},s=[];for(let a=2;a<t.length-1;a+=2){let o=t[a];const l=t[a+1];Array.isArray(o)||(o=[o]);const c=e.concat(a);if(0===o.length)return c.error("Expected at least one branch label.");for(const t of o){if("number"!=typeof t&&"string"!=typeof t)return c.error("Branch labels must be numbers or strings.");if("number"==typeof t&&Math.abs(t)>Number.MAX_SAFE_INTEGER)return c.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof t&&Math.floor(t)!==t)return c.error("Numeric branch labels must be integer values.");if(i){if(c.checkSubtype(i,re(t)))return null}else i=re(t);if(void 0!==n[String(t)])return c.error("Branch labels must be unique.");n[String(t)]=s.length}const h=e.parse(l,a,r);if(!h)return null;r=r||h.type,s.push(h)}const a=e.parse(t[1],1,ft);if(!a)return null;const o=e.parse(t[t.length-1],t.length-1,r);return o?"value"!==a.type.kind&&e.concat(1).checkSubtype(i,a.type)?null:new xe(i,r,a,n,s,o):null}evaluate(t){const e=this.input.evaluate(t);return(re(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}outputDefined(){return this.outputs.every(t=>t.outputDefined())&&this.otherwise.outputDefined()}}class ve{constructor(t,e,i){this.type=t,this.branches=e,this.otherwise=i}static parse(t,e){if(t.length<4)return e.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return e.error("Expected an odd number of arguments.");let i;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);const r=[];for(let n=1;n<t.length-1;n+=2){const s=e.parse(t[n],n,ut);if(!s)return null;const a=e.parse(t[n+1],n+1,i);if(!a)return null;r.push([s,a]),i=i||a.type}const n=e.parse(t[t.length-1],t.length-1,i);if(!n)return null;if(!i)throw new Error("Can't infer output type");return new ve(i,r,n)}evaluate(t){for(const[e,i]of this.branches)if(e.evaluate(t))return i.evaluate(t);return this.otherwise.evaluate(t)}eachChild(t){for(const[e,i]of this.branches)t(e),t(i);t(this.otherwise)}outputDefined(){return this.branches.every(([t,e])=>e.outputDefined())&&this.otherwise.outputDefined()}}class be{constructor(t,e,i,r){this.type=t,this.input=e,this.beginIndex=i,this.endIndex=r}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const i=e.parse(t[1],1,ft),r=e.parse(t[2],2,ct);if(!i||!r)return null;if(!St(i.type,[vt(ft),ht,ft]))return e.error(`Expected first argument to be of type array or string, but found ${bt(i.type)} instead`);if(4===t.length){const n=e.parse(t[3],3,ct);return n?new be(i.type,i,r,n):null}return new be(i.type,i,r)}evaluate(t){const e=this.input.evaluate(t),i=this.beginIndex.evaluate(t);let r;if(this.endIndex&&(r=this.endIndex.evaluate(t)),It(e,["string"]))return[...e].slice(i,r).join("");if(It(e,["array"]))return e.slice(i,r);throw new ae(`Expected first argument to be of type array or string, but found ${bt(re(e))} instead.`)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}}function we(t,e){const i=t.length-1;let r,n,s=0,a=i,o=0;for(;s<=a;)if(o=Math.floor((s+a)/2),r=t[o],n=t[o+1],r<=e){if(o===i||e<n)return o;s=o+1}else{if(!(r>e))throw new ae("Input is not a number.");a=o-1}return 0}class Te{constructor(t,e,i){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(const[t,e]of i)this.labels.push(t),this.outputs.push(e)}static parse(t,e){if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");const i=e.parse(t[1],1,ct);if(!i)return null;const r=[];let n=null;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(let i=1;i<t.length;i+=2){const s=1===i?-1/0:t[i],a=t[i+1],o=i,l=i+1;if("number"!=typeof s)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',o);if(r.length&&r[r.length-1][0]>=s)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',o);const c=e.parse(a,l,n);if(!c)return null;n=n||c.type,r.push([s,c])}return new Te(n,i,r)}evaluate(t){const e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);const r=this.input.evaluate(t);if(r<=e[0])return i[0].evaluate(t);const n=e.length;return r>=e[n-1]?i[n-1].evaluate(t):i[we(e,r)].evaluate(t)}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}}var Se=Ie;function Ie(t,e,i,r){this.cx=3*t,this.bx=3*(i-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(r-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=e,this.p2x=i,this.p2y=r}Ie.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,e){if(void 0===e&&(e=1e-6),t<0)return 0;if(t>1)return 1;for(var i=t,r=0;r<8;r++){var n=this.sampleCurveX(i)-t;if(Math.abs(n)<e)return i;var s=this.sampleCurveDerivativeX(i);if(Math.abs(s)<1e-6)break;i-=n/s}var a=0,o=1;for(i=t,r=0;r<20&&(n=this.sampleCurveX(i),!(Math.abs(n-t)<e));r++)t>n?a=i:o=i,i=.5*(o-a)+a;return i},solve:function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}};var Pe=function(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t["default"]:t}(Se);function Ae(t,e,i){return t+i*(e-t)}function Me(t,e,i){return t.map((t,r)=>Ae(t,e[r],i))}const ke={number:Ae,color:function(t,e,i,r="rgb"){switch(r){case"rgb":{const[r,n,s,a]=Me(t.rgb,e.rgb,i);return new Ht(r,n,s,a,!1)}case"hcl":{const[r,n,s,a]=t.hcl,[o,l,c,h]=e.hcl;let u,d;if(isNaN(r)||isNaN(o))isNaN(r)?isNaN(o)?u=NaN:(u=o,1!==s&&0!==s||(d=l)):(u=r,1!==c&&0!==c||(d=n));else{let t=o-r;o>r&&t>180?t-=360:o<r&&r-o>180&&(t+=360),u=r+i*t}const[p,f,m,_]=function([t,e,i,r]){return t=isNaN(t)?0:t*Dt,Vt([i,Math.cos(t)*e,Math.sin(t)*e,r])}([u,null!=d?d:Ae(n,l,i),Ae(s,c,i),Ae(a,h,i)]);return new Ht(p,f,m,_,!1)}case"lab":{const[r,n,s,a]=Vt(Me(t.lab,e.lab,i));return new Ht(r,n,s,a,!1)}}},array:Me,padding:function(t,e,i){return new Jt(Me(t.values,e.values,i))},variableAnchorOffsetCollection:function(t,e,i){const r=t.values,n=e.values;if(r.length!==n.length)throw new ae(`Cannot interpolate values of different length. from: ${t.toString()}, to: ${e.toString()}`);const s=[];for(let t=0;t<r.length;t+=2){if(r[t]!==n[t])throw new ae(`Cannot interpolate values containing mismatched anchors. from[${t}]: ${r[t]}, to[${t}]: ${n[t]}`);s.push(r[t]);const[e,a]=r[t+1],[o,l]=n[t+1];s.push([Ae(e,o,i),Ae(a,l,i)])}return new Qt(s)}};class Ce{constructor(t,e,i,r,n){this.type=t,this.operator=e,this.interpolation=i,this.input=r,this.labels=[],this.outputs=[];for(const[t,e]of n)this.labels.push(t),this.outputs.push(e)}static interpolationFactor(t,e,i,r){let n=0;if("exponential"===t.name)n=ze(e,t.base,i,r);else if("linear"===t.name)n=ze(e,1,i,r);else if("cubic-bezier"===t.name){const s=t.controlPoints;n=new Pe(s[0],s[1],s[2],s[3]).solve(ze(e,1,i,r))}return n}static parse(t,e){let[i,r,n,...s]=t;if(!Array.isArray(r)||0===r.length)return e.error("Expected an interpolation type expression.",1);if("linear"===r[0])r={name:"linear"};else if("exponential"===r[0]){const t=r[1];if("number"!=typeof t)return e.error("Exponential interpolation requires a numeric base.",1,1);r={name:"exponential",base:t}}else{if("cubic-bezier"!==r[0])return e.error(`Unknown interpolation type ${String(r[0])}`,1,0);{const t=r.slice(1);if(4!==t.length||t.some(t=>"number"!=typeof t||t<0||t>1))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);r={name:"cubic-bezier",controlPoints:t}}}if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(n=e.parse(n,2,ct),!n)return null;const a=[];let o=null;"interpolate-hcl"===i||"interpolate-lab"===i?o=dt:e.expectedType&&"value"!==e.expectedType.kind&&(o=e.expectedType);for(let t=0;t<s.length;t+=2){const i=s[t],r=s[t+1],n=t+3,l=t+4;if("number"!=typeof i)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',n);if(a.length&&a[a.length-1][0]>=i)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',n);const c=e.parse(r,l,o);if(!c)return null;o=o||c.type,a.push([i,c])}return Pt(o,ct)||Pt(o,dt)||Pt(o,gt)||Pt(o,xt)||Pt(o,vt(ct))?new Ce(o,i,r,n,a):e.error(`Type ${bt(o)} is not interpolatable.`)}evaluate(t){const e=this.labels,i=this.outputs;if(1===e.length)return i[0].evaluate(t);const r=this.input.evaluate(t);if(r<=e[0])return i[0].evaluate(t);const n=e.length;if(r>=e[n-1])return i[n-1].evaluate(t);const s=we(e,r),a=Ce.interpolationFactor(this.interpolation,r,e[s],e[s+1]),o=i[s].evaluate(t),l=i[s+1].evaluate(t);switch(this.operator){case"interpolate":return ke[this.type.kind](o,l,a);case"interpolate-hcl":return ke.color(o,l,a,"hcl");case"interpolate-lab":return ke.color(o,l,a,"lab")}}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}}function ze(t,e,i,r){const n=r-i,s=t-i;return 0===n?0:1===e?s/n:(Math.pow(e,s)-1)/(Math.pow(e,n)-1)}class Ee{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expectected at least one argument.");let i=null;const r=e.expectedType;r&&"value"!==r.kind&&(i=r);const n=[];for(const r of t.slice(1)){const t=e.parse(r,1+n.length,i,void 0,{typeAnnotation:"omit"});if(!t)return null;i=i||t.type,n.push(t)}if(!i)throw new Error("No output type");const s=r&&n.some(t=>Tt(r,t.type));return new Ee(s?ft:i,n)}evaluate(t){let e,i=null,r=0;for(const n of this.args)if(r++,i=n.evaluate(t),i&&i instanceof te&&!i.available&&(e||(e=i.name),i=null,r===this.args.length&&(i=e)),null!==i)break;return i}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}}function De(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function Le(t,e,i,r){return 0===r.compare(e,i)}function Re(t,e,i){const r="=="!==t&&"!="!==t;return class n{constructor(t,e,i){this.type=ut,this.lhs=t,this.rhs=e,this.collator=i,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}static parse(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");const i=t[0];let s=e.parse(t[1],1,ft);if(!s)return null;if(!De(i,s.type))return e.concat(1).error(`"${i}" comparisons are not supported for type '${bt(s.type)}'.`);let a=e.parse(t[2],2,ft);if(!a)return null;if(!De(i,a.type))return e.concat(2).error(`"${i}" comparisons are not supported for type '${bt(a.type)}'.`);if(s.type.kind!==a.type.kind&&"value"!==s.type.kind&&"value"!==a.type.kind)return e.error(`Cannot compare types '${bt(s.type)}' and '${bt(a.type)}'.`);r&&("value"===s.type.kind&&"value"!==a.type.kind?s=new le(a.type,[s]):"value"!==s.type.kind&&"value"===a.type.kind&&(a=new le(s.type,[a])));let o=null;if(4===t.length){if("string"!==s.type.kind&&"string"!==a.type.kind&&"value"!==s.type.kind&&"value"!==a.type.kind)return e.error("Cannot use collator to compare non-string types.");if(o=e.parse(t[3],3,mt),!o)return null}return new n(s,a,o)}evaluate(n){const s=this.lhs.evaluate(n),a=this.rhs.evaluate(n);if(r&&this.hasUntypedArgument){const e=re(s),i=re(a);if(e.kind!==i.kind||"string"!==e.kind&&"number"!==e.kind)throw new ae(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${e.kind}, ${i.kind}) instead.`)}if(this.collator&&!r&&this.hasUntypedArgument){const t=re(s),i=re(a);if("string"!==t.kind||"string"!==i.kind)return e(n,s,a)}return this.collator?i(n,s,a,this.collator.evaluate(n)):e(n,s,a)}eachChild(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)}outputDefined(){return!0}}}const Be=Re("==",function(t,e,i){return e===i},Le),Fe=Re("!=",function(t,e,i){return e!==i},function(t,e,i,r){return!Le(0,e,i,r)}),Oe=Re("<",function(t,e,i){return e<i},function(t,e,i,r){return r.compare(e,i)<0}),Ve=Re(">",function(t,e,i){return e>i},function(t,e,i,r){return r.compare(e,i)>0}),Ne=Re("<=",function(t,e,i){return e<=i},function(t,e,i,r){return r.compare(e,i)<=0}),je=Re(">=",function(t,e,i){return e>=i},function(t,e,i,r){return r.compare(e,i)>=0});class Ue{constructor(t,e,i){this.type=mt,this.locale=i,this.caseSensitive=t,this.diacriticSensitive=e}static parse(t,e){if(2!==t.length)return e.error("Expected one argument.");const i=t[1];if("object"!=typeof i||Array.isArray(i))return e.error("Collator options argument must be an object.");const r=e.parse(void 0!==i["case-sensitive"]&&i["case-sensitive"],1,ut);if(!r)return null;const n=e.parse(void 0!==i["diacritic-sensitive"]&&i["diacritic-sensitive"],1,ut);if(!n)return null;let s=null;return i.locale&&(s=e.parse(i.locale,1,ht),!s)?null:new Ue(r,n,s)}evaluate(t){return new Xt(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)}eachChild(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)}outputDefined(){return!1}}class $e{constructor(t,e,i,r,n){this.type=ht,this.number=t,this.locale=e,this.currency=i,this.minFractionDigits=r,this.maxFractionDigits=n}static parse(t,e){if(3!==t.length)return e.error("Expected two arguments.");const i=e.parse(t[1],1,ct);if(!i)return null;const r=t[2];if("object"!=typeof r||Array.isArray(r))return e.error("NumberFormat options argument must be an object.");let n=null;if(r.locale&&(n=e.parse(r.locale,1,ht),!n))return null;let s=null;if(r.currency&&(s=e.parse(r.currency,1,ht),!s))return null;let a=null;if(r["min-fraction-digits"]&&(a=e.parse(r["min-fraction-digits"],1,ct),!a))return null;let o=null;return r["max-fraction-digits"]&&(o=e.parse(r["max-fraction-digits"],1,ct),!o)?null:new $e(i,n,s,a,o)}evaluate(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}}class qe{constructor(t){this.type=_t,this.sections=t}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const i=t[1];if(!Array.isArray(i)&&"object"==typeof i)return e.error("First argument must be an image or text section.");const r=[];let n=!1;for(let i=1;i<=t.length-1;++i){const s=t[i];if(n&&"object"==typeof s&&!Array.isArray(s)){n=!1;let t=null;if(s["font-scale"]&&(t=e.parse(s["font-scale"],1,ct),!t))return null;let i=null;if(s["text-font"]&&(i=e.parse(s["text-font"],1,vt(ht)),!i))return null;let a=null;if(s["text-color"]&&(a=e.parse(s["text-color"],1,dt),!a))return null;const o=r[r.length-1];o.scale=t,o.font=i,o.textColor=a}else{const s=e.parse(t[i],1,ft);if(!s)return null;const a=s.type.kind;if("string"!==a&&"value"!==a&&"null"!==a&&"resolvedImage"!==a)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");n=!0,r.push({content:s,scale:null,font:null,textColor:null})}}return new qe(r)}evaluate(t){return new Kt(this.sections.map(e=>{const i=e.content.evaluate(t);return re(i)===yt?new Wt("",i,null,null,null):new Wt(ne(i),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)}))}eachChild(t){for(const e of this.sections)t(e.content),e.scale&&t(e.scale),e.font&&t(e.font),e.textColor&&t(e.textColor)}outputDefined(){return!1}}class Ze{constructor(t){this.type=yt,this.input=t}static parse(t,e){if(2!==t.length)return e.error("Expected two arguments.");const i=e.parse(t[1],1,ht);return i?new Ze(i):e.error("No image name provided.")}evaluate(t){const e=this.input.evaluate(t),i=te.fromString(e);return i&&t.availableImages&&(i.available=t.availableImages.indexOf(e)>-1),i}eachChild(t){t(this.input)}outputDefined(){return!1}}class Ge{constructor(t){this.type=ct,this.input=t}static parse(t,e){if(2!==t.length)return e.error(`Expected 1 argument, but found ${t.length-1} instead.`);const i=e.parse(t[1],1);return i?"array"!==i.type.kind&&"string"!==i.type.kind&&"value"!==i.type.kind?e.error(`Expected argument of type string or array, but found ${bt(i.type)} instead.`):new Ge(i):null}evaluate(t){const e=this.input.evaluate(t);if("string"==typeof e)return[...e].length;if(Array.isArray(e))return e.length;throw new ae(`Expected value to be of type string or array, but found ${bt(re(e))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}}const He=8192;function Xe(t,e){const i=(180+t[0])/360,r=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t[1]*Math.PI/360)))/360,n=Math.pow(2,e.z);return[Math.round(i*n*He),Math.round(r*n*He)]}function We(t,e){const i=Math.pow(2,e.z);return[(n=(t[0]/He+e.x)/i,360*n-180),(r=(t[1]/He+e.y)/i,360/Math.PI*Math.atan(Math.exp((180-360*r)*Math.PI/180))-90)];var r,n}function Ke(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function Je(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function Ye(t,e,i){const r=t[0]-e[0],n=t[1]-e[1],s=t[0]-i[0],a=t[1]-i[1];return r*a-s*n==0&&r*s<=0&&n*a<=0}function Qe(t,e,i,r){return 0!=(n=[r[0]-i[0],r[1]-i[1]])[0]*(s=[e[0]-t[0],e[1]-t[1]])[1]-n[1]*s[0]&&!(!si(t,e,i,r)||!si(i,r,t,e));var n,s}function ti(t,e,i){for(const r of i)for(let i=0;i<r.length-1;++i)if(Qe(t,e,r[i],r[i+1]))return!0;return!1}function ei(t,e,i=!1){let r=!1;for(const o of e)for(let e=0;e<o.length-1;e++){if(Ye(t,o[e],o[e+1]))return i;(s=o[e])[1]>(n=t)[1]!=(a=o[e+1])[1]>n[1]&&n[0]<(a[0]-s[0])*(n[1]-s[1])/(a[1]-s[1])+s[0]&&(r=!r)}var n,s,a;return r}function ii(t,e){for(const i of e)if(ei(t,i))return!0;return!1}function ri(t,e){for(const i of t)if(!ei(i,e))return!1;for(let i=0;i<t.length-1;++i)if(ti(t[i],t[i+1],e))return!1;return!0}function ni(t,e){for(const i of e)if(ri(t,i))return!0;return!1}function si(t,e,i,r){const n=r[0]-i[0],s=r[1]-i[1],a=(t[0]-i[0])*s-n*(t[1]-i[1]),o=(e[0]-i[0])*s-n*(e[1]-i[1]);return a>0&&o<0||a<0&&o>0}function ai(t,e,i){const r=[];for(let n=0;n<t.length;n++){const s=[];for(let r=0;r<t[n].length;r++){const a=Xe(t[n][r],i);Ke(e,a),s.push(a)}r.push(s)}return r}function oi(t,e,i){const r=[];for(let n=0;n<t.length;n++){const s=ai(t[n],e,i);r.push(s)}return r}function li(t,e,i,r){if(t[0]<i[0]||t[0]>i[2]){const e=.5*r;let n=t[0]-i[0]>e?-r:i[0]-t[0]>e?r:0;0===n&&(n=t[0]-i[2]>e?-r:i[2]-t[0]>e?r:0),t[0]+=n}Ke(e,t)}function ci(t,e,i,r){const n=Math.pow(2,r.z)*He,s=[r.x*He,r.y*He],a=[];for(const r of t)for(const t of r){const r=[t.x+s[0],t.y+s[1]];li(r,e,i,n),a.push(r)}return a}function hi(t,e,i,r){const n=Math.pow(2,r.z)*He,s=[r.x*He,r.y*He],a=[];for(const i of t){const t=[];for(const r of i){const i=[r.x+s[0],r.y+s[1]];Ke(e,i),t.push(i)}a.push(t)}if(e[2]-e[0]<=n/2){(o=e)[0]=o[1]=1/0,o[2]=o[3]=-1/0;for(const t of a)for(const r of t)li(r,e,i,n)}var o;return a}class ui{constructor(t,e){this.type=ut,this.geojson=t,this.geometries=e}static parse(t,e){if(2!==t.length)return e.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(ie(t[1])){const e=t[1];if("FeatureCollection"===e.type){const t=[];for(const i of e.features){const{type:e,coordinates:r}=i.geometry;"Polygon"===e&&t.push(r),"MultiPolygon"===e&&t.push(...r)}if(t.length)return new ui(e,{type:"MultiPolygon",coordinates:t})}else if("Feature"===e.type){const t=e.geometry.type;if("Polygon"===t||"MultiPolygon"===t)return new ui(e,e.geometry)}else if("Polygon"===e.type||"MultiPolygon"===e.type)return new ui(e,e)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){const i=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if("Polygon"===e.type){const s=ai(e.coordinates,r,n),a=ci(t.geometry(),i,r,n);if(!Je(i,r))return!1;for(const t of a)if(!ei(t,s))return!1}if("MultiPolygon"===e.type){const s=oi(e.coordinates,r,n),a=ci(t.geometry(),i,r,n);if(!Je(i,r))return!1;for(const t of a)if(!ii(t,s))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){const i=[1/0,1/0,-1/0,-1/0],r=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if("Polygon"===e.type){const s=ai(e.coordinates,r,n),a=hi(t.geometry(),i,r,n);if(!Je(i,r))return!1;for(const t of a)if(!ri(t,s))return!1}if("MultiPolygon"===e.type){const s=oi(e.coordinates,r,n),a=hi(t.geometry(),i,r,n);if(!Je(i,r))return!1;for(const t of a)if(!ni(t,s))return!1}return!0}(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let di=class{constructor(t=[],e=(t,e)=>t<e?-1:t>e?1:0){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let t=(this.length>>1)-1;t>=0;t--)this._down(t)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(0===this.length)return;const t=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:e,compare:i}=this,r=e[t];for(;t>0;){const n=t-1>>1,s=e[n];if(i(r,s)>=0)break;e[t]=s,t=n}e[t]=r}_down(t){const{data:e,compare:i}=this,r=this.length>>1,n=e[t];for(;t<r;){let r=1+(t<<1);const s=r+1;if(s<this.length&&i(e[s],e[r])<0&&(r=s),i(e[r],n)>=0)break;e[t]=e[r],t=r}e[t]=n}};function pi(t,e,i,r,n){fi(t,e,i,r||t.length-1,n||_i)}function fi(t,e,i,r,n){for(;r>i;){if(r-i>600){var s=r-i+1,a=e-i+1,o=Math.log(s),l=.5*Math.exp(2*o/3),c=.5*Math.sqrt(o*l*(s-l)/s)*(a-s/2<0?-1:1);fi(t,e,Math.max(i,Math.floor(e-a*l/s+c)),Math.min(r,Math.floor(e+(s-a)*l/s+c)),n)}var h=t[e],u=i,d=r;for(mi(t,i,e),n(t[r],h)>0&&mi(t,i,r);u<d;){for(mi(t,u,d),u++,d--;n(t[u],h)<0;)u++;for(;n(t[d],h)>0;)d--}0===n(t[i],h)?mi(t,i,d):mi(t,++d,r),d<=e&&(i=d+1),e<=d&&(r=d-1)}}function mi(t,e,i){var r=t[e];t[e]=t[i],t[i]=r}function _i(t,e){return t<e?-1:t>e?1:0}function gi(t,e){if(t.length<=1)return[t];const i=[];let r,n;for(const e of t){const t=xi(e);0!==t&&(e.area=Math.abs(t),void 0===n&&(n=t<0),n===t<0?(r&&i.push(r),r=[e]):r.push(e))}if(r&&i.push(r),e>1)for(let t=0;t<i.length;t++)i[t].length<=e||(pi(i[t],e,1,i[t].length-1,yi),i[t]=i[t].slice(0,e));return i}function yi(t,e){return e.area-t.area}function xi(t){let e=0;for(let i,r,n=0,s=t.length,a=s-1;n<s;a=n++)i=t[n],r=t[a],e+=(r.x-i.x)*(i.y+r.y);return e}const vi=1/298.257223563,bi=vi*(2-vi),wi=Math.PI/180;class Ti{constructor(t){const e=6378.137*wi*1e3,i=Math.cos(t*wi),r=1/(1-bi*(1-i*i)),n=Math.sqrt(r);this.kx=e*n*i,this.ky=e*n*r*(1-bi)}distance(t,e){const i=this.wrap(t[0]-e[0])*this.kx,r=(t[1]-e[1])*this.ky;return Math.sqrt(i*i+r*r)}pointOnLine(t,e){let i,r,n,s,a=1/0;for(let o=0;o<t.length-1;o++){let l=t[o][0],c=t[o][1],h=this.wrap(t[o+1][0]-l)*this.kx,u=(t[o+1][1]-c)*this.ky,d=0;0===h&&0===u||(d=(this.wrap(e[0]-l)*this.kx*h+(e[1]-c)*this.ky*u)/(h*h+u*u),d>1?(l=t[o+1][0],c=t[o+1][1]):d>0&&(l+=h/this.kx*d,c+=u/this.ky*d)),h=this.wrap(e[0]-l)*this.kx,u=(e[1]-c)*this.ky;const p=h*h+u*u;p<a&&(a=p,i=l,r=c,n=o,s=d)}return{point:[i,r],index:n,t:Math.max(0,Math.min(1,s))}}wrap(t){for(;t<-180;)t+=360;for(;t>180;)t-=360;return t}}function Si(t,e){return e[0]-t[0]}function Ii(t){return t[1]-t[0]+1}function Pi(t,e){return t[1]>=t[0]&&t[1]<e}function Ai(t,e){if(t[0]>t[1])return[null,null];const i=Ii(t);if(e){if(2===i)return[t,null];const e=Math.floor(i/2);return[[t[0],t[0]+e],[t[0]+e,t[1]]]}if(1===i)return[t,null];const r=Math.floor(i/2)-1;return[[t[0],t[0]+r],[t[0]+r+1,t[1]]]}function Mi(t,e){if(!Pi(e,t.length))return[1/0,1/0,-1/0,-1/0];const i=[1/0,1/0,-1/0,-1/0];for(let r=e[0];r<=e[1];++r)Ke(i,t[r]);return i}function ki(t){const e=[1/0,1/0,-1/0,-1/0];for(const i of t)for(const t of i)Ke(e,t);return e}function Ci(t){return t[0]!==-1/0&&t[1]!==-1/0&&t[2]!==1/0&&t[3]!==1/0}function zi(t,e,i){if(!Ci(t)||!Ci(e))return NaN;let r=0,n=0;return t[2]<e[0]&&(r=e[0]-t[2]),t[0]>e[2]&&(r=t[0]-e[2]),t[1]>e[3]&&(n=t[1]-e[3]),t[3]<e[1]&&(n=e[1]-t[3]),i.distance([0,0],[r,n])}function Ei(t,e,i){const r=i.pointOnLine(e,t);return i.distance(t,r.point)}function Di(t,e,i,r,n){const s=Math.min(Ei(t,[i,r],n),Ei(e,[i,r],n)),a=Math.min(Ei(i,[t,e],n),Ei(r,[t,e],n));return Math.min(s,a)}function Li(t,e,i,r,n){if(!Pi(e,t.length)||!Pi(r,i.length))return 1/0;let s=1/0;for(let a=e[0];a<e[1];++a){const e=t[a],o=t[a+1];for(let t=r[0];t<r[1];++t){const r=i[t],a=i[t+1];if(Qe(e,o,r,a))return 0;s=Math.min(s,Di(e,o,r,a,n))}}return s}function Ri(t,e,i,r,n){if(!Pi(e,t.length)||!Pi(r,i.length))return NaN;let s=1/0;for(let a=e[0];a<=e[1];++a)for(let e=r[0];e<=r[1];++e)if(s=Math.min(s,n.distance(t[a],i[e])),0===s)return s;return s}function Bi(t,e,i){if(ei(t,e,!0))return 0;let r=1/0;for(const n of e){const e=n[0],s=n[n.length-1];if(e!==s&&(r=Math.min(r,Ei(t,[s,e],i)),0===r))return r;const a=i.pointOnLine(n,t);if(r=Math.min(r,i.distance(t,a.point)),0===r)return r}return r}function Fi(t,e,i,r){if(!Pi(e,t.length))return NaN;for(let r=e[0];r<=e[1];++r)if(ei(t[r],i,!0))return 0;let n=1/0;for(let s=e[0];s<e[1];++s){const e=t[s],a=t[s+1];for(const t of i)for(let i=0,s=t.length,o=s-1;i<s;o=i++){const s=t[o],l=t[i];if(Qe(e,a,s,l))return 0;n=Math.min(n,Di(e,a,s,l,r))}}return n}function Oi(t,e){for(const i of t)for(const t of i)if(ei(t,e,!0))return!0;return!1}function Vi(t,e,i,r=1/0){const n=ki(t),s=ki(e);if(r!==1/0&&zi(n,s,i)>=r)return r;if(Je(n,s)){if(Oi(t,e))return 0}else if(Oi(e,t))return 0;let a=1/0;for(const r of t)for(let t=0,n=r.length,s=n-1;t<n;s=t++){const n=r[s],o=r[t];for(const t of e)for(let e=0,r=t.length,s=r-1;e<r;s=e++){const r=t[s],l=t[e];if(Qe(n,o,r,l))return 0;a=Math.min(a,Di(n,o,r,l,i))}}return a}function Ni(t,e,i,r,n,s){if(!s)return;const a=zi(Mi(r,s),n,i);a<e&&t.push([a,s,[0,0]])}function ji(t,e,i,r,n,s,a){if(!s||!a)return;const o=zi(Mi(r,s),Mi(n,a),i);o<e&&t.push([o,s,a])}
vendor: 4,103 bytes, line 313
313function Ui(t,e,i,r,n=1/0){let s=Math.min(r.distance(t[0],i[0][0]),n);if(0===s)return s;const a=new di([[0,[0,t.length-1],[0,0]]],Si),o=ki(i);for(;a.length>0;){const n=a.pop();if(n[0]>=s)continue;const l=n[1],c=e?50:100;if(Ii(l)<=c){if(!Pi(l,t.length))return NaN;if(e){const e=Fi(t,l,i,r);if(isNaN(e)||0===e)return e;s=Math.min(s,e)}else for(let e=l[0];e<=l[1];++e){const n=Bi(t[e],i,r);if(s=Math.min(s,n),0===s)return 0}}else{const i=Ai(l,e);Ni(a,s,r,t,o,i[0]),Ni(a,s,r,t,o,i[1])}}return s}function $i(t,e,i,r,n,s=1/0){let a=Math.min(s,n.distance(t[0],i[0]));if(0===a)return a;const o=new di([[0,[0,t.length-1],[0,i.length-1]]],Si);for(;o.length>0;){const s=o.pop();if(s[0]>=a)continue;const l=s[1],c=s[2],h=e?50:100,u=r?50:100;if(Ii(l)<=h&&Ii(c)<=u){if(!Pi(l,t.length)&&Pi(c,i.length))return NaN;let s;if(e&&r)s=Li(t,l,i,c,n),a=Math.min(a,s);else if(e&&!r){const e=t.slice(l[0],l[1]+1);for(let t=c[0];t<=c[1];++t)if(s=Ei(i[t],e,n),a=Math.min(a,s),0===a)return a}else if(!e&&r){const e=i.slice(c[0],c[1]+1);for(let i=l[0];i<=l[1];++i)if(s=Ei(t[i],e,n),a=Math.min(a,s),0===a)return a}else s=Ri(t,l,i,c,n),a=Math.min(a,s)}else{const s=Ai(l,e),h=Ai(c,r);ji(o,a,n,t,i,s[0],h[0]),ji(o,a,n,t,i,s[0],h[1]),ji(o,a,n,t,i,s[1],h[0]),ji(o,a,n,t,i,s[1],h[1])}}return a}function qi(t){return"MultiPolygon"===t.type?t.coordinates.map(t=>({type:"Polygon",coordinates:t})):"MultiLineString"===t.type?t.coordinates.map(t=>({type:"LineString",coordinates:t})):"MultiPoint"===t.type?t.coordinates.map(t=>({type:"Point",coordinates:t})):[t]}class Zi{constructor(t,e){this.type=ct,this.geojson=t,this.geometries=e}static parse(t,e){if(2!==t.length)return e.error(`'distance' expression requires exactly one argument, but found ${t.length-1} instead.`);if(ie(t[1])){const e=t[1];if("FeatureCollection"===e.type)return new Zi(e,e.features.map(t=>qi(t.geometry)).flat());if("Feature"===e.type)return new Zi(e,qi(e.geometry));if("type"in e&&"coordinates"in e)return new Zi(e,qi(e))}return e.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){const i=t.geometry(),r=i.flat().map(e=>We([e.x,e.y],t.canonical));if(0===i.length)return NaN;const n=new Ti(r[0][1]);let s=1/0;for(const t of e){switch(t.type){case"Point":s=Math.min(s,$i(r,!1,[t.coordinates],!1,n,s));break;case"LineString":s=Math.min(s,$i(r,!1,t.coordinates,!0,n,s));break;case"Polygon":s=Math.min(s,Ui(r,!1,t.coordinates,n,s))}if(0===s)return s}return s}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){const i=t.geometry(),r=i.flat().map(e=>We([e.x,e.y],t.canonical));if(0===i.length)return NaN;const n=new Ti(r[0][1]);let s=1/0;for(const t of e){switch(t.type){case"Point":s=Math.min(s,$i(r,!0,[t.coordinates],!1,n,s));break;case"LineString":s=Math.min(s,$i(r,!0,t.coordinates,!0,n,s));break;case"Polygon":s=Math.min(s,Ui(r,!0,t.coordinates,n,s))}if(0===s)return s}return s}(t,this.geometries);if("Polygon"===t.geometryType())return function(t,e){const i=t.geometry();if(0===i.length||0===i[0].length)return NaN;const r=gi(i,0).map(e=>e.map(e=>e.map(e=>We([e.x,e.y],t.canonical)))),n=new Ti(r[0][0][0][1]);let s=1/0;for(const t of e)for(const e of r){switch(t.type){case"Point":s=Math.min(s,Ui([t.coordinates],!1,e,n,s));break;case"LineString":s=Math.min(s,Ui(t.coordinates,!0,e,n,s));break;case"Polygon":s=Math.min(s,Vi(e,t.coordinates,n,s))}if(0===s)return s}return s}(t,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}const Gi={"==":Be,"!=":Fe,">":Ve,"<":Oe,">=":je,"<=":Ne,array:le,at:_e,boolean:le,"case":ve,coalesce:Ee,collator:Ue,format:qe,image:Ze,"in":ge,"index-of":ye,interpolate:Ce,"interpolate-hcl":Ce,"interpolate-lab":Ce,length:Ge,"let":fe,literal:se,match:xe,number:le,"number-format":$e,object:le,slice:be,step:Te,string:le,"to-boolean":he,"to-color":he,"to-number":he,"to-string":he,"var":me,within:ui,distance:Zi};class Hi{constructor(t,e,i,r){this.name=t,this.type=e,this._evaluate=i,this.args=r}evaluate(t){return this._evaluate(t,this.args)}
vendor: 89,640 bytes, line 313
313eachChild(t){this.args.forEach(t)}outputDefined(){return!1}static parse(t,e){const i=t[0],r=Hi.definitions[i];if(!r)return e.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0);const n=Array.isArray(r)?r[0]:r.type,s=Array.isArray(r)?[[r[1],r[2]]]:r.overloads,a=s.filter(([e])=>!Array.isArray(e)||e.length===t.length-1);let o=null;for(const[r,s]of a){o=new pe(e.registry,Yi,e.path,null,e.scope);const a=[];let l=!1;for(let e=1;e<t.length;e++){const i=t[e],n=Array.isArray(r)?r[e-1]:r.type,s=o.parse(i,1+a.length,n);if(!s){l=!0;break}a.push(s)}if(!l)if(Array.isArray(r)&&r.length!==a.length)o.error(`Expected ${r.length} arguments, but found ${a.length} instead.`);else{for(let t=0;t<a.length;t++){const e=Array.isArray(r)?r[t]:r.type,i=a[t];o.concat(t+1).checkSubtype(e,i.type)}if(0===o.errors.length)return new Hi(i,n,s,a)}}if(1===a.length)e.errors.push(...o.errors);else{const i=(a.length?a:s).map(([t])=>{return e=t,Array.isArray(e)?`(${e.map(bt).join(", ")})`:`(${bt(e.type)}...)`;var e}).join(" | "),r=[];for(let i=1;i<t.length;i++){const n=e.parse(t[i],1+r.length);if(!n)return null;r.push(bt(n.type))}e.error(`Expected arguments of type ${i}, but found (${r.join(", ")}) instead.`)}return null}static register(t,e){Hi.definitions=e;for(const i in e)t[i]=Hi}}function Xi(t,[e,i,r,n]){e=e.evaluate(t),i=i.evaluate(t),r=r.evaluate(t);const s=n?n.evaluate(t):1,a=ee(e,i,r,s);if(a)throw new ae(a);return new Ht(e/255,i/255,r/255,s,!1)}function Wi(t,e){return t in e}function Ki(t,e){const i=e[t];return void 0===i?null:i}function Ji(t){return{type:t}}function Yi(t){if(t instanceof me)return Yi(t.boundExpression);if(t instanceof Hi&&"error"===t.name)return!1;if(t instanceof Ue)return!1;if(t instanceof ui)return!1;if(t instanceof Zi)return!1;const e=t instanceof he||t instanceof le;let i=!0;return t.eachChild(t=>{i=e?i&&Yi(t):i&&t instanceof se}),!!i&&Qi(t)&&er(t,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function Qi(t){if(t instanceof Hi){if("get"===t.name&&1===t.args.length)return!1;if("feature-state"===t.name)return!1;if("has"===t.name&&1===t.args.length)return!1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return!1;if(/^filter-/.test(t.name))return!1}if(t instanceof ui)return!1;if(t instanceof Zi)return!1;let e=!0;return t.eachChild(t=>{e&&!Qi(t)&&(e=!1)}),e}function tr(t){if(t instanceof Hi&&"feature-state"===t.name)return!1;let e=!0;return t.eachChild(t=>{e&&!tr(t)&&(e=!1)}),e}function er(t,e){if(t instanceof Hi&&e.indexOf(t.name)>=0)return!1;let i=!0;return t.eachChild(t=>{i&&!er(t,e)&&(i=!1)}),i}function ir(t){return{result:"success",value:t}}function rr(t){return{result:"error",value:t}}function nr(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function sr(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}function ar(t){return!!t.expression&&t.expression.interpolated}function or(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function lr(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function cr(t){return t}function hr(t,e){const i="color"===e.type,r=t.stops&&"object"==typeof t.stops[0][0],n=r||!(r||void 0!==t.property),s=t.type||(ar(e)?"exponential":"interval");if(i||"padding"===e.type){const r=i?Ht.parse:Jt.parse;(t=st({},t)).stops&&(t.stops=t.stops.map(t=>[t[0],r(t[1])])),t["default"]=r(t["default"]?t["default"]:e["default"])}if(t.colorSpace&&"rgb"!==(a=t.colorSpace)&&"hcl"!==a&&"lab"!==a)throw new Error(`Unknown color space: "${t.colorSpace}"`);var a;let o,l,c;if("exponential"===s)o=fr;else if("interval"===s)o=pr;else if("categorical"===s){o=dr,l=Object.create(null);for(const e of t.stops)l[e[0]]=e[1];c=typeof t.stops[0][0]}else{if("identity"!==s)throw new Error(`Unknown function type "${s}"`);o=mr}if(r){const i={},r=[];for(let e=0;e<t.stops.length;e++){const n=t.stops[e],s=n[0].zoom;void 0===i[s]&&(i[s]={zoom:s,type:t.type,property:t.property,"default":t["default"],stops:[]},r.push(s)),i[s].stops.push([n[0].value,n[1]])}const n=[];for(const t of r)n.push([i[t].zoom,hr(i[t],e)]);const s={name:"linear"};return{kind:"composite",interpolationType:s,interpolationFactor:Ce.interpolationFactor.bind(void 0,s),zoomStops:n.map(t=>t[0]),evaluate:({zoom:i},r)=>fr({stops:n,base:t.base},e,i).evaluate(i,r)}}if(n){const i="exponential"===s?{name:"exponential",base:void 0!==t.base?t.base:1}:null;return{kind:"camera",interpolationType:i,interpolationFactor:Ce.interpolationFactor.bind(void 0,i),zoomStops:t.stops.map(t=>t[0]),evaluate:({zoom:i})=>o(t,e,i,l,c)}}return{kind:"source",evaluate(i,r){const n=r&&r.properties?r.properties[t.property]:void 0;return void 0===n?ur(t["default"],e["default"]):o(t,e,n,l,c)}}}function ur(t,e,i){return void 0!==t?t:void 0!==e?e:void 0!==i?i:void 0}function dr(t,e,i,r,n){return ur(typeof i===n?r[i]:void 0,t["default"],e["default"])}function pr(t,e,i){if("number"!==or(i))return ur(t["default"],e["default"]);const r=t.stops.length;if(1===r)return t.stops[0][1];if(i<=t.stops[0][0])return t.stops[0][1];if(i>=t.stops[r-1][0])return t.stops[r-1][1];const n=we(t.stops.map(t=>t[0]),i);return t.stops[n][1]}function fr(t,e,i){const r=void 0!==t.base?t.base:1;if("number"!==or(i))return ur(t["default"],e["default"]);const n=t.stops.length;if(1===n)return t.stops[0][1];if(i<=t.stops[0][0])return t.stops[0][1];if(i>=t.stops[n-1][0])return t.stops[n-1][1];const s=we(t.stops.map(t=>t[0]),i),a=function(t,e,i,r){const n=r-i,s=t-i;return 0===n?0:1===e?s/n:(Math.pow(e,s)-1)/(Math.pow(e,n)-1)}(i,r,t.stops[s][0],t.stops[s+1][0]),o=t.stops[s][1],l=t.stops[s+1][1],c=ke[e.type]||cr;return"function"==typeof o.evaluate?{evaluate(...e){const i=o.evaluate.apply(void 0,e),r=l.evaluate.apply(void 0,e);if(void 0!==i&&void 0!==r)return c(i,r,a,t.colorSpace)}}:c(o,l,a,t.colorSpace)}function mr(t,e,i){switch(e.type){case"color":i=Ht.parse(i);break;case"formatted":i=Kt.fromString(i.toString());break;case"resolvedImage":i=te.fromString(i.toString());break;case"padding":i=Jt.parse(i);break;default:or(i)===e.type||"enum"===e.type&&e.values[i]||(i=void 0)}return ur(i,t["default"],e["default"])}Hi.register(Gi,{error:[{kind:"error"},[ht],(t,[e])=>{throw new ae(e.evaluate(t))}],"typeof":[ht,[ft],(t,[e])=>bt(re(e.evaluate(t)))],"to-rgba":[vt(ct,4),[dt],(t,[e])=>{const[i,r,n,s]=e.evaluate(t).rgb;return[255*i,255*r,255*n,s]}],rgb:[dt,[ct,ct,ct],Xi],rgba:[dt,[ct,ct,ct,ct],Xi],has:{type:ut,overloads:[[[ht],(t,[e])=>Wi(e.evaluate(t),t.properties())],[[ht,pt],(t,[e,i])=>Wi(e.evaluate(t),i.evaluate(t))]]},get:{type:ft,overloads:[[[ht],(t,[e])=>Ki(e.evaluate(t),t.properties())],[[ht,pt],(t,[e,i])=>Ki(e.evaluate(t),i.evaluate(t))]]},"feature-state":[ft,[ht],(t,[e])=>Ki(e.evaluate(t),t.featureState||{})],properties:[pt,[],t=>t.properties()],"geometry-type":[ht,[],t=>t.geometryType()],id:[ft,[],t=>t.id()],zoom:[ct,[],t=>t.globals.zoom],"heatmap-density":[ct,[],t=>t.globals.heatmapDensity||0],"line-progress":[ct,[],t=>t.globals.lineProgress||0],accumulated:[ft,[],t=>void 0===t.globals.accumulated?null:t.globals.accumulated],"+":[ct,Ji(ct),(t,e)=>{let i=0;for(const r of e)i+=r.evaluate(t);return i}],"*":[ct,Ji(ct),(t,e)=>{let i=1;for(const r of e)i*=r.evaluate(t);return i}],"-":{type:ct,overloads:[[[ct,ct],(t,[e,i])=>e.evaluate(t)-i.evaluate(t)],[[ct],(t,[e])=>-e.evaluate(t)]]},"/":[ct,[ct,ct],(t,[e,i])=>e.evaluate(t)/i.evaluate(t)],"%":[ct,[ct,ct],(t,[e,i])=>e.evaluate(t)%i.evaluate(t)],ln2:[ct,[],()=>Math.LN2],pi:[ct,[],()=>Math.PI],e:[ct,[],()=>Math.E],"^":[ct,[ct,ct],(t,[e,i])=>Math.pow(e.evaluate(t),i.evaluate(t))],sqrt:[ct,[ct],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[ct,[ct],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[ct,[ct],(t,[e])=>Math.log(e.evaluate(t))],log2:[ct,[ct],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[ct,[ct],(t,[e])=>Math.sin(e.evaluate(t))],cos:[ct,[ct],(t,[e])=>Math.cos(e.evaluate(t))],tan:[ct,[ct],(t,[e])=>Math.tan(e.evaluate(t))],asin:[ct,[ct],(t,[e])=>Math.asin(e.evaluate(t))],acos:[ct,[ct],(t,[e])=>Math.acos(e.evaluate(t))],atan:[ct,[ct],(t,[e])=>Math.atan(e.evaluate(t))],min:[ct,Ji(ct),(t,e)=>Math.min(...e.map(e=>e.evaluate(t)))],max:[ct,Ji(ct),(t,e)=>Math.max(...e.map(e=>e.evaluate(t)))],abs:[ct,[ct],(t,[e])=>Math.abs(e.evaluate(t))],round:[ct,[ct],(t,[e])=>{const i=e.evaluate(t);return i<0?-Math.round(-i):Math.round(i)}],floor:[ct,[ct],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[ct,[ct],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[ut,[ht,ft],(t,[e,i])=>t.properties()[e.value]===i.value],"filter-id-==":[ut,[ft],(t,[e])=>t.id()===e.value],"filter-type-==":[ut,[ht],(t,[e])=>t.geometryType()===e.value],"filter-<":[ut,[ht,ft],(t,[e,i])=>{const r=t.properties()[e.value],n=i.value;return typeof r==typeof n&&r<n}],"filter-id-<":[ut,[ft],(t,[e])=>{const i=t.id(),r=e.value;return typeof i==typeof r&&i<r}],"filter->":[ut,[ht,ft],(t,[e,i])=>{const r=t.properties()[e.value],n=i.value;return typeof r==typeof n&&r>n}],"filter-id->":[ut,[ft],(t,[e])=>{const i=t.id(),r=e.value;return typeof i==typeof r&&i>r}],"filter-<=":[ut,[ht,ft],(t,[e,i])=>{const r=t.properties()[e.value],n=i.value;return typeof r==typeof n&&r<=n}],"filter-id-<=":[ut,[ft],(t,[e])=>{const i=t.id(),r=e.value;return typeof i==typeof r&&i<=r}],"filter->=":[ut,[ht,ft],(t,[e,i])=>{const r=t.properties()[e.value],n=i.value;return typeof r==typeof n&&r>=n}],"filter-id->=":[ut,[ft],(t,[e])=>{const i=t.id(),r=e.value;return typeof i==typeof r&&i>=r}],"filter-has":[ut,[ft],(t,[e])=>e.value in t.properties()],"filter-has-id":[ut,[],t=>null!==t.id()&&void 0!==t.id()],"filter-type-in":[ut,[vt(ht)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[ut,[vt(ft)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[ut,[ht,vt(ft)],(t,[e,i])=>i.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[ut,[ht,vt(ft)],(t,[e,i])=>function(t,e,i,r){for(;i<=r;){const n=i+r>>1;if(e[n]===t)return!0;e[n]>t?r=n-1:i=n+1}return!1}(t.properties()[e.value],i.value,0,i.value.length-1)],all:{type:ut,overloads:[[[ut,ut],(t,[e,i])=>e.evaluate(t)&&i.evaluate(t)],[Ji(ut),(t,e)=>{for(const i of e)if(!i.evaluate(t))return!1;return!0}]]},any:{type:ut,overloads:[[[ut,ut],(t,[e,i])=>e.evaluate(t)||i.evaluate(t)],[Ji(ut),(t,e)=>{for(const i of e)if(i.evaluate(t))return!0;return!1}]]},"!":[ut,[ut],(t,[e])=>!e.evaluate(t)],"is-supported-script":[ut,[ht],(t,[e])=>{const i=t.globals&&t.globals.isSupportedScript;return!i||i(e.evaluate(t))}],upcase:[ht,[ht],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[ht,[ht],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[ht,Ji(ft),(t,e)=>e.map(e=>ne(e.evaluate(t))).join("")],"resolved-locale":[ht,[mt],(t,[e])=>e.evaluate(t).resolvedLocale()]});class _r{constructor(t,e){var i;this.expression=t,this._warningHistory={},this._evaluator=new de,this._defaultValue=e?"color"===(i=e).type&&lr(i["default"])?new Ht(0,0,0,0):"color"===i.type?Ht.parse(i["default"])||null:"padding"===i.type?Jt.parse(i["default"])||null:"variableAnchorOffsetCollection"===i.type?Qt.parse(i["default"])||null:void 0===i["default"]?null:i["default"]:null,this._enumValues=e&&"enum"===e.type?e.values:null}evaluateWithoutErrorHandling(t,e,i,r,n,s){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=i,this._evaluator.canonical=r,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=s,this.expression.evaluate(this._evaluator)}evaluate(t,e,i,r,n,s){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=i||null,this._evaluator.canonical=r,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=s||null;try{const t=this.expression.evaluate(this._evaluator);if(null==t||"number"==typeof t&&t!=t)return this._defaultValue;if(this._enumValues&&!(t in this._enumValues))throw new ae(`Expected value to be one of ${Object.keys(this._enumValues).map(t=>JSON.stringify(t)).join(", ")}, but found ${JSON.stringify(t)} instead.`);return t}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}}}function gr(t){return Array.isArray(t)&&t.length>0&&"string"==typeof t[0]&&t[0]in Gi}function yr(t,e){const i=new pe(Gi,Yi,[],e?function(t){const e={color:dt,string:ht,number:ct,"enum":ht,boolean:ut,formatted:_t,padding:gt,resolvedImage:yt,variableAnchorOffsetCollection:xt};return"array"===t.type?vt(e[t.value]||ft,t.length):e[t.type]}(e):void 0),r=i.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return r?ir(new _r(r,e)):rr(i.errors)}class xr{constructor(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!tr(e.expression)}evaluateWithoutErrorHandling(t,e,i,r,n,s){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i,r,n,s)}evaluate(t,e,i,r,n,s){return this._styleExpression.evaluate(t,e,i,r,n,s)}}class vr{constructor(t,e,i,r){this.kind=t,this.zoomStops=i,this._styleExpression=e,this.isStateDependent="camera"!==t&&!tr(e.expression),this.interpolationType=r}evaluateWithoutErrorHandling(t,e,i,r,n,s){return this._styleExpression.evaluateWithoutErrorHandling(t,e,i,r,n,s)}evaluate(t,e,i,r,n,s){return this._styleExpression.evaluate(t,e,i,r,n,s)}interpolationFactor(t,e,i){return this.interpolationType?Ce.interpolationFactor(this.interpolationType,t,e,i):0}}function br(t,e){const i=yr(t,e);if("error"===i.result)return i;const r=i.value.expression,n=Qi(r);if(!n&&!nr(e))return rr([new at("","data expressions not supported")]);const s=er(r,["zoom"]);if(!s&&!sr(e))return rr([new at("","zoom expressions not supported")]);const a=Tr(r);return a||s?a instanceof at?rr([a]):a instanceof Ce&&!ar(e)?rr([new at("",'"interpolate" expressions cannot be used with this property')]):ir(a?new vr(n?"camera":"composite",i.value,a.labels,a instanceof Ce?a.interpolation:void 0):new xr(n?"constant":"source",i.value)):rr([new at("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class wr{constructor(t,e){this._parameters=t,this._specification=e,st(this,hr(this._parameters,this._specification))}static deserialize(t){return new wr(t._parameters,t._specification)}static serialize(t){return{_parameters:t._parameters,_specification:t._specification}}}function Tr(t){let e=null;if(t instanceof fe)e=Tr(t.result);else if(t instanceof Ee){for(const i of t.args)if(e=Tr(i),e)break}else(t instanceof Te||t instanceof Ce)&&t.input instanceof Hi&&"zoom"===t.input.name&&(e=t);return e instanceof at||t.eachChild(t=>{const i=Tr(t);i instanceof at?e=i:!e&&i?e=new at("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&i&&e!==i&&(e=new at("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}function Sr(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(const e of t.slice(1))if(!Sr(e)&&"boolean"!=typeof e)return!1;return!0;default:return!0}}const Ir={type:"boolean","default":!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Pr(t){if(null==t)return{filter:()=>!0,needGeometry:!1};Sr(t)||(t=kr(t));const e=yr(t,Ir);if("error"===e.result)throw new Error(e.value.map(t=>`${t.key}: ${t.message}`).join(", "));return{filter:(t,i,r)=>e.value.evaluate(t,i,{},r),needGeometry:Mr(t)}}function Ar(t,e){return t<e?-1:t>e?1:0}function Mr(t){if(!Array.isArray(t))return!1;if("within"===t[0]||"distance"===t[0])return!0;for(let e=1;e<t.length;e++)if(Mr(t[e]))return!0;return!1}function kr(t){if(!t)return!0;const e=t[0];return t.length<=1?"any"!==e:"=="===e?Cr(t[1],t[2],"=="):"!="===e?Dr(Cr(t[1],t[2],"==")):"<"===e||">"===e||"<="===e||">="===e?Cr(t[1],t[2],e):"any"===e?(i=t.slice(1),["any"].concat(i.map(kr))):"all"===e?["all"].concat(t.slice(1).map(kr)):"none"===e?["all"].concat(t.slice(1).map(kr).map(Dr)):"in"===e?zr(t[1],t.slice(2)):"!in"===e?Dr(zr(t[1],t.slice(2))):"has"===e?Er(t[1]):"!has"!==e||Dr(Er(t[1]));var i}function Cr(t,e,i){switch(t){case"$type":return[`filter-type-${i}`,e];case"$id":return[`filter-id-${i}`,e];default:return[`filter-${i}`,t,e]}}function zr(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(t=>typeof t!=typeof e[0])?["filter-in-large",t,["literal",e.sort(Ar)]]:["filter-in-small",t,["literal",e]]}}function Er(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function Dr(t){return["!",t]}function Lr(t){const e=typeof t;if("number"===e||"boolean"===e||"string"===e||null==t)return JSON.stringify(t);if(Array.isArray(t)){let e="[";for(const i of t)e+=`${Lr(i)},`;return`${e}]`}const i=Object.keys(t).sort();let r="{";for(let e=0;e<i.length;e++)r+=`${JSON.stringify(i[e])}:${Lr(t[i[e]])},`;return`${r}}`}function Rr(t){let e="";for(const i of H)e+=`/${Lr(t[i])}`;return e}function Br(t){const e=t.value;return e?[new nt(t.key,e,"constants have been deprecated as of v8")]:[]}function Fr(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function Or(t){if(Array.isArray(t))return t.map(Or);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){const e={};for(const i in t)e[i]=Or(t[i]);return e}return Fr(t)}function Vr(t){const e=t.key,i=t.value,r=t.valueSpec||{},n=t.objectElementValidators||{},s=t.style,a=t.styleSpec,o=t.validateSpec;let l=[];const c=or(i);if("object"!==c)return[new nt(e,i,`object expected, ${c} found`)];for(const t in i){const c=t.split(".")[0],h=r[c]||r["*"];let u;if(n[c])u=n[c];else if(r[c])u=o;else if(n["*"])u=n["*"];else{if(!r["*"]){l.push(new nt(e,i[t],`unknown property "${t}"`));continue}u=o}l=l.concat(u({key:(e?`${e}.`:e)+t,value:i[t],valueSpec:h,style:s,styleSpec:a,object:i,objectKey:t,validateSpec:o},i))}for(const t in r)n[t]||r[t].required&&void 0===r[t]["default"]&&void 0===i[t]&&l.push(new nt(e,i,`missing required property "${t}"`));return l}function Nr(t){const e=t.value,i=t.valueSpec,r=t.style,n=t.styleSpec,s=t.key,a=t.arrayElementValidator||t.validateSpec;if("array"!==or(e))return[new nt(s,e,`array expected, ${or(e)} found`)];if(i.length&&e.length!==i.length)return[new nt(s,e,`array length ${i.length} expected, length ${e.length} found`)];if(i["min-length"]&&e.length<i["min-length"])return[new nt(s,e,`array length at least ${i["min-length"]} expected, length ${e.length} found`)];let o={type:i.value,values:i.values};n.$version<7&&(o["function"]=i["function"]),"object"===or(i.value)&&(o=i.value);let l=[];for(let i=0;i<e.length;i++)l=l.concat(a({array:e,arrayIndex:i,value:e[i],valueSpec:o,validateSpec:t.validateSpec,style:r,styleSpec:n,key:`${s}[${i}]`}));return l}function jr(t){const e=t.key,i=t.value,r=t.valueSpec;let n=or(i);return"number"===n&&i!=i&&(n="NaN"),"number"!==n?[new nt(e,i,`number expected, ${n} found`)]:"minimum"in r&&i<r.minimum?[new nt(e,i,`${i} is less than the minimum value ${r.minimum}`)]:"maximum"in r&&i>r.maximum?[new nt(e,i,`${i} is greater than the maximum value ${r.maximum}`)]:[]}function Ur(t){const e=t.valueSpec,i=Fr(t.value.type);let r,n,s,a={};const o="categorical"!==i&&void 0===t.value.property,l=!o,c="array"===or(t.value.stops)&&"array"===or(t.value.stops[0])&&"object"===or(t.value.stops[0][0]),h=Vr({key:t.key,value:t.value,valueSpec:t.styleSpec["function"],validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===i)return[new nt(t.key,t.value,'identity function may not have a "stops" property')];let e=[];const r=t.value;return e=e.concat(Nr({key:t.key,value:r,valueSpec:t.valueSpec,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:u})),"array"===or(r)&&0===r.length&&e.push(new nt(t.key,r,"array must have at least one stop")),e},"default":function(t){return t.validateSpec({key:t.key,value:t.value,valueSpec:e,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===i&&o&&h.push(new nt(t.key,t.value,'missing required property "property"')),"identity"===i||t.value.stops||h.push(new nt(t.key,t.value,'missing required property "stops"')),"exponential"===i&&t.valueSpec.expression&&!ar(t.valueSpec)&&h.push(new nt(t.key,t.value,"exponential functions not supported")),t.styleSpec.$version>=8&&(l&&!nr(t.valueSpec)?h.push(new nt(t.key,t.value,"property functions not supported")):o&&!sr(t.valueSpec)&&h.push(new nt(t.key,t.value,"zoom functions not supported"))),"categorical"!==i&&!c||void 0!==t.value.property||h.push(new nt(t.key,t.value,'"property" property is required')),h;function u(t){let i=[];const r=t.value,o=t.key;if("array"!==or(r))return[new nt(o,r,`array expected, ${or(r)} found`)];if(2!==r.length)return[new nt(o,r,`array length 2 expected, length ${r.length} found`)];if(c){if("object"!==or(r[0]))return[new nt(o,r,`object expected, ${or(r[0])} found`)];if(void 0===r[0].zoom)return[new nt(o,r,"object stop key must have zoom")];if(void 0===r[0].value)return[new nt(o,r,"object stop key must have value")];if(s&&s>Fr(r[0].zoom))return[new nt(o,r[0].zoom,"stop zoom values must appear in ascending order")];Fr(r[0].zoom)!==s&&(s=Fr(r[0].zoom),n=void 0,a={}),i=i.concat(Vr({key:`${o}[0]`,value:r[0],valueSpec:{zoom:{}},validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:jr,value:d}}))}else i=i.concat(d({key:`${o}[0]`,value:r[0],valueSpec:{},validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec},r));return gr(Or(r[1]))?i.concat([new nt(`${o}[1]`,r[1],"expressions are not allowed in function stops.")]):i.concat(t.validateSpec({key:`${o}[1]`,value:r[1],valueSpec:e,validateSpec:t.validateSpec,style:t.style,styleSpec:t.styleSpec}))}function d(t,s){const o=or(t.value),l=Fr(t.value),c=null!==t.value?t.value:s;if(r){if(o!==r)return[new nt(t.key,c,`${o} stop domain type must match previous stop domain type ${r}`)]}else r=o;if("number"!==o&&"string"!==o&&"boolean"!==o)return[new nt(t.key,c,"stop domain value must be a number, string, or boolean")];if("number"!==o&&"categorical"!==i){let r=`number expected, ${o} found`;return nr(e)&&void 0===i&&(r+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new nt(t.key,c,r)]}return"categorical"!==i||"number"!==o||isFinite(l)&&Math.floor(l)===l?"categorical"!==i&&"number"===o&&void 0!==n&&l<n?[new nt(t.key,c,"stop domain values must appear in ascending order")]:(n=l,"categorical"===i&&l in a?[new nt(t.key,c,"stop domain values must be unique")]:(a[l]=!0,[])):[new nt(t.key,c,`integer expected, found ${l}`)]}}function $r(t){const e=("property"===t.expressionContext?br:yr)(Or(t.value),t.valueSpec);if("error"===e.result)return e.value.map(e=>new nt(`${t.key}${e.key}`,t.value,e.message));const i=e.value.expression||e.value._styleExpression.expression;if("property"===t.expressionContext&&"text-font"===t.propertyKey&&!i.outputDefined())return[new nt(t.key,t.value,`Invalid data expression for "${t.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===t.expressionContext&&"layout"===t.propertyType&&!tr(i))return[new nt(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext&&!tr(i))return[new nt(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!er(i,["zoom","feature-state"]))return[new nt(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!Qi(i))return[new nt(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function qr(t){const e=t.key,i=t.value,r=t.valueSpec,n=[];return Array.isArray(r.values)?-1===r.values.indexOf(Fr(i))&&n.push(new nt(e,i,`expected one of [${r.values.join(", ")}], ${JSON.stringify(i)} found`)):-1===Object.keys(r.values).indexOf(Fr(i))&&n.push(new nt(e,i,`expected one of [${Object.keys(r.values).join(", ")}], ${JSON.stringify(i)} found`)),n}function Zr(t){return Sr(Or(t.value))?$r(st({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Gr(t)}function Gr(t){const e=t.value,i=t.key;if("array"!==or(e))return[new nt(i,e,`array expected, ${or(e)} found`)];const r=t.styleSpec;let n,s=[];if(e.length<1)return[new nt(i,e,"filter array must have at least 1 element")];switch(s=s.concat(qr({key:`${i}[0]`,value:e[0],valueSpec:r.filter_operator,style:t.style,styleSpec:t.styleSpec})),Fr(e[0])){case"<":case"<=":case">":case">=":e.length>=2&&"$type"===Fr(e[1])&&s.push(new nt(i,e,`"$type" cannot be use with operator "${e[0]}"`));case"==":case"!=":3!==e.length&&s.push(new nt(i,e,`filter array for operator "${e[0]}" must have 3 elements`));case"in":case"!in":e.length>=2&&(n=or(e[1]),"string"!==n&&s.push(new nt(`${i}[1]`,e[1],`string expected, ${n} found`)));for(let a=2;a<e.length;a++)n=or(e[a]),"$type"===Fr(e[1])?s=s.concat(qr({key:`${i}[${a}]`,value:e[a],valueSpec:r.geometry_type,style:t.style,styleSpec:t.styleSpec})):"string"!==n&&"number"!==n&&"boolean"!==n&&s.push(new nt(`${i}[${a}]`,e[a],`string, number, or boolean expected, ${n} found`));break;case"any":case"all":case"none":for(let r=1;r<e.length;r++)s=s.concat(Gr({key:`${i}[${r}]`,value:e[r],style:t.style,styleSpec:t.styleSpec}));break;case"has":case"!has":n=or(e[1]),2!==e.length?s.push(new nt(i,e,`filter array for "${e[0]}" operator must have 2 elements`)):"string"!==n&&s.push(new nt(`${i}[1]`,e[1],`string expected, ${n} found`))}return s}function Hr(t,e){const i=t.key,r=t.validateSpec,n=t.style,s=t.styleSpec,a=t.value,o=t.objectKey,l=s[`${e}_${t.layerType}`];if(!l)return[];const c=o.match(/^(.*)-transition$/);if("paint"===e&&c&&l[c[1]]&&l[c[1]].transition)return r({key:i,value:a,valueSpec:s.transition,style:n,styleSpec:s});const h=t.valueSpec||l[o];if(!h)return[new nt(i,a,`unknown property "${o}"`)];let u;if("string"===or(a)&&nr(h)&&!h.tokens&&(u=/^{([^}]+)}$/.exec(a)))return[new nt(i,a,`"${o}" does not support interpolation syntax\nUse an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(u[1])} }\`.`)];const d=[];return"symbol"===t.layerType&&("text-field"===o&&n&&!n.glyphs&&d.push(new nt(i,a,'use of "text-field" requires a style "glyphs" property')),"text-font"===o&&lr(Or(a))&&"identity"===Fr(a.type)&&d.push(new nt(i,a,'"text-font" does not support identity functions'))),d.concat(r({key:t.key,value:a,valueSpec:h,style:n,styleSpec:s,expressionContext:"property",propertyType:e,propertyKey:o}))}function Xr(t){return Hr(t,"paint")}function Wr(t){return Hr(t,"layout")}function Kr(t){let e=[];const i=t.value,r=t.key,n=t.style,s=t.styleSpec;i.type||i.ref||e.push(new nt(r,i,'either "type" or "ref" is required'));let a=Fr(i.type);const o=Fr(i.ref);if(i.id){const s=Fr(i.id);for(let a=0;a<t.arrayIndex;a++){const t=n.layers[a];Fr(t.id)===s&&e.push(new nt(r,i.id,`duplicate layer id "${i.id}", previously used at line ${t.id.__line__}`))}}if("ref"in i){let t;["type","source","source-layer","filter","layout"].forEach(t=>{t in i&&e.push(new nt(r,i[t],`"${t}" is prohibited for ref layers`))}),n.layers.forEach(e=>{Fr(e.id)===o&&(t=e)}),t?t.ref?e.push(new nt(r,i.ref,"ref cannot reference another ref layer")):a=Fr(t.type):e.push(new nt(r,i.ref,`ref layer "${o}" not found`))}else if("background"!==a)if(i.source){const t=n.sources&&n.sources[i.source],s=t&&Fr(t.type);t?"vector"===s&&"raster"===a?e.push(new nt(r,i.source,`layer "${i.id}" requires a raster source`)):"raster-dem"!==s&&"hillshade"===a?e.push(new nt(r,i.source,`layer "${i.id}" requires a raster-dem source`)):"raster"===s&&"raster"!==a?e.push(new nt(r,i.source,`layer "${i.id}" requires a vector source`)):"vector"!==s||i["source-layer"]?"raster-dem"===s&&"hillshade"!==a?e.push(new nt(r,i.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==a||!i.paint||!i.paint["line-gradient"]||"geojson"===s&&t.lineMetrics||e.push(new nt(r,i,`layer "${i.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):e.push(new nt(r,i,`layer "${i.id}" must specify a "source-layer"`)):e.push(new nt(r,i.source,`source "${i.source}" not found`))}else e.push(new nt(r,i,'missing required property "source"'));return e=e.concat(Vr({key:r,value:i,valueSpec:s.layer,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{"*":()=>[],type:()=>t.validateSpec({key:`${r}.type`,value:i.type,valueSpec:s.layer.type,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,object:i,objectKey:"type"}),filter:Zr,layout:t=>Vr({layer:i,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{"*":t=>Wr(st({layerType:a},t))}}),paint:t=>Vr({layer:i,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,validateSpec:t.validateSpec,objectElementValidators:{"*":t=>Xr(st({layerType:a},t))}})}})),e}function Jr(t){const e=t.value,i=t.key,r=or(e);return"string"!==r?[new nt(i,e,`string expected, ${r} found`)]:[]}const Yr={promoteId:function({key:t,value:e}){if("string"===or(e))return Jr({key:t,value:e});{const i=[];for(const r in e)i.push(...Jr({key:`${t}.${r}`,value:e[r]}));return i}}};function Qr(t){const e=t.value,i=t.key,r=t.styleSpec,n=t.style,s=t.validateSpec;if(!e.type)return[new nt(i,e,'"type" is required')];const a=Fr(e.type);let o;switch(a){case"vector":case"raster":return o=Vr({key:i,value:e,valueSpec:r[`source_${a.replace("-","_")}`],style:t.style,styleSpec:r,objectElementValidators:Yr,validateSpec:s}),o;case"raster-dem":return o=function(t){var e;const i=null!==(e=t.sourceName)&&void 0!==e?e:"",r=t.value,n=t.styleSpec,s=n.source_raster_dem,a=t.style;let o=[];const l=or(r);if(void 0===r)return o;if("object"!==l)return o.push(new nt("source_raster_dem",r,`object expected, ${l} found`)),o;const c="custom"===Fr(r.encoding),h=["redFactor","greenFactor","blueFactor","baseShift"],u=t.value.encoding?`"${t.value.encoding}"`:"Default";for(const e in r)!c&&h.includes(e)?o.push(new nt(e,r[e],`In "${i}": "${e}" is only valid when "encoding" is set to "custom". ${u} encoding found`)):s[e]?o=o.concat(t.validateSpec({key:e,value:r[e],valueSpec:s[e],validateSpec:t.validateSpec,style:a,styleSpec:n})):o.push(new nt(e,r[e],`unknown property "${e}"`));return o}({sourceName:i,value:e,style:t.style,styleSpec:r,validateSpec:s}),o;case"geojson":if(o=Vr({key:i,value:e,valueSpec:r.source_geojson,style:n,styleSpec:r,validateSpec:s,objectElementValidators:Yr}),e.cluster)for(const t in e.clusterProperties){const[r,n]=e.clusterProperties[t],a="string"==typeof r?[r,["accumulated"],["get",t]]:r;o.push(...$r({key:`${i}.${t}.map`,value:n,validateSpec:s,expressionContext:"cluster-map"})),o.push(...$r({key:`${i}.${t}.reduce`,value:a,validateSpec:s,expressionContext:"cluster-reduce"}))}return o;case"video":return Vr({key:i,value:e,valueSpec:r.source_video,style:n,validateSpec:s,styleSpec:r});case"image":return Vr({key:i,value:e,valueSpec:r.source_image,style:n,validateSpec:s,styleSpec:r});case"canvas":return[new nt(i,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return qr({key:`${i}.type`,value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:n,validateSpec:s,styleSpec:r})}}function tn(t){const e=t.value,i=t.styleSpec,r=i.light,n=t.style;let s=[];const a=or(e);if(void 0===e)return s;if("object"!==a)return s=s.concat([new nt("light",e,`object expected, ${a} found`)]),s;for(const a in e){const o=a.match(/^(.*)-transition$/);s=s.concat(o&&r[o[1]]&&r[o[1]].transition?t.validateSpec({key:a,value:e[a],valueSpec:i.transition,validateSpec:t.validateSpec,style:n,styleSpec:i}):r[a]?t.validateSpec({key:a,value:e[a],valueSpec:r[a],validateSpec:t.validateSpec,style:n,styleSpec:i}):[new nt(a,e[a],`unknown property "${a}"`)])}return s}function en(t){const e=t.value,i=t.styleSpec,r=i.sky,n=t.style,s=or(e);if(void 0===e)return[];if("object"!==s)return[new nt("sky",e,`object expected, ${s} found`)];let a=[];for(const s in e)a=a.concat(r[s]?t.validateSpec({key:s,value:e[s],valueSpec:r[s],style:n,styleSpec:i}):[new nt(s,e[s],`unknown property "${s}"`)]);return a}function rn(t){const e=t.value,i=t.styleSpec,r=i.terrain,n=t.style;let s=[];const a=or(e);if(void 0===e)return s;if("object"!==a)return s=s.concat([new nt("terrain",e,`object expected, ${a} found`)]),s;for(const a in e)s=s.concat(r[a]?t.validateSpec({key:a,value:e[a],valueSpec:r[a],validateSpec:t.validateSpec,style:n,styleSpec:i}):[new nt(a,e[a],`unknown property "${a}"`)]);return s}function nn(t){let e=[];const i=t.value,r=t.key;if(Array.isArray(i)){const n=[],s=[];for(const a in i)i[a].id&&n.includes(i[a].id)&&e.push(new nt(r,i,`all the sprites' ids must be unique, but ${i[a].id} is duplicated`)),n.push(i[a].id),i[a].url&&s.includes(i[a].url)&&e.push(new nt(r,i,`all the sprites' URLs must be unique, but ${i[a].url} is duplicated`)),s.push(i[a].url),e=e.concat(Vr({key:`${r}[${a}]`,value:i[a],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:t.validateSpec}));return e}return Jr({key:r,value:i})}const sn={"*":()=>[],array:Nr,boolean:function(t){const e=t.value,i=t.key,r=or(e);return"boolean"!==r?[new nt(i,e,`boolean expected, ${r} found`)]:[]},number:jr,color:function(t){const e=t.key,i=t.value,r=or(i);return"string"!==r?[new nt(e,i,`color expected, ${r} found`)]:Ht.parse(String(i))?[]:[new nt(e,i,`color expected, "${i}" found`)]},constants:Br,"enum":qr,filter:Zr,"function":Ur,layer:Kr,object:Vr,source:Qr,light:tn,sky:en,terrain:rn,projection:function(t){const e=t.value,i=t.styleSpec,r=i.projection,n=t.style,s=or(e);if(void 0===e)return[];if("object"!==s)return[new nt("projection",e,`object expected, ${s} found`)];let a=[];for(const s in e)a=a.concat(r[s]?t.validateSpec({key:s,value:e[s],valueSpec:r[s],style:n,styleSpec:i}):[new nt(s,e[s],`unknown property "${s}"`)]);return a},string:Jr,formatted:function(t){return 0===Jr(t).length?[]:$r(t)},resolvedImage:function(t){return 0===Jr(t).length?[]:$r(t)},padding:function(t){const e=t.key,i=t.value;if("array"===or(i)){if(i.length<1||i.length>4)return[new nt(e,i,`padding requires 1 to 4 values; ${i.length} values found`)];const r={type:"number"};let n=[];for(let s=0;s<i.length;s++)n=n.concat(t.validateSpec({key:`${e}[${s}]`,value:i[s],validateSpec:t.validateSpec,valueSpec:r}));return n}return jr({key:e,value:i,valueSpec:{}})},variableAnchorOffsetCollection:function(t){const e=t.key,i=t.value,r=or(i),n=t.styleSpec;if("array"!==r||i.length<1||i.length%2!=0)return[new nt(e,i,"variableAnchorOffsetCollection requires a non-empty array of even length")];let s=[];for(let r=0;r<i.length;r+=2)s=s.concat(qr({key:`${e}[${r}]`,value:i[r],valueSpec:n.layout_symbol["text-anchor"]})),s=s.concat(Nr({key:`${e}[${r+1}]`,value:i[r+1],valueSpec:{length:2,value:"number"},validateSpec:t.validateSpec,style:t.style,styleSpec:n}));return s},sprite:nn};function an(t){const e=t.value,i=t.valueSpec,r=t.styleSpec;return t.validateSpec=an,i.expression&&lr(Fr(e))?Ur(t):i.expression&&gr(Or(e))?$r(t):i.type&&sn[i.type]?sn[i.type](t):Vr(st({},t,{valueSpec:i.type?r[i.type]:i}))}function on(t){const e=t.value,i=t.key,r=Jr(t);return r.length||(-1===e.indexOf("{fontstack}")&&r.push(new nt(i,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&r.push(new nt(i,e,'"glyphs" url must include a "{range}" token'))),r}function ln(t,e=G){let i=[];return i=i.concat(an({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,validateSpec:an,objectElementValidators:{glyphs:on,"*":()=>[]}})),t.constants&&(i=i.concat(Br({key:"constants",value:t.constants,style:t,styleSpec:e,validateSpec:an}))),hn(i)}function cn(t){return function(e){return t({...e,validateSpec:an})}}function hn(t){return[].concat(t).sort((t,e)=>t.line-e.line)}function un(t){return function(...e){return hn(t.apply(this,e))}}ln.source=un(cn(Qr)),ln.sprite=un(cn(nn)),ln.glyphs=un(cn(on)),ln.light=un(cn(tn)),ln.sky=un(cn(en)),ln.terrain=un(cn(rn)),ln.layer=un(cn(Kr)),ln.filter=un(cn(Zr)),ln.paintProperty=un(cn(Xr)),ln.layoutProperty=un(cn(Wr));const dn=ln,pn=dn.light,fn=dn.sky,mn=dn.paintProperty,_n=dn.layoutProperty;function gn(t,e){let i=!1;if(e&&e.length)for(const r of e)t.fire(new q(new Error(r.message))),i=!0;return i}class yn{constructor(t,e,i){const r=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;const n=new Int32Array(this.arrayBuffer);t=n[0],this.d=(e=n[1])+2*(i=n[2]);for(let t=0;t<this.d*this.d;t++){const e=n[3+t],i=n[3+t+1];r.push(e===i?null:n.subarray(e,i))}const s=n[3+r.length+1];this.keys=n.subarray(n[3+r.length],s),this.bboxes=n.subarray(s),this.insert=this._insertReadonly}else{this.d=e+2*i;for(let t=0;t<this.d*this.d;t++)r.push([]);this.keys=[],this.bboxes=[]}this.n=e,this.extent=t,this.padding=i,this.scale=e/t,this.uid=0;const n=i/e*t;this.min=-n,this.max=t+n}insert(t,e,i,r,n){this._forEachCell(e,i,r,n,this._insertCell,this.uid++,void 0,void 0),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(i),this.bboxes.push(r),this.bboxes.push(n)}_insertReadonly(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(t,e,i,r,n,s){this.cells[n].push(s)}query(t,e,i,r,n){const s=this.min,a=this.max;if(t<=s&&e<=s&&a<=i&&a<=r&&!n)return Array.prototype.slice.call(this.keys);{const s=[];return this._forEachCell(t,e,i,r,this._queryCell,s,{},n),s}}_queryCell(t,e,i,r,n,s,a,o){const l=this.cells[n];if(null!==l){const n=this.keys,c=this.bboxes;for(let h=0;h<l.length;h++){const u=l[h];if(void 0===a[u]){const l=4*u;(o?o(c[l+0],c[l+1],c[l+2],c[l+3]):t<=c[l+2]&&e<=c[l+3]&&i>=c[l+0]&&r>=c[l+1])?(a[u]=!0,s.push(n[u])):a[u]=!1}}}}_forEachCell(t,e,i,r,n,s,a,o){const l=this._convertToCellCoord(t),c=this._convertToCellCoord(e),h=this._convertToCellCoord(i),u=this._convertToCellCoord(r);for(let d=l;d<=h;d++)for(let l=c;l<=u;l++){const c=this.d*l+d;if((!o||o(this._convertFromCellCoord(d),this._convertFromCellCoord(l),this._convertFromCellCoord(d+1),this._convertFromCellCoord(l+1)))&&n.call(this,t,e,i,r,c,s,a,o))return}}_convertFromCellCoord(t){return(t-this.padding)/this.scale}_convertToCellCoord(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const t=this.cells,e=3+this.cells.length+1+1;let i=0;for(let t=0;t<this.cells.length;t++)i+=this.cells[t].length;const r=new Int32Array(e+i+this.keys.length+this.bboxes.length);r[0]=this.extent,r[1]=this.n,r[2]=this.padding;let n=e;for(let e=0;e<t.length;e++){const i=t[e];r[3+e]=n,r.set(i,n),n+=i.length}return r[3+t.length]=n,r.set(this.keys,n),n+=this.keys.length,r[3+t.length+1]=n,r.set(this.bboxes,n),n+=this.bboxes.length,r.buffer}static serialize(t,e){const i=t.toArrayBuffer();return e&&e.push(i),{buffer:i}}static deserialize(t){return new yn(t.buffer)}}const xn={};function vn(t,e,i={}){if(xn[t])throw new Error(`${t} is already registered.`);Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),xn[t]={klass:e,omit:i.omit||[],shallow:i.shallow||[]}}vn("Object",Object),vn("TransferableGridIndex",yn),vn("Color",Ht),vn("Error",Error),vn("AJAXError",F),vn("ResolvedImage",te),vn("StylePropertyFunction",wr),vn("StyleExpression",_r,{omit:["_evaluator"]}),vn("ZoomDependentExpression",vr),vn("ZoomConstantExpression",xr),vn("CompoundExpression",Hi,{omit:["_evaluate"]});for(const t in Gi)Gi[t]._classRegistryKey||vn(`Expression_${t}`,Gi[t]);function bn(t){return t&&"undefined"!=typeof ArrayBuffer&&(t instanceof ArrayBuffer||t.constructor&&"ArrayBuffer"===t.constructor.name)}function wn(t){return t.$name||t.constructor._classRegistryKey}function Tn(t){return!function(t){if(null===t||"object"!=typeof t)return!1;const e=wn(t);return!(!e||"Object"===e)}(t)&&(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||t instanceof Blob||t instanceof Error||bn(t)||A(t)||ArrayBuffer.isView(t)||t instanceof ImageData)}function Sn(t,e){if(Tn(t))return(bn(t)||A(t))&&e&&e.push(t),ArrayBuffer.isView(t)&&e&&e.push(t.buffer),t instanceof ImageData&&e&&e.push(t.data.buffer),t;if(Array.isArray(t)){const i=[];for(const r of t)i.push(Sn(r,e));return i}if("object"!=typeof t)throw new Error("can't serialize object of type "+typeof t);const i=wn(t);if(!i)throw new Error(`can't serialize object of unregistered class ${t.constructor.name}`);if(!xn[i])throw new Error(`${i} is not registered.`);const{klass:r}=xn[i],n=r.serialize?r.serialize(t,e):{};if(r.serialize){if(e&&n===e[e.length-1])throw new Error("statically serialized object won't survive transfer of $name property")}else{for(const r in t){if(!t.hasOwnProperty(r))continue;if(xn[i].omit.indexOf(r)>=0)continue;const s=t[r];n[r]=xn[i].shallow.indexOf(r)>=0?s:Sn(s,e)}t instanceof Error&&(n.message=t.message)}if(n.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==i&&(n.$name=i),n}function In(t){if(Tn(t))return t;if(Array.isArray(t))return t.map(In);if("object"!=typeof t)throw new Error("can't deserialize object of type "+typeof t);const e=wn(t)||"Object";if(!xn[e])throw new Error(`can't deserialize unregistered class ${e}`);const{klass:i}=xn[e];if(!i)throw new Error(`can't deserialize unregistered class ${e}`);if(i.deserialize)return i.deserialize(t);const r=Object.create(i.prototype);for(const i of Object.keys(t)){if("$name"===i)continue;const n=t[i];r[i]=xn[e].shallow.indexOf(i)>=0?n:In(n)}return r}class Pn{constructor(){this.first=!0}update(t,e){const i=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=i,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=i,!0):(this.lastFloorZoom>i?(this.lastIntegerZoom=i+1,this.lastIntegerZoomTime=e):this.lastFloorZoom<i&&(this.lastIntegerZoom=i,this.lastIntegerZoomTime=e),t!==this.lastZoom&&(this.lastZoom=t,this.lastFloorZoom=i,!0))}}const An=t=>t>=128&&t<=255,Mn=t=>t>=6016&&t<=6143,kn=t=>t>=8192&&t<=8303,Cn=t=>t>=8448&&t<=8527,zn=t=>t>=8528&&t<=8591,En=t=>t>=8960&&t<=9215,Dn=t=>t>=9216&&t<=9279,Ln=t=>t>=9280&&t<=9311,Rn=t=>t>=9312&&t<=9471,Bn=t=>t>=9632&&t<=9727,Fn=t=>t>=9728&&t<=9983,On=t=>t>=11008&&t<=11263,Vn=t=>t>=12272&&t<=12287,Nn=t=>t>=12288&&t<=12351,jn=t=>t>=12448&&t<=12543,Un=t=>t>=12688&&t<=12703,$n=t=>t>=12736&&t<=12783,qn=t=>t>=12800&&t<=13055,Zn=t=>t>=13056&&t<=13311,Gn=t=>t>=19904&&t<=19967,Hn=t=>t>=57344&&t<=63743,Xn=t=>t>=65040&&t<=65055,Wn=t=>t>=65072&&t<=65103,Kn=t=>t>=65104&&t<=65135,Jn=t=>t>=65280&&t<=65519;function Yn(t){for(const e of t)if(ns(e.charCodeAt(0)))return!0;return!1}function Qn(t){for(const e of t)if(!is(e.charCodeAt(0)))return!1;return!0}function ts(t){const e=t.map(t=>{try{return new RegExp(`\\p{sc=${t}}`,"u").source}catch(t){return null}}).filter(t=>t);return new RegExp(e.join("|"),"u")}const es=ts(["Arab","Dupl","Mong","Ougr","Syrc"]);function is(t){return!es.test(String.fromCodePoint(t))}const rs=ts(["Bopo","Hani","Hira","Kana","Kits","Nshu","Tang","Yiii"]);function ns(t){return!(746!==t&&747!==t&&(t<4352||!(Wn(t)&&!(t>=65097&&t<=65103)||Zn(t)||$n(t)||!(!Nn(t)||t>=12296&&t<=12305||t>=12308&&t<=12319||12336===t)||qn(t)||Vn(t)||Un(t)||jn(t)&&12540!==t||!(!Jn(t)||65288===t||65289===t||65293===t||t>=65306&&t<=65310||65339===t||65341===t||65343===t||t>=65371&&t<=65503||65507===t||t>=65512&&t<=65519)||!(!Kn(t)||t>=65112&&t<=65118||t>=65123&&t<=65126)||Xn(t)||Gn(t)||/\p{sc=Cans}/u.test(String.fromCodePoint(t))||/\p{sc=Hang}/u.test(String.fromCodePoint(t))||rs.test(String.fromCodePoint(t)))))}function ss(t){return!(ns(t)||function(t){return!!(An(t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||kn(t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||Cn(t)||zn(t)||En(t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||Dn(t)&&9251!==t||Ln(t)||Rn(t)||Bn(t)||Fn(t)&&!(t>=9754&&t<=9759)||On(t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||Nn(t)||jn(t)||Hn(t)||Wn(t)||Kn(t)||Jn(t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t)}(t))}const as=ts(["Adlm","Arab","Armi","Avst","Chrs","Cprt","Egyp","Elym","Gara","Hatr","Hebr","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogo","Syrc","Thaa","Todr","Yezi"]);function os(t){return as.test(String.fromCodePoint(t))}function ls(t,e){return!(!e&&os(t)||t>=2304&&t<=3583||t>=3840&&t<=4255||Mn(t))}function cs(t){for(const e of t)if(os(e.charCodeAt(0)))return!0;return!1}const hs=new class{constructor(){this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null}setState(t){this.pluginStatus=t.pluginStatus,this.pluginURL=t.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(t){this.applyArabicShaping=t.applyArabicShaping,this.processBidirectionalText=t.processBidirectionalText,this.processStyledBidirectionalText=t.processStyledBidirectionalText}isParsed(){return null!=this.applyArabicShaping&&null!=this.processBidirectionalText&&null!=this.processStyledBidirectionalText}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}};class us{constructor(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.zoomHistory=e.zoomHistory,this.transition=e.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Pn,this.transition={})}isSupportedScript(t){return function(t,e){for(const i of t)if(!ls(i.charCodeAt(0),e))return!1;return!0}(t,"loaded"===hs.getRTLTextPluginStatus())}crossFadingFactor(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const t=this.zoom,e=t-Math.floor(t),i=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*i}:{fromScale:.5,toScale:1,t:1-(1-i)*e}}}class ds{constructor(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(lr(t))return new wr(t,e);if(gr(t)){const i=br(t,e);if("error"===i.result)throw new Error(i.value.map(t=>`${t.key}: ${t.message}`).join(", "));return i.value}{let i=t;return"color"===e.type&&"string"==typeof t?i=Ht.parse(t):"padding"!==e.type||"number"!=typeof t&&!Array.isArray(t)?"variableAnchorOffsetCollection"===e.type&&Array.isArray(t)&&(i=Qt.parse(t)):i=Jt.parse(t),{kind:"constant",evaluate:()=>i}}}(void 0===e?t.specification["default"]:e,t.specification)}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}possiblyEvaluate(t,e,i){return this.property.possiblyEvaluate(this,t,e,i)}}class ps{constructor(t){this.property=t,this.value=new ds(t,void 0)}transitioned(t,e){return new ms(this.property,this.value,e,g({},t.transition,this.transition),t.now)}untransitioned(){return new ms(this.property,this.value,null,{},0)}}class fs{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)}getValue(t){return b(this._values[t].value.value)}setValue(t,e){Object.prototype.hasOwnProperty.call(this._values,t)||(this._values[t]=new ps(this._values[t].property)),this._values[t].value=new ds(this._values[t].property,null===e?void 0:b(e))}getTransition(t){return b(this._values[t].transition)}setTransition(t,e){Object.prototype.hasOwnProperty.call(this._values,t)||(this._values[t]=new ps(this._values[t].property)),this._values[t].transition=b(e)||void 0}serialize(){const t={};for(const e of Object.keys(this._values)){const i=this.getValue(e);void 0!==i&&(t[e]=i);const r=this.getTransition(e);void 0!==r&&(t[`${e}-transition`]=r)}return t}transitioned(t,e){const i=new _s(this._properties);for(const r of Object.keys(this._values))i._values[r]=this._values[r].transitioned(t,e._values[r]);return i}untransitioned(){const t=new _s(this._properties);for(const e of Object.keys(this._values))t._values[e]=this._values[e].untransitioned();return t}}class ms{constructor(t,e,i,r,n){this.property=t,this.value=e,this.begin=n+r.delay||0,this.end=this.begin+r.duration||0,t.specification.transition&&(r.delay||r.duration)&&(this.prior=i)}possiblyEvaluate(t,e,i){const r=t.now||0,n=this.value.possiblyEvaluate(t,e,i),s=this.prior;if(s){if(r>this.end)return this.prior=null,n;if(this.value.isDataDriven())return this.prior=null,n;if(r<this.begin)return s.possiblyEvaluate(t,e,i);{const a=(r-this.begin)/(this.end-this.begin);return this.property.interpolate(s.possiblyEvaluate(t,e,i),n,function(t){if(t<=0)return 0;if(t>=1)return 1;const e=t*t,i=e*t;return 4*(t<.5?i:3*(t-e)+i-.75)}(a))}}return n}}class _s{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)}possiblyEvaluate(t,e,i){const r=new xs(this._properties);for(const n of Object.keys(this._values))r._values[n]=this._values[n].possiblyEvaluate(t,e,i);return r}hasTransition(){for(const t of Object.keys(this._values))if(this._values[t].prior)return!0;return!1}}class gs{constructor(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)}hasValue(t){return void 0!==this._values[t].value}getValue(t){return b(this._values[t].value)}setValue(t,e){this._values[t]=new ds(this._values[t].property,null===e?void 0:b(e))}serialize(){const t={};for(const e of Object.keys(this._values)){const i=this.getValue(e);void 0!==i&&(t[e]=i)}return t}possiblyEvaluate(t,e,i){const r=new xs(this._properties);for(const n of Object.keys(this._values))r._values[n]=this._values[n].possiblyEvaluate(t,e,i);return r}}class ys{constructor(t,e,i){this.property=t,this.value=e,this.parameters=i}isConstant(){return"constant"===this.value.kind}constantOr(t){return"constant"===this.value.kind?this.value.value:t}evaluate(t,e,i,r){return this.property.evaluate(this.value,this.parameters,t,e,i,r)}}class xs{constructor(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)}get(t){return this._values[t]}}class vs{constructor(t){this.specification=t}possiblyEvaluate(t,e){if(t.isDataDriven())throw new Error("Value should not be data driven");return t.expression.evaluate(e)}interpolate(t,e,i){const r=ke[this.specification.type];return r?r(t,e,i):t}}class bs{constructor(t,e){this.specification=t,this.overrides=e}possiblyEvaluate(t,e,i,r){return new ys(this,"constant"===t.expression.kind||"camera"===t.expression.kind?{kind:"constant",value:t.expression.evaluate(e,null,{},i,r)}:t.expression,e)}interpolate(t,e,i){if("constant"!==t.value.kind||"constant"!==e.value.kind)return t;if(void 0===t.value.value||void 0===e.value.value)return new ys(this,{kind:"constant",value:void 0},t.parameters);const r=ke[this.specification.type];if(r){const n=r(t.value.value,e.value.value,i);return new ys(this,{kind:"constant",value:n},t.parameters)}return t}evaluate(t,e,i,r,n,s){return"constant"===t.kind?t.value:t.evaluate(e,i,r,n,s)}}class ws extends bs{possiblyEvaluate(t,e,i,r){if(void 0===t.value)return new ys(this,{kind:"constant",value:void 0},e);if("constant"===t.expression.kind){const n=t.expression.evaluate(e,null,{},i,r),s="resolvedImage"===t.property.specification.type&&"string"!=typeof n?n.name:n,a=this._calculate(s,s,s,e);return new ys(this,{kind:"constant",value:a},e)}if("camera"===t.expression.kind){const i=this._calculate(t.expression.evaluate({zoom:e.zoom-1}),t.expression.evaluate({zoom:e.zoom}),t.expression.evaluate({zoom:e.zoom+1}),e);return new ys(this,{kind:"constant",value:i},e)}return new ys(this,t.expression,e)}evaluate(t,e,i,r,n,s){if("source"===t.kind){const a=t.evaluate(e,i,r,n,s);return this._calculate(a,a,a,e)}return"composite"===t.kind?this._calculate(t.evaluate({zoom:Math.floor(e.zoom)-1},i,r),t.evaluate({zoom:Math.floor(e.zoom)},i,r),t.evaluate({zoom:Math.floor(e.zoom)+1},i,r),e):t.value}_calculate(t,e,i,r){return r.zoom>r.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:i,to:e}}interpolate(t){return t}}class Ts{constructor(t){this.specification=t}possiblyEvaluate(t,e,i,r){if(void 0!==t.value){if("constant"===t.expression.kind){const n=t.expression.evaluate(e,null,{},i,r);return this._calculate(n,n,n,e)}return this._calculate(t.expression.evaluate(new us(Math.floor(e.zoom-1),e)),t.expression.evaluate(new us(Math.floor(e.zoom),e)),t.expression.evaluate(new us(Math.floor(e.zoom+1),e)),e)}}_calculate(t,e,i,r){return r.zoom>r.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:i,to:e}}interpolate(t){return t}}class Ss{constructor(t){this.specification=t}possiblyEvaluate(t,e,i,r){return!!t.expression.evaluate(e,null,{},i,r)}interpolate(){return!1}}class Is{constructor(t){this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const e in t){const i=t[e];i.specification.overridable&&this.overridableProperties.push(e);const r=this.defaultPropertyValues[e]=new ds(i,void 0),n=this.defaultTransitionablePropertyValues[e]=new ps(i);this.defaultTransitioningPropertyValues[e]=n.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=r.possiblyEvaluate({})}}}vn("DataDrivenProperty",bs),vn("DataConstantProperty",vs),vn("CrossFadedDataDrivenProperty",ws),vn("CrossFadedProperty",Ts),vn("ColorRampProperty",Ss);const Ps="-transition";class As extends Z{constructor(t,e){if(super(),this.id=t.id,this.type=t.type,this._featureFilter={filter:()=>!0,needGeometry:!1},"custom"!==t.type&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,"background"!==t.type&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter),e.layout&&(this._unevaluatedLayout=new gs(e.layout)),e.paint)){this._transitionablePaint=new fs(e.paint);for(const e in t.paint)this.setPaintProperty(e,t.paint[e],{validate:!1});for(const e in t.layout)this.setLayoutProperty(e,t.layout[e],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new xs(e.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)}setLayoutProperty(t,e,i={}){null!=e&&this._validate(_n,`layers.${this.id}.layout.${t}`,t,e,i)||("visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e)}getPaintProperty(t){return t.endsWith(Ps)?this._transitionablePaint.getTransition(t.slice(0,-11)):this._transitionablePaint.getValue(t)}setPaintProperty(t,e,i={}){if(null!=e&&this._validate(mn,`layers.${this.id}.paint.${t}`,t,e,i))return!1;if(t.endsWith(Ps))return this._transitionablePaint.setTransition(t.slice(0,-11),e||void 0),!1;{const i=this._transitionablePaint._values[t],r="cross-faded-data-driven"===i.property.specification["property-type"],n=i.value.isDataDriven(),s=i.value;this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t);const a=this._transitionablePaint._values[t].value;return a.isDataDriven()||n||r||this._handleOverridablePaintPropertyUpdate(t,s,a)}}_handleSpecialPaintPropertyUpdate(t){}_handleOverridablePaintPropertyUpdate(t,e,i){return!1}isHidden(t){return!!(this.minzoom&&t<this.minzoom)||!!(this.maxzoom&&t>=this.maxzoom)||"none"===this.visibility}updateTransitions(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)}serialize(){const t={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),v(t,(t,e)=>!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length))}_validate(t,e,i,r,n={}){return(!n||!1!==n.validate)&&gn(this,t.call(dn,{key:e,layerType:this.type,objectKey:i,value:r,styleSpec:G,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const t in this.paint._values){const e=this.paint.get(t);if(e instanceof ys&&nr(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1}}const Ms={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class ks{constructor(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class Cs{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}}static deserialize(t){const e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(t){this.reserve(t),this.length=t}reserve(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const e=this.uint8;this._refreshViews(),e&&this.uint8.set(e)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function zs(t,e=1){let i=0,r=0;return{members:t.map(t=>{const n=Ms[t.type].BYTES_PER_ELEMENT,s=i=Es(i,Math.max(e,n)),a=t.components||1;return r=Math.max(r,n),i+=n*a,{name:t.name,type:t.type,components:a,offset:s}}),size:Es(i,Math.max(r,e)),alignment:e}}function Es(t,e){return Math.ceil(t/e)*e}class Ds extends Cs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e){const i=this.length;return this.resize(i+1),this.emplace(i,t,e)}emplace(t,e,i){const r=2*t;return this.int16[r+0]=e,this.int16[r+1]=i,t}}Ds.prototype.bytesPerElement=4,vn("StructArrayLayout2i4",Ds);class Ls extends Cs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i){const r=this.length;return this.resize(r+1),this.emplace(r,t,e,i)}emplace(t,e,i,r){const n=3*t;return this.int16[n+0]=e,this.int16[n+1]=i,this.int16[n+2]=r,t}}Ls.prototype.bytesPerElement=6,vn("StructArrayLayout3i6",Ls);class Rs extends Cs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,r){const n=this.length;return this.resize(n+1),this.emplace(n,t,e,i,r)}emplace(t,e,i,r,n){const s=4*t;return this.int16[s+0]=e,this.int16[s+1]=i,this.int16[s+2]=r,this.int16[s+3]=n,t}}Rs.prototype.bytesPerElement=8,vn("StructArrayLayout4i8",Rs);class Bs extends Cs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,r,n,s){const a=this.length;return this.resize(a+1),this.emplace(a,t,e,i,r,n,s)}emplace(t,e,i,r,n,s,a){const o=6*t;return this.int16[o+0]=e,this.int16[o+1]=i,this.int16[o+2]=r,this.int16[o+3]=n,this.int16[o+4]=s,this.int16[o+5]=a,t}}Bs.prototype.bytesPerElement=12,vn("StructArrayLayout2i4i12",Bs);class Fs extends Cs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,r,n,s){const a=this.length;return this.resize(a+1),this.emplace(a,t,e,i,r,n,s)}emplace(t,e,i,r,n,s,a){const o=4*t,l=8*t;return this.int16[o+0]=e,this.int16[o+1]=i,this.uint8[l+4]=r,this.uint8[l+5]=n,this.uint8[l+6]=s,this.uint8[l+7]=a,t}}Fs.prototype.bytesPerElement=8,vn("StructArrayLayout2i4ub8",Fs);class Os extends Cs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e){const i=this.length;return this.resize(i+1),this.emplace(i,t,e)}emplace(t,e,i){const r=2*t;return this.float32[r+0]=e,this.float32[r+1]=i,t}}Os.prototype.bytesPerElement=8,vn("StructArrayLayout2f8",Os);class Vs extends Cs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,i,r,n,s,a,o,l,c){const h=this.length;return this.resize(h+1),this.emplace(h,t,e,i,r,n,s,a,o,l,c)}emplace(t,e,i,r,n,s,a,o,l,c,h){const u=10*t;return this.uint16[u+0]=e,this.uint16[u+1]=i,this.uint16[u+2]=r,this.uint16[u+3]=n,this.uint16[u+4]=s,this.uint16[u+5]=a,this.uint16[u+6]=o,this.uint16[u+7]=l,this.uint16[u+8]=c,this.uint16[u+9]=h,t}}Vs.prototype.bytesPerElement=20,vn("StructArrayLayout10ui20",Vs);class Ns extends Cs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,i,r,n,s,a,o,l,c,h,u){const d=this.length;return this.resize(d+1),this.emplace(d,t,e,i,r,n,s,a,o,l,c,h,u)}emplace(t,e,i,r,n,s,a,o,l,c,h,u,d){const p=12*t;return this.int16[p+0]=e,this.int16[p+1]=i,this.int16[p+2]=r,this.int16[p+3]=n,this.uint16[p+4]=s,this.uint16[p+5]=a,this.uint16[p+6]=o,this.uint16[p+7]=l,this.int16[p+8]=c,this.int16[p+9]=h,this.int16[p+10]=u,this.int16[p+11]=d,t}}Ns.prototype.bytesPerElement=24,vn("StructArrayLayout4i4ui4i24",Ns);class js extends Cs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,i){const r=this.length;return this.resize(r+1),this.emplace(r,t,e,i)}emplace(t,e,i,r){const n=3*t;return this.float32[n+0]=e,this.float32[n+1]=i,this.float32[n+2]=r,t}}js.prototype.bytesPerElement=12,vn("StructArrayLayout3f12",js);class Us extends Cs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t){const e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){return this.uint32[1*t+0]=e,t}}Us.prototype.bytesPerElement=4,vn("StructArrayLayout1ul4",Us);class $s extends Cs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,i,r,n,s,a,o,l){const c=this.length;return this.resize(c+1),this.emplace(c,t,e,i,r,n,s,a,o,l)}emplace(t,e,i,r,n,s,a,o,l,c){const h=10*t,u=5*t;return this.int16[h+0]=e,this.int16[h+1]=i,this.int16[h+2]=r,this.int16[h+3]=n,this.int16[h+4]=s,this.int16[h+5]=a,this.uint32[u+3]=o,this.uint16[h+8]=l,this.uint16[h+9]=c,t}}$s.prototype.bytesPerElement=20,vn("StructArrayLayout6i1ul2ui20",$s);class qs extends Cs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,r,n,s){const a=this.length;return this.resize(a+1),this.emplace(a,t,e,i,r,n,s)}emplace(t,e,i,r,n,s,a){const o=6*t;return this.int16[o+0]=e,this.int16[o+1]=i,this.int16[o+2]=r,this.int16[o+3]=n,this.int16[o+4]=s,this.int16[o+5]=a,t}}qs.prototype.bytesPerElement=12,vn("StructArrayLayout2i2i2i12",qs);class Zs extends Cs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,r,n){const s=this.length;return this.resize(s+1),this.emplace(s,t,e,i,r,n)}emplace(t,e,i,r,n,s){const a=4*t,o=8*t;return this.float32[a+0]=e,this.float32[a+1]=i,this.float32[a+2]=r,this.int16[o+6]=n,this.int16[o+7]=s,t}}Zs.prototype.bytesPerElement=16,vn("StructArrayLayout2f1f2i16",Zs);class Gs extends Cs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,e,i,r,n,s){const a=this.length;return this.resize(a+1),this.emplace(a,t,e,i,r,n,s)}emplace(t,e,i,r,n,s,a){const o=16*t,l=4*t,c=8*t;return this.uint8[o+0]=e,this.uint8[o+1]=i,this.float32[l+1]=r,this.float32[l+2]=n,this.int16[c+6]=s,this.int16[c+7]=a,t}}Gs.prototype.bytesPerElement=16,vn("StructArrayLayout2ub2f2i16",Gs);class Hs extends Cs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,i){const r=this.length;return this.resize(r+1),this.emplace(r,t,e,i)}emplace(t,e,i,r){const n=3*t;return this.uint16[n+0]=e,this.uint16[n+1]=i,this.uint16[n+2]=r,t}}Hs.prototype.bytesPerElement=6,vn("StructArrayLayout3ui6",Hs);class Xs extends Cs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,i,r,n,s,a,o,l,c,h,u,d,p,f,m,_){const g=this.length;return this.resize(g+1),this.emplace(g,t,e,i,r,n,s,a,o,l,c,h,u,d,p,f,m,_)}emplace(t,e,i,r,n,s,a,o,l,c,h,u,d,p,f,m,_,g){const y=24*t,x=12*t,v=48*t;return this.int16[y+0]=e,this.int16[y+1]=i,this.uint16[y+2]=r,this.uint16[y+3]=n,this.uint32[x+2]=s,this.uint32[x+3]=a,this.uint32[x+4]=o,this.uint16[y+10]=l,this.uint16[y+11]=c,this.uint16[y+12]=h,this.float32[x+7]=u,this.float32[x+8]=d,this.uint8[v+36]=p,this.uint8[v+37]=f,this.uint8[v+38]=m,this.uint32[x+10]=_,this.int16[y+22]=g,t}}Xs.prototype.bytesPerElement=48,vn("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Xs);class Ws extends Cs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,i,r,n,s,a,o,l,c,h,u,d,p,f,m,_,g,y,x,v,b,w,T,S,I,P,A){const M=this.length;return this.resize(M+1),this.emplace(M,t,e,i,r,n,s,a,o,l,c,h,u,d,p,f,m,_,g,y,x,v,b,w,T,S,I,P,A)}emplace(t,e,i,r,n,s,a,o,l,c,h,u,d,p,f,m,_,g,y,x,v,b,w,T,S,I,P,A,M){const k=32*t,C=16*t;return this.int16[k+0]=e,this.int16[k+1]=i,this.int16[k+2]=r,this.int16[k+3]=n,this.int16[k+4]=s,this.int16[k+5]=a,this.int16[k+6]=o,this.int16[k+7]=l,this.uint16[k+8]=c,this.uint16[k+9]=h,this.uint16[k+10]=u,this.uint16[k+11]=d,this.uint16[k+12]=p,this.uint16[k+13]=f,this.uint16[k+14]=m,this.uint16[k+15]=_,this.uint16[k+16]=g,this.uint16[k+17]=y,this.uint16[k+18]=x,this.uint16[k+19]=v,this.uint16[k+20]=b,this.uint16[k+21]=w,this.uint16[k+22]=T,this.uint32[C+12]=S,this.float32[C+13]=I,this.float32[C+14]=P,this.uint16[k+30]=A,this.uint16[k+31]=M,t}}Ws.prototype.bytesPerElement=64,vn("StructArrayLayout8i15ui1ul2f2ui64",Ws);class Ks extends Cs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t){const e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){return this.float32[1*t+0]=e,t}}Ks.prototype.bytesPerElement=4,vn("StructArrayLayout1f4",Ks);class Js extends Cs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,i){const r=this.length;return this.resize(r+1),this.emplace(r,t,e,i)}emplace(t,e,i,r){const n=3*t;return this.uint16[6*t+0]=e,this.float32[n+1]=i,this.float32[n+2]=r,t}}Js.prototype.bytesPerElement=12,vn("StructArrayLayout1ui2f12",Js);class Ys extends Cs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e,i){const r=this.length;return this.resize(r+1),this.emplace(r,t,e,i)}emplace(t,e,i,r){const n=4*t;return this.uint32[2*t+0]=e,this.uint16[n+2]=i,this.uint16[n+3]=r,t}}Ys.prototype.bytesPerElement=8,vn("StructArrayLayout1ul2ui8",Ys);class Qs extends Cs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,e){const i=this.length;return this.resize(i+1),this.emplace(i,t,e)}emplace(t,e,i){const r=2*t;return this.uint16[r+0]=e,this.uint16[r+1]=i,t}}Qs.prototype.bytesPerElement=4,vn("StructArrayLayout2ui4",Qs);class ta extends Cs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t){const e=this.length;return this.resize(e+1),this.emplace(e,t)}emplace(t,e){return this.uint16[1*t+0]=e,t}}ta.prototype.bytesPerElement=2,vn("StructArrayLayout1ui2",ta);class ea extends Cs{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,e,i,r){const n=this.length;return this.resize(n+1),this.emplace(n,t,e,i,r)}emplace(t,e,i,r,n){const s=4*t;return this.float32[s+0]=e,this.float32[s+1]=i,this.float32[s+2]=r,this.float32[s+3]=n,t}}ea.prototype.bytesPerElement=16,vn("StructArrayLayout4f16",ea);class ia extends ks{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new s(this.anchorPointX,this.anchorPointY)}}ia.prototype.size=20;class ra extends $s{get(t){return new ia(this,t)}}vn("CollisionBoxArray",ra);class na extends ks{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(t){this._structArray.uint8[this._pos1+37]=t}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(t){this._structArray.uint8[this._pos1+38]=t}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(t){this._structArray.uint32[this._pos4+10]=t}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}na.prototype.size=48;class sa extends Xs{get(t){return new na(this,t)}}vn("PlacedSymbolArray",sa);class aa extends ks{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(t){this._structArray.uint32[this._pos4+12]=t}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}aa.prototype.size=64;class oa extends Ws{get(t){return new aa(this,t)}}vn("SymbolInstanceArray",oa);class la extends Ks{getoffsetX(t){return this.float32[1*t+0]}}vn("GlyphOffsetArray",la);class ca extends Ls{getx(t){return this.int16[3*t+0]}gety(t){return this.int16[3*t+1]}gettileUnitDistanceFromAnchor(t){return this.int16[3*t+2]}}vn("SymbolLineVertexArray",ca);class ha extends ks{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}}ha.prototype.size=12;class ua extends Js{get(t){return new ha(this,t)}}vn("TextAnchorOffsetArray",ua);class da extends ks{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}}da.prototype.size=8;class pa extends Ys{get(t){return new da(this,t)}}vn("FeatureIndexArray",pa);class fa extends Ds{}class ma extends Ds{}class _a extends Ds{}class ga extends Bs{}class ya extends Fs{}class xa extends Os{}class va extends Vs{}class ba extends Ns{}class wa extends js{}class Ta extends Us{}class Sa extends qs{}class Ia extends Gs{}class Pa extends Hs{}class Aa extends Qs{}const Ma=zs([{name:"a_pos",components:2,type:"Int16"}],4),{members:ka}=Ma;class Ca{constructor(t=[]){this.segments=t}prepareSegment(t,e,i,r){let n=this.segments[this.segments.length-1];return t>Ca.MAX_VERTEX_ARRAY_LENGTH&&T(`Max vertices per segment is ${Ca.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${t}`),(!n||n.vertexLength+t>Ca.MAX_VERTEX_ARRAY_LENGTH||n.sortKey!==r)&&(n={vertexOffset:e.length,primitiveOffset:i.length,vertexLength:0,primitiveLength:0},void 0!==r&&(n.sortKey=r),this.segments.push(n)),n}get(){return this.segments}destroy(){for(const t of this.segments)for(const e in t.vaos)t.vaos[e].destroy()}static simpleSegment(t,e,i,r){return new Ca([{vertexOffset:t,primitiveOffset:e,vertexLength:i,primitiveLength:r,vaos:{},sortKey:0}])}}function za(t,e){return 256*(t=m(Math.floor(t),0,255))+m(Math.floor(e),0,255)}Ca.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,vn("SegmentVector",Ca);const Ea=zs([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]);var Da={exports:{}},La={exports:{}};La.exports=function(t,e){var i,r,n,s,a,o,l,c;for(r=t.length-(i=3&t.length),n=e,a=3432918353,o=461845907,c=0;c<r;)l=255&t.charCodeAt(c)|(255&t.charCodeAt(++c))<<8|(255&t.charCodeAt(++c))<<16|(255&t.charCodeAt(++c))<<24,++c,n=27492+(65535&(s=5*(65535&(n=(n^=l=(65535&(l=(l=(65535&l)*a+(((l>>>16)*a&65535)<<16)&4294967295)<<15|l>>>17))*o+(((l>>>16)*o&65535)<<16)&4294967295)<<13|n>>>19))+((5*(n>>>16)&65535)<<16)&4294967295))+((58964+(s>>>16)&65535)<<16);switch(l=0,i){case 3:l^=(255&t.charCodeAt(c+2))<<16;case 2:l^=(255&t.charCodeAt(c+1))<<8;case 1:n^=l=(65535&(l=(l=(65535&(l^=255&t.charCodeAt(c)))*a+(((l>>>16)*a&65535)<<16)&4294967295)<<15|l>>>17))*o+(((l>>>16)*o&65535)<<16)&4294967295}return n^=t.length,n=2246822507*(65535&(n^=n>>>16))+((2246822507*(n>>>16)&65535)<<16)&4294967295,n=3266489909*(65535&(n^=n>>>13))+((3266489909*(n>>>16)&65535)<<16)&4294967295,(n^=n>>>16)>>>0};var Ra=La.exports,Ba={exports:{}};Ba.exports=function(t,e){for(var i,r=t.length,n=e^r,s=0;r>=4;)i=1540483477*(65535&(i=255&t.charCodeAt(s)|(255&t.charCodeAt(++s))<<8|(255&t.charCodeAt(++s))<<16|(255&t.charCodeAt(++s))<<24))+((1540483477*(i>>>16)&65535)<<16),n=1540483477*(65535&n)+((1540483477*(n>>>16)&65535)<<16)^(i=1540483477*(65535&(i^=i>>>24))+((1540483477*(i>>>16)&65535)<<16)),r-=4,++s;switch(r){case 3:n^=(255&t.charCodeAt(s+2))<<16;case 2:n^=(255&t.charCodeAt(s+1))<<8;case 1:n=1540483477*(65535&(n^=255&t.charCodeAt(s)))+((1540483477*(n>>>16)&65535)<<16)}return n=1540483477*(65535&(n^=n>>>13))+((1540483477*(n>>>16)&65535)<<16),(n^=n>>>15)>>>0};var Fa=Ra,Oa=Ba.exports;Da.exports=Fa,Da.exports.murmur3=Fa,Da.exports.murmur2=Oa;var Va=i(Da.exports);class Na{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(t,e,i,r){this.ids.push(ja(t)),this.positions.push(e,i,r)}getPositions(t){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const e=ja(t);let i=0,r=this.ids.length-1;for(;i<r;){const t=i+r>>1;this.ids[t]>=e?r=t:i=t+1}const n=[];for(;this.ids[i]===e;)n.push({index:this.positions[3*i],start:this.positions[3*i+1],end:this.positions[3*i+2]}),i++;return n}static serialize(t,e){const i=new Float64Array(t.ids),r=new Uint32Array(t.positions);return Ua(i,r,0,i.length-1),e&&e.push(i.buffer,r.buffer),{ids:i,positions:r}}static deserialize(t){const e=new Na;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e}}function ja(t){const e=+t;return!isNaN(e)&&e<=Number.MAX_SAFE_INTEGER?e:Va(String(t))}function Ua(t,e,i,r){for(;i<r;){const n=t[i+r>>1];let s=i-1,a=r+1;for(;;){do{s++}while(t[s]<n);do{a--}while(t[a]>n);if(s>=a)break;$a(t,s,a),$a(e,3*s,3*a),$a(e,3*s+1,3*a+1),$a(e,3*s+2,3*a+2)}a-i<r-a?(Ua(t,e,i,a),i=a+1):(Ua(t,e,a+1,r),r=a)}}function $a(t,e,i){const r=t[e];t[e]=t[i],t[i]=r}vn("FeaturePositionMap",Na);class qa{constructor(t,e){this.gl=t.gl,this.location=e}}class Za extends qa{constructor(t,e){super(t,e),this.current=0}set(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t))}}class Ga extends qa{constructor(t,e){super(t,e),this.current=[0,0,0,0]}set(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]&&t[3]===this.current[3]||(this.current=t,this.gl.uniform4f(this.location,t[0],t[1],t[2],t[3]))}}class Ha extends qa{constructor(t,e){super(t,e),this.current=Ht.transparent}set(t){t.r===this.current.r&&t.g===this.current.g&&t.b===this.current.b&&t.a===this.current.a||(this.current=t,this.gl.uniform4f(this.location,t.r,t.g,t.b,t.a))}}const Xa=new Float32Array(16);function Wa(t){return[za(255*t.r,255*t.g),za(255*t.b,255*t.a)]}class Ka{constructor(t,e,i){this.value=t,this.uniformNames=e.map(t=>`u_${t}`),this.type=i}setUniform(t,e,i){t.set(i.constantOr(this.value))}getBinding(t,e,i){return"color"===this.type?new Ha(t,e):new Za(t,e)}}class Ja{constructor(t,e){this.uniformNames=e.map(t=>`u_${t}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(t,e){this.pixelRatioFrom=e.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=e.tlbr,this.patternTo=t.tlbr}setUniform(t,e,i,r){const n="u_pattern_to"===r?this.patternTo:"u_pattern_from"===r?this.patternFrom:"u_pixel_ratio_to"===r?this.pixelRatioTo:"u_pixel_ratio_from"===r?this.pixelRatioFrom:null;n&&t.set(n)}getBinding(t,e,i){return"u_pattern"===i.substr(0,9)?new Ga(t,e):new Za(t,e)}}class Ya{constructor(t,e,i,r){this.expression=t,this.type=i,this.maxValue=0,this.paintVertexAttributes=e.map(t=>({name:`a_${t}`,type:"Float32",components:"color"===i?2:1,offset:0})),this.paintVertexArray=new r}populatePaintArray(t,e,i,r,n){const s=this.paintVertexArray.length,a=this.expression.evaluate(new us(0),e,{},r,[],n);this.paintVertexArray.resize(t),this._setPaintValue(s,t,a)}updatePaintArray(t,e,i,r){const n=this.expression.evaluate({zoom:0},i,r);this._setPaintValue(t,e,n)}_setPaintValue(t,e,i){if("color"===this.type){const r=Wa(i);for(let i=t;i<e;i++)this.paintVertexArray.emplace(i,r[0],r[1])}else{for(let r=t;r<e;r++)this.paintVertexArray.emplace(r,i);this.maxValue=Math.max(this.maxValue,Math.abs(i))}}upload(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class Qa{constructor(t,e,i,r,n,s){this.expression=t,this.uniformNames=e.map(t=>`u_${t}_t`),this.type=i,this.useIntegerZoom=r,this.zoom=n,this.maxValue=0,this.paintVertexAttributes=e.map(t=>({name:`a_${t}`,type:"Float32",components:"color"===i?4:2,offset:0})),this.paintVertexArray=new s}populatePaintArray(t,e,i,r,n){const s=this.expression.evaluate(new us(this.zoom),e,{},r,[],n),a=this.expression.evaluate(new us(this.zoom+1),e,{},r,[],n),o=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(o,t,s,a)}updatePaintArray(t,e,i,r){const n=this.expression.evaluate({zoom:this.zoom},i,r),s=this.expression.evaluate({zoom:this.zoom+1},i,r);this._setPaintValue(t,e,n,s)}_setPaintValue(t,e,i,r){if("color"===this.type){const n=Wa(i),s=Wa(r);for(let i=t;i<e;i++)this.paintVertexArray.emplace(i,n[0],n[1],s[0],s[1])}else{for(let n=t;n<e;n++)this.paintVertexArray.emplace(n,i,r);this.maxValue=Math.max(this.maxValue,Math.abs(i),Math.abs(r))}}upload(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(t,e){const i=this.useIntegerZoom?Math.floor(e.zoom):e.zoom,r=m(this.expression.interpolationFactor(i,this.zoom,this.zoom+1),0,1);t.set(r)}getBinding(t,e,i){return new Za(t,e)}}class to{constructor(t,e,i,r,n,s){this.expression=t,this.type=e,this.useIntegerZoom=i,this.zoom=r,this.layerId=s,this.zoomInPaintVertexArray=new n,this.zoomOutPaintVertexArray=new n}populatePaintArray(t,e,i){const r=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(t),this.zoomOutPaintVertexArray.resize(t),this._setPaintValues(r,t,e.patterns&&e.patterns[this.layerId],i)}updatePaintArray(t,e,i,r,n){this._setPaintValues(t,e,i.patterns&&i.patterns[this.layerId],n)}_setPaintValues(t,e,i,r){if(!r||!i)return;const{min:n,mid:s,max:a}=i,o=r[n],l=r[s],c=r[a];if(o&&l&&c)for(let i=t;i<e;i++)this.zoomInPaintVertexArray.emplace(i,l.tl[0],l.tl[1],l.br[0],l.br[1],o.tl[0],o.tl[1],o.br[0],o.br[1],l.pixelRatio,o.pixelRatio),this.zoomOutPaintVertexArray.emplace(i,l.tl[0],l.tl[1],l.br[0],l.br[1],c.tl[0],c.tl[1],c.br[0],c.br[1],l.pixelRatio,c.pixelRatio)}upload(t){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,Ea.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,Ea.members,this.expression.isStateDependent))}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class eo{constructor(t,e,i){this.binders={},this._buffers=[];const r=[];for(const n in t.paint._values){if(!i(n))continue;const s=t.paint.get(n);if(!(s instanceof ys&&nr(s.property.specification)))continue;const a=ro(n,t.type),o=s.value,l=s.property.specification.type,c=s.property.useIntegerZoom,h=s.property.specification["property-type"],u="cross-faded"===h||"cross-faded-data-driven"===h;if("constant"===o.kind)this.binders[n]=u?new Ja(o.value,a):new Ka(o.value,a,l),r.push(`/u_${n}`);else if("source"===o.kind||u){const i=no(n,l,"source");this.binders[n]=u?new to(o,l,c,e,i,t.id):new Ya(o,a,l,i),r.push(`/a_${n}`)}else{const t=no(n,l,"composite");this.binders[n]=new Qa(o,a,l,c,e,t),r.push(`/z_${n}`)}}this.cacheKey=r.sort().join("")}getMaxValue(t){const e=this.binders[t];return e instanceof Ya||e instanceof Qa?e.maxValue:0}populatePaintArrays(t,e,i,r,n){for(const s in this.binders){const a=this.binders[s];(a instanceof Ya||a instanceof Qa||a instanceof to)&&a.populatePaintArray(t,e,i,r,n)}}setConstantPatternPositions(t,e){for(const i in this.binders){const r=this.binders[i];r instanceof Ja&&r.setConstantPatternPositions(t,e)}}updatePaintArrays(t,e,i,r,n){let s=!1;for(const a in t){const o=e.getPositions(a);for(const e of o){const o=i.feature(e.index);for(const i in this.binders){const l=this.binders[i];if((l instanceof Ya||l instanceof Qa||l instanceof to)&&!0===l.expression.isStateDependent){const c=r.paint.get(i);l.expression=c.value,l.updatePaintArray(e.start,e.end,o,t[a],n),s=!0}}}}return s}defines(){const t=[];for(const e in this.binders){const i=this.binders[e];(i instanceof Ka||i instanceof Ja)&&t.push(...i.uniformNames.map(t=>`#define HAS_UNIFORM_${t}`))}return t}getBinderAttributes(){const t=[];for(const e in this.binders){const i=this.binders[e];if(i instanceof Ya||i instanceof Qa)for(let e=0;e<i.paintVertexAttributes.length;e++)t.push(i.paintVertexAttributes[e].name);else if(i instanceof to)for(let e=0;e<Ea.members.length;e++)t.push(Ea.members[e].name)}return t}getBinderUniforms(){const t=[];for(const e in this.binders){const i=this.binders[e];if(i instanceof Ka||i instanceof Ja||i instanceof Qa)for(const e of i.uniformNames)t.push(e)}return t}getPaintVertexBuffers(){return this._buffers}getUniforms(t,e){const i=[];for(const r in this.binders){const n=this.binders[r];if(n instanceof Ka||n instanceof Ja||n instanceof Qa)for(const s of n.uniformNames)if(e[s]){const a=n.getBinding(t,e[s],s);i.push({name:s,property:r,binding:a})}}return i}setUniforms(t,e,i,r){for(const{name:t,property:n,binding:s}of e)this.binders[n].setUniform(s,r,i.get(n),t)}updatePaintBuffers(t){this._buffers=[];for(const e in this.binders){const i=this.binders[e];if(t&&i instanceof to){const e=2===t.fromScale?i.zoomInPaintVertexBuffer:i.zoomOutPaintVertexBuffer;e&&this._buffers.push(e)}else(i instanceof Ya||i instanceof Qa)&&i.paintVertexBuffer&&this._buffers.push(i.paintVertexBuffer)}}upload(t){for(const e in this.binders){const i=this.binders[e];(i instanceof Ya||i instanceof Qa||i instanceof to)&&i.upload(t)}this.updatePaintBuffers()}destroy(){for(const t in this.binders){const e=this.binders[t];(e instanceof Ya||e instanceof Qa||e instanceof to)&&e.destroy()}}}class io{constructor(t,e,i=()=>!0){this.programConfigurations={};for(const r of t)this.programConfigurations[r.id]=new eo(r,e,i);this.needsUpload=!1,this._featureMap=new Na,this._bufferOffset=0}populatePaintArrays(t,e,i,r,n,s){for(const i in this.programConfigurations)this.programConfigurations[i].populatePaintArrays(t,e,r,n,s);void 0!==e.id&&this._featureMap.add(e.id,i,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0}updatePaintArrays(t,e,i,r){for(const n of i)this.needsUpload=this.programConfigurations[n.id].updatePaintArrays(t,this._featureMap,e,n,r)||this.needsUpload}get(t){return this.programConfigurations[t]}upload(t){if(this.needsUpload){for(const e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}}destroy(){for(const t in this.programConfigurations)this.programConfigurations[t].destroy()}}function ro(t,e){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[t]||[t.replace(`${e}
313-`,"").replace(/-/g,"_")]}function no(t,e,i){const r={color:{source:Os,composite:ea},number:{source:Ks,composite:Os}},n=function(t){return{"line-pattern":{source:va,composite:va},"fill-pattern":{source:va,composite:va},"fill-extrusion-pattern":{source:va,composite:va}}[t]}(t);return n&&n[i]||r[e][i]}vn("ConstantBinder",Ka),vn("CrossFadedConstantBinder",Ja),vn("SourceExpressionBinder",Ya),vn("CrossFadedCompositeBinder",to),vn("CompositeExpressionBinder",Qa),vn("ProgramConfiguration",eo,{omit:["_buffers"]}),vn("ProgramConfigurationSet",io);const so=8192,ao=Math.pow(2,14)-1,oo=-ao-1;function lo(t){const e=so/t.extent,i=t.loadGeometry();for(let t=0;t<i.length;t++){const r=i[t];for(let t=0;t<r.length;t++){const i=r[t],n=Math.round(i.x*e),s=Math.round(i.y*e);i.x=m(n,oo,ao),i.y=m(s,oo,ao),(n<i.x||n>i.x+1||s<i.y||s>i.y+1)&&T("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return i}function co(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?lo(t):[]}}function ho(t,e,i,r,n){t.emplaceBack(2*e+(r+1)/2,2*i+(n+1)/2)}class uo{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(t=>t.id),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new ma,this.indexArray=new Pa,this.segments=new Ca,this.programConfigurations=new io(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter(t=>t.isStateDependent()).map(t=>t.id)}populate(t,e,i){const r=this.layers[0],n=[];let s=null,a=!1;"circle"===r.type&&(s=r.layout.get("circle-sort-key"),a=!s.isConstant());for(const{feature:e,id:r,index:o,sourceLayerIndex:l}of t){const t=this.layers[0]._featureFilter.needGeometry,c=co(e,t);if(!this.layers[0]._featureFilter.filter(new us(this.zoom),c,i))continue;const h=a?s.evaluate(c,{},i):void 0,u={id:r,properties:e.properties,type:e.type,sourceLayerIndex:l,index:o,geometry:t?c.geometry:lo(e),patterns:{},sortKey:h};n.push(u)}a&&n.sort((t,e)=>t.sortKey-e.sortKey);for(const r of n){const{geometry:n,index:s,sourceLayerIndex:a}=r,o=t[s].feature;this.addFeature(r,n,s,i),e.featureIndex.insert(o,n,s,a,this.index)}}update(t,e,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,i)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ka),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(t,e,i,r){for(const i of e)for(const e of i){const i=e.x,r=e.y;if(i<0||i>=so||r<0||r>=so)continue;const n=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),s=n.vertexLength;ho(this.layoutVertexArray,i,r,-1,-1),ho(this.layoutVertexArray,i,r,1,-1),ho(this.layoutVertexArray,i,r,1,1),ho(this.layoutVertexArray,i,r,-1,1),this.indexArray.emplaceBack(s,s+1,s+2),this.indexArray.emplaceBack(s,s+3,s+2),n.vertexLength+=4,n.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,{},r)}}function po(t,e){for(let i=0;i<t.length;i++)if(wo(e,t[i]))return!0;for(let i=0;i<e.length;i++)if(wo(t,e[i]))return!0;return!!go(t,e)}function fo(t,e,i){return!!wo(t,e)||!!xo(e,t,i)}function mo(t,e){if(1===t.length)return bo(e,t[0]);for(let i=0;i<e.length;i++){const r=e[i];for(let e=0;e<r.length;e++)if(wo(t,r[e]))return!0}for(let i=0;i<t.length;i++)if(bo(e,t[i]))return!0;for(let i=0;i<e.length;i++)if(go(t,e[i]))return!0;return!1}function _o(t,e,i){if(t.length>1){if(go(t,e))return!0;for(let r=0;r<e.length;r++)if(xo(e[r],t,i))return!0}for(let r=0;r<t.length;r++)if(xo(t[r],e,i))return!0;return!1}function go(t,e){if(0===t.length||0===e.length)return!1;for(let i=0;i<t.length-1;i++){const r=t[i],n=t[i+1];for(let t=0;t<e.length-1;t++)if(yo(r,n,e[t],e[t+1]))return!0}return!1}function yo(t,e,i,r){return S(t,i,r)!==S(e,i,r)&&S(t,e,i)!==S(t,e,r)}function xo(t,e,i){const r=i*i;if(1===e.length)return t.distSqr(e[0])<r;for(let i=1;i<e.length;i++)if(vo(t,e[i-1],e[i])<r)return!0;return!1}
vendor: 47,090 bytes, line 313
313function vo(t,e,i){const r=e.distSqr(i);if(0===r)return t.distSqr(e);const n=((t.x-e.x)*(i.x-e.x)+(t.y-e.y)*(i.y-e.y))/r;return t.distSqr(n<0?e:n>1?i:i.sub(e)._mult(n)._add(e))}function bo(t,e){let i,r,n,s=!1;for(let a=0;a<t.length;a++){i=t[a];for(let t=0,a=i.length-1;t<i.length;a=t++)r=i[t],n=i[a],r.y>e.y!=n.y>e.y&&e.x<(n.x-r.x)*(e.y-r.y)/(n.y-r.y)+r.x&&(s=!s)}return s}function wo(t,e){let i=!1;for(let r=0,n=t.length-1;r<t.length;n=r++){const s=t[r],a=t[n];s.y>e.y!=a.y>e.y&&e.x<(a.x-s.x)*(e.y-s.y)/(a.y-s.y)+s.x&&(i=!i)}return i}function To(t,e,i){const r=i[0],n=i[2];if(t.x<r.x&&e.x<r.x||t.x>n.x&&e.x>n.x||t.y<r.y&&e.y<r.y||t.y>n.y&&e.y>n.y)return!1;const s=S(t,e,i[0]);return s!==S(t,e,i[1])||s!==S(t,e,i[2])||s!==S(t,e,i[3])}function So(t,e,i){const r=e.paint.get(t).value;return"constant"===r.kind?r.value:i.programConfigurations.get(e.id).getMaxValue(t)}function Io(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Po(t,e,i,r,n){if(!e[0]&&!e[1])return t;const a=s.convert(e)._mult(n);"viewport"===i&&a._rotate(-r);const o=[];for(let e=0;e<t.length;e++)o.push(t[e].sub(a));return o}let Ao,Mo;vn("CircleBucket",uo,{omit:["layers"]});var ko={get paint(){return Mo=Mo||new Is({"circle-radius":new bs(G.paint_circle["circle-radius"]),"circle-color":new bs(G.paint_circle["circle-color"]),"circle-blur":new bs(G.paint_circle["circle-blur"]),"circle-opacity":new bs(G.paint_circle["circle-opacity"]),"circle-translate":new vs(G.paint_circle["circle-translate"]),"circle-translate-anchor":new vs(G.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new vs(G.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new vs(G.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new bs(G.paint_circle["circle-stroke-width"]),"circle-stroke-color":new bs(G.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new bs(G.paint_circle["circle-stroke-opacity"])})},get layout(){return Ao=Ao||new Is({"circle-sort-key":new bs(G.layout_circle["circle-sort-key"])})}},Co=1e-6,zo="undefined"!=typeof Float32Array?Float32Array:Array;function Eo(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Do(t,e,i){var r=e[0],n=e[1],s=e[2],a=e[3],o=e[4],l=e[5],c=e[6],h=e[7],u=e[8],d=e[9],p=e[10],f=e[11],m=e[12],_=e[13],g=e[14],y=e[15],x=i[0],v=i[1],b=i[2],w=i[3];return t[0]=x*r+v*o+b*u+w*m,t[1]=x*n+v*l+b*d+w*_,t[2]=x*s+v*c+b*p+w*g,t[3]=x*a+v*h+b*f+w*y,t[4]=(x=i[4])*r+(v=i[5])*o+(b=i[6])*u+(w=i[7])*m,t[5]=x*n+v*l+b*d+w*_,t[6]=x*s+v*c+b*p+w*g,t[7]=x*a+v*h+b*f+w*y,t[8]=(x=i[8])*r+(v=i[9])*o+(b=i[10])*u+(w=i[11])*m,t[9]=x*n+v*l+b*d+w*_,t[10]=x*s+v*c+b*p+w*g,t[11]=x*a+v*h+b*f+w*y,t[12]=(x=i[12])*r+(v=i[13])*o+(b=i[14])*u+(w=i[15])*m,t[13]=x*n+v*l+b*d+w*_,t[14]=x*s+v*c+b*p+w*g,t[15]=x*a+v*h+b*f+w*y,t}Math.hypot||(Math.hypot=function(){for(var t=0,e=arguments.length;e--;)t+=arguments[e]*arguments[e];return Math.sqrt(t)});var Lo,Ro=Do;function Bo(t,e,i){var r=e[0],n=e[1],s=e[2],a=e[3];return t[0]=i[0]*r+i[4]*n+i[8]*s+i[12]*a,t[1]=i[1]*r+i[5]*n+i[9]*s+i[13]*a,t[2]=i[2]*r+i[6]*n+i[10]*s+i[14]*a,t[3]=i[3]*r+i[7]*n+i[11]*s+i[15]*a,t}Lo=new zo(4),zo!=Float32Array&&(Lo[0]=0,Lo[1]=0,Lo[2]=0,Lo[3]=0);class Fo extends As{constructor(t){super(t,ko)}createBucket(t){return new uo(t)}queryRadius(t){const e=t;return So("circle-radius",this,e)+So("circle-stroke-width",this,e)+Io(this.paint.get("circle-translate"))}queryIntersectsFeature(t,e,i,r,n,s,a,o){const l=Po(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),s.angle,a),c=this.paint.get("circle-radius").evaluate(e,i)+this.paint.get("circle-stroke-width").evaluate(e,i),h="map"===this.paint.get("circle-pitch-alignment"),u=h?l:function(t,e){return t.map(t=>Oo(t,e))}(l,o),d=h?c*a:c;for(const t of r)for(const e of t){const t=h?e:Oo(e,o);let i=d;const r=Bo([],[e.x,e.y,0,1],o);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?i*=r[3]/s.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(i*=s.cameraToCenterDistance/r[3]),fo(u,t,i))return!0}return!1}}function Oo(t,e){const i=Bo([],[t.x,t.y,0,1],e);return new s(i[0]/i[3],i[1]/i[3])}class Vo extends uo{}let No;vn("HeatmapBucket",Vo,{omit:["layers"]});var jo={get paint(){return No=No||new Is({"heatmap-radius":new bs(G.paint_heatmap["heatmap-radius"]),"heatmap-weight":new bs(G.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new vs(G.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Ss(G.paint_heatmap["heatmap-color"]),"heatmap-opacity":new vs(G.paint_heatmap["heatmap-opacity"])})}};function Uo(t,{width:e,height:i},r,n){if(n){if(n instanceof Uint8ClampedArray)n=new Uint8Array(n.buffer);else if(n.length!==e*i*r)throw new RangeError(`mismatched image size. expected: ${n.length} but got: ${e*i*r}`)}else n=new Uint8Array(e*i*r);return t.width=e,t.height=i,t.data=n,t}function $o(t,{width:e,height:i},r){if(e===t.width&&i===t.height)return;const n=Uo({},{width:e,height:i},r);qo(t,n,{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,e),height:Math.min(t.height,i)},r),t.width=e,t.height=i,t.data=n.data}function qo(t,e,i,r,n,s){if(0===n.width||0===n.height)return e;if(n.width>t.width||n.height>t.height||i.x>t.width-n.width||i.y>t.height-n.height)throw new RangeError("out of range source coordinates for image copy");if(n.width>e.width||n.height>e.height||r.x>e.width-n.width||r.y>e.height-n.height)throw new RangeError("out of range destination coordinates for image copy");const a=t.data,o=e.data;if(a===o)throw new Error("srcData equals dstData, so image is already copied");for(let l=0;l<n.height;l++){const c=((i.y+l)*t.width+i.x)*s,h=((r.y+l)*e.width+r.x)*s;for(let t=0;t<n.width*s;t++)o[h+t]=a[c+t]}return e}class Zo{constructor(t,e){Uo(this,t,1,e)}resize(t){$o(this,t,1)}clone(){return new Zo({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,e,i,r,n){qo(t,e,i,r,n,1)}}class Go{constructor(t,e){Uo(this,t,4,e)}resize(t){$o(this,t,4)}replace(t,e){e?this.data.set(t):this.data=t instanceof Uint8ClampedArray?new Uint8Array(t.buffer):t}clone(){return new Go({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,e,i,r,n){qo(t,e,i,r,n,4)}}function Ho(t){const e={},i=t.resolution||256,r=t.clips?t.clips.length:1,n=t.image||new Go({width:i,height:r});if(Math.log(i)/Math.LN2%1!=0)throw new Error(`width is not a power of 2 - ${i}`);const s=(i,r,s)=>{e[t.evaluationKey]=s;const a=t.expression.evaluate(e);n.data[i+r+0]=Math.floor(255*a.r/a.a),n.data[i+r+1]=Math.floor(255*a.g/a.a),n.data[i+r+2]=Math.floor(255*a.b/a.a),n.data[i+r+3]=Math.floor(255*a.a)};if(t.clips)for(let e=0,n=0;e<r;++e,n+=4*i)for(let r=0,a=0;r<i;r++,a+=4){const o=r/(i-1),{start:l,end:c}=t.clips[e];s(n,a,l*(1-o)+c*o)}else for(let t=0,e=0;t<i;t++,e+=4)s(0,e,t/(i-1));return n}vn("AlphaImage",Zo),vn("RGBAImage",Go);const Xo="big-fb";class Wo extends As{createBucket(t){return new Vo(t)}constructor(t){super(t,jo),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(t){"heatmap-color"===t&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=Ho({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has(Xo)&&this.heatmapFbos["delete"](Xo)}queryRadius(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility}}let Ko;var Jo={get paint(){return Ko=Ko||new Is({"hillshade-illumination-direction":new vs(G.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new vs(G.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new vs(G.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new vs(G.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new vs(G.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new vs(G.paint_hillshade["hillshade-accent-color"])})}};class Yo extends As{constructor(t){super(t,Jo)}hasOffscreenPass(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility}}const Qo=zs([{name:"a_pos",components:2,type:"Int16"}],4),{members:tl}=Qo;function el(t,e,i=2){const r=e&&e.length,n=r?e[0]*i:t.length;let s=il(t,0,n,i,!0);const a=[];if(!s||s.next===s.prev)return a;let o,l,c;if(r&&(s=function(t,e,i,r){const n=[];for(let i=0,s=e.length;i<s;i++){const a=il(t,e[i]*r,i<s-1?e[i+1]*r:t.length,r,!1);a===a.next&&(a.steiner=!0),n.push(pl(a))}n.sort(cl);for(let t=0;t<n.length;t++)i=hl(n[t],i);return i}(t,e,s,i)),t.length>80*i){o=1/0,l=1/0;let e=-1/0,r=-1/0;for(let s=i;s<n;s+=i){const i=t[s],n=t[s+1];i<o&&(o=i),n<l&&(l=n),i>e&&(e=i),n>r&&(r=n)}c=Math.max(e-o,r-l),c=0!==c?32767/c:0}return nl(s,a,i,o,l,c,0),a}function il(t,e,i,r,n){let s;if(n===function(t,e,i,r){let n=0;for(let s=e,a=i-r;s<i;s+=r)n+=(t[a]-t[s])*(t[s+1]+t[a+1]),a=s;return n}(t,e,i,r)>0)for(let n=e;n<i;n+=r)s=Tl(n/r|0,t[n],t[n+1],s);else for(let n=i-r;n>=e;n-=r)s=Tl(n/r|0,t[n],t[n+1],s);return s&&gl(s,s.next)&&(Sl(s),s=s.next),s}function rl(t,e){if(!t)return t;e||(e=t);let i,r=t;do{if(i=!1,r.steiner||!gl(r,r.next)&&0!==_l(r.prev,r,r.next))r=r.next;else{if(Sl(r),r=e=r.prev,r===r.next)break;i=!0}}while(i||r!==e);return e}function nl(t,e,i,r,n,s,a){if(!t)return;!a&&s&&function(t,e,i,r){let n=t;do{0===n.z&&(n.z=dl(n.x,n.y,e,i,r)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==t);n.prevZ.nextZ=null,n.prevZ=null,function(t){let e,i=1;do{let r,n=t;t=null;let s=null;for(e=0;n;){e++;let a=n,o=0;for(let t=0;t<i&&(o++,a=a.nextZ,a);t++);let l=i;for(;o>0||l>0&&a;)0!==o&&(0===l||!a||n.z<=a.z)?(r=n,n=n.nextZ,o--):(r=a,a=a.nextZ,l--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;n=a}s.nextZ=null,i*=2}while(e>1)}(n)}(t,r,n,s);let o=t;for(;t.prev!==t.next;){const l=t.prev,c=t.next;if(s?al(t,r,n,s):sl(t))e.push(l.i,t.i,c.i),Sl(t),t=c.next,o=c.next;else if((t=c)===o){a?1===a?nl(t=ol(rl(t),e),e,i,r,n,s,2):2===a&&ll(t,e,i,r,n,s):nl(rl(t),e,i,r,n,s,1);break}}}function sl(t){const e=t.prev,i=t,r=t.next;if(_l(e,i,r)>=0)return!1;const n=e.x,s=i.x,a=r.x,o=e.y,l=i.y,c=r.y,h=n<s?n<a?n:a:s<a?s:a,u=o<l?o<c?o:c:l<c?l:c,d=n>s?n>a?n:a:s>a?s:a,p=o>l?o>c?o:c:l>c?l:c;let f=r.next;for(;f!==e;){if(f.x>=h&&f.x<=d&&f.y>=u&&f.y<=p&&fl(n,o,s,l,a,c,f.x,f.y)&&_l(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function al(t,e,i,r){const n=t.prev,s=t,a=t.next;if(_l(n,s,a)>=0)return!1;const o=n.x,l=s.x,c=a.x,h=n.y,u=s.y,d=a.y,p=o<l?o<c?o:c:l<c?l:c,f=h<u?h<d?h:d:u<d?u:d,m=o>l?o>c?o:c:l>c?l:c,_=h>u?h>d?h:d:u>d?u:d,g=dl(p,f,e,i,r),y=dl(m,_,e,i,r);let x=t.prevZ,v=t.nextZ;for(;x&&x.z>=g&&v&&v.z<=y;){if(x.x>=p&&x.x<=m&&x.y>=f&&x.y<=_&&x!==n&&x!==a&&fl(o,h,l,u,c,d,x.x,x.y)&&_l(x.prev,x,x.next)>=0)return!1;if(x=x.prevZ,v.x>=p&&v.x<=m&&v.y>=f&&v.y<=_&&v!==n&&v!==a&&fl(o,h,l,u,c,d,v.x,v.y)&&_l(v.prev,v,v.next)>=0)return!1;v=v.nextZ}for(;x&&x.z>=g;){if(x.x>=p&&x.x<=m&&x.y>=f&&x.y<=_&&x!==n&&x!==a&&fl(o,h,l,u,c,d,x.x,x.y)&&_l(x.prev,x,x.next)>=0)return!1;x=x.prevZ}for(;v&&v.z<=y;){if(v.x>=p&&v.x<=m&&v.y>=f&&v.y<=_&&v!==n&&v!==a&&fl(o,h,l,u,c,d,v.x,v.y)&&_l(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function ol(t,e){let i=t;do{const r=i.prev,n=i.next.next;!gl(r,n)&&yl(r,i,i.next,n)&&bl(r,n)&&bl(n,r)&&(e.push(r.i,i.i,n.i),Sl(i),Sl(i.next),i=t=n),i=i.next}while(i!==t);return rl(i)}function ll(t,e,i,r,n,s){let a=t;do{let t=a.next.next;for(;t!==a.prev;){if(a.i!==t.i&&ml(a,t)){let o=wl(a,t);return a=rl(a,a.next),o=rl(o,o.next),nl(a,e,i,r,n,s,0),void nl(o,e,i,r,n,s,0)}t=t.next}a=a.next}while(a!==t)}function cl(t,e){return t.x-e.x}function hl(t,e){const i=function(t,e){let i=e;const r=t.x,n=t.y;let s,a=-1/0;do{if(n<=i.y&&n>=i.next.y&&i.next.y!==i.y){const t=i.x+(n-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(t<=r&&t>a&&(a=t,s=i.x<i.next.x?i:i.next,t===r))return s}i=i.next}while(i!==e);if(!s)return null;const o=s,l=s.x,c=s.y;let h=1/0;i=s;do{if(r>=i.x&&i.x>=l&&r!==i.x&&fl(n<c?r:a,n,l,c,n<c?a:r,n,i.x,i.y)){const e=Math.abs(n-i.y)/(r-i.x);bl(i,t)&&(e<h||e===h&&(i.x>s.x||i.x===s.x&&ul(s,i)))&&(s=i,h=e)}i=i.next}while(i!==o);return s}(t,e);if(!i)return e;const r=wl(i,t);return rl(r,r.next),rl(i,i.next)}function ul(t,e){return _l(t.prev,t,e.prev)<0&&_l(e.next,t,t.next)<0}function dl(t,e,i,r,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*n|0)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*n|0)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function pl(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 fl(t,e,i,r,n,s,a,o){return(n-a)*(e-o)>=(t-a)*(s-o)&&(t-a)*(r-o)>=(i-a)*(e-o)&&(i-a)*(s-o)>=(n-a)*(r-o)}function ml(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&&yl(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}(t,e)&&(bl(t,e)&&bl(e,t)&&function(t,e){let i=t,r=!1;const n=(t.x+e.x)/2,s=(t.y+e.y)/2;do{i.y>s!=i.next.y>s&&i.next.y!==i.y&&n<(i.next.x-i.x)*(s-i.y)/(i.next.y-i.y)+i.x&&(r=!r),i=i.next}while(i!==t);return r}(t,e)&&(_l(t.prev,t,e.prev)||_l(t,e.prev,e))||gl(t,e)&&_l(t.prev,t,t.next)>0&&_l(e.prev,e,e.next)>0)}function _l(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function gl(t,e){return t.x===e.x&&t.y===e.y}function yl(t,e,i,r){const n=vl(_l(t,e,i)),s=vl(_l(t,e,r)),a=vl(_l(i,r,t)),o=vl(_l(i,r,e));return n!==s&&a!==o||!(0!==n||!xl(t,i,e))||!(0!==s||!xl(t,r,e))||!(0!==a||!xl(i,t,r))||!(0!==o||!xl(i,e,r))}function xl(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 vl(t){return t>0?1:t<0?-1:0}function bl(t,e){return _l(t.prev,t,t.next)<0?_l(t,e,t.next)>=0&&_l(t,t.prev,e)>=0:_l(t,e,t.prev)<0||_l(t,t.next,e)<0}function wl(t,e){const i=Il(t.i,t.x,t.y),r=Il(e.i,e.x,e.y),n=t.next,s=e.prev;return t.next=e,e.prev=t,i.next=n,n.prev=i,r.next=i,i.prev=r,s.next=r,r.prev=s,r}function Tl(t,e,i,r){const n=Il(t,e,i);return r?(n.next=r.next,n.prev=r,r.next.prev=n,r.next=n):(n.prev=n,n.next=n),n}function Sl(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 Il(t,e,i){return{i:t,x:e,y:i,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function Pl(t,e,i){const r=i.patternDependencies;let n=!1;for(const i of e){const e=i.paint.get(`${t}-pattern`);e.isConstant()||(n=!0);const s=e.constantOr(null);s&&(n=!0,r[s.to]=!0,r[s.from]=!0)}return n}function Al(t,e,i,r,n){const s=n.patternDependencies;for(const a of e){const e=a.paint.get(`${t}-pattern`).value;if("constant"!==e.kind){let t=e.evaluate({zoom:r-1},i,{},n.availableImages),o=e.evaluate({zoom:r},i,{},n.availableImages),l=e.evaluate({zoom:r+1},i,{},n.availableImages);t=t&&t.name?t.name:t,o=o&&o.name?o.name:o,l=l&&l.name?l.name:l,s[t]=!0,s[o]=!0,s[l]=!0,i.patterns[a.id]={min:t,mid:o,max:l}}}return i}class Ml{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(t=>t.id),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new _a,this.indexArray=new Pa,this.indexArray2=new Aa,this.programConfigurations=new io(t.layers,t.zoom),this.segments=new Ca,this.segments2=new Ca,this.stateDependentLayerIds=this.layers.filter(t=>t.isStateDependent()).map(t=>t.id)}populate(t,e,i){this.hasPattern=Pl("fill",this.layers,e);const r=this.layers[0].layout.get("fill-sort-key"),n=!r.isConstant(),s=[];for(const{feature:a,id:o,index:l,sourceLayerIndex:c}of t){const t=this.layers[0]._featureFilter.needGeometry,h=co(a,t);if(!this.layers[0]._featureFilter.filter(new us(this.zoom),h,i))continue;const u=n?r.evaluate(h,{},i,e.availableImages):void 0,d={id:o,properties:a.properties,type:a.type,sourceLayerIndex:c,index:l,geometry:t?h.geometry:lo(a),patterns:{},sortKey:u};s.push(d)}n&&s.sort((t,e)=>t.sortKey-e.sortKey);for(const r of s){const{geometry:n,index:s,sourceLayerIndex:a}=r;if(this.hasPattern){const t=Al("fill",this.layers,r,this.zoom,e);this.patternFeatures.push(t)}else this.addFeature(r,n,s,i,{});e.featureIndex.insert(t[s].feature,n,s,a,this.index)}}update(t,e,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,i)}addFeatures(t,e,i){for(const t of this.patternFeatures)this.addFeature(t,t.geometry,t.index,e,i)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,tl),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(t,e,i,r,n){for(const t of gi(e,500)){let e=0;for(const i of t)e+=i.length;const i=this.segments.prepareSegment(e,this.layoutVertexArray,this.indexArray),r=i.vertexLength,n=[],s=[];for(const e of t){if(0===e.length)continue;e!==t[0]&&s.push(n.length/2);const i=this.segments2.prepareSegment(e.length,this.layoutVertexArray,this.indexArray2),r=i.vertexLength;this.layoutVertexArray.emplaceBack(e[0].x,e[0].y),this.indexArray2.emplaceBack(r+e.length-1,r),n.push(e[0].x),n.push(e[0].y);for(let t=1;t<e.length;t++)this.layoutVertexArray.emplaceBack(e[t].x,e[t].y),this.indexArray2.emplaceBack(r+t-1,r+t),n.push(e[t].x),n.push(e[t].y);i.vertexLength+=e.length,i.primitiveLength+=e.length}const a=el(n,s);for(let t=0;t<a.length;t+=3)this.indexArray.emplaceBack(r+a[t],r+a[t+1],r+a[t+2]);i.vertexLength+=e,i.primitiveLength+=a.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,n,r)}}let kl,Cl;vn("FillBucket",Ml,{omit:["layers","patternFeatures"]});var zl={get paint(){return Cl=Cl||new Is({"fill-antialias":new vs(G.paint_fill["fill-antialias"]),"fill-opacity":new bs(G.paint_fill["fill-opacity"]),"fill-color":new bs(G.paint_fill["fill-color"]),"fill-outline-color":new bs(G.paint_fill["fill-outline-color"]),"fill-translate":new vs(G.paint_fill["fill-translate"]),"fill-translate-anchor":new vs(G.paint_fill["fill-translate-anchor"]),"fill-pattern":new ws(G.paint_fill["fill-pattern"])})},get layout(){return kl=kl||new Is({"fill-sort-key":new bs(G.layout_fill["fill-sort-key"])})}};class El extends As{constructor(t){super(t,zl)}recalculate(t,e){super.recalculate(t,e);const i=this.paint._values["fill-outline-color"];"constant"===i.value.kind&&void 0===i.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(t){return new Ml(t)}queryRadius(){return Io(this.paint.get("fill-translate"))}queryIntersectsFeature(t,e,i,r,n,s,a){return mo(Po(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),s.angle,a),r)}isTileClipped(){return!0}}const Dl=zs([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),Ll=zs([{name:"a_centroid",components:2,type:"Int16"}],4),{members:Rl}=Dl;var Bl={},Fl=r,Ol=Vl;function Vl(t,e,i,r,n){this.properties={},this.extent=i,this.type=0,this._pbf=t,this._geometry=-1,this._keys=r,this._values=n,t.readFields(Nl,this,e)}function Nl(t,e,i){1==t?e.id=i.readVarint():2==t?function(t,e){for(var i=t.readVarint()+t.pos;t.pos<i;){var r=e._keys[t.readVarint()],n=e._values[t.readVarint()];e.properties[r]=n}}(i,e):3==t?e.type=i.readVarint():4==t&&(e._geometry=i.pos)}function jl(t){for(var e,i,r=0,n=0,s=t.length,a=s-1;n<s;a=n++)r+=((i=t[a]).x-(e=t[n]).x)*(e.y+i.y);return r}Vl.types=["Unknown","Point","LineString","Polygon"],Vl.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,i=t.readVarint()+t.pos,r=1,n=0,s=0,a=0,o=[];t.pos<i;){if(n<=0){var l=t.readVarint();r=7&l,n=l>>3}if(n--,1===r||2===r)s+=t.readSVarint(),a+=t.readSVarint(),1===r&&(e&&o.push(e),e=[]),e.push(new Fl(s,a));else{if(7!==r)throw new Error("unknown command "+r);e&&e.push(e[0].clone())}}return e&&o.push(e),o},Vl.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e=t.readVarint()+t.pos,i=1,r=0,n=0,s=0,a=1/0,o=-1/0,l=1/0,c=-1/0;t.pos<e;){if(r<=0){var h=t.readVarint();i=7&h,r=h>>3}if(r--,1===i||2===i)(n+=t.readSVarint())<a&&(a=n),n>o&&(o=n),(s+=t.readSVarint())<l&&(l=s),s>c&&(c=s);else if(7!==i)throw new Error("unknown command "+i)}return[a,l,o,c]},Vl.prototype.toGeoJSON=function(t,e,i){var r,n,s=this.extent*Math.pow(2,i),a=this.extent*t,o=this.extent*e,l=this.loadGeometry(),c=Vl.types[this.type];function h(t){for(var e=0;e<t.length;e++){var i=t[e];t[e]=[360*(i.x+a)/s-180,360/Math.PI*Math.atan(Math.exp((180-360*(i.y+o)/s)*Math.PI/180))-90]}}switch(this.type){case 1:var u=[];for(r=0;r<l.length;r++)u[r]=l[r][0];h(l=u);break;case 2:for(r=0;r<l.length;r++)h(l[r]);break;case 3:for(l=function(t){var e=t.length;if(e<=1)return[t];for(var i,r,n=[],s=0;s<e;s++){var a=jl(t[s]);0!==a&&(void 0===r&&(r=a<0),r===a<0?(i&&n.push(i),i=[t[s]]):i.push(t[s]))}return i&&n.push(i),n}(l),r=0;r<l.length;r++)for(n=0;n<l[r].length;n++)h(l[r][n])}1===l.length?l=l[0]:c="Multi"+c;var d={type:"Feature",geometry:{type:c,coordinates:l},properties:this.properties};return"id"in this&&(d.id=this.id),d};var Ul=Ol,$l=ql;function ql(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(Zl,this,e),this.length=this._features.length}function Zl(t,e,i){15===t?e.version=i.readVarint():1===t?e.name=i.readString():5===t?e.extent=i.readVarint():2===t?e._features.push(i.pos):3===t?e._keys.push(i.readString()):4===t&&e._values.push(function(t){for(var e=null,i=t.readVarint()+t.pos;t.pos<i;){var r=t.readVarint()>>3;e=1===r?t.readString():2===r?t.readFloat():3===r?t.readDouble():4===r?t.readVarint64():5===r?t.readVarint():6===r?t.readSVarint():7===r?t.readBoolean():null}return e}(i))}ql.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[t];var e=this._pbf.readVarint()+this._pbf.pos;return new Ul(this._pbf,e,this.extent,this._keys,this._values)};var Gl=$l;function Hl(t,e,i){if(3===t){var r=new Gl(i,i.readVarint()+i.pos);r.length&&(e[r.name]=r)}}Bl.VectorTile=function(t,e){this.layers=t.readFields(Hl,{},e)},Bl.VectorTileFeature=Ol,Bl.VectorTileLayer=$l;const Xl=Bl.VectorTileFeature.types,Wl=Math.pow(2,13);function Kl(t,e,i,r,n,s,a,o){t.emplaceBack(e,i,2*Math.floor(r*Wl)+a,n*Wl*2,s*Wl*2,Math.round(o))}class Jl{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(t=>t.id),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new ga,this.centroidVertexArray=new fa,this.indexArray=new Pa,this.programConfigurations=new io(t.layers,t.zoom),this.segments=new Ca,this.stateDependentLayerIds=this.layers.filter(t=>t.isStateDependent()).map(t=>t.id)}populate(t,e,i){this.features=[],this.hasPattern=Pl("fill-extrusion",this.layers,e);for(const{feature:r,id:n,index:s,sourceLayerIndex:a}of t){const t=this.layers[0]._featureFilter.needGeometry,o=co(r,t);if(!this.layers[0]._featureFilter.filter(new us(this.zoom),o,i))continue;const l={id:n,sourceLayerIndex:a,index:s,geometry:t?o.geometry:lo(r),properties:r.properties,type:r.type,patterns:{}};this.hasPattern?this.features.push(Al("fill-extrusion",this.layers,l,this.zoom,e)):this.addFeature(l,l.geometry,s,i,{}),e.featureIndex.insert(r,l.geometry,s,a,this.index,!0)}}addFeatures(t,e,i){for(const t of this.features){const{geometry:r}=t;this.addFeature(t,r,t.index,e,i)}}update(t,e,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,i)}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.centroidVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Rl),this.centroidVertexBuffer=t.createVertexBuffer(this.centroidVertexArray,Ll.members,!0),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(t,e,i,r,n){for(const i of gi(e,500)){const e={x:0,y:0,vertexCount:0};let r=0;for(const t of i)r+=t.length;let n=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const t of i){if(0===t.length)continue;if(Ql(t))continue;let i=0;for(let r=0;r<t.length;r++){const s=t[r];if(r>=1){const a=t[r-1];if(!Yl(s,a)){n.vertexLength+4>Ca.MAX_VERTEX_ARRAY_LENGTH&&(n=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const t=s.sub(a)._perp()._unit(),r=a.dist(s);i+r>32768&&(i=0),Kl(this.layoutVertexArray,s.x,s.y,t.x,t.y,0,0,i),Kl(this.layoutVertexArray,s.x,s.y,t.x,t.y,0,1,i),e.x+=2*s.x,e.y+=2*s.y,e.vertexCount+=2,i+=r,Kl(this.layoutVertexArray,a.x,a.y,t.x,t.y,0,0,i),Kl(this.layoutVertexArray,a.x,a.y,t.x,t.y,0,1,i),e.x+=2*a.x,e.y+=2*a.y,e.vertexCount+=2;const o=n.vertexLength;this.indexArray.emplaceBack(o,o+2,o+1),this.indexArray.emplaceBack(o+1,o+2,o+3),n.vertexLength+=4,n.primitiveLength+=2}}}}if(n.vertexLength+r>Ca.MAX_VERTEX_ARRAY_LENGTH&&(n=this.segments.prepareSegment(r,this.layoutVertexArray,this.indexArray)),"Polygon"!==Xl[t.type])continue;const s=[],a=[],o=n.vertexLength;for(const t of i)if(0!==t.length){t!==i[0]&&a.push(s.length/2);for(let i=0;i<t.length;i++){const r=t[i];Kl(this.layoutVertexArray,r.x,r.y,0,0,1,1,0),e.x+=r.x,e.y+=r.y,e.vertexCount+=1,s.push(r.x),s.push(r.y)}}const l=el(s,a);for(let t=0;t<l.length;t+=3)this.indexArray.emplaceBack(o+l[t],o+l[t+2],o+l[t+1]);n.primitiveLength+=l.length/3,n.vertexLength+=r;for(let t=0;t<e.vertexCount;t++){const t=Math.floor(e.x/e.vertexCount),i=Math.floor(e.y/e.vertexCount);this.centroidVertexArray.emplaceBack(t,i)}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,n,r)}}function Yl(t,e){return t.x===e.x&&(t.x<0||t.x>so)||t.y===e.y&&(t.y<0||t.y>so)}function Ql(t){return t.every(t=>t.x<0)||t.every(t=>t.x>so)||t.every(t=>t.y<0)||t.every(t=>t.y>so)}let tc;vn("FillExtrusionBucket",Jl,{omit:["layers","features"]});var ec={get paint(){return tc=tc||new Is({"fill-extrusion-opacity":new vs(G["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new bs(G["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new vs(G["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new vs(G["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new ws(G["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new bs(G["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new bs(G["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new vs(G["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class ic extends As{constructor(t){super(t,ec)}createBucket(t){return new Jl(t)}queryRadius(){return Io(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(t,e,i,r,n,a,o,l){const c=Po(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),a.angle,o),h=this.paint.get("fill-extrusion-height").evaluate(e,i),u=this.paint.get("fill-extrusion-base").evaluate(e,i),d=function(t,e){const i=[];for(const r of t){const t=[r.x,r.y,0,1];Bo(t,t,e),i.push(new s(t[0]/t[3],t[1]/t[3]))}return i}(c,l),p=function(t,e,i,r){const n=[],a=[],o=r[8]*e,l=r[9]*e,c=r[10]*e,h=r[11]*e,u=r[8]*i,d=r[9]*i,p=r[10]*i,f=r[11]*i;for(const e of t){const t=[],i=[];for(const n of e){const e=n.x,a=n.y,m=r[0]*e+r[4]*a+r[12],_=r[1]*e+r[5]*a+r[13],g=r[2]*e+r[6]*a+r[14],y=r[3]*e+r[7]*a+r[15],x=g+c,v=y+h,b=m+u,w=_+d,T=g+p,S=y+f,I=new s((m+o)/v,(_+l)/v);I.z=x/v,t.push(I);const P=new s(b/S,w/S);P.z=T/S,i.push(P)}n.push(t),a.push(i)}return[n,a]}(r,u,h,l);return function(t,e,i){let r=1/0;mo(i,e)&&(r=nc(i,e[0]));for(let n=0;n<e.length;n++){const s=e[n],a=t[n];for(let t=0;t<s.length-1;t++){const e=s[t],n=[e,s[t+1],a[t+1],a[t],e];po(i,n)&&(r=Math.min(r,nc(i,n)))}}return r!==1/0&&r}(p[0],p[1],d)}}function rc(t,e){return t.x*e.x+t.y*e.y}function nc(t,e){if(1===t.length){let i=0;const r=e[i++];let n;for(;!n||r.equals(n);)if(n=e[i++],!n)return 1/0;for(;i<e.length;i++){const s=e[i],a=t[0],o=n.sub(r),l=s.sub(r),c=a.sub(r),h=rc(o,o),u=rc(o,l),d=rc(l,l),p=rc(c,o),f=rc(c,l),m=h*d-u*u,_=(d*p-u*f)/m,g=(h*f-u*p)/m,y=r.z*(1-_-g)+n.z*_+s.z*g;if(isFinite(y))return y}return 1/0}{let t=1/0;for(const i of e)t=Math.min(t,i.z);return t}}const sc=zs([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:ac}=sc,oc=zs([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:lc}=oc,cc=Bl.VectorTileFeature.types,hc=Math.cos(Math.PI/180*37.5),uc=Math.pow(2,14)/.5;class dc{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(t=>t.id),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(t=>{this.gradients[t.id]={}}),this.layoutVertexArray=new ya,this.layoutVertexArray2=new xa,this.indexArray=new Pa,this.programConfigurations=new io(t.layers,t.zoom),this.segments=new Ca,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(t=>t.isStateDependent()).map(t=>t.id)}populate(t,e,i){this.hasPattern=Pl("line",this.layers,e);const r=this.layers[0].layout.get("line-sort-key"),n=!r.isConstant(),s=[];for(const{feature:e,id:a,index:o,sourceLayerIndex:l}of t){const t=this.layers[0]._featureFilter.needGeometry,c=co(e,t);if(!this.layers[0]._featureFilter.filter(new us(this.zoom),c,i))continue;const h=n?r.evaluate(c,{},i):void 0,u={id:a,properties:e.properties,type:e.type,sourceLayerIndex:l,index:o,geometry:t?c.geometry:lo(e),patterns:{},sortKey:h};s.push(u)}n&&s.sort((t,e)=>t.sortKey-e.sortKey);for(const r of s){const{geometry:n,index:s,sourceLayerIndex:a}=r;if(this.hasPattern){const t=Al("line",this.layers,r,this.zoom,e);this.patternFeatures.push(t)}else this.addFeature(r,n,s,i,{});e.featureIndex.insert(t[s].feature,n,s,a,this.index)}}update(t,e,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,i)}addFeatures(t,e,i){for(const t of this.patternFeatures)this.addFeature(t,t.geometry,t.index,e,i)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,lc)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ac),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(t){if(t.properties&&Object.prototype.hasOwnProperty.call(t.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(t.properties,"mapbox_clip_end"))return{start:+t.properties.mapbox_clip_start,end:+t.properties.mapbox_clip_end}}addFeature(t,e,i,r,n){const s=this.layers[0].layout,a=s.get("line-join").evaluate(t,{}),o=s.get("line-cap"),l=s.get("line-miter-limit"),c=s.get("line-round-limit");this.lineClips=this.lineFeatureClips(t);for(const i of e)this.addLine(i,t,a,o,l,c);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,i,n,r)}addLine(t,e,i,r,n,s){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let e=0;e<t.length-1;e++)this.totalDistance+=t[e].dist(t[e+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}const a="Polygon"===cc[e.type];let o=t.length;for(;o>=2&&t[o-1].equals(t[o-2]);)o--;let l=0;for(;l<o-1&&t[l].equals(t[l+1]);)l++;if(o<(a?3:2))return;"bevel"===i&&(n=1.05);const c=this.overscaling<=16?15*so/(512*this.overscaling):0,h=this.segments.prepareSegment(10*o,this.layoutVertexArray,this.indexArray);let u,d,p,f,m;this.e1=this.e2=-1,a&&(u=t[o-2],m=t[l].sub(u)._unit()._perp());for(let e=l;e<o;e++){if(p=e===o-1?a?t[l+1]:void 0:t[e+1],p&&t[e].equals(p))continue;m&&(f=m),u&&(d=u),u=t[e],m=p?p.sub(u)._unit()._perp():f,f=f||m;let _=f.add(m);0===_.x&&0===_.y||_._unit();const g=f.x*m.x+f.y*m.y,y=_.x*m.x+_.y*m.y,x=0!==y?1/y:1/0,v=2*Math.sqrt(2-2*y),b=y<hc&&d&&p,w=f.x*m.y-f.y*m.x>0;if(b&&e>l){const t=u.dist(d);if(t>2*c){const e=u.sub(u.sub(d)._mult(c/t)._round());this.updateDistance(d,e),this.addCurrentVertex(e,f,0,0,h),d=e}}const T=d&&p;let S=T?i:a?"butt":r;if(T&&"round"===S&&(x<s?S="miter":x<=2&&(S="fakeround")),"miter"===S&&x>n&&(S="bevel"),"bevel"===S&&(x>2&&(S="flipbevel"),x<n&&(S="miter")),d&&this.updateDistance(d,u),"miter"===S)_._mult(x),this.addCurrentVertex(u,_,0,0,h);else if("flipbevel"===S){if(x>100)_=m.mult(-1);else{const t=x*f.add(m).mag()/f.sub(m).mag();_._perp()._mult(t*(w?-1:1))}this.addCurrentVertex(u,_,0,0,h),this.addCurrentVertex(u,_.mult(-1),0,0,h)}else if("bevel"===S||"fakeround"===S){const t=-Math.sqrt(x*x-1),e=w?t:0,i=w?0:t;if(d&&this.addCurrentVertex(u,f,e,i,h),"fakeround"===S){const t=Math.round(180*v/Math.PI/20);for(let e=1;e<t;e++){let i=e/t;if(.5!==i){const t=i-.5;i+=i*t*(i-1)*((1.0904+g*(g*(3.55645-1.43519*g)-3.2452))*t*t+(.848013+g*(.215638*g-1.06021)))}const r=m.sub(f)._mult(i)._add(f)._unit()._mult(w?-1:1);this.addHalfVertex(u,r.x,r.y,!1,w,0,h)}}p&&this.addCurrentVertex(u,m,-e,-i,h)}else if("butt"===S)this.addCurrentVertex(u,_,0,0,h);else if("square"===S){const t=d?1:-1;this.addCurrentVertex(u,_,t,t,h)}else"round"===S&&(d&&(this.addCurrentVertex(u,f,0,0,h),this.addCurrentVertex(u,f,1,1,h,!0)),p&&(this.addCurrentVertex(u,m,-1,-1,h,!0),this.addCurrentVertex(u,m,0,0,h)));if(b&&e<o-1){const t=u.dist(p);if(t>2*c){const e=u.add(p.sub(u)._mult(c/t)._round());this.updateDistance(u,e),this.addCurrentVertex(e,m,0,0,h),u=e}}}}addCurrentVertex(t,e,i,r,n,s=!1){const a=e.y*r-e.x,o=-e.y-e.x*r;this.addHalfVertex(t,e.x+e.y*i,e.y-e.x*i,s,!1,i,n),this.addHalfVertex(t,a,o,s,!0,-r,n),this.distance>uc/2&&0===this.totalDistance&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(t,e,i,r,n,s))}addHalfVertex({x:t,y:e},i,r,n,s,a,o){const l=.5*(this.lineClips?this.scaledDistance*(uc-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((t<<1)+(n?1:0),(e<<1)+(s?1:0),Math.round(63*i)+128,Math.round(63*r)+128,1+(0===a?0:a<0?-1:1)|(63&l)<<2,l>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const c=o.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,c),o.primitiveLength++),s?this.e2=c:this.e1=c}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(t,e){this.distance+=t.dist(e),this.updateScaledDistance()}}let pc,fc;vn("LineBucket",dc,{omit:["layers","patternFeatures"]});var mc={get paint(){return fc=fc||new Is({"line-opacity":new bs(G.paint_line["line-opacity"]),"line-color":new bs(G.paint_line["line-color"]),"line-translate":new vs(G.paint_line["line-translate"]),"line-translate-anchor":new vs(G.paint_line["line-translate-anchor"]),"line-width":new bs(G.paint_line["line-width"]),"line-gap-width":new bs(G.paint_line["line-gap-width"]),"line-offset":new bs(G.paint_line["line-offset"]),"line-blur":new bs(G.paint_line["line-blur"]),"line-dasharray":new Ts(G.paint_line["line-dasharray"]),"line-pattern":new ws(G.paint_line["line-pattern"]),"line-gradient":new Ss(G.paint_line["line-gradient"])})},get layout(){return pc=pc||new Is({"line-cap":new vs(G.layout_line["line-cap"]),"line-join":new bs(G.layout_line["line-join"]),"line-miter-limit":new vs(G.layout_line["line-miter-limit"]),"line-round-limit":new vs(G.layout_line["line-round-limit"]),"line-sort-key":new bs(G.layout_line["line-sort-key"])})}};class _c extends bs{possiblyEvaluate(t,e){return e=new us(Math.floor(e.zoom),{now:e.now,fadeDuration:e.fadeDuration,zoomHistory:e.zoomHistory,transition:e.transition}),super.possiblyEvaluate(t,e)}evaluate(t,e,i,r){return e=g({},e,{zoom:Math.floor(e.zoom)}),super.evaluate(t,e,i,r)}}let gc;class yc extends As{constructor(t){super(t,mc),this.gradientVersion=0,gc||(gc=new _c(mc.paint.properties["line-width"].specification),gc.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(t){if("line-gradient"===t){const t=this.gradientExpression();this.stepInterpolant=!!function(t){return void 0!==t._styleExpression}(t)&&t._styleExpression.expression instanceof Te,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(t,e){super.recalculate(t,e),this.paint._values["line-floorwidth"]=gc.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)}createBucket(t){return new dc(t)}queryRadius(t){const e=t,i=xc(So("line-width",this,e),So("line-gap-width",this,e)),r=So("line-offset",this,e);return i/2+Math.abs(r)+Io(this.paint.get("line-translate"))}queryIntersectsFeature(t,e,i,r,n,a,o){const l=Po(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,o),c=o/2*xc(this.paint.get("line-width").evaluate(e,i),this.paint.get("line-gap-width").evaluate(e,i)),h=this.paint.get("line-offset").evaluate(e,i);return h&&(r=function(t,e){const i=[];for(let r=0;r<t.length;r++){const n=t[r],a=[];for(let t=0;t<n.length;t++){const i=n[t-1],r=n[t],o=n[t+1],l=0===t?new s(0,0):r.sub(i)._unit()._perp(),c=t===n.length-1?new s(0,0):o.sub(r)._unit()._perp(),h=l._add(c)._unit(),u=h.x*c.x+h.y*c.y;0!==u&&h._mult(1/u),a.push(h._mult(e)._add(r))}i.push(a)}return i}(r,h*o)),function(t,e,i){for(let r=0;r<e.length;r++){const n=e[r];if(t.length>=3)for(let e=0;e<n.length;e++)if(wo(t,n[e]))return!0;if(_o(t,n,i))return!0}return!1}(l,r,c)}isTileClipped(){return!0}}function xc(t,e){return e>0?e+2*t:t}const vc=zs([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),bc=zs([{name:"a_projected_pos",components:3,type:"Float32"}],4);zs([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const wc=zs([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);zs([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);const Tc=zs([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),Sc=zs([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Ic(t,e,i){return t.sections.forEach(t=>{t.text=function(t,e,i){const r=e.layout.get("text-transform").evaluate(i,{});return"uppercase"===r?t=t.toLocaleUpperCase():"lowercase"===r&&(t=t.toLocaleLowerCase()),hs.applyArabicShaping&&(t=hs.applyArabicShaping(t)),t}(t.text,e,i)}),t}zs([{name:"triangle",components:3,type:"Uint16"}]),zs([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),zs([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),zs([{type:"Float32",name:"offsetX"}]),zs([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),zs([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const Pc={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var Ac=24,Mc=zc,kc=function(t,e,i,r,n){var s,a,o=8*n-r-1,l=(1<<o)-1,c=l>>1,h=-7,u=i?n-1:0,d=i?-1:1,p=t[e+u];for(u+=d,s=p&(1<<-h)-1,p>>=-h,h+=o;h>0;s=256*s+t[e+u],u+=d,h-=8);for(a=s&(1<<-h)-1,s>>=-h,h+=r;h>0;a=256*a+t[e+u],u+=d,h-=8);if(0===s)s=1-c;else{if(s===l)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),s-=c}return(p?-1:1)*a*Math.pow(2,s-r)},Cc=function(t,e,i,r,n,s){var a,o,l,c=8*s-n-1,h=(1<<c)-1,u=h>>1,d=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:s-1,f=r?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(o=isNaN(e)?1:0,a=h):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),(e+=a+u>=1?d/l:d*Math.pow(2,1-u))*l>=2&&(a++,l/=2),a+u>=h?(o=0,a=h):a+u>=1?(o=(e*l-1)*Math.pow(2,n),a+=u):(o=e*Math.pow(2,u-1)*Math.pow(2,n),a=0));n>=8;t[i+p]=255&o,p+=f,o/=256,n-=8);for(a=a<<n|o,c+=n;c>0;t[i+p]=255&a,p+=f,a/=256,c-=8);t[i+p-f]|=128*m};function zc(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}zc.Varint=0,zc.Fixed64=1,zc.Bytes=2,zc.Fixed32=5;var Ec=4294967296,Dc=1/Ec,Lc="undefined"==typeof TextDecoder?null:new TextDecoder("utf-8");function Rc(t){return t.type===zc.Bytes?t.readVarint()+t.pos:t.pos+1}function Bc(t,e,i){return i?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function Fc(t,e,i){var r=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));i.realloc(r);for(var n=i.pos-1;n>=t;n--)i.buf[n+r]=i.buf[n]}function Oc(t,e){for(var i=0;i<t.length;i++)e.writeVarint(t[i])}function Vc(t,e){for(var i=0;i<t.length;i++)e.writeSVarint(t[i])}function Nc(t,e){for(var i=0;i<t.length;i++)e.writeFloat(t[i])}function jc(t,e){for(var i=0;i<t.length;i++)e.writeDouble(t[i])}function Uc(t,e){for(var i=0;i<t.length;i++)e.writeBoolean(t[i])}function $c(t,e){for(var i=0;i<t.length;i++)e.writeFixed32(t[i])}function qc(t,e){for(var i=0;i<t.length;i++)e.writeSFixed32(t[i])}function Zc(t,e){for(var i=0;i<t.length;i++)e.writeFixed64(t[i])}function Gc(t,e){for(var i=0;i<t.length;i++)e.writeSFixed64(t[i])}function Hc(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function Xc(t,e,i){t[i]=e,t[i+1]=e>>>8,t[i+2]=e>>>16,t[i+3]=e>>>24}function Wc(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}zc.prototype={destroy:function(){this.buf=null},readFields:function(t,e,i){for(i=i||this.length;this.pos<i;){var r=this.readVarint(),n=r>>3,s=this.pos;this.type=7&r,t(n,e,this),this.pos===s&&this.skip(r)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=Hc(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=Wc(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=Hc(this.buf,this.pos)+Hc(this.buf,this.pos+4)*Ec;return this.pos+=8,t},readSFixed64:function(){var t=Hc(this.buf,this.pos)+Wc(this.buf,this.pos+4)*Ec;return this.pos+=8,t},readFloat:function(){var t=kc(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=kc(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,i,r=this.buf;return e=127&(i=r[this.pos++]),i<128?e:(e|=(127&(i=r[this.pos++]))<<7,i<128?e:(e|=(127&(i=r[this.pos++]))<<14,i<128?e:(e|=(127&(i=r[this.pos++]))<<21,i<128?e:function(t,e,i){var r,n,s=i.buf;if(r=(112&(n=s[i.pos++]))>>4,n<128)return Bc(t,r,e);if(r|=(127&(n=s[i.pos++]))<<3,n<128)return Bc(t,r,e);if(r|=(127&(n=s[i.pos++]))<<10,n<128)return Bc(t,r,e);if(r|=(127&(n=s[i.pos++]))<<17,n<128)return Bc(t,r,e);if(r|=(127&(n=s[i.pos++]))<<24,n<128)return Bc(t,r,e);if(r|=(1&(n=s[i.pos++]))<<31,n<128)return Bc(t,r,e);throw new Error("Expected varint not more than 10 bytes")}(e|=(15&(i=r[this.pos]))<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&Lc?function(t,e,i){return Lc.decode(t.subarray(e,i))}(this.buf,e,t):function(t,e,i){for(var r="",n=e;n<i;){var s,a,o,l=t[n],c=null,h=l>239?4:l>223?3:l>191?2:1;if(n+h>i)break;
vendor: 4,207 bytes, line 313
3131===h?l<128&&(c=l):2===h?128==(192&(s=t[n+1]))&&(c=(31&l)<<6|63&s)<=127&&(c=null):3===h?(a=t[n+2],128==(192&(s=t[n+1]))&&128==(192&a)&&((c=(15&l)<<12|(63&s)<<6|63&a)<=2047||c>=55296&&c<=57343)&&(c=null)):4===h&&(a=t[n+2],o=t[n+3],128==(192&(s=t[n+1]))&&128==(192&a)&&128==(192&o)&&((c=(15&l)<<18|(63&s)<<12|(63&a)<<6|63&o)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,h=1):c>65535&&(c-=65536,r+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),r+=String.fromCharCode(c),n+=h}return r}(this.buf,e,t)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==zc.Bytes)return t.push(this.readVarint(e));var i=Rc(this);for(t=t||[];this.pos<i;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==zc.Bytes)return t.push(this.readSVarint());var e=Rc(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==zc.Bytes)return t.push(this.readBoolean());var e=Rc(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==zc.Bytes)return t.push(this.readFloat());var e=Rc(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==zc.Bytes)return t.push(this.readDouble());var e=Rc(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==zc.Bytes)return t.push(this.readFixed32());var e=Rc(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==zc.Bytes)return t.push(this.readSFixed32());var e=Rc(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==zc.Bytes)return t.push(this.readFixed64());var e=Rc(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==zc.Bytes)return t.push(this.readSFixed64());var e=Rc(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){var e=7&t;if(e===zc.Varint)for(;this.buf[this.pos++]>127;);else if(e===zc.Bytes)this.pos=this.readVarint()+this.pos;else if(e===zc.Fixed32)this.pos+=4;else{if(e!==zc.Fixed64)throw new Error("Unimplemented type: "+e);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e=this.length||16;e<this.pos+t;)e*=2;if(e!==this.length){var i=new Uint8Array(e);i.set(this.buf),this.buf=i,this.length=e}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),Xc(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),Xc(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),Xc(this.buf,-1&t,this.pos),Xc(this.buf,Math.floor(t*Dc),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),Xc(this.buf,-1&t,this.pos),Xc(this.buf,Math.floor(t*Dc),this.pos+4),this.pos+=8},writeVarint:function(t){(t=+t||0)>268435455||t<0?function(t,e){var i,r;if(t>=0?(i=t%4294967296|0,r=t/4294967296|0):(r=~(-t/4294967296),4294967295^(i=~(-t%4294967296))?i=i+1|0:(i=0,r=r+1|0)),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,i.buf[i.pos]=127&(t>>>=7)}(i,0,e),function(t,e){var i=(7&t)<<4;e.buf[e.pos++]|=i|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(r,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;
vendor: 16,609 bytes, line 313
313this.pos=function(t,e,i){for(var r,n,s=0;s<e.length;s++){if((r=e.charCodeAt(s))>55295&&r<57344){if(!n){r>56319||s+1===e.length?(t[i++]=239,t[i++]=191,t[i++]=189):n=r;continue}if(r<56320){t[i++]=239,t[i++]=191,t[i++]=189,n=r;continue}r=n-55296<<10|r-56320|65536,n=null}else n&&(t[i++]=239,t[i++]=191,t[i++]=189,n=null);r<128?t[i++]=r:(r<2048?t[i++]=r>>6|192:(r<65536?t[i++]=r>>12|224:(t[i++]=r>>18|240,t[i++]=r>>12&63|128),t[i++]=r>>6&63|128),t[i++]=63&r|128)}return i}(this.buf,t,this.pos);var i=this.pos-e;i>=128&&Fc(e,i,this),this.pos=e-1,this.writeVarint(i),this.pos+=i},writeFloat:function(t){this.realloc(4),Cc(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Cc(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var i=0;i<e;i++)this.buf[this.pos++]=t[i]},writeRawMessage:function(t,e){this.pos++;var i=this.pos;t(e,this);var r=this.pos-i;r>=128&&Fc(i,r,this),this.pos=i-1,this.writeVarint(r),this.pos+=r},writeMessage:function(t,e,i){this.writeTag(t,zc.Bytes),this.writeRawMessage(e,i)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Oc,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Vc,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,Uc,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Nc,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,jc,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,$c,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,qc,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Zc,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,Gc,e)},writeBytesField:function(t,e){this.writeTag(t,zc.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,zc.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,zc.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,zc.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,zc.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,zc.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,zc.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,zc.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,zc.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,zc.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}};var Kc=i(Mc);function Jc(t,e,i){1===t&&i.readMessage(Yc,e)}function Yc(t,e,i){if(3===t){const{id:t,bitmap:r,width:n,height:s,left:a,top:o,advance:l}=i.readMessage(Qc,{});e.push({id:t,bitmap:new Zo({width:n+6,height:s+6},r),metrics:{width:n,height:s,left:a,top:o,advance:l}})}}function Qc(t,e,i){1===t?e.id=i.readVarint():2===t?e.bitmap=i.readBytes():3===t?e.width=i.readVarint():4===t?e.height=i.readVarint():5===t?e.left=i.readSVarint():6===t?e.top=i.readSVarint():7===t&&(e.advance=i.readVarint())}function th(t){let e=0,i=0;for(const r of t)e+=r.w*r.h,i=Math.max(i,r.w);t.sort((t,e)=>e.h-t.h);const r=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),i),h:1/0}];let n=0,s=0;for(const e of t)for(let t=r.length-1;t>=0;t--){const i=r[t];if(!(e.w>i.w||e.h>i.h)){if(e.x=i.x,e.y=i.y,s=Math.max(s,e.y+e.h),n=Math.max(n,e.x+e.w),e.w===i.w&&e.h===i.h){const e=r.pop();t<r.length&&(r[t]=e)}else e.h===i.h?(i.x+=e.w,i.w-=e.w):e.w===i.w?(i.y+=e.h,i.h-=e.h):(r.push({x:i.x+e.w,y:i.y,w:i.w-e.w,h:e.h}),i.y+=e.h,i.h-=e.h);break}}return{w:n,h:s,fill:e/(n*s)||0}}class eh{constructor(t,{pixelRatio:e,version:i,stretchX:r,stretchY:n,content:s,textFitWidth:a,textFitHeight:o}){this.paddedRect=t,this.pixelRatio=e,this.stretchX=r,this.stretchY=n,this.content=s,this.version=i,this.textFitWidth=a,this.textFitHeight=o}get tl(){return[this.paddedRect.x+1,this.paddedRect.y+1]}get br(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}}class ih{constructor(t,e){const i={},r={};this.haveRenderCallbacks=[];const n=[];this.addImages(t,i,n),this.addImages(e,r,n);const{w:s,h:a}=th(n),o=new Go({width:s||1,height:a||1});for(const e in t){const r=t[e],n=i[e].paddedRect;Go.copy(r.data,o,{x:0,y:0},{x:n.x+1,y:n.y+1},r.data)}for(const t in e){const i=e[t],n=r[t].paddedRect,s=n.x+1,a=n.y+1,l=i.data.width,c=i.data.height;Go.copy(i.data,o,{x:0,y:0},{x:s,y:a},i.data),Go.copy(i.data,o,{x:0,y:c-1},{x:s,y:a-1},{width:l,height:1}),Go.copy(i.data,o,{x:0,y:0},{x:s,y:a+c},{width:l,height:1}),Go.copy(i.data,o,{x:l-1,y:0},{x:s-1,y:a},{width:1,height:c}),Go.copy(i.data,o,{x:0,y:0},{x:s+l,y:a},{width:1,height:c})}this.image=o,this.iconPositions=i,this.patternPositions=r}addImages(t,e,i){for(const r in t){const n=t[r],s={x:0,y:0,w:n.data.width+2,h:n.data.height+2};i.push(s),e[r]=new eh(s,n),n.hasRenderCallback&&this.haveRenderCallbacks.push(r)}}patchUpdatedImages(t,e){t.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const i in t.updatedImages)this.patchUpdatedImage(this.iconPositions[i],t.getImage(i),e),this.patchUpdatedImage(this.patternPositions[i],t.getImage(i),e)}patchUpdatedImage(t,e,i){if(!t||!e)return;if(t.version===e.version)return;t.version=e.version;const[r,n]=t.tl;i.update(e.data,void 0,{x:r,y:n})}}var rh;vn("ImagePosition",eh),vn("ImageAtlas",ih),t.ah=void 0,(rh=t.ah||(t.ah={}))[rh.none=0]="none",rh[rh.horizontal=1]="horizontal",rh[rh.vertical=2]="vertical",rh[rh.horizontalOnly=3]="horizontalOnly";const nh=-17;class sh{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(t,e){const i=new sh;return i.scale=t||1,i.fontStack=e,i}static forImage(t){const e=new sh;return e.imageName=t,e}}class ah{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(t,e){const i=new ah;for(let r=0;r<t.sections.length;r++){const n=t.sections[r];n.image?i.addImageSection(n):i.addTextSection(n,e)}return i}length(){return this.text.length}getSection(t){return this.sections[this.sectionIndex[t]]}getSectionIndex(t){return this.sectionIndex[t]}getCharCode(t){return this.text.charCodeAt(t)}verticalizePunctuation(){this.text=function(t){let e="";for(let i=0;i<t.length;i++){const r=t.charCodeAt(i+1)||null,n=t.charCodeAt(i-1)||null;e+=r&&ss(r)&&!Pc[t[i+1]]||n&&ss(n)&&!Pc[t[i-1]]||!Pc[t[i]]?t[i]:Pc[t[i]]}return e}(this.text)}trim(){let t=0;for(let e=0;e<this.text.length&&lh[this.text.charCodeAt(e)];e++)t++;let e=this.text.length;for(let i=this.text.length-1;i>=0&&i>=t&&lh[this.text.charCodeAt(i)];i--)e--;this.text=this.text.substring(t,e),this.sectionIndex=this.sectionIndex.slice(t,e)}substring(t,e){const i=new ah;return i.text=this.text.substring(t,e),i.sectionIndex=this.sectionIndex.slice(t,e),i.sections=this.sections,i}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((t,e)=>Math.max(t,this.sections[e].scale),0)}addTextSection(t,e){this.text+=t.text,this.sections.push(sh.forText(t.scale,t.fontStack||e));const i=this.sections.length-1;for(let e=0;e<t.text.length;++e)this.sectionIndex.push(i)}addImageSection(t){const e=t.image?t.image.name:"";if(0===e.length)return void T("Can't add FormattedSection with an empty image.");const i=this.getNextImageSectionCharCode();i?(this.text+=String.fromCharCode(i),this.sections.push(sh.forImage(e)),this.sectionIndex.push(this.sections.length-1)):T("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function oh(e,i,r,n,s,a,o,l,c,h,u,d,p,f,m){const _=ah.fromFeature(e,s);let g;d===t.ah.vertical&&_.verticalizePunctuation();const{processBidirectionalText:y,processStyledBidirectionalText:x}=hs;if(y&&1===_.sections.length){g=[];const t=y(_.toString(),_h(_,h,a,i,n,f));for(const e of t){const t=new ah;t.text=e,t.sections=_.sections;for(let i=0;i<e.length;i++)t.sectionIndex.push(0);g.push(t)}}else if(x){g=[];const t=x(_.text,_.sectionIndex,_h(_,h,a,i,n,f));for(const e of t){const t=new ah;t.text=e[0],t.sectionIndex=e[1],t.sections=_.sections,g.push(t)}}else g=function(t,e){const i=[],r=t.text;let n=0;for(const r of e)i.push(t.substring(n,r)),n=r;return n<r.length&&i.push(t.substring(n,r.length)),i}(_,_h(_,h,a,i,n,f));const v=[],b={positionedLines:v,text:_.toString(),top:u[1],bottom:u[1],left:u[0],right:u[0],writingMode:d,iconsInText:!1,verticalizable:!1};return function(e,i,r,n,s,a,o,l,c,h,u,d){let p=0,f=nh,m=0,_=0;const g="right"===l?1:"left"===l?0:.5;let y=0;for(const o of s){o.trim();const s=o.getMaxScale(),l=(s-1)*Ac,v={positionedGlyphs:[],lineOffset:0};e.positionedLines[y]=v;const b=v.positionedGlyphs;let w=0;if(!o.length()){f+=a,++y;continue}for(let a=0;a<o.length();a++){const m=o.getSection(a),_=o.getSectionIndex(a),g=o.getCharCode(a);let y=0,v=null,T=null,S=null,I=Ac;const P=!(c===t.ah.horizontal||!u&&!ns(g)||u&&(lh[g]||(x=g,/\p{sc=Arab}/u.test(String.fromCodePoint(x)))));if(m.imageName){const t=n[m.imageName];if(!t)continue;S=m.imageName,e.iconsInText=e.iconsInText||!0,T=t.paddedRect;const i=t.displaySize;m.scale=m.scale*Ac/d,v={width:i[0],height:i[1],left:1,top:-3,advance:P?i[1]:i[0]},y=l+(Ac-i[1]*m.scale),I=v.advance;const r=P?i[0]*m.scale-Ac*s:i[1]*m.scale-Ac*s;r>0&&r>w&&(w=r)}else{const t=r[m.fontStack],e=t&&t[g];if(e&&e.rect)T=e.rect,v=e.metrics;else{const t=i[m.fontStack],e=t&&t[g];if(!e)continue;v=e.metrics}y=(s-m.scale)*Ac}P?(e.verticalizable=!0,b.push({glyph:g,imageName:S,x:p,y:f+y,vertical:P,scale:m.scale,fontStack:m.fontStack,sectionIndex:_,metrics:v,rect:T}),p+=I*m.scale+h):(b.push({glyph:g,imageName:S,x:p,y:f+y,vertical:P,scale:m.scale,fontStack:m.fontStack,sectionIndex:_,metrics:v,rect:T}),p+=v.advance*m.scale+h)}0!==b.length&&(m=Math.max(p-h,m),yh(b,0,b.length-1,g,w)),p=0;const T=a*s+w;v.lineOffset=Math.max(w,l),f+=T,_=Math.max(T,_),++y}var x;const v=f-nh,{horizontalAlign:b,verticalAlign:w}=gh(o);(function(t,e,i,r,n,s,a,o,l){const c=(e-i)*n;let h=0;h=s!==a?-o*r-nh:(-r*l+.5)*a;for(const e of t)for(const t of e.positionedGlyphs)t.x+=c,t.y+=h})(e.positionedLines,g,b,w,m,_,a,v,s.length),e.top+=-w*v,e.bottom=e.top+v,e.left+=-b*m,e.right=e.left+m}(b,i,r,n,g,o,l,c,d,h,p,m),!function(t){for(const e of t)if(0!==e.positionedGlyphs.length)return!1;return!0}(v)&&b}const lh={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},ch={10:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},hh={40:!0};function uh(t,e,i,r,n,s){if(e.imageName){const t=r[e.imageName];return t?t.displaySize[0]*e.scale*Ac/s+n:0}{const r=i[e.fontStack],s=r&&r[t];return s?s.metrics.advance*e.scale+n:0}}function dh(t,e,i,r){const n=Math.pow(t-e,2);return r?t<e?n/2:2*n:n+Math.abs(i)*i}function ph(t,e,i){let r=0;return 10===t&&(r-=1e4),i&&(r+=150),40!==t&&65288!==t||(r+=50),41!==e&&65289!==e||(r+=50),r}function fh(t,e,i,r,n,s){let a=null,o=dh(e,i,n,s);for(const t of r){const r=dh(e-t.x,i,n,s)+t.badness;r<=o&&(a=t,o=r)}return{index:t,x:e,priorBreak:a,badness:o}}function mh(t){return t?mh(t.priorBreak).concat(t.index):[]}function _h(t,e,i,r,n,s){if(!t)return[];const a=[],o=function(t,e,i,r,n,s){let a=0;for(let i=0;i<t.length();i++){const o=t.getSection(i);a+=uh(t.getCharCode(i),o,r,n,e,s)}return a/Math.max(1,Math.ceil(a/i))}(t,e,i,r,n,s),l=t.text.indexOf("​")>=0;let c=0;for(let i=0;i<t.length();i++){const u=t.getSection(i),d=t.getCharCode(i);if(lh[d]||(c+=uh(d,u,r,n,e,s)),i<t.length()-1){const e=!((h=d)<11904)&&(!!Wn(h)||!!Zn(h)||!!$n(h)||!!Nn(h)||!!qn(h)||!!Jn(h)||!!Vn(h)||!!Xn(h)||rs.test(String.fromCodePoint(h)));(ch[d]||e||u.imageName||i!==t.length()-2&&hh[t.getCharCode(i+1)])&&a.push(fh(i+1,c,o,a,ph(d,t.getCharCode(i+1),e&&l),!1))}}var h;return mh(fh(t.length(),c,o,a,0,!0))}function gh(t){let e=.5,i=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(t){case"bottom":case"bottom-right":case"bottom-left":i=1;break;case"top":case"top-right":case"top-left":i=0}return{horizontalAlign:e,verticalAlign:i}}function yh(t,e,i,r,n){if(!r&&!n)return;const s=t[i],a=(t[i].x+s.metrics.advance*s.scale)*r;for(let r=e;r<=i;r++)t[r].x-=a,t[r].y+=n}function xh(t,e,i){const{horizontalAlign:r,verticalAlign:n}=gh(i),s=e[0]-t.displaySize[0]*r,a=e[1]-t.displaySize[1]*n;return{image:t,top:a,bottom:a+t.displaySize[1],left:s,right:s+t.displaySize[0]}}function vh(t){var e,i;let r=t.left,n=t.top,s=t.right-r,a=t.bottom-n;const o=null!==(e=t.image.textFitWidth)&&void 0!==e?e:"stretchOrShrink",l=null!==(i=t.image.textFitHeight)&&void 0!==i?i:"stretchOrShrink",c=(t.image.content[2]-t.image.content[0])/(t.image.content[3]-t.image.content[1]);if("proportional"===l){if("stretchOnly"===o&&s/a<c||"proportional"===o){const t=Math.ceil(a*c);r*=t/s,s=t}}else if("proportional"===o&&"stretchOnly"===l&&0!==c&&s/a>c){const t=Math.ceil(s/c);n*=t/a,a=t}return{x1:r,y1:n,x2:r+s,y2:n+a}}function bh(t,e,i,r,n,s){const a=t.image;let o;if(a.content){const t=a.content,e=a.pixelRatio||1;o=[t[0]/e,t[1]/e,a.displaySize[0]-t[2]/e,a.displaySize[1]-t[3]/e]}const l=e.left*s,c=e.right*s;let h,u,d,p;"width"===i||"both"===i?(p=n[0]+l-r[3],u=n[0]+c+r[1]):(p=n[0]+(l+c-a.displaySize[0])/2,u=p+a.displaySize[0]);const f=e.top*s,m=e.bottom*s;return"height"===i||"both"===i?(h=n[1]+f-r[0],d=n[1]+m+r[2]):(h=n[1]+(f+m-a.displaySize[1])/2,d=h+a.displaySize[1]),{image:a,top:h,right:u,bottom:d,left:p,collisionPadding:o}}const wh=128,Th=32640;function Sh(t,e){const{expression:i}=e;if("constant"===i.kind)return{kind:"constant",layoutSize:i.evaluate(new us(t+1))};if("source"===i.kind)return{kind:"source"};{const{zoomStops:e,interpolationType:r}=i;let n=0;for(;n<e.length&&e[n]<=t;)n++;n=Math.max(0,n-1);let s=n;for(;s<e.length&&e[s]<t+1;)s++;s=Math.min(e.length-1,s);const a=e[n],o=e[s];return"composite"===i.kind?{kind:"composite",minZoom:a,maxZoom:o,interpolationType:r}:{kind:"camera",minZoom:a,maxZoom:o,minSize:i.evaluate(new us(a)),maxSize:i.evaluate(new us(o)),interpolationType:r}}}function Ih(t,e,i){let r="never";const n=t.get(e);return n?r=n:t.get(i)&&(r="always"),r}const Ph=Bl.VectorTileFeature.types,Ah=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Mh(t,e,i,r,n,s,a,o,l,c,h,u,d){const p=o?Math.min(Th,Math.round(o[0])):0,f=o?Math.min(Th,Math.round(o[1])):0;t.emplaceBack(e,i,Math.round(32*r),Math.round(32*n),s,a,(p<<1)+(l?1:0),f,16*c,16*h,256*u,256*d)}function kh(t,e,i){t.emplaceBack(e.x,e.y,i),t.emplaceBack(e.x,e.y,i),t.emplaceBack(e.x,e.y,i),t.emplaceBack(e.x,e.y,i)}function Ch(t){for(const e of t.sections)if(cs(e.text))return!0;return!1}class zh{constructor(t){this.layoutVertexArray=new ba,this.indexArray=new Pa,this.programConfigurations=t,this.segments=new Ca,this.dynamicLayoutVertexArray=new wa,this.opacityVertexArray=new Ta,this.hasVisibleVertices=!1,this.placedSymbolArray=new sa}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length}upload(t,e,i,r){this.isEmpty()||(i&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,vc.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,bc.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,Ah,!0),this.opacityVertexBuffer.itemSize=1),(i||r)&&this.programConfigurations.upload(t))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}vn("SymbolBuffers",zh);class Eh{constructor(t,e,i){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new i,this.segments=new Ca,this.collisionVertexArray=new Ia}upload(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,wc.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}vn("CollisionBuffers",Eh);class Dh{constructor(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(t=>
313t.id),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=Eo([]),this.placementViewportMatrix=Eo([]);const i=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Sh(this.zoom,i["text-size"]),this.iconSizeData=Sh(this.zoom,i["icon-size"]);const r=this.layers[0].layout,n=r.get("symbol-sort-key"),s=r.get("symbol-z-order");this.canOverlap="never"!==Ih(r,"text-overlap","text-allow-overlap")||"never"!==Ih(r,"icon-overlap","icon-allow-overlap")||r.get("text-ignore-placement")||r.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==s&&!n.isConstant(),this.sortFeaturesByY=("viewport-y"===s||"auto"===s&&!this.sortFeaturesByKey)&&this.canOverlap,"point"===r.get("symbol-placement")&&(this.writingModes=r.get("text-writing-mode").map(e=>t.ah[e])),this.stateDependentLayerIds=this.layers.filter(t=>t.isStateDependent()).map(t=>t.id),this.sourceID=e.sourceID}createArrays(){this.text=new zh(new io(this.layers,this.zoom,t=>/^text/.test(t))),this.icon=new zh(new io(this.layers,this.zoom,t=>/^icon/.test(t))),this.glyphOffsetArray=new la,this.lineVertexArray=new ca,this.symbolInstances=new oa,this.textAnchorOffsets=new ua}calculateGlyphDependencies(t,e,i,r,n){for(let s=0;s<t.length;s++)if(e[t.charCodeAt(s)]=!0,(i||r)&&n){const i=Pc[t.charAt(s)];
vendor: 24,424 bytes, line 313
313i&&(e[i.charCodeAt(0)]=!0)}}populate(e,i,r){const n=this.layers[0],s=n.layout,a=s.get("text-font"),o=s.get("text-field"),l=s.get("icon-image"),c=("constant"!==o.value.kind||o.value.value instanceof Kt&&!o.value.value.isEmpty()||o.value.value.toString().length>0)&&("constant"!==a.value.kind||a.value.value.length>0),h="constant"!==l.value.kind||!!l.value.value||Object.keys(l.parameters).length>0,u=s.get("symbol-sort-key");if(this.features=[],!c&&!h)return;const d=i.iconDependencies,p=i.glyphDependencies,f=i.availableImages,m=new us(this.zoom);for(const{feature:i,id:o,index:l,sourceLayerIndex:_}of e){const e=n._featureFilter.needGeometry,g=co(i,e);if(!n._featureFilter.filter(m,g,r))continue;let y,x;if(e||(g.geometry=lo(i)),c){const t=n.getValueAndResolveTokens("text-field",g,r,f),e=Kt.factory(t),i=this.hasRTLText=this.hasRTLText||Ch(e);(!i||"unavailable"===hs.getRTLTextPluginStatus()||i&&hs.isParsed())&&(y=Ic(e,n,g))}if(h){const t=n.getValueAndResolveTokens("icon-image",g,r,f);x=t instanceof te?t:te.fromString(t)}if(!y&&!x)continue;const v=this.sortFeaturesByKey?u.evaluate(g,{},r):void 0;if(this.features.push({id:o,text:y,icon:x,index:l,sourceLayerIndex:_,geometry:g.geometry,properties:i.properties,type:Ph[i.type],sortKey:v}),x&&(d[x.name]=!0),y){const e=a.evaluate(g,{},r).join(","),i="viewport"!==s.get("text-rotation-alignment")&&"point"!==s.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(t.ah.vertical)>=0;for(const t of y.sections)if(t.image)d[t.image.name]=!0;else{const r=Yn(y.toString()),n=t.fontStack||e,s=p[n]=p[n]||{};this.calculateGlyphDependencies(t.text,s,i,this.allowVerticalPlacement,r)}}}"line"===s.get("symbol-placement")&&(this.features=function(t){const e={},i={},r=[];let n=0;function s(e){r.push(t[e]),n++}function a(t,e,n){const s=i[t];return delete i[t],i[e]=s,r[s].geometry[0].pop(),r[s].geometry[0]=r[s].geometry[0].concat(n[0]),s}function o(t,i,n){const s=e[i];return delete e[i],e[t]=s,r[s].geometry[0].shift(),r[s].geometry[0]=n[0].concat(r[s].geometry[0]),s}function l(t,e,i){const r=i?e[0][e[0].length-1]:e[0][0];return`${t}:${r.x}:${r.y}`}for(let c=0;c<t.length;c++){const h=t[c],u=h.geometry,d=h.text?h.text.toString():null;if(!d){s(c);continue}const p=l(d,u),f=l(d,u,!0);if(p in i&&f in e&&i[p]!==e[f]){const t=o(p,f,u),n=a(p,f,r[t].geometry);delete e[p],delete i[f],i[l(d,r[n].geometry,!0)]=n,r[t].geometry=null}else p in i?a(p,f,u):f in e?o(p,f,u):(s(c),e[p]=n-1,i[f]=n-1)}return r.filter(t=>t.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((t,e)=>t.sortKey-e.sortKey)}update(t,e,i){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers,i),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers,i))}isEmpty(){return 0===this.symbolInstances.length&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(t,e){const i=this.lineVertexArray.length;if(void 0!==t.segment){let i=t.dist(e[t.segment+1]),r=t.dist(e[t.segment]);const n={};for(let r=t.segment+1;r<e.length;r++)n[r]={x:e[r].x,y:e[r].y,tileUnitDistanceFromAnchor:i},r<e.length-1&&(i+=e[r+1].dist(e[r]));for(let i=t.segment||0;i>=0;i--)n[i]={x:e[i].x,y:e[i].y,tileUnitDistanceFromAnchor:r},i>0&&(r+=e[i-1].dist(e[i]));for(let t=0;t<e.length;t++){const e=n[t];this.lineVertexArray.emplaceBack(e.x,e.y,e.tileUnitDistanceFromAnchor)}}return{lineStartIndex:i,lineLength:this.lineVertexArray.length-i}}addSymbols(e,i,r,n,s,a,o,l,c,h,u,d){const p=e.indexArray,f=e.layoutVertexArray,m=e.segments.prepareSegment(4*i.length,f,p,this.canOverlap?a.sortKey:void 0),_=this.glyphOffsetArray.length,g=m.vertexLength,y=this.allowVerticalPlacement&&o===t.ah.vertical?Math.PI/2:0,x=a.text&&a.text.sections;for(let t=0;t<i.length;t++){const{tl:n,tr:s,bl:o,br:c,tex:h,pixelOffsetTL:u,pixelOffsetBR:_,minFontScaleX:g,minFontScaleY:v,glyphOffset:b,isSDF:w,sectionIndex:T}=i[t],S=m.vertexLength,I=b[1];Mh(f,l.x,l.y,n.x,I+n.y,h.x,h.y,r,w,u.x,u.y,g,v),Mh(f,l.x,l.y,s.x,I+s.y,h.x+h.w,h.y,r,w,_.x,u.y,g,v),Mh(f,l.x,l.y,o.x,I+o.y,h.x,h.y+h.h,r,w,u.x,_.y,g,v),Mh(f,l.x,l.y,c.x,I+c.y,h.x+h.w,h.y+h.h,r,w,_.x,_.y,g,v),kh(e.dynamicLayoutVertexArray,l,y),p.emplaceBack(S,S+1,S+2),p.emplaceBack(S+1,S+2,S+3),m.vertexLength+=4,m.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(b[0]),t!==i.length-1&&T===i[t+1].sectionIndex||e.programConfigurations.populatePaintArrays(f.length,a,a.index,{},d,x&&x[T])}e.placedSymbolArray.emplaceBack(l.x,l.y,_,this.glyphOffsetArray.length-_,g,c,h,l.segment,r?r[0]:0,r?r[1]:0,n[0],n[1],o,0,!1,0,u)}_addCollisionDebugVertex(t,e,i,r,n,s){return e.emplaceBack(0,0),t.emplaceBack(i.x,i.y,r,n,Math.round(s.x),Math.round(s.y))}addCollisionDebugVertices(t,e,i,r,n,a,o){const l=n.segments.prepareSegment(4,n.layoutVertexArray,n.indexArray),c=l.vertexLength,h=n.layoutVertexArray,u=n.collisionVertexArray,d=o.anchorX,p=o.anchorY;this._addCollisionDebugVertex(h,u,a,d,p,new s(t,e)),this._addCollisionDebugVertex(h,u,a,d,p,new s(i,e)),this._addCollisionDebugVertex(h,u,a,d,p,new s(i,r)),this._addCollisionDebugVertex(h,u,a,d,p,new s(t,r)),l.vertexLength+=4;const f=n.indexArray;f.emplaceBack(c,c+1),f.emplaceBack(c+1,c+2),f.emplaceBack(c+2,c+3),f.emplaceBack(c+3,c),l.primitiveLength+=4}addDebugCollisionBoxes(t,e,i,r){for(let n=t;n<e;n++){const t=this.collisionBoxArray.get(n);this.addCollisionDebugVertices(t.x1,t.y1,t.x2,t.y2,r?this.textCollisionBox:this.iconCollisionBox,t.anchorPoint,i)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new Eh(Sa,Tc.members,Aa),this.iconCollisionBox=new Eh(Sa,Tc.members,Aa);for(let t=0;t<this.symbolInstances.length;t++){const e=this.symbolInstances.get(t);this.addDebugCollisionBoxes(e.textBoxStartIndex,e.textBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.verticalTextBoxStartIndex,e.verticalTextBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.iconBoxStartIndex,e.iconBoxEndIndex,e,!1),this.addDebugCollisionBoxes(e.verticalIconBoxStartIndex,e.verticalIconBoxEndIndex,e,!1)}}_deserializeCollisionBoxesForSymbol(t,e,i,r,n,s,a,o,l){const c={};for(let r=e;r<i;r++){const e=t.get(r);c.textBox={x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,anchorPointX:e.anchorPointX,anchorPointY:e.anchorPointY},c.textFeatureIndex=e.featureIndex;break}for(let e=r;e<n;e++){const i=t.get(e);c.verticalTextBox={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2,anchorPointX:i.anchorPointX,anchorPointY:i.anchorPointY},c.verticalTextFeatureIndex=i.featureIndex;break}for(let e=s;e<a;e++){const i=t.get(e);c.iconBox={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2,anchorPointX:i.anchorPointX,anchorPointY:i.anchorPointY},c.iconFeatureIndex=i.featureIndex;break}for(let e=o;e<l;e++){const i=t.get(e);c.verticalIconBox={x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2,anchorPointX:i.anchorPointX,anchorPointY:i.anchorPointY},c.verticalIconFeatureIndex=i.featureIndex;break}return c}deserializeCollisionBoxes(t){this.collisionArrays=[];for(let e=0;e<this.symbolInstances.length;e++){const i=this.symbolInstances.get(e);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,i.textBoxStartIndex,i.textBoxEndIndex,i.verticalTextBoxStartIndex,i.verticalTextBoxEndIndex,i.iconBoxStartIndex,i.iconBoxEndIndex,i.verticalIconBoxStartIndex,i.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(t,e){const i=t.placedSymbolArray.get(e),r=i.vertexStartIndex+4*i.numGlyphs;for(let e=i.vertexStartIndex;e<r;e+=4)t.indexArray.emplaceBack(e,e+1,e+2),t.indexArray.emplaceBack(e+1,e+2,e+3)}getSortedSymbolIndexes(t){if(this.sortedAngle===t&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;const e=Math.sin(t),i=Math.cos(t),r=[],n=[],s=[];for(let t=0;t<this.symbolInstances.length;++t){s.push(t);const a=this.symbolInstances.get(t);r.push(0|Math.round(e*a.anchorX+i*a.anchorY)),n.push(a.featureIndex)}return s.sort((t,e)=>r[t]-r[e]||n[e]-n[t]),s}addToSortKeyRanges(t,e){const i=this.sortKeyRanges[this.sortKeyRanges.length-1];i&&i.sortKey===e?i.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:e,symbolInstanceStart:t,symbolInstanceEnd:t+1})}sortFeatures(t){if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const t of this.symbolInstanceIndexes){const e=this.symbolInstances.get(t);this.featureSortOrder.push(e.featureIndex),[e.rightJustifiedTextSymbolIndex,e.centerJustifiedTextSymbolIndex,e.leftJustifiedTextSymbolIndex].forEach((t,e,i)=>{t>=0&&i.indexOf(t)===e&&this.addIndicesForPlacedSymbol(this.text,t)}),e.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,e.verticalPlacedTextSymbolIndex),e.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,e.placedIconSymbolIndex),e.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,e.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let Lh,Rh;vn("SymbolBucket",Dh,{omit:["layers","collisionBoxArray","features","compareText"]}),Dh.MAX_GLYPHS=65535,Dh.addDynamicAttributes=kh;var Bh={get paint(){return Rh=Rh||new Is({"icon-opacity":new bs(G.paint_symbol["icon-opacity"]),"icon-color":new bs(G.paint_symbol["icon-color"]),"icon-halo-color":new bs(G.paint_symbol["icon-halo-color"]),"icon-halo-width":new bs(G.paint_symbol["icon-halo-width"]),"icon-halo-blur":new bs(G.paint_symbol["icon-halo-blur"]),"icon-translate":new vs(G.paint_symbol["icon-translate"]),"icon-translate-anchor":new vs(G.paint_symbol["icon-translate-anchor"]),"text-opacity":new bs(G.paint_symbol["text-opacity"]),"text-color":new bs(G.paint_symbol["text-color"],{runtimeType:dt,getOverride:t=>t.textColor,hasOverride:t=>!!t.textColor}),"text-halo-color":new bs(G.paint_symbol["text-halo-color"]),"text-halo-width":new bs(G.paint_symbol["text-halo-width"]),"text-halo-blur":new bs(G.paint_symbol["text-halo-blur"]),"text-translate":new vs(G.paint_symbol["text-translate"]),"text-translate-anchor":new vs(G.paint_symbol["text-translate-anchor"])})},get layout(){return Lh=Lh||new Is({"symbol-placement":new vs(G.layout_symbol["symbol-placement"]),"symbol-spacing":new vs(G.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new vs(G.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new bs(G.layout_symbol["symbol-sort-key"]),"symbol-z-order":new vs(G.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new vs(G.layout_symbol["icon-allow-overlap"]),"icon-overlap":new vs(G.layout_symbol["icon-overlap"]),"icon-ignore-placement":new vs(G.layout_symbol["icon-ignore-placement"]),"icon-optional":new vs(G.layout_symbol["icon-optional"]),"icon-rotation-alignment":new vs(G.layout_symbol["icon-rotation-alignment"]),"icon-size":new bs(G.layout_symbol["icon-size"]),"icon-text-fit":new vs(G.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new vs(G.layout_symbol["icon-text-fit-padding"]),"icon-image":new bs(G.layout_symbol["icon-image"]),"icon-rotate":new bs(G.layout_symbol["icon-rotate"]),"icon-padding":new bs(G.layout_symbol["icon-padding"]),"icon-keep-upright":new vs(G.layout_symbol["icon-keep-upright"]),"icon-offset":new bs(G.layout_symbol["icon-offset"]),"icon-anchor":new bs(G.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new vs(G.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new vs(G.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new vs(G.layout_symbol["text-rotation-alignment"]),"text-field":new bs(G.layout_symbol["text-field"]),"text-font":new bs(G.layout_symbol["text-font"]),"text-size":new bs(G.layout_symbol["text-size"]),"text-max-width":new bs(G.layout_symbol["text-max-width"]),"text-line-height":new vs(G.layout_symbol["text-line-height"]),"text-letter-spacing":new bs(G.layout_symbol["text-letter-spacing"]),"text-justify":new bs(G.layout_symbol["text-justify"]),"text-radial-offset":new bs(G.layout_symbol["text-radial-offset"]),"text-variable-anchor":new vs(G.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new bs(G.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new bs(G.layout_symbol["text-anchor"]),"text-max-angle":new vs(G.layout_symbol["text-max-angle"]),"text-writing-mode":new vs(G.layout_symbol["text-writing-mode"]),"text-rotate":new bs(G.layout_symbol["text-rotate"]),"text-padding":new vs(G.layout_symbol["text-padding"]),"text-keep-upright":new vs(G.layout_symbol["text-keep-upright"]),"text-transform":new bs(G.layout_symbol["text-transform"]),"text-offset":new bs(G.layout_symbol["text-offset"]),"text-allow-overlap":new vs(G.layout_symbol["text-allow-overlap"]),"text-overlap":new vs(G.layout_symbol["text-overlap"]),"text-ignore-placement":new vs(G.layout_symbol["text-ignore-placement"]),"text-optional":new vs(G.layout_symbol["text-optional"])})}};class Fh{constructor(t){if(void 0===t.property.overrides)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=t.property.overrides?t.property.overrides.runtimeType:lt,this.defaultValue=t}evaluate(t){if(t.formattedSection){const e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification["default"]}eachChild(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}vn("FormatSectionOverride",Fh,{omit:["defaultValue"]});class Oh extends As{constructor(t){super(t,Bh)}recalculate(t,e){if(super.recalculate(t,e),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]="map"===this.layout.get("text-rotation-alignment")?"map":"viewport"),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){const t=this.layout.get("text-writing-mode");if(t){const e=[];for(const i of t)e.indexOf(i)<0&&e.push(i);this.layout._values["text-writing-mode"]=e}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(t,e,i,r){const n=this.layout.get(t).evaluate(e,{},i,r),s=this._unevaluatedLayout._values[t];return s.isDataDriven()||gr(s.value)||!n?n:function(t,e){return e.replace(/{([^{}]+)}/g,(e,i)=>t&&i in t?String(t[i]):"")}(e.properties,n)}createBucket(t){return new Dh(t)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const t of Bh.paint.overridableProperties){if(!Oh.hasPaintOverride(this.layout,t))continue;const e=this.paint.get(t),i=new Fh(e),r=new _r(i,e.property.specification);let n=null;n="constant"===e.value.kind||"source"===e.value.kind?new xr("source",r):new vr("composite",r,e.value.zoomStops),this.paint._values[t]=new ys(e.property,n,e.parameters)}}_handleOverridablePaintPropertyUpdate(t,e,i){return!(!this.layout||e.isDataDriven()||i.isDataDriven())&&Oh.hasPaintOverride(this.layout,t)}static hasPaintOverride(t,e){const i=t.get("text-field"),r=Bh.paint.properties[e];let n=!1;const s=t=>{for(const e of t)if(r.overrides&&r.overrides.hasOverride(e))return void(n=!0)};if("constant"===i.value.kind&&i.value.value instanceof Kt)s(i.value.value.sections);else if("source"===i.value.kind){const t=e=>{n||(e instanceof se&&re(e.value)===_t?s(e.value.sections):e instanceof qe?s(e.sections):e.eachChild(t))},e=i.value;e._styleExpression&&t(e._styleExpression.expression)}return n}}let Vh;var Nh={get paint(){return Vh=Vh||new Is({"background-color":new vs(G.paint_background["background-color"]),"background-pattern":new Ts(G.paint_background["background-pattern"]),"background-opacity":new vs(G.paint_background["background-opacity"])})}};class jh extends As{constructor(t){super(t,Nh)}}let Uh;var $h={get paint(){return Uh=Uh||new Is({"raster-opacity":new vs(G.paint_raster["raster-opacity"]),"raster-hue-rotate":new vs(G.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new vs(G.paint_raster["raster-brightness-min"]),"raster-brightness-max":new vs(G.paint_raster["raster-brightness-max"]),"raster-saturation":new vs(G.paint_raster["raster-saturation"]),"raster-contrast":new vs(G.paint_raster["raster-contrast"]),"raster-resampling":new vs(G.paint_raster["raster-resampling"]),"raster-fade-duration":new vs(G.paint_raster["raster-fade-duration"])})}};class qh extends As{constructor(t){super(t,$h)}}class Zh extends As{constructor(t){super(t,{}),this.onAdd=t=>{this.implementation.onAdd&&this.implementation.onAdd(t,t.painter.context.gl)},this.onRemove=t=>{this.implementation.onRemove&&this.implementation.onRemove(t,t.painter.context.gl)},this.implementation=t}is3D(){return"3d"===this.implementation.renderingMode}hasOffscreenPass(){return void 0!==this.implementation.prerender}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class Gh{constructor(t){this._methodToThrottle=t,this._triggered=!1,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(()=>{this._triggered=!1,this._methodToThrottle()},0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}const Hh=6371008.8;class Xh{constructor(t,e){if(isNaN(t)||isNaN(e))throw new Error(`Invalid LngLat object: (${t}, ${e})`);if(this.lng=+t,this.lat=+e,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Xh(_(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(t){const e=Math.PI/180,i=this.lat*e,r=t.lat*e,n=Math.sin(i)*Math.sin(r)+Math.cos(i)*Math.cos(r)*Math.cos((t.lng-this.lng)*e);return Hh*Math.acos(Math.min(n,1))}static convert(t){if(t instanceof Xh)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new Xh(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new Xh(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}const Wh=2*Math.PI*Hh;function Kh(t){return Wh*Math.cos(t*Math.PI/180)}function Jh(t){return(180+t)/360}function Yh(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Qh(t,e){return t/Kh(e)}function tu(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}class eu{constructor(t,e,i=0){this.x=+t,this.y=+e,this.z=+i}static fromLngLat(t,e=0){const i=Xh.convert(t);return new eu(Jh(i.lng),Yh(i.lat),Qh(e,i.lat))}toLngLat(){return new Xh(360*this.x-180,tu(this.y))}toAltitude(){return this.z*Kh(tu(this.y))}meterInMercatorCoordinateUnits(){return 1/Wh*(t=tu(this.y),1/Math.cos(t*Math.PI/180));var t}}function iu(t,e,i){var r=2*Math.PI*6378137/256/Math.pow(2,i);return[t*r-2*Math.PI*6378137/2,e*r-2*Math.PI*6378137/2]}class ru{constructor(t,e,i){if(!function(t,e,i){return!(t<0||t>25||i<0||i>=Math.pow(2,t)||e<0||e>=Math.pow(2,t))}(t,e,i))throw new Error(`x=${e}, y=${i}, z=${t} outside of bounds. 0<=x<${Math.pow(2,t)}, 0<=y<${Math.pow(2,t)} 0<=z<=25 `);this.z=t,this.x=e,this.y=i,this.key=au(0,t,t,e,i)}equals(t){return this.z===t.z&&this.x===t.x&&this.y===t.y}url(t,e,i){const r=(s=this.y,a=this.z,o=iu(256*(n=this.x),256*(s=Math.pow(2,a)-s-1),a),l=iu(256*(n+1),256*(s+1),a),o[0]+","+o[1]+","+l[0]+","+l[1]);var n,s,a,o,l;const c=function(t,e,i){let r,n="";for(let s=t;s>0;s--)r=1<<s-1,n+=(e&r?1:0)+(i&r?2:0);return n}(this.z,this.x,this.y);return t[(this.x+this.y)%t.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String("tms"===i?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,e>1?"@2x":"").replace(/{quadkey}/g,c).replace(/{bbox-epsg-3857}/g,r)}isChildOf(t){const e=this.z-t.z;return e>0&&t.x===this.x>>e&&t.y===this.y>>e}getTilePoint(t){const e=Math.pow(2,this.z);return new s((t.x*e-this.x)*so,(t.y*e-this.y)*so)}toString(){return`${this.z}/${this.x}/${this.y}`}}class nu{constructor(t,e){this.wrap=t,this.canonical=e,this.key=au(t,e.z,e.z,e.x,e.y)}}class su{constructor(t,e,i,r,n){if(t<i)throw new Error(`overscaledZ should be >= z; overscaledZ = ${t}; z = ${i}`);this.overscaledZ=t,this.wrap=e,this.canonical=new ru(i,+r,+n),this.key=au(e,t,i,r,n)}clone(){return new su(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)}scaledTo(t){if(t>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${t}; overscaledZ = ${this.overscaledZ}`);const e=this.canonical.z-t;return t>this.canonical.z?new su(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new su(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)}calculateScaledKey(t,e){if(t>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${t}; overscaledZ = ${this.overscaledZ}`);const i=this.canonical.z-t;return t>this.canonical.z?au(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):au(this.wrap*+e,t,t,this.canonical.x>>i,this.canonical.y>>i)}isChildOf(t){if(t.wrap!==this.wrap)return!1;const e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ<this.overscaledZ&&t.canonical.x===this.canonical.x>>e&&t.canonical.y===this.canonical.y>>e}children(t){if(this.overscaledZ>=t)return[new su(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const e=this.canonical.z+1,i=2*this.canonical.x,r=2*this.canonical.y;return[new su(e,this.wrap,e,i,r),new su(e,this.wrap,e,i+1,r),new su(e,this.wrap,e,i,r+1),new su(e,this.wrap,e,i+1,r+1)]}isLessThan(t){return this.wrap<t.wrap||!(this.wrap>t.wrap)&&(this.overscaledZ<t.overscaledZ||!(this.overscaledZ>t.overscaledZ)&&(this.canonical.x<t.canonical.x||!(this.canonical.x>t.canonical.x)&&this.canonical.y<t.canonical.y))}wrapped(){return new su(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(t){return new su(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new nu(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(t){return this.canonical.getTilePoint(new eu(t.x-this.wrap,t.y))}}function au(t,e,i,r,n){(t*=2)<0&&(t=-1*t-1);const s=1<<i;return(s*s*t+s*n+r).toString(36)+i.toString(36)+e.toString(36)}vn("CanonicalTileID",ru),vn("OverscaledTileID",su,{omit:["posMatrix"]});class ou
vendor: 1,759 bytes, line 313
313{constructor(t,e,i,r=1,n=1,s=1,a=0){if(this.uid=t,e.height!==e.width)throw new RangeError("DEM tiles must be square");if(i&&!["mapbox","terrarium","custom"].includes(i))return void T(`"${i}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);this.stride=e.height;const o=this.dim=e.height-2;switch(this.data=new Uint32Array(e.data.buffer),i){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=r,this.greenFactor=n,this.blueFactor=s,this.baseShift=a;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let t=0;t<o;t++)this.data[this._idx(-1,t)]=this.data[this._idx(0,t)],this.data[this._idx(o,t)]=this.data[this._idx(o-1,t)],this.data[this._idx(t,-1)]=this.data[this._idx(t,0)],this.data[this._idx(t,o)]=this.data[this._idx(t,o-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(o,-1)]=this.data[this._idx(o-1,0)],this.data[this._idx(-1,o)]=this.data[this._idx(0,o-1)],this.data[this._idx(o,o)]=this.data[this._idx(o-1,o-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let t=0;t<o;t++)for(let e=0;e<o;e++){const i=this.get(t,e);i>this.max&&(this.max=i),i<this.min&&(this.min=i)}}get(t,e){const i=new Uint8Array(this.data.buffer),r=4*this._idx(t,e);return this.unpack(i[r],i[r+1],i[r+2])}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(t,e){if(t<-1||t>=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(e+1)*this.stride+(t+1)}unpack(t,e,i){return t*this.redFactor+e*this.greenFactor+i*this.blueFactor-this.baseShift}getPixels(){return new 
vendor: 26,671 bytes, line 313
313Go({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(t,e,i){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");let r=e*this.dim,n=e*this.dim+this.dim,s=i*this.dim,a=i*this.dim+this.dim;switch(e){case-1:r=n-1;break;case 1:n=r+1}switch(i){case-1:s=a-1;break;case 1:a=s+1}const o=-e*this.dim,l=-i*this.dim;for(let e=s;e<a;e++)for(let i=r;i<n;i++)this.data[this._idx(i,e)]=t.data[this._idx(i+o,e+l)]}}vn("DEMData",ou);class lu{constructor(t){this._stringToNumber={},this._numberToString=[];for(let e=0;e<t.length;e++){const i=t[e];this._stringToNumber[i]=e,this._numberToString[e]=i}}encode(t){return this._stringToNumber[t]}decode(t){if(t>=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${t} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[t]}}class cu{constructor(t,e,i,r,n){this.type="Feature",this._vectorTileFeature=t,t._z=e,t._x=i,t._y=r,this.properties=t.properties,this.id=n}get geometry(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(t){this._geometry=t}toJSON(){const t={geometry:this.geometry};for(const e in this)"_geometry"!==e&&"_vectorTileFeature"!==e&&(t[e]=this[e]);return t}}class hu{constructor(t,e){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new yn(so,16,0),this.grid3D=new yn(so,16,0),this.featureIndexArray=new pa,this.promoteId=e}insert(t,e,i,r,n,s){const a=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(i,r,n);const o=s?this.grid3D:this.grid;for(let t=0;t<e.length;t++){const i=e[t],r=[1/0,1/0,-1/0,-1/0];for(let t=0;t<i.length;t++){const e=i[t];r[0]=Math.min(r[0],e.x),r[1]=Math.min(r[1],e.y),r[2]=Math.max(r[2],e.x),r[3]=Math.max(r[3],e.y)}r[0]<so&&r[1]<so&&r[2]>=0&&r[3]>=0&&o.insert(a,r[0],r[1],r[2],r[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Bl.VectorTile(new Kc(this.rawTileData)).layers,this.sourceLayerCoder=new lu(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(t,e,i,r){this.loadVTLayers();const n=t.params||{},a=so/t.tileSize/t.scale,o=Pr(n.filter),l=t.queryGeometry,c=t.queryPadding*a,h=du(l),u=this.grid.query(h.minX-c,h.minY-c,h.maxX+c,h.maxY+c),d=du(t.cameraQueryGeometry),p=this.grid3D.query(d.minX-c,d.minY-c,d.maxX+c,d.maxY+c,(e,i,r,n)=>function(t,e,i,r,n){for(const s of t)if(e<=s.x&&i<=s.y&&r>=s.x&&n>=s.y)return!0;const a=[new s(e,i),new s(e,n),new s(r,n),new s(r,i)];if(t.length>2)for(const e of a)if(wo(t,e))return!0;for(let e=0;e<t.length-1;e++)if(To(t[e],t[e+1],a))return!0;return!1}(t.cameraQueryGeometry,e-c,i-c,r+c,n+c));for(const t of p)u.push(t);u.sort(pu);const f={};let m;for(let s=0;s<u.length;s++){const c=u[s];if(c===m)continue;m=c;const h=this.featureIndexArray.get(c);let d=null;this.loadMatchingFeature(f,h.bucketIndex,h.sourceLayerIndex,h.featureIndex,o,n.layers,n.availableImages,e,i,r,(e,i,r)=>(d||(d=lo(e)),i.queryIntersectsFeature(l,e,r,d,this.z,t.transform,a,t.pixelPosMatrix)))}return f}loadMatchingFeature(t,e,i,r,n,s,a,o,l,c,h){const u=this.bucketLayerIDs[e];if(s&&!function(t,e){for(let i=0;i<t.length;i++)if(e.indexOf(t[i])>=0)return!0;return!1}(s,u))return;const d=this.sourceLayerCoder.decode(i),p=this.vtLayers[d].feature(r);if(n.needGeometry){const t=co(p,!0);if(!n.filter(new us(this.tileID.overscaledZ),t,this.tileID.canonical))return}else if(!n.filter(new us(this.tileID.overscaledZ),p))return;const f=this.getId(p,d);for(let e=0;e<u.length;e++){const i=u[e];if(s&&s.indexOf(i)<0)continue;const n=o[i];if(!n)continue;let d={};f&&c&&(d=c.getState(n.sourceLayer||"_geojsonTileLayer",f));const m=g({},l[i]);m.paint=uu(m.paint,n.paint,p,d,a),m.layout=uu(m.layout,n.layout,p,d,a);const _=!h||h(p,n,d);if(!_)continue;const y=new cu(p,this.z,this.x,this.y,f);y.layer=m;let x=t[i];void 0===x&&(x=t[i]=[]),x.push({featureIndex:r,feature:y,intersectionZ:_})}}lookupSymbolFeatures(t,e,i,r,n,s,a,o){const l={};this.loadVTLayers();const c=Pr(n);for(const n of t)this.loadMatchingFeature(l,i,r,n,c,s,a,o,e);return l}hasLayer(t){for(const e of this.bucketLayerIDs)for(const i of e)if(t===i)return!0;return!1}getId(t,e){let i=t.id;return this.promoteId&&(i=t.properties["string"==typeof this.promoteId?this.promoteId:this.promoteId[e]],"boolean"==typeof i&&(i=Number(i))),i}}function uu(t,e,i,r,n){return x(t,(t,s)=>{const a=e instanceof xs?e.get(s):null;return a&&a.evaluate?a.evaluate(i,r,n):a})}function du(t){let e=1/0,i=1/0,r=-1/0,n=-1/0;for(const s of t)e=Math.min(e,s.x),i=Math.min(i,s.y),r=Math.max(r,s.x),n=Math.max(n,s.y);return{minX:e,minY:i,maxX:r,maxY:n}}function pu(t,e){return e-t}function fu(t,e,i,r,n){const a=[];for(let o=0;o<t.length;o++){const l=t[o];let c;for(let t=0;t<l.length-1;t++){let o=l[t],h=l[t+1];o.x<e&&h.x<e||(o.x<e?o=new s(e,o.y+(e-o.x)/(h.x-o.x)*(h.y-o.y))._round():h.x<e&&(h=new s(e,o.y+(e-o.x)/(h.x-o.x)*(h.y-o.y))._round()),o.y<i&&h.y<i||(o.y<i?o=new s(o.x+(i-o.y)/(h.y-o.y)*(h.x-o.x),i)._round():h.y<i&&(h=new s(o.x+(i-o.y)/(h.y-o.y)*(h.x-o.x),i)._round()),o.x>=r&&h.x>=r||(o.x>=r?o=new s(r,o.y+(r-o.x)/(h.x-o.x)*(h.y-o.y))._round():h.x>=r&&(h=new s(r,o.y+(r-o.x)/(h.x-o.x)*(h.y-o.y))._round()),o.y>=n&&h.y>=n||(o.y>=n?o=new s(o.x+(n-o.y)/(h.y-o.y)*(h.x-o.x),n)._round():h.y>=n&&(h=new s(o.x+(n-o.y)/(h.y-o.y)*(h.x-o.x),n)._round()),c&&o.equals(c[c.length-1])||(c=[o],a.push(c)),c.push(h)))))}}return a}vn("FeatureIndex",hu,{omit:["rawTileData","sourceLayerCoder"]});class mu extends s{constructor(t,e,i,r){super(t,e),this.angle=i,void 0!==r&&(this.segment=r)}clone(){return new mu(this.x,this.y,this.angle,this.segment)}}function _u(t,e,i,r,n){if(void 0===e.segment||0===i)return!0;let s=e,a=e.segment+1,o=0;for(;o>-i/2;){if(a--,a<0)return!1;o-=t[a].dist(s),s=t[a]}o+=t[a].dist(t[a+1]),a++;const l=[];let c=0;for(;o<i/2;){const e=t[a],i=t[a+1];if(!i)return!1;let s=t[a-1].angleTo(e)-e.angleTo(i);for(s=Math.abs((s+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:o,angleDelta:s}),c+=s;o-l[0].distance>r;)c-=l.shift().angleDelta;if(c>n)return!1;a++,o+=e.dist(i)}return!0}function gu(t){let e=0;for(let i=0;i<t.length-1;i++)e+=t[i].dist(t[i+1]);return e}function yu(t,e,i){return t?.6*e*i:0}function xu(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function vu(t,e,i,r,n,s){const a=yu(i,n,s),o=xu(i,r)*s;let l=0;const c=gu(t)/2;for(let i=0;i<t.length-1;i++){const r=t[i],n=t[i+1],s=r.dist(n);if(l+s>c){const h=(c-l)/s,u=ke.number(r.x,n.x,h),d=ke.number(r.y,n.y,h),p=new mu(u,d,n.angleTo(r),i);return p._round(),!a||_u(t,p,o,a,e)?p:void 0}l+=s}}function bu(t,e,i,r,n,s,a,o,l){const c=yu(r,s,a),h=xu(r,n),u=h*a,d=0===t[0].x||t[0].x===l||0===t[0].y||t[0].y===l;return e-u<e/4&&(e=u+e/4),wu(t,d?e/2*o%e:(h/2+2*s)*a*o%e,e,c,i,u,d,!1,l)}function wu(t,e,i,r,n,s,a,o,l){const c=s/2,h=gu(t);let u=0,d=e-i,p=[];for(let e=0;e<t.length-1;e++){const a=t[e],o=t[e+1],f=a.dist(o),m=o.angleTo(a);for(;d+i<u+f;){d+=i;const _=(d-u)/f,g=ke.number(a.x,o.x,_),y=ke.number(a.y,o.y,_);if(g>=0&&g<l&&y>=0&&y<l&&d-c>=0&&d+c<=h){const i=new mu(g,y,m,e);i._round(),r&&!_u(t,i,s,r,n)||p.push(i)}}u+=f}return o||p.length||a||(p=wu(t,u/2,i,r,n,s,a,!0,l)),p}vn("Anchor",mu);function Tu(t,e,i,r){const n=[],a=t.image,o=a.pixelRatio,l=a.paddedRect.w-2,c=a.paddedRect.h-2;let h={x1:t.left,y1:t.top,x2:t.right,y2:t.bottom};const u=a.stretchX||[[0,l]],d=a.stretchY||[[0,c]],p=(t,e)=>t+e[1]-e[0],f=u.reduce(p,0),m=d.reduce(p,0),_=l-f,g=c-m;let y=0,x=f,v=0,b=m,w=0,T=_,S=0,I=g;if(a.content&&r){const e=a.content,i=e[2]-e[0],r=e[3]-e[1];(a.textFitWidth||a.textFitHeight)&&(h=vh(t)),y=Su(u,0,e[0]),v=Su(d,0,e[1]),x=Su(u,e[0],e[2]),b=Su(d,e[1],e[3]),w=e[0]-y,S=e[1]-v,T=i-x,I=r-b}const P=h.x1,A=h.y1,M=h.x2-P,k=h.y2-A,C=(t,r,n,l)=>{const c=Pu(t.stretch-y,x,M,P),h=Au(t.fixed-w,T,t.stretch,f),u=Pu(r.stretch-v,b,k,A),d=Au(r.fixed-S,I,r.stretch,m),p=Pu(n.stretch-y,x,M,P),_=Au(n.fixed-w,T,n.stretch,f),g=Pu(l.stretch-v,b,k,A),C=Au(l.fixed-S,I,l.stretch,m),z=new s(c,u),E=new s(p,u),D=new s(p,g),L=new s(c,g),R=new s(h/o,d/o),B=new s(_/o,C/o),F=e*Math.PI/180;if(F){const t=Math.sin(F),e=Math.cos(F),i=[e,-t,t,e];z._matMult(i),E._matMult(i),L._matMult(i),D._matMult(i)}const O=t.stretch+t.fixed,V=r.stretch+r.fixed;return{tl:z,tr:E,bl:L,br:D,tex:{x:a.paddedRect.x+1+O,y:a.paddedRect.y+1+V,w:n.stretch+n.fixed-O,h:l.stretch+l.fixed-V},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:R,pixelOffsetBR:B,minFontScaleX:T/o/M,minFontScaleY:I/o/k,isSDF:i}};if(r&&(a.stretchX||a.stretchY)){const t=Iu(u,_,f),e=Iu(d,g,m);for(let i=0;i<t.length-1;i++){const r=t[i],s=t[i+1];for(let t=0;t<e.length-1;t++)n.push(C(r,e[t],s,e[t+1]))}}else n.push(C({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:l+1},{fixed:0,stretch:c+1}));return n}function Su(t,e,i){let r=0;for(const n of t)r+=Math.max(e,Math.min(i,n[1]))-Math.max(e,Math.min(i,n[0]));return r}function Iu(t,e,i){const r=[{fixed:-1,stretch:0}];for(const[e,i]of t){const t=r[r.length-1];r.push({fixed:e-t.stretch,stretch:t.stretch}),r.push({fixed:e-t.stretch,stretch:t.stretch+(i-e)})}return r.push({fixed:e+1,stretch:i}),r}function Pu(t,e,i,r){return t/e*i+r}function Au(t,e,i,r){return t-e*i/r}class Mu{constructor(t,e,i,r,n,a,o,l,c,h){var u;if(this.boxStartIndex=t.length,c){let t=a.top,e=a.bottom;const i=a.collisionPadding;i&&(t-=i[1],e+=i[3]);let r=e-t;r>0&&(r=Math.max(10,r),this.circleDiameter=r)}else{const c=(null===(u=a.image)||void 0===u?void 0:u.content)&&(a.image.textFitWidth||a.image.textFitHeight)?vh(a):{x1:a.left,y1:a.top,x2:a.right,y2:a.bottom};c.y1=c.y1*o-l[0],c.y2=c.y2*o+l[2],c.x1=c.x1*o-l[3],c.x2=c.x2*o+l[1];const d=a.collisionPadding;if(d&&(c.x1-=d[0]*o,c.y1-=d[1]*o,c.x2+=d[2]*o,c.y2+=d[3]*o),h){const t=new s(c.x1,c.y1),e=new s(c.x2,c.y1),i=new s(c.x1,c.y2),r=new s(c.x2,c.y2),n=h*Math.PI/180;t._rotate(n),e._rotate(n),i._rotate(n),r._rotate(n),c.x1=Math.min(t.x,e.x,i.x,r.x),c.x2=Math.max(t.x,e.x,i.x,r.x),c.y1=Math.min(t.y,e.y,i.y,r.y),c.y2=Math.max(t.y,e.y,i.y,r.y)}t.emplaceBack(e.x,e.y,c.x1,c.y1,c.x2,c.y2,i,r,n)}this.boxEndIndex=t.length}}class ku{constructor(t=[],e=(t,e)=>t<e?-1:t>e?1:0){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let t=(this.length>>1)-1;t>=0;t--)this._down(t)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(0===this.length)return;const t=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:e,compare:i}=this,r=e[t];for(;t>0;){const n=t-1>>1,s=e[n];if(i(r,s)>=0)break;e[t]=s,t=n}e[t]=r}_down(t){const{data:e,compare:i}=this,r=this.length>>1,n=e[t];for(;t<r;){let r=1+(t<<1);const s=r+1;if(s<this.length&&i(e[s],e[r])<0&&(r=s),i(e[r],n)>=0)break;e[t]=e[r],t=r}e[t]=n}}function Cu(t,e=1,i=!1){let r=1/0,n=1/0,a=-1/0,o=-1/0;const l=t[0];for(let t=0;t<l.length;t++){const e=l[t];(!t||e.x<r)&&(r=e.x),(!t||e.y<n)&&(n=e.y),(!t||e.x>a)&&(a=e.x),(!t||e.y>o)&&(o=e.y)}const c=Math.min(a-r,o-n);let h=c/2;const u=new ku([],zu);if(0===c)return new s(r,n);for(let e=r;e<a;e+=c)for(let i=n;i<o;i+=c)u.push(new Eu(e+h,i+h,h,t));let d=function(t){let e=0,i=0,r=0;const n=t[0];for(let t=0,s=n.length,a=s-1;t<s;a=t++){const s=n[t],o=n[a],l=s.x*o.y-o.x*s.y;i+=(s.x+o.x)*l,r+=(s.y+o.y)*l,e+=3*l}return new Eu(i/e,r/e,0,t)}(t),p=u.length;for(;u.length;){const r=u.pop();(r.d>d.d||!d.d)&&(d=r,i&&console.log("found best %d after %d probes",Math.round(1e4*r.d)/1e4,p)),r.max-d.d<=e||(h=r.h/2,u.push(new Eu(r.p.x-h,r.p.y-h,h,t)),u.push(new Eu(r.p.x+h,r.p.y-h,h,t)),u.push(new Eu(r.p.x-h,r.p.y+h,h,t)),u.push(new Eu(r.p.x+h,r.p.y+h,h,t)),p+=4)}return i&&(console.log(`num probes: ${p}`),console.log(`best distance: ${d.d}`)),d.p}function zu(t,e){return e.max-t.max}function Eu(t,e,i,r){this.p=new s(t,e),this.h=i,this.d=function(t,e){let i=!1,r=1/0;for(let n=0;n<e.length;n++){const s=e[n];for(let e=0,n=s.length,a=n-1;e<n;a=e++){const n=s[e],o=s[a];n.y>t.y!=o.y>t.y&&t.x<(o.x-n.x)*(t.y-n.y)/(o.y-n.y)+n.x&&(i=!i),r=Math.min(r,vo(t,n,o))}}return(i?1:-1)*Math.sqrt(r)}(this.p,r),this.max=this.d+this.h*Math.SQRT2}var Du;t.aq=void 0,(Du=t.aq||(t.aq={}))[Du.center=1]="center",Du[Du.left=2]="left",Du[Du.right=3]="right",Du[Du.top=4]="top",Du[Du.bottom=5]="bottom",Du[Du["top-left"]=6]="top-left",Du[Du["top-right"]=7]="top-right",Du[Du["bottom-left"]=8]="bottom-left",Du[Du["bottom-right"]=9]="bottom-right";const Lu=Number.POSITIVE_INFINITY;function Ru(t,e){return e[1]!==Lu?function(t,e,i){let r=0,n=0;switch(e=Math.abs(e),i=Math.abs(i),t){case"top-right":case"top-left":case"top":n=i-7;break;case"bottom-right":case"bottom-left":case"bottom":n=7-i}switch(t){case"top-right":case"bottom-right":case"right":r=-e;break;case"top-left":case"bottom-left":case"left":r=e}return[r,n]}(t,e[0],e[1]):function(t,e){let i=0,r=0;e<0&&(e=0);const n=e/Math.SQRT2;switch(t){case"top-right":case"top-left":r=n-7;break;case"bottom-right":case"bottom-left":r=7-n;break;case"bottom":r=7-e;break;case"top":r=e-7}switch(t){case"top-right":case"bottom-right":i=-n;break;case"top-left":case"bottom-left":i=n;break;case"left":i=e;break;case"right":i=-e}return[i,r]}(t,e[0])}function Bu(t,e,i){var r;const n=t.layout,s=null===(r=n.get("text-variable-anchor-offset"))||void 0===r?void 0:r.evaluate(e,{},i);if(s){const t=s.values,e=[];for(let i=0;i<t.length;i+=2){const r=e[i]=t[i],n=t[i+1].map(t=>t*Ac);r.startsWith("top")?n[1]-=7:r.startsWith("bottom")&&(n[1]+=7),e[i+1]=n}return new Qt(e)}const a=n.get("text-variable-anchor");if(a){let r;r=void 0!==t._unevaluatedLayout.getValue("text-radial-offset")?[n.get("text-radial-offset").evaluate(e,{},i)*Ac,Lu]:n.get("text-offset").evaluate(e,{},i).map(t=>t*Ac);const s=[];for(const t of a)s.push(t,Ru(t,r));return new Qt(s)}return null}function Fu(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Ou(e,i,r,n,s,a,o,l,c,h,u){let d=a.textMaxSize.evaluate(i,{});void 0===d&&(d=o);const p=e.layers[0].layout,f=p.get("icon-offset").evaluate(i,{},u),m=Nu(r.horizontal),_=o/24,g=e.tilePixelRatio*_,y=e.tilePixelRatio*d/24,x=e.tilePixelRatio*l,v=e.tilePixelRatio*p.get("symbol-spacing"),b=p.get("text-padding")*e.tilePixelRatio,w=function(t,e,i,r=1){const n=t.get("icon-padding").evaluate(e,{},i),s=n&&n.values;return[s[0]*r,s[1]*r,s[2]*r,s[3]*r]}(p,i,u,e.tilePixelRatio),S=p.get("text-max-angle")/180*Math.PI,I="viewport"!==p.get("text-rotation-alignment")&&"point"!==p.get("symbol-placement"),P="map"===p.get("icon-rotation-alignment")&&"point"!==p.get("symbol-placement"),A=p.get("symbol-placement"),M=v/2,k=p.get("icon-text-fit");let C;n&&"none"!==k&&(e.allowVerticalPlacement&&r.vertical&&(C=bh(n,r.vertical,k,p.get("icon-text-fit-padding"),f,_)),m&&(n=bh(n,m,k,p.get("icon-text-fit-padding"),f,_)));const z=(l,d)=>{d.x<0||d.x>=so||d.y<0||d.y>=so||function(e,i,r,n,s,a,o,l,c,h,u,d,p,f,m,_,g,y,x,v,b,w,S,I,P){const A=e.addToLineVertexArray(i,r);let M,k,C,z,E=0,D=0,L=0,R=0,B=-1,F=-1;const O={};let V=Va("");if(e.allowVerticalPlacement&&n.vertical){const t=l.layout.get("text-rotate").evaluate(b,{},I)+90;C=new Mu(c,i,h,u,d,n.vertical,p,f,m,t),o&&(z=new Mu(c,i,h,u,d,o,g,y,m,t))}if(s){const r=l.layout.get("icon-rotate").evaluate(b,{}),n="none"!==l.layout.get("icon-text-fit"),a=Tu(s,r,S,n),p=o?Tu(o,r,S,n):void 0;k=new Mu(c,i,h,u,d,s,g,y,!1,r),E=4*a.length;const f=e.iconSizeData;let m=null;"source"===f.kind?(m=[wh*l.layout.get("icon-size").evaluate(b,{})],m[0]>Th&&T(`${e.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):"composite"===f.kind&&(m=[wh*w.compositeIconSizes[0].evaluate(b,{},I),wh*w.compositeIconSizes[1].evaluate(b,{},I)],(m[0]>Th||m[1]>Th)&&T(`${e.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),e.addSymbols(e.icon,a,m,v,x,b,t.ah.none,i,A.lineStartIndex,A.lineLength,-1,I),B=e.icon.placedSymbolArray.length-1,p&&(D=4*p.length,e.addSymbols(e.icon,p,m,v,x,b,t.ah.vertical,i,A.lineStartIndex,A.lineLength,-1,I),F=e.icon.placedSymbolArray.length-1)}const N=Object.keys(n.horizontal);for(const r of N){const s=n.horizontal[r];if(!M){V=Va(s.text);const t=l.layout.get("text-rotate").evaluate(b,{},I);M=new Mu(c,i,h,u,d,s,p,f,m,t)}const o=1===s.positionedLines.length;if(L+=Vu(e,i,s,a,l,m,b,_,A,n.vertical?t.ah.horizontal:t.ah.horizontalOnly,o?N:[r],O,B,w,I),o)break}n.vertical&&(R+=Vu(e,i,n.vertical,a,l,m,b,_,A,t.ah.vertical,["vertical"],O,F,w,I));const j=M?M.boxStartIndex:e.collisionBoxArray.length,U=M?M.boxEndIndex:e.collisionBoxArray.length,$=C?C.boxStartIndex:e.collisionBoxArray.length,q=C?C.boxEndIndex:e.collisionBoxArray.length,Z=k?k.boxStartIndex:e.collisionBoxArray.length,G=k?k.boxEndIndex:e.collisionBoxArray.length,H=z?z.boxStartIndex:e.collisionBoxArray.length,X=z?z.boxEndIndex:e.collisionBoxArray.length;let W=-1;const K=(t,e)=>t&&t.circleDiameter?Math.max(t.circleDiameter,e):e;W=K(M,W),W=K(C,W),W=K(k,W),W=K(z,W);const J=W>-1?1:0;J&&(W*=P/Ac),e.glyphOffsetArray.length>=Dh.MAX_GLYPHS&&T("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==b.sortKey&&e.addToSortKeyRanges(e.symbolInstances.length,b.sortKey);const Y=Bu(l,b,I),[Q,tt]=function(e,i){const r=e.length,n=null==i?void 0:i.values;if((null==n?void 0:n.length)>0)for(let i=0;i<n.length;i+=2){const r=n[i+1];e.emplaceBack(t.aq[n[i]],r[0],r[1])}return[r,e.length]}(e.textAnchorOffsets,Y);e.symbolInstances.emplaceBack(i.x,i.y,O.right>=0?O.right:-1,O.center>=0?O.center:-1,O.left>=0?O.left:-1,O.vertical||-1,B,F,V,j,U,$,q,Z,G,H,X,h,L,R,E,D,J,0,p,W,Q,tt)}(e,d,l,r,n,s,C,e.layers[0],e.collisionBoxArray,i.index,i.sourceLayerIndex,e.index,g,[b,b,b,b],I,c,x,w,P,f,i,a,h,u,o)};if("line"===A)for(const t of fu(i.geometry,0,0,so,so)){const i=bu(t,v,S,r.vertical||m,n,24,y,e.overscaling,so);for(const r of i)m&&ju(e,m.text,M,r)||z(t,r)}else if("line-center"===A){for(const t of i.geometry)if(t.length>1){const e=vu(t,S,r.vertical||m,n,24,y);e&&z(t,e)}}else if("Polygon"===i.type)for(const t of gi(i.geometry,0)){const e=Cu(t,16);z(t[0],new mu(e.x,e.y,0))}else if("LineString"===i.type)for(const t of i.geometry)z(t,new mu(t[0].x,t[0].y,0));else if("Point"===i.type)for(const t of i.geometry)for(const e of t)z([e],new mu(e.x,e.y,0))}function Vu(t,e,i,r,n,a,o,l,c,h,u,d,p,f,m){const _=function(t,e,i,r,n,a,o,l){const c=r.layout.get("text-rotate").evaluate(a,{})*Math.PI/180,h=[];for(const t of e.positionedLines)for(const r of t.positionedGlyphs){if(!r.rect)continue;const a=r.rect||{};let u=4,d=!0,p=1,f=0;const m=(n||l)&&r.vertical,_=r.metrics.advance*r.scale/2;if(l&&e.verticalizable&&(f=t.lineOffset/2-(r.imageName?-(Ac-r.metrics.width*r.scale)/2:(r.scale-1)*Ac)),r.imageName){const t=o[r.imageName];d=t.sdf,p=t.pixelRatio,u=1/p}const g=n?[r.x+_,r.y]:[0,0];let y=n?[0,0]:[r.x+_+i[0],r.y+i[1]-f],x=[0,0];m&&(x=y,y=[0,0]);const v=r.metrics.isDoubleResolution?2:1,b=(r.metrics.left-u)*r.scale-_+y[0],w=(-r.metrics.top-u)*r.scale+y[1],T=b+a.w/v*r.scale/p,S=w+a.h/v*r.scale/p,I=new s(b,w),P=new s(T,w),A=new s(b,S),M=new s(T,S);if(m){const t=new s(-_,_-nh),e=-Math.PI/2,i=12-_,n=new s(22-i,-(r.imageName?i:0)),a=new s(...x);I._rotateAround(e,t)._add(n)._add(a),P._rotateAround(e,t)._add(n)._add(a),A._rotateAround(e,t)._add(n)._add(a),M._rotateAround(e,t)._add(n)._add(a)}if(c){const t=Math.sin(c),e=Math.cos(c),i=[e,-t,t,e];I._matMult(i),P._matMult(i),A._matMult(i),M._matMult(i)}const k=new s(0,0),C=new s(0,0);h.push({tl:I,tr:P,bl:A,br:M,tex:a,writingMode:e.writingMode,glyphOffset:g,sectionIndex:r.sectionIndex,isSDF:d,pixelOffsetTL:k,pixelOffsetBR:C,minFontScaleX:0,minFontScaleY:0})}return h}(0,i,l,n,a,o,r,t.allowVerticalPlacement),g=t.textSizeData;let y=null;"source"===g.kind?(y=[wh*n.layout.get("text-size").evaluate(o,{})],y[0]>Th&&T(`${t.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):"composite"===g.kind&&(y=[wh*f.compositeTextSizes[0].evaluate(o,{},m),wh*f.compositeTextSizes[1].evaluate(o,{},m)],(y[0]>Th||y[1]>Th)&&T(`${t.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),t.addSymbols(t.text,_,y,l,a,o,h,e,c.lineStartIndex,c.lineLength,p,m);for(const e of u)d[e]=t.text.placedSymbolArray.length-1;return 4*_.length}function Nu(t){for(const e in t)return t[e];return null}function ju(t,e,i,r){const n=t.compareText;if(e in n){const t=n[e];for(let e=t.length-1;e>=0;e--)if(r.dist(t[e])<i)return!0}else n[e]=[];return n[e].push(r),!1}const Uu=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class $u{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[e,i]=new Uint8Array(t,0,2);if(219!==e)throw new Error("Data does not appear to be in a KDBush format.");const r=i>>4;if(1!==r)throw new Error(`Got v${r} data when expected v1.`);const n=Uu[15&i];if(!n)throw new Error("Unrecognized array type.");const[s]=new Uint16Array(t,2,1),[a]=new Uint32Array(t,4,1);return new $u(a,s,n,t)}constructor(t,e=64,i=Float64Array,r){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+e,2),65535),this.ArrayType=i,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const n=Uu.indexOf(this.ArrayType),s=2*t*this.ArrayType.BYTES_PER_ELEMENT,a=t*this.IndexArrayType.BYTES_PER_ELEMENT,o=(8-a%8)%8;if(n<0)throw new Error(`Unexpected typed array class: ${i}.`);r&&r instanceof ArrayBuffer?(this.data=r,this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+a+o,2*t),this._pos=2*t,this._finished=!0):(this.data=new ArrayBuffer(8+s+a+o),this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+a+o,2*t),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+n]),new Uint16Array(this.data,2,1)[0]=e,new Uint32Array(this.data,4,1)[0]=t)}add(t,e){const i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=t,this.coords[this._pos++]=e,i}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return qu(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,e,i,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:n,coords:s,nodeSize:a}=this,o=[0,n.length-1,0],l=[];for(;o.length;){const c=o.pop()||0,h=o.pop()||0,u=o.pop()||0;if(h-u<=a){for(let a=u;a<=h;a++){const o=s[2*a],c=s[2*a+1];o>=t&&o<=i&&c>=e&&c<=r&&l.push(n[a])}continue}const d=u+h>>1,p=s[2*d],f=s[2*d+1];p>=t&&p<=i&&f>=e&&f<=r&&l.push(n[d]),(0===c?t<=p:e<=f)&&(o.push(u),o.push(d-1),o.push(1-c)),(0===c?i>=p:r>=f)&&(o.push(d+1),o.push(h),o.push(1-c))}return l}within(t,e,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:r,coords:n,nodeSize:s}=this,a=[0,r.length-1,0],o=[],l=i*i;for(;a.length;){const c=a.pop()||0,h=a.pop()||0,u=a.pop()||0;if(h-u<=s){for(let i=u;i<=h;i++)Xu(n[2*i],n[2*i+1],t,e)<=l&&o.push(r[i]);continue}const d=u+h>>1,p=n[2*d],f=n[2*d+1];Xu(p,f,t,e)<=l&&o.push(r[d]),(0===c?t-i<=p:e-i<=f)&&(a.push(u),a.push(d-1),a.push(1-c)),(0===c?t+i>=p:e+i>=f)&&(a.push(d+1),a.push(h),a.push(1-c))}return o}}function qu(t,e,i,r,n,s){if(n-r<=i)return;const a=r+n>>1;Zu(t,e,a,r,n,s),qu(t,e,i,r,a-1,1-s),qu(t,e,i,a+1,n,1-s)}function Zu(t,e,i,r,n,s){for(;n>r;){if(n-r>600){const a=n-r+1,o=i-r+1,l=Math.log(a),c=.5*Math.exp(2*l/3),h=.5*Math.sqrt(l*c*(a-c)/a)*(o-a/2<0?-1:1);Zu(t,e,i,Math.max(r,Math.floor(i-o*c/a+h)),Math.min(n,Math.floor(i+(a-o)*c/a+h)),s)}const a=e[2*i+s];let o=r,l=n;for(Gu(t,e,r,i),e[2*n+s]>a&&Gu(t,e,r,n);o<l;){for(Gu(t,e,o,l),o++,l--;e[2*o+s]<a;)o++;for(;e[2*l+s]>a;)l--}e[2*r+s]===a?Gu(t,e,r,l):(l++,Gu(t,e,l,n)),l<=i&&(r=l+1),i<=l&&(n=l-1)}}function Gu(t,e,i,r){Hu(t,i,r),Hu(e,2*i,2*r),Hu(e,2*i+1,2*r+1)}function Hu(t,e,i){const r=t[e];t[e]=t[i],t[i]=r}function Xu(t,e,i,r){const n=t-i,s=e-r;return n*n+s*s}var Wu;t.bg=void 0,(Wu=t.bg||(t.bg={})).create="create",Wu.load="load",Wu.fullLoad="fullLoad";let Ku=null,Ju=[];const Yu=1e3/60,Qu="loadTime",td="fullLoadTime",ed={mark(t){performance.mark(t)},frame(t){const e=t;null!=Ku&&Ju.push(e-Ku),Ku=e},clearMetrics(){Ku=null,Ju=[],performance.clearMeasures(Qu),performance.clearMeasures(td);for(const e in t.bg)performance.clearMarks(t.bg[e])},getPerformanceMetrics(){performance.measure(Qu,t.bg.create,t.bg.load),performance.measure(td,t.bg.create,t.bg.fullLoad);const e=performance.getEntriesByName(Qu)[0].duration,i=performance.getEntriesByName(td)[0].duration,r=Ju.length,n=1/(Ju.reduce((t,e)=>t+e,0)/r/1e3),s=Ju.filter(t=>t>Yu).reduce((t,e)=>t+(e-Yu)/Yu,0);return{loadTime:e,fullLoadTime:i,fps:n,percentDroppedFrames:s/(r+s)*100,totalFrames:r}}};t.$=class extends Rs{},t.A=zo,t.B=fn,t.C=function(t){if(null==P){const e=t.navigator?t.navigator.userAgent:null;P=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))}return P},t.D=vs,t.E=Z,t.F=class{constructor(t,e){this.target=t,this.mapId=e,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new Gh(()=>this.process()),this.subscription=function(t,e,i){return t.addEventListener(e,i,!1),{unsubscribe:()=>{t.removeEventListener(e,i,!1)}}}(this.target,"message",t=>this.receive(t)),this.globalScope=I(self)?t:window}registerMessageHandler(t,e){this.messageHandlers[t]=e}sendAsync(t,e){return new Promise((i,r)=>{const n=Math.round(1e18*Math.random()).toString(36).substring(0,10);this.resolveRejects[n]={resolve:i,reject:r},e&&e.signal.addEventListener("abort",()=>{delete this.resolveRejects[n];const e={id:n,type:"<cancel>",origin:location.origin,targetMapId:t.targetMapId,sourceMapId:this.mapId};this.target.postMessage(e)},{once:!0});const s=[],a=Object.assign(Object.assign({},t),{id:n,sourceMapId:this.mapId,origin:location.origin,data:Sn(t.data,s)});this.target.postMessage(a,{transfer:s})})}receive(t){const e=t.data,i=e.id;if(!("file://"!==e.origin&&"file://"!==location.origin&&"resource://android"!==e.origin&&"resource://android"!==location.origin&&e.origin!==location.origin||e.targetMapId&&this.mapId!==e.targetMapId)){if("<cancel>"===e.type){delete this.tasks[i];const t=this.abortControllers[i];return delete this.abortControllers[i],void(t&&t.abort())}if(I(self)||e.mustQueue)return this.tasks[i]=e,this.taskQueue.push(i),void this.invoker.trigger();this.processTask(i,e)}}process(){if(0===this.taskQueue.length)return;const t=this.taskQueue.shift(),e=this.tasks[t];delete this.tasks[t],this.taskQueue.length>0&&this.invoker.trigger(),e&&this.processTask(t,e)}processTask(t,i){return e(this,void 0,void 0,function*(){if("<response>
313"===i.type){const e=this.resolveRejects[t];if(delete this.resolveRejects[t],!e)return;return void(i.error?e.reject(In(i.error)):e.resolve(In(i.data)))}if(!this.messageHandlers[i.type])return void this.completeTask(t,new Error(`Could not find a registered handler for ${i.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));const e=In(i.data),r=new AbortController;this.abortControllers[t]=r;try{const n=yield this.messageHandlers[i.type](i.sourceMapId,e,r);this.completeTask(t,null,n)}catch(e){this.completeTask(t,e)}})}completeTask(t,e,i){const r=[];delete this.abortControllers[t];const n={id:t,type:"<response>",sourceMapId:this.mapId,origin:location.origin,error:e?Sn(e):null,data:Sn(i,r)};this.target.postMessage(n,{transfer:r})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},t.G=B,t.H=function(){var t=new zo(16);return zo!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},t.I=eh,t.J=function(t,e,i){var r,n,s,a,o,l,c,h,u,d,p,f,m=i[0],_=i[1],g=i[2];return e===t?(t[12]=e[0]*m+e[4]*_+e[8]*g+e[12],t[13]=e[1]*m+e[5]*_+e[9]*g+e[13],t[14]=e[2]*m+e[6]*_+e[10]*g+e[14],t[15]=e[3]*m+e[7]*_+e[11]*g+e[15]):(n=e[1],s=e[2],a=e[3],o=e[4],l=e[5],c=e[6],h=e[7],u=e[8],d=e[9],p=e[10],f=e[11],t[0]=r=e[0],t[1]=n,t[2]=s,t[3]=a,t[4]=o,t[5]=l,t[6]=c,t[7]=h,t[8]=u,t[9]=d,t[10]=p,t[11]=f,t[12]=r*m+o*_+u*g+e[12],t[13]=n*m+l*_+d*g+e[13],t[14]=s*m+c*_+p*g+e[14],t[15]=a*m+h*_+f*g+e[15]),t},t.K=function(t,e,i){var r=i[0],n=i[1],s=i[2];return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},t.L=Do,t.M=function(t,e){const i={};for(let r=0;r<e.length;r++){const n=e[r];n in t&&(i[n]=t[n])}return i},t.N=Xh,t.O=Jh,t.P=s,t.Q=Yh,t.R=Go,t.S=su,t.T=fs,t.U=u,t.V=d,t.W=k,t.X=so,t.Y=zs,t.Z=eu,t._=e,t.a=L,t.a$=function(t,e){var i=t[0],r=t[1],n=t[2],s=t[3],a=t[4],o=t[5],l=t[6],c=t[7],h=t[8],u=t[9],d=t[10],p=t[11],f=t[12],m=t[13],_=t[14],g=t[15],y=e[0],x=e[1],v=e[2],b=e[3],w=e[4],T=e[5],S=e[6],I=e[7],P=e[8],A=e[9],M=e[10],k=e[11],C=e[12],z=e[13],E=e[14],D=e[15];return Math.abs(i-y)<=Co*Math.max(1,Math.abs(i),Math.abs(y))&&Math.abs(r-x)<=Co*Math.max(1,Math.abs(r),Math.abs(x))&&Math.abs(n-v)<=Co*Math.max(1,Math.abs(n),Math.abs(v))&&Math.abs(s-b)<=Co*Math.max(1,Math.abs(s),Math.abs(b))&&Math.abs(a-w)<=Co*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(o-T)<=Co*Math.max(1,Math.abs(o),Math.abs(T))&&Math.abs(l-S)<=Co*Math.max(1,Math.abs(l),Math.abs(S))&&Math.abs(c-I)<=Co*Math.max(1,Math.abs(c),Math.abs(I))&&Math.abs(h-P)<=Co*Math.max(1,Math.abs(h),Math.abs(P))&&Math.abs(u-A)<=Co*Math.max(1,Math.abs(u),Math.abs(A))&&Math.abs(d-M)<=Co*Math.max(1,Math.abs(d),Math.abs(M))&&Math.abs(p-k)<=Co*Math.max(1,Math.abs(p),Math.abs(k))&&Math.abs(f-C)<=Co*Math.max(1,Math.abs(f),Math.abs(C))&&Math.abs(m-z)<=Co*Math.max(1,Math.abs(m),Math.abs(z))&&Math.abs(_-E)<=Co*Math.max(1,Math.abs(_),Math.abs(E))&&Math.abs(g-D)<=Co*Math.max(1,Math.abs(g),Math.abs(D))},t.a0=Ca,t.a1=ru,t.a2=nt,t.a3=t=>{const e=window.document.createElement("video");return e.muted=!0,new Promise(i=>{e.onloadstart=()=>{i(e)};for(const i of t){const t=window.document.createElement("source");N(i)||(e.crossOrigin="Anonymous"),t.src=i,e.appendChild(t)}})},t.a4=function(){return y++},t.a5=ra,t.a6=Dh,t.a7=Pr,t.a8=co,t.a9=cu,t.aA=function(t){if("custom"===t.type)return new Zh(t);switch(t.type){case"background":return new jh(t);case"circle":return new Fo(t);case"fill":return new El(t);case"fill-extrusion":return new ic(t);case"heatmap":return new Wo(t);case"hillshade":return new Yo(t);case"line":return new yc(t);case"raster":return new qh(t);case"symbol":return new Oh(t)}},t.aB=b,t.aC=function(t,e){if(!t)return[{command:"setStyle",args:[e]}];let i=[];try{if(!W(t.version,e.version))return[{command:"setStyle",args:[e]}];W(t.center,e.center)||i.push({command:"setCenter",args:[e.center]}),W(t.zoom,e.zoom)||i.push({command:"setZoom",args:[e.zoom]}),W(t.bearing,e.bearing)||i.push({command:"setBearing",args:[e.bearing]}),W(t.pitch,e.pitch)||i.push({command:"setPitch",args:[e.pitch]}
vendor: 22,871 bytes, line 313
313),W(t.sprite,e.sprite)||i.push({command:"setSprite",args:[e.sprite]}),W(t.glyphs,e.glyphs)||i.push({command:"setGlyphs",args:[e.glyphs]}),W(t.transition,e.transition)||i.push({command:"setTransition",args:[e.transition]}),W(t.light,e.light)||i.push({command:"setLight",args:[e.light]}),W(t.terrain,e.terrain)||i.push({command:"setTerrain",args:[e.terrain]}),W(t.sky,e.sky)||i.push({command:"setSky",args:[e.sky]}),W(t.projection,e.projection)||i.push({command:"setProjection",args:[e.projection]});const r={},n=[];!function(t,e,i,r){let n;for(n in e=e||{},t=t||{})Object.prototype.hasOwnProperty.call(t,n)&&(Object.prototype.hasOwnProperty.call(e,n)||Y(n,i,r));for(n in e)Object.prototype.hasOwnProperty.call(e,n)&&(Object.prototype.hasOwnProperty.call(t,n)?W(t[n],e[n])||("geojson"===t[n].type&&"geojson"===e[n].type&&tt(t,e,n)?K(i,{command:"setGeoJSONSourceData",args:[n,e[n].data]}):Q(n,e,i,r)):J(n,e,i))}(t.sources,e.sources,n,r);const s=[];t.layers&&t.layers.forEach(t=>{"source"in t&&r[t.source]?i.push({command:"removeLayer",args:[t.id]}):s.push(t)}),i=i.concat(n),function(t,e,i){e=e||[];const r=(t=t||[]).map(it),n=e.map(it),s=t.reduce(rt,{}),a=e.reduce(rt,{}),o=r.slice(),l=Object.create(null);let c,h,u,d,p;for(let t=0,e=0;t<r.length;t++)c=r[t],Object.prototype.hasOwnProperty.call(a,c)?e++:(K(i,{command:"removeLayer",args:[c]}),o.splice(o.indexOf(c,e),1));for(let t=0,e=0;t<n.length;t++)c=n[n.length-1-t],o[o.length-1-t]!==c&&(Object.prototype.hasOwnProperty.call(s,c)?(K(i,{command:"removeLayer",args:[c]}),o.splice(o.lastIndexOf(c,o.length-e),1)):e++,d=o[o.length-t],K(i,{command:"addLayer",args:[a[c],d]}),o.splice(o.length-t,0,c),l[c]=!0);for(let t=0;t<n.length;t++)if(c=n[t],h=s[c],u=a[c],!l[c]&&!W(h,u))if(W(h.source,u.source)&&W(h["source-layer"],u["source-layer"])&&W(h.type,u.type)){for(p in et(h.layout,u.layout,i,c,null,"setLayoutProperty"),et(h.paint,u.paint,i,c,null,"setPaintProperty"),W(h.filter,u.filter)||K(i,{command:"setFilter",args:[c,u.filter]}),W(h.minzoom,u.minzoom)&&W(h.maxzoom,u.maxzoom)||K(i,{command:"setLayerZoomRange",args:[c,u.minzoom,u.maxzoom]}),h)Object.prototype.hasOwnProperty.call(h,p)&&"layout"!==p&&"paint"!==p&&"filter"!==p&&"metadata"!==p&&"minzoom"!==p&&"maxzoom"!==p&&(0===p.indexOf("paint.")?et(h[p],u[p],i,c,p.slice(6),"setPaintProperty"):W(h[p],u[p])||K(i,{command:"setLayerProperty",args:[c,p,u[p]]}));for(p in u)Object.prototype.hasOwnProperty.call(u,p)&&!Object.prototype.hasOwnProperty.call(h,p)&&"layout"!==p&&"paint"!==p&&"filter"!==p&&"metadata"!==p&&"minzoom"!==p&&"maxzoom"!==p&&(0===p.indexOf("paint.")?et(h[p],u[p],i,c,p.slice(6),"setPaintProperty"):W(h[p],u[p])||K(i,{command:"setLayerProperty",args:[c,p,u[p]]}))}else K(i,{command:"removeLayer",args:[c]}),d=o[o.lastIndexOf(c)+1],K(i,{command:"addLayer",args:[u,d]})}(s,e.layers,i)}catch(t){console.warn("Unable to compute style diff:",t),i=[{command:"setStyle",args:[e]}]}return i},t.aD=function(t){const e=[],i=t.id;return void 0===i&&e.push({message:`layers.${i}: missing required property "id"`}),void 0===t.render&&e.push({message:`layers.${i}: missing required method "render"`}),t.renderingMode&&"2d"!==t.renderingMode&&"3d"!==t.renderingMode&&e.push({message:`layers.${i}: property "renderingMode" must be either "2d" or "3d"`}),e},t.aE=function id(t,e){if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(!id(t[i],e[i]))return!1;return!0}if("object"==typeof t&&null!==t&&null!==e){if("object"!=typeof e)return!1;if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const i in t)if(!id(t[i],e[i]))return!1;return!0}return t===e},t.aF=x,t.aG=v,t.aH=class extends qa{constructor(t,e){super(t,e),this.current=0}set(t){this.current!==t&&(this.current=t,this.gl.uniform1i(this.location,t))}},t.aI=Za,t.aJ=class extends qa{constructor(t,e){super(t,e),this.current=Xa}set(t){if(t[12]!==this.current[12]||t[0]!==this.current[0])return this.current=t,void this.gl.uniformMatrix4fv(this.location,!1,t);for(let e=1;e<16;e++)if(t[e]!==this.current[e]){this.current=t,this.gl.uniformMatrix4fv(this.location,!1,t);break}}},t.aK=Ga,t.aL=Ha,t.aM=Ht,t.aN=class extends qa{constructor(t,e){super(t,e),this.current=[0,0,0]}set(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]||(this.current=t,this.gl.uniform3f(this.location,t[0],t[1],t[2]))}},t.aO=class extends qa{constructor(t,e){super(t,e),this.current=[0,0]}set(t){t[0]===this.current[0]&&t[1]===this.current[1]||(this.current=t,this.gl.uniform2f(this.location,t[0],t[1]))}},t.aP=function(t,e,i,r,n,s,a){var o=1/(e-i),l=1/(r-n),c=1/(s-a);return t[0]=-2*o,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*l,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+i)*o,t[13]=(n+r)*l,t[14]=(a+s)*c,t[15]=1,t},t.aQ=Ro,t.aR=class extends Zs{},t.aS=Sc,t.aT=class extends Hs{},t.aU=Xo,t.aV=function(t){return t<=1?1:Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},t.aW=Ho,t.aX=fa,t.aY=Pa,t.aZ=class extends ta{},t.a_=function(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[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]},t.aa=function(t){const e={};if(t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(t,i,r,n)=>{const s=r||n;return e[i]=!s||s.toLowerCase(),""}),e["max-age"]){const t=parseInt(e["max-age"],10);isNaN(t)?delete e["max-age"]:e["max-age"]=t}return e},t.ab=function(t,e){const i=[];for(const r in t)r in e||i.push(r);return i},t.ac=m,t.ad=function(t,e,i){var r=Math.sin(i),n=Math.cos(i),s=e[0],a=e[1],o=e[2],l=e[3],c=e[4],h=e[5],u=e[6],d=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*n+c*r,t[1]=a*n+h*r,t[2]=o*n+u*r,t[3]=l*n+d*r,t[4]=c*n-s*r,t[5]=h*n-a*r,t[6]=u*n-o*r,t[7]=d*n-l*r,t},t.ae=function(t){var e=new zo(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},t.af=Bo,t.ag=function(t,e){let i=0,r=0;if("constant"===t.kind)r=t.layoutSize;else if("source"!==t.kind){const{interpolationType:n,minZoom:s,maxZoom:a}=t,o=n?m(Ce.interpolationFactor(n,e,s,a),0,1):0;"camera"===t.kind?r=ke.number(t.minSize,t.maxSize,o):i=o}return{uSizeT:i,uSize:r}},t.ai=function(t,{uSize:e,uSizeT:i},{lowerSize:r,upperSize:n}){return"source"===t.kind?r/wh:"composite"===t.kind?ke.number(r/wh,n/wh,i):e},t.aj=kh,t.ak=function(t,e,i,r){const n=e.y-t.y,a=e.x-t.x,o=r.y-i.y,l=r.x-i.x,c=o*a-l*n;if(0===c)return null;const h=(l*(t.y-i.y)-o*(t.x-i.x))/c;return new s(t.x+h*a,t.y+h*n)},t.al=fu,t.am=po,t.an=Eo,t.ao=function(t){let e=1/0,i=1/0,r=-1/0,n=-1/0;for(const s of t)e=Math.min(e,s.x),i=Math.min(i,s.y),r=Math.max(r,s.x),n=Math.max(n,s.y);return[e,i,r,n]},t.ap=Ac,t.ar=Ih,t.as=function(t,e){var i=e[0],r=e[1],n=e[2],s=e[3],a=e[4],o=e[5],l=e[6],c=e[7],h=e[8],u=e[9],d=e[10],p=e[11],f=e[12],m=e[13],_=e[14],g=e[15],y=i*o-r*a,x=i*l-n*a,v=i*c-s*a,b=r*l-n*o,w=r*c-s*o,T=n*c-s*l,S=h*m-u*f,I=h*_-d*f,P=h*g-p*f,A=u*_-d*m,M=u*g-p*m,k=d*g-p*_,C=y*k-x*M+v*A+b*P-w*I+T*S;return C?(t[0]=(o*k-l*M+c*A)*(C=1/C),t[1]=(n*M-r*k-s*A)*C,t[2]=(m*T-_*w+g*b)*C,t[3]=(d*w-u*T-p*b)*C,t[4]=(l*P-a*k-c*I)*C,t[5]=(i*k-n*P+s*I)*C,t[6]=(_*v-f*T-g*x)*C,t[7]=(h*T-d*v+p*x)*C,t[8]=(a*M-o*P+c*S)*C,t[9]=(r*P-i*M-s*S)*C,t[10]=(f*w-m*v+g*y)*C,t[11]=(u*v-h*w-p*y)*C,t[12]=(o*I-a*A-l*S)*C,t[13]=(i*A-r*I+n*S)*C,t[14]=(m*x-f*b-_*y)*C,t[15]=(h*b-u*x+d*y)*C,t):null},t.at=Fu,t.au=gh,t.av=$u,t.aw=function(){const t={},e=G.$version;for(const i in G.$root){const r=G.$root[i];if(r.required){let n=null;n="version"===i?e:"array"===r.type?[]:{},null!=n&&(t[i]=n)}}return t},t.ax=Pn,t.ay=O,t.az=function(t){t=t.slice();const e=Object.create(null);for(let i=0;i<t.length;i++)e[t[i].id]=t[i];for(let i=0;i<t.length;i++)"ref"in t[i]&&(t[i]=X(t[i],e[t[i].ref]));return t},t.b=A,t.b0=function(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[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},t.b1=function(t,e,i){return t[0]=e[0]*i[0],t[1]=e[1]*i[1],t[2]=e[2]*i[2],t[3]=e[3]*i[3],t},t.b2=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},t.b3=_,t.b4=nu,t.b5=Qh,t.b6=function(t,e,i,r,n){var s,a=1/Math.tan(e/2);return t[0]=a/i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=n&&n!==1/0?(t[10]=(n+r)*(s=1/(r-n)),t[14]=2*n*r*s):(t[10]=-1,t[14]=-2*r),t},t.b7=function(t,e,i){var r=Math.sin(i),n=Math.cos(i),s=e[4],a=e[5],o=e[6],l=e[7],c=e[8],h=e[9],u=e[10],d=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=s*n+c*r,t[5]=a*n+h*r,t[6]=o*n+u*r,t[7]=l*n+d*r,t[8]=c*n-s*r,t[9]=h*n-a*r,t[10]=u*n-o*r,t[11]=d*n-l*r,t},t.b8=p,t.b9=f,t.bA=Mc,t.bB=function(t){return t.message===E},t.bC=yr,t.bD=hs,t.ba=function(t){return t*Math.PI/180},t.bb=function(t,e){const{x:i,y:r}=eu.fromLngLat(e);return!(t<0||t>25||r<0||r>=1||i<0||i>=1)},t.bc=function(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},t.bd=class extends Ls{},t.be=Hh,t.bf=ed,t.bh=F,t.bi=function(t,e){L.REGISTERED_PROTOCOLS[t]=e},t.bj=function(t){delete L.REGISTERED_PROTOCOLS[t]},t.bk=function(t,e){const i={};for(let r=0;r<t.length;r++){const n=e&&e[t[r].id]||Rr(t[r]);e&&(e[t[r].id]=n);let s=i[n];s||(s=i[n]=[]),s.push(t[r])}const r=[];for(const t in i)r.push(i[t]);return r},t.bl=vn,t.bm=lu,t.bn=hu,t.bo=ih,t.bp=function(e){e.bucket.createArrays(),e.bucket.tilePixelRatio=so/(512*e.bucket.overscaling),e.bucket.compareText={},e.bucket.iconsNeedLinear=!1;const i=e.bucket.layers[0],r=i.layout,n=i._unevaluatedLayout._values,s={layoutIconSize:n["icon-size"].possiblyEvaluate(new us(e.bucket.zoom+1),e.canonical),layoutTextSize:n["text-size"].possiblyEvaluate(new us(e.bucket.zoom+1),e.canonical),textMaxSize:n["text-size"].possiblyEvaluate(new us(18))};if("composite"===e.bucket.textSizeData.kind){const{minZoom:t,maxZoom:i}=e.bucket.textSizeData;s.compositeTextSizes=[n["text-size"].possiblyEvaluate(new us(t),e.canonical),n["text-size"].possiblyEvaluate(new us(i),e.canonical)]}if("composite"===e.bucket.iconSizeData.kind){const{minZoom:t,maxZoom:i}=e.bucket.iconSizeData;s.compositeIconSizes=[n["icon-size"].possiblyEvaluate(new us(t),e.canonical),n["icon-size"].possiblyEvaluate(new us(i),e.canonical)]}const a=r.get("text-line-height")*Ac,o="viewport"!==r.get("text-rotation-alignment")&&"point"!==r.get("symbol-placement"),l=r.get("text-keep-upright"),c=r.get("text-size");for(const n of e.bucket.features){const h=r.get("text-font").evaluate(n,{},e.canonical).join(","),u=c.evaluate(n,{},e.canonical),d=s.layoutTextSize.evaluate(n,{},e.canonical),p=s.layoutIconSize.evaluate(n,{},e.canonical),f={horizontal:{},vertical:void 0},m=n.text;let _,g=[0,0];if(m){const s=m.toString(),c=r.get("text-letter-spacing").evaluate(n,{},e.canonical)*Ac,p=Qn(s)?c:0,_=r.get("text-anchor").evaluate(n,{},e.canonical),y=Bu(i,n,e.canonical);if(!y){const t=r.get("text-radial-offset").evaluate(n,{},e.canonical);g=t?Ru(_,[t*Ac,Lu]):r.get("text-offset").evaluate(n,{},e.canonical).map(t=>t*Ac)}let x=o?"center":r.get("text-justify").evaluate(n,{},e.canonical);const v="point"===r.get("symbol-placement")?r.get("text-max-width").evaluate(n,{},e.canonical)*Ac:1/0,b=()=>{e.bucket.allowVerticalPlacement&&Yn(s)&&(f.vertical=oh(m,e.glyphMap,e.glyphPositions,e.imagePositions,h,v,a,_,"left",p,g,t.ah.vertical,!0,d,u))};if(!o&&y){const i=new Set;if("auto"===x)for(let t=0;t<y.values.length;t+=2)i.add(Fu(y.values[t]));else i.add(x);let r=!1;for(const n of i)if(!f.horizontal[n])if(r)f.horizontal[n]=f.horizontal[0];else{const i=oh(m,e.glyphMap,e.glyphPositions,e.imagePositions,h,v,a,"center",n,p,g,t.ah.horizontal,!1,d,u);i&&(f.horizontal[n]=i,r=1===i.positionedLines.length)}b()}else{"auto"===x&&(x=Fu(_));const i=oh(m,e.glyphMap,e.glyphPositions,e.imagePositions,h,v,a,_,x,p,g,t.ah.horizontal,!1,d,u);i&&(f.horizontal[x]=i),b(),Yn(s)&&o&&l&&(f.vertical=oh(m,e.glyphMap,e.glyphPositions,e.imagePositions,h,v,a,_,x,p,g,t.ah.vertical,!1,d,u))}}let y=!1;if(n.icon&&n.icon.name){const t=e.imageMap[n.icon.name];t&&(_=xh(e.imagePositions[n.icon.name],r.get("icon-offset").evaluate(n,{},e.canonical),r.get("icon-anchor").evaluate(n,{},e.canonical)),y=!!t.sdf,void 0===e.bucket.sdfIcons?e.bucket.sdfIcons=y:e.bucket.sdfIcons!==y&&T("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(t.pixelRatio!==e.bucket.pixelRatio||0!==r.get("icon-rotate").constantOr(1))&&(e.bucket.iconsNeedLinear=!0))}const x=Nu(f.horizontal)||f.vertical;e.bucket.iconsInText=!!x&&x.iconsInText,(x||_)&&Ou(e.bucket,n,f,_,e.imageMap,s,d,p,g,y,e.canonical)}e.showCollisionBoxes&&e.bucket.generateCollisionDebugBuffers()},t.bq=dc,t.br=Ml,t.bs=Jl,t.bt=Bl,t.bu=Kc,t.bv=class{constructor(t){this._marks={start:[t.url,"start"].join("#"),end:[t.url,"end"].join("#"),measure:t.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let t=performance.getEntriesByName(this._marks.measure);return 0===t.length&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),t=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),t}},t.bw=function(t,i,r,n,s){return e(this,void 0,void 0,function*(){if(d())try{return yield k(t,i,r,n,s)}catch(t){}return function(t,e,i,r,n){const s=t.width,a=t.height;C&&z||(C=new OffscreenCanvas(s,a),z=C.getContext("2d",{willReadFrequently:!0})),C.width=s,C.height=a,z.drawImage(t,0,0,s,a);const o=z.getImageData(e,i,r,n);return z.clearRect(0,0,s,a),o.data}(t,i,r,n,s)})},t.bx=ou,t.by=i,t.bz=r,t.c=D,t.d=t=>e(void 0,void 0,void 0,function*(){if(0===t.byteLength)return createImageBitmap(new ImageData(1,1));const e=new Blob([new Uint8Array(t)],{type:"image/png"});try{return createImageBitmap(e)}catch(t){throw new Error(`Could not load image because of ${t.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),t.e=g,t.f=t=>new Promise((e,i)=>{const r=new Image;r.onload=()=>{e(r),URL.revokeObjectURL(r.src),r.onload=null,window.requestAnimationFrame(()=>{r.src=M})},r.onerror=()=>i(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const n=new Blob([new Uint8Array(t)],{type:"image/png"});r.src=t.byteLength?URL.createObjectURL(n):M}),t.g=R,t.h=(t,e)=>V(g(t,{type:"json"}),e),t.i=I,t.j=q,t.k=$,t.l=(t,e)=>V(g(t,{type:"arrayBuffer"}),e),t.m=V,t.n=function(t){return new Kc(t).readFields(Jc,[])},t.o=Zo,t.p=th,t.q=Is,t.r=pn,t.s=N,t.t=gn,t.u=dn,t.v=G,t.w=T,t.x=function([t,e,i]){return e+=90,e*=Math.PI/180,i*=Math.PI/180,{x:t*Math.cos(e)*Math.sin(i),y:t*Math.sin(e)*Math.sin(i),z:t*Math.cos(i)}},t.y=ke,t.z=us}),i("worker",0,function(t){class e{constructor(t){this.keyCache={},t&&this.replace(t)}replace(t){this._layerConfigs={},this._layers={},this.update(t,[])}update(e,i){for(const i of e){this._layerConfigs[i.id]=i;const e=this._layers[i.id]=t.aA(i);e._featureFilter=t.a7(e.filter),this.keyCache[i.id]&&delete this.keyCache[i.id]}for(const t of i)delete this.keyCache[t],delete this._layerConfigs[t],delete this._layers[t];this.familiesBySource={};const r=t.bk(Object.values(this._layerConfigs),this.keyCache);for(const t of r){const e=t.map(t=>this._layers[t.id]),i=e[0];if("none"===i.visibility)continue;const r=i.source||"";let n=this.familiesBySource[r];n||(n=this.familiesBySource[r]={});const s=i.sourceLayer||"_geojsonTileLayer";let a=n[s];a||(a=n[s]=[]),a.push(e)}}}class i{constructor(e){const i={},r=[];for(const t in e){const n=e[t],s=i[t]={};for(const t in n){const e=n[+t];if(!e||0===e.bitmap.width||0===e.bitmap.height)continue;const i={x:0,y:0,w:e.bitmap.width+2,h:e.bitmap.height+2};r.push(i),s[t]={rect:i,metrics:e.metrics}}}const{w:n,h:s}=t.p(r),a=new t.o({width:n||1,height:s||1});for(const r in e){const n=e[r];for(const e in n){const s=n[+e];if(!s||0===s.bitmap.width||0===s.bitmap.height)continue;const o=i[r][e].rect;t.o.copy(s.bitmap,a,{x:0,y:0},{x:o.x+1,y:o.y+1},s.bitmap)}}this.image=a,this.positions=i}}t.bl("GlyphAtlas",i);class r{constructor(e){this.tileID=new t.S(e.tileID.overscaledZ,e.tileID.wrap,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),this.uid=e.uid,this.zoom=e.zoom,this.pixelRatio=e.pixelRatio,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=e.showCollisionBoxes,this.collectResourceTiming=!!e.collectResourceTiming,this.returnDependencies=!!e.returnDependencies,this.promoteId=e.promoteId,this.inFlightDependencies=[]}parse(e,r,s,a){return t._(this,void 0,void 0,function*(){this.status="parsing",this.data=e,this.collisionBoxArray=new t.a5;const o=new t.bm(Object.keys(e.layers).sort()),l=new t.bn(this.tileID,this.promoteId);l.bucketLayerIDs=[];const c={},h={featureIndex:l,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:s},u=r.familiesBySource[this.source];for(const i in u){const r=e.layers[i];if(!r)continue;1===r.version&&t.w(`Vector tile source "${this.source}" layer "${i}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const a=o.encode(i),d=[];for(let t=0;t<r.length;t++){const e=r.feature(t),n=l.getId(e,i);d.push({feature:e,id:n,index:t,sourceLayerIndex:a})}for(const e of u[i]){const i=e[0];i.source!==this.source&&t.w(`layer.source = ${i.source} does not equal this.source = ${this.source}`),i.minzoom&&this.zoom<Math.floor(i.minzoom)||i.maxzoom&&this.zoom>=i.maxzoom||"none"!==i.visibility&&(n(e,this.zoom,s),(c[i.id]=i.createBucket({index:l.bucketLayerIDs.length,layers:e,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:a,sourceID:this.source})).populate(d,h,this.tileID.canonical),l.bucketLayerIDs.push(e.map(t=>t.id)))}}const d=t.aF(h.glyphDependencies,t=>Object.keys(t).map(Number));this.inFlightDependencies.forEach(t=>null==t?void 0:t.abort()),this.inFlightDependencies=[];let p=Promise.resolve({});if(Object.keys(d).length){const t=new AbortController;this.inFlightDependencies.push(t),p=a.sendAsync({type:"GG",data:{stacks:d,source:this.source,tileID:this.tileID,type:"glyphs"}},t)}const f=Object.keys(h.iconDependencies);let m=Promise.resolve({});if(f.length){const t=new AbortController;this.inFlightDependencies.push(t),m=a.sendAsync({type:"GI",data:{icons:f,source:this.source,tileID:this.tileID,type:"icons"}},t)}const _=Object.keys(h.patternDependencies);let g=Promise.resolve({});if(_.length){const t=new AbortController;this.inFlightDependencies.push(t),g=a.sendAsync({type:"GI",data:{icons:_,source:this.source,tileID:this.tileID,type:"patterns"}},t)}const[y,x,v]=yield Promise.all([p,m,g]),b=new i(y),w=new t.bo(x,v);for(const e in c){const i=c[e];i instanceof t.a6?(n(i.layers,this.zoom,s),t.bp({bucket:i,glyphMap:y,glyphPositions:b.positions,imageMap:x,imagePositions:w.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):i.hasPattern&&(i instanceof t.bq||i instanceof t.br||i instanceof t.bs)&&(n(i.layers,this.zoom,s),i.addFeatures(h,this.tileID.canonical,w.patternPositions))}return this.status="done",{buckets:Object.values(c).filter(t=>!t.isEmpty()),featureIndex:l,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:b.image,imageAtlas:w,glyphMap:this.returnDependencies?y:null,iconMap:this.returnDependencies?x:null,glyphPositions:this.returnDependencies?b.positions:null}})}}function n(e,i,r){const n=new t.z(i);for(const t of e)t.recalculate(n,r)}class s{constructor(t,e,i){this.actor=t,this.layerIndex=e,this.availableImages=i,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(e,i){return t._(this,void 0,void 0,function*(){const r=yield t.l(e.request,i);try{return{vectorTile:new t.bt.VectorTile(new t.bu(r.data)),rawData:r.data,cacheControl:r.cacheControl,expires:r.expires}}catch(t){const n=new Uint8Array(r.data);let s=`Unable to parse the tile at ${e.request.url}, `;throw s+=31===n[0]&&139===n[1]?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${t.message}`,new Error(s)}})}loadTile(e){return t._(this,void 0,void 0,function*(){const i=e.uid,n=!!(e&&e.request&&e.request.collectResourceTiming)&&new t.bv(e.request),s=new r(e);this.loading[i]=s;const a=new AbortController;s.abort=a;try{const r=yield this.loadVectorTile(e,a);if(delete this.loading[i],!r)return null;const o=r.rawData,l={};r.expires&&(l.expires=r.expires),r.cacheControl&&(l.cacheControl=r.cacheControl);const c={};if(n){const t=n.finish();t&&(c.resourceTiming=JSON.parse(JSON.stringify(t)))}s.vectorTile=r.vectorTile;const h=s.parse(r.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[i]=s,this.fetching[i]={rawTileData:o,cacheControl:l,resourceTiming:c};try{const e=yield h;return t.e({rawTileData:o.slice(0)},e,l,c)}finally{delete this.fetching[i]}}catch(t){throw delete this.loading[i],s.status="done",this.loaded[i]=s,t}})}reloadTile(e){return t._(this,void 0,void 0,function*(){const i=e.uid;if(!this.loaded||!this.loaded[i])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");const r=this.loaded[i];if(r.showCollisionBoxes=e.showCollisionBoxes,"parsing"===r.status){const e=yield r.parse(r.vectorTile,this.layerIndex,this.availableImages,this.actor);let n;if(this.fetching[i]){const{rawTileData:r,cacheControl:s,resourceTiming:a}=this.fetching[i];delete this.fetching[i],n=t.e({rawTileData:r.slice(0)},e,s,a)}else n=e;return n}if("done"===r.status&&r.vectorTile)return r.parse(r.vectorTile,this.layerIndex,this.availableImages,this.actor)})}abortTile(e){return t._(this,void 0,void 0,function*(){const t=this.loading,i=e.uid;t&&t[i]&&t[i].abort&&(t[i].abort.abort(),delete t[i])})}removeTile(e){return t._(this,void 0,void 0,function*(){this.loaded&&this.loaded[e.uid]&&delete this.loaded[e.uid]})}}class a{constructor(){this.loaded={}}loadTile(e){return t._(this,void 0,void 0,function*(){const{uid:i,encoding:r,rawImageData:n,redFactor:s,greenFactor:a,blueFactor:o,baseShift:l}=e,c=n.width+2,h=n.height+2,u=t.b(n)?new t.R({width:c,height:h},yield t.bw(n,-1,-1,c,h)):n,d=new t.bx(i,u,r,s,a,o,l);return this.loaded=this.loaded||{},this.loaded[i]=d,d})}removeTile(t){const e=this.loaded,i=t.uid;e&&e[i]&&delete e[i]}}function o(t,e){if(0!==t.length){l(t[0],e);for(var i=1;i<t.length;i++)l(t[i],!e)}}function l(t,e){for(var i=0,r=0,n=0,s=t.length,a=s-1;n<s;
vendor: 10,908 bytes, line 313
313a=n++){var o=(t[n][0]-t[a][0])*(t[a][1]+t[n][1]),l=i+o;r+=Math.abs(i)>=Math.abs(o)?i-l+o:o-l+i,i=l}i+r>=0!=!!e&&t.reverse()}var c=t.by(function _t(t,e){var i,r=t&&t.type;if("FeatureCollection"===r)for(i=0;i<t.features.length;i++)_t(t.features[i],e);else if("GeometryCollection"===r)for(i=0;i<t.geometries.length;i++)_t(t.geometries[i],e);else if("Feature"===r)_t(t.geometry,e);else if("Polygon"===r)o(t.coordinates,e);else if("MultiPolygon"===r)for(i=0;i<t.coordinates.length;i++)o(t.coordinates[i],e);return t});const h=t.bt.VectorTileFeature.prototype.toGeoJSON;var u={exports:{}},d=t.bz,p=t.bt.VectorTileFeature,f=m;function m(t,e){this.options=e||{},this.features=t,this.length=t.length}function _(t,e){this.id="number"==typeof t.id?t.id:void 0,this.type=t.type,this.rawGeometry=1===t.type?[t.geometry]:t.geometry,this.properties=t.tags,this.extent=e||4096}m.prototype.feature=function(t){return new _(this.features[t],this.options.extent)},_.prototype.loadGeometry=function(){var t=this.rawGeometry;this.geometry=[];for(var e=0;e<t.length;e++){for(var i=t[e],r=[],n=0;n<i.length;n++)r.push(new d(i[n][0],i[n][1]));this.geometry.push(r)}return this.geometry},_.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var t=this.geometry,e=1/0,i=-1/0,r=1/0,n=-1/0,s=0;s<t.length;s++)for(var a=t[s],o=0;o<a.length;o++){var l=a[o];e=Math.min(e,l.x),i=Math.max(i,l.x),r=Math.min(r,l.y),n=Math.max(n,l.y)}return[e,r,i,n]},_.prototype.toGeoJSON=p.prototype.toGeoJSON;var g=t.bA,y=f;function x(t){var e=new g;return function(t,e){for(var i in t.layers)e.writeMessage(3,v,t.layers[i])}(t,e),e.finish()}function v(t,e){var i;e.writeVarintField(15,t.version||1),e.writeStringField(1,t.name||""),e.writeVarintField(5,t.extent||4096);var r={keys:[],values:[],keycache:{},valuecache:{}};for(i=0;i<t.length;i++)r.feature=t.feature(i),e.writeMessage(2,b,r);var n=r.keys;for(i=0;i<n.length;i++)e.writeStringField(3,n[i]);var s=r.values;for(i=0;i<s.length;i++)e.writeMessage(4,P,s[i])}function b(t,e){var i=t.feature;void 0!==i.id&&e.writeVarintField(1,i.id),e.writeMessage(2,w,t),e.writeVarintField(3,i.type),e.writeMessage(4,I,i)}function w(t,e){var i=t.feature,r=t.keys,n=t.values,s=t.keycache,a=t.valuecache;for(var o in i.properties){var l=i.properties[o],c=s[o];if(null!==l){void 0===c&&(r.push(o),s[o]=c=r.length-1),e.writeVarint(c);var h=typeof l;"string"!==h&&"boolean"!==h&&"number"!==h&&(l=JSON.stringify(l));var u=h+":"+l,d=a[u];void 0===d&&(n.push(l),a[u]=d=n.length-1),e.writeVarint(d)}}}function T(t,e){return(e<<3)+(7&t)}function S(t){return t<<1^t>>31}function I(t,e){for(var i=t.loadGeometry(),r=t.type,n=0,s=0,a=i.length,o=0;o<a;o++){var l=i[o],c=1;1===r&&(c=l.length),e.writeVarint(T(1,c));for(var h=3===r?l.length-1:l.length,u=0;u<h;u++){1===u&&1!==r&&e.writeVarint(T(2,h-1));var d=l[u].x-n,p=l[u].y-s;e.writeVarint(S(d)),e.writeVarint(S(p)),n+=d,s+=p}3===r&&e.writeVarint(T(7,1))}}function P(t,e){var i=typeof t;"string"===i?e.writeStringField(1,t):"boolean"===i?e.writeBooleanField(7,t):"number"===i&&(t%1!=0?e.writeDoubleField(3,t):t<0?e.writeSVarintField(6,t):e.writeVarintField(5,t))}u.exports=x,u.exports.fromVectorTileJs=x,u.exports.fromGeojsonVt=function(t,e){e=e||{};var i={};for(var r in t)i[r]=new y(t[r].features,e),i[r].name=r,i[r].version=e.version,i[r].extent=e.extent;return x({layers:i})},u.exports.GeoJSONWrapper=y;var A=t.by(u.exports);const M={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:t=>t},k=Math.fround||(C=new Float32Array(1),t=>(C[0]=+t,C[0]));var C;class z{constructor(t){this.options=Object.assign(Object.create(M),t),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(t){const{log:e,minZoom:i,maxZoom:r}=this.options;e&&console.time("total time");const n=`prepare ${t.length} points`;e&&console.time(n),this.points=t;const s=[];for(let e=0;e<t.length;e++){const i=t[e];if(!i.geometry)continue;const[r,n]=i.geometry.coordinates,a=k(L(r)),o=k(R(n));s.push(a,o,1/0,e,-1,1),this.options.reduce&&s.push(0)}let a=this.trees[r+1]=this._createTree(s);e&&console.timeEnd(n);for(let t=r;t>=i;t--){const i=+Date.now();a=this.trees[t]=this._createTree(this._cluster(a,t)),e&&console.log("z%d: %d clusters in %dms",t,a.numItems,+Date.now()-i)}return e&&console.timeEnd("total time"),this}getClusters(t,e){let i=((t[0]+180)%360+360)%360-180;const r=Math.max(-90,Math.min(90,t[1]));let n=180===t[2]?180:((t[2]+180)%360+360)%360-180;const s=Math.max(-90,Math.min(90,t[3]));if(t[2]-t[0]>=360)i=-180,n=180;else if(i>n){const t=this.getClusters([i,r,180,s],e),a=this.getClusters([-180,r,n,s],e);return t.concat(a)}const a=this.trees[this._limitZoom(e)],o=a.range(L(i),R(s),L(n),R(r)),l=a.data,c=[];for(const t of o){const e=this.stride*t;c.push(l[e+5]>1?E(l,e,this.clusterProps):this.points[l[e+3]])}return c}getChildren(t){const e=this._getOriginId(t),i=this._getOriginZoom(t),r="No cluster with the specified id.",n=this.trees[i];if(!n)throw new Error(r);const s=n.data;if(e*this.stride>=s.length)throw new Error(r);const a=this.options.radius/(this.options.extent*Math.pow(2,i-1)),o=n.within(s[e*this.stride],s[e*this.stride+1],a),l=[];for(const e of o){const i=e*this.stride;s[i+4]===t&&l.push(s[i+5]>1?E(s,i,this.clusterProps):this.points[s[i+3]])}if(0===l.length)throw new Error(r);return l}getLeaves(t,e,i){const r=[];return this._appendLeaves(r,t,e=e||10,i=i||0,0),r}getTile(t,e,i){const r=this.trees[this._limitZoom(t)],n=Math.pow(2,t),{extent:s,radius:a}=this.options,o=a/s,l=(i-o)/n,c=(i+1+o)/n,h={features:[]};return this._addTileFeatures(r.range((e-o)/n,l,(e+1+o)/n,c),r.data,e,i,n,h),0===e&&this._addTileFeatures(r.range(1-o/n,l,1,c),r.data,n,i,n,h),e===n-1&&this._addTileFeatures(r.range(0,l,o/n,c),r.data,-1,i,n,h),h.features.length?h:null}getClusterExpansionZoom(t){let e=this._getOriginZoom(t)-1;for(;e<=this.options.maxZoom;){const i=this.getChildren(t);if(e++,1!==i.length)break;t=i[0].properties.cluster_id}return e}_appendLeaves(t,e,i,r,n){const s=this.getChildren(e);for(const e of s){const s=e.properties;if(s&&s.cluster?n+s.point_count<=r?n+=s.point_count:n=this._appendLeaves(t,s.cluster_id,i,r,n):n<r?n++:t.push(e),t.length===i)break}return n}_createTree(e){const i=new t.av(e.length/this.stride|0,this.options.nodeSize,Float32Array);for(let t=0;t<e.length;t+=this.stride)i.add(e[t],e[t+1]);return i.finish(),i.data=e,i}_addTileFeatures(t,e,i,r,n,s){for(const a of t){const t=a*this.stride,o=e[t+5]>1;let l,c,h;if(o)l=D(e,t,this.clusterProps),c=e[t],h=e[t+1];else{const i=this.points[e[t+3]];l=i.properties;const[r,n]=i.geometry.coordinates;c=L(r),h=R(n)}const u={type:1,geometry:[[Math.round(this.options.extent*(c*n-i)),Math.round(this.options.extent*(h*n-r))]],tags:l};let d;d=o||this.options.generateId?e[t+3]:this.points[e[t+3]].id,void 0!==d&&(u.id=d),s.features.push(u)}}_limitZoom(t){return Math.max(this.options.minZoom,Math.min(Math.floor(+t),this.options.maxZoom+1))}_cluster(t,e){const{radius:i,extent:r,reduce:n,minPoints:s}=this.options,a=i/(r*Math.pow(2,e)),o=t.data,l=[],c=this.stride;for(let i=0;i<o.length;i+=c){if(o[i+2]<=e)continue;o[i+2]=e;const r=o[i],h=o[i+1],u=t.within(o[i],o[i+1],a),d=o[i+5];let p=d;for(const t of u){const i=t*c;o[i+2]>e&&(p+=o[i+5])}if(p>d&&p>=s){let t,s=r*d,a=h*d,f=-1;const m=(i/c<<5)+(e+1)+this.points.length;for(const r of u){const l=r*c;if(o[l+2]<=e)continue;o[l+2]=e;const h=o[l+5];s+=o[l]*h,a+=o[l+1]*h,o[l+4]=m,n&&(t||(t=this._map(o,i,!0),f=this.clusterProps.length,this.clusterProps.push(t)),n(t,this._map(o,l)))}o[i+4]=m,l.push(s/p,a/p,1/0,m,-1,p),n&&l.push(f)}else{for(let t=0;t<c;t++)l.push(o[i+t]);if(p>1)for(const t of u){const i=t*c;if(!(o[i+2]<=e)){o[i+2]=e;for(let t=0;t<c;t++)l.push(o[i+t])}}}}return l}_getOriginId(t){return t-this.points.length>>5}_getOriginZoom(t){return(t-this.points.length)%32}_map(t,e,i){if(t[e+5]>1){const r=this.clusterProps[t[e+6]];return i?Object.assign({},r):r}const r=this.points[t[e+3]].properties,n=this.options.map(r);return i&&n===r?Object.assign({},n):n}}function E(t,e,i){return{type:"Feature",id:t[e+3],properties:D(t,e,i),geometry:{type:"Point",coordinates:[(r=t[e],360*(r-.5)),B(t[e+1])]}};var r}function D(t,e,i){const r=t[e+5],n=r>=1e4?`${Math.round(r/1e3)}k`:r>=1e3?Math.round(r/100)/10+"k":r,s=t[e+6],a=-1===s?{}:Object.assign({},i[s]);return Object.assign(a,{cluster:!0,cluster_id:t[e+3],point_count:r,point_count_abbreviated:n})}function L(t){return t/360+.5}function R(t){const e=Math.sin(t*Math.PI/180),i=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return i<0?0:i>1?1:i}function B(t){const e=(180-360*t)*Math.PI/180;return 360*Math.atan(Math.exp(e))/Math.PI-90}function F(t,e,i,r){let n=r;const s=e+(i-e>>1);let a,o=i-e;const l=t[e],c=t[e+1],h=t[i],u=t[i+1];for(let r=e+3;r<i;r+=3){const e=O(t[r],t[r+1],l,c,h,u);if(e>n)a=r,n=e;else if(e===n){const t=Math.abs(r-s);t<o&&(a=r,o=t)}}n>r&&(a-e>3&&F(t,e,a,r),t[a+2]=n,i-a>3&&F(t,a,i,r))}function O(t,e,i,r,n,s){let a=n-i,o=s-r;if(0!==a||0!==o){const l=((t-i)*a+(e-r)*o)/(a*a+o*o);l>1?(i=n,r=s):l>0&&(i+=a*l,r+=o*l)}return a=t-i,o=e-r,a*a+o*o}function V(t,e,i,r){const n={id:null==t?null:t,type:e,geometry:i,tags:r,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if("Point"===e||"MultiPoint"===e||"LineString"===e)N(n,i);else if("Polygon"===e)N(n,i[0]);else if("MultiLineString"===e)for(const t of i)N(n,t);else if("MultiPolygon"===e)for(const t of i)N(n,t[0]);return n}function N(t,e){for(let i=0;i<e.length;i+=3)t.minX=Math.min(t.minX,e[i]),t.minY=Math.min(t.minY,e[i+1]),t.maxX=Math.max(t.maxX,e[i]),t.maxY=Math.max(t.maxY,e[i+1])}function j(t,e,i,r){if(!e.geometry)return;const n=e.geometry.coordinates;if(n&&0===n.length)return;const s=e.geometry.type,a=Math.pow(i.tolerance/((1<<i.maxZoom)*i.extent),2);let o=[],l=e.id;if(i.promoteId?l=e.properties[i.promoteId]:i.generateId&&(l=r||0),"Point"===s)U(n,o);else if("MultiPoint"===s)for(const t of n)U(t,o);else if("LineString"===s)$(n,o,a,!1);else if("MultiLineString"===s){if(i.lineMetrics){for(const i of n)o=[],$(i,o,a,!1),t.push(V(l,"LineString",o,e.properties));return}q(n,o,a,!1)}else if("Polygon"===s)q(n,o,a,!0);else{if("MultiPolygon"!==s){if("GeometryCollection"===s){for(const n of e.geometry.geometries)j(t,{id:l,geometry:n,properties:e.properties},i,r);return}throw new Error("Input data is not a valid GeoJSON object.")}for(const t of n){const e=[];q(t,e,a,!0),o.push(e)}}t.push(V(l,s,o,e.properties))}function U(t,e){e.push(Z(t[0]),G(t[1]),0)}function $(t,e,i,r){let n,s,a=0;for(let i=0;i<t.length;i++){const o=Z(t[i][0]),l=G(t[i][1]);e.push(o,l,0),i>0&&(a+=r?(n*l-o*s)/2:Math.sqrt(Math.pow(o-n,2)+Math.pow(l-s,2))),n=o,s=l}const o=e.length-3;e[2]=1,F(e,0,o,i),e[o+2]=1,e.size=Math.abs(a),e.start=0,e.end=e.size}function q(t,e,i,r){for(let n=0;n<t.length;n++){const s=[];$(t[n],s,i,r),e.push(s)}}function Z(t){return t/360+.5}function G(t){const e=Math.sin(t*Math.PI/180),i=.5-.25*Math.log((1+e)/(1-e))/Math.PI;return i<0?0:i>1?1:i}
vendor: 11,633 bytes, line 313
313function H(t,e,i,r,n,s,a,o){if(r/=e,s>=(i/=e)&&a<r)return t;if(a<i||s>=r)return null;const l=[];for(const e of t){const t=e.geometry;let s=e.type;const a=0===n?e.minX:e.minY,c=0===n?e.maxX:e.maxY;if(a>=i&&c<r){l.push(e);continue}if(c<i||a>=r)continue;let h=[];if("Point"===s||"MultiPoint"===s)X(t,h,i,r,n);else if("LineString"===s)W(t,h,i,r,n,!1,o.lineMetrics);else if("MultiLineString"===s)J(t,h,i,r,n,!1);else if("Polygon"===s)J(t,h,i,r,n,!0);else if("MultiPolygon"===s)for(const e of t){const t=[];J(e,t,i,r,n,!0),t.length&&h.push(t)}if(h.length){if(o.lineMetrics&&"LineString"===s){for(const t of h)l.push(V(e.id,s,t,e.tags));continue}"LineString"!==s&&"MultiLineString"!==s||(1===h.length?(s="LineString",h=h[0]):s="MultiLineString"),"Point"!==s&&"MultiPoint"!==s||(s=3===h.length?"Point":"MultiPoint"),l.push(V(e.id,s,h,e.tags))}}return l.length?l:null}function X(t,e,i,r,n){for(let s=0;s<t.length;s+=3){const a=t[s+n];a>=i&&a<=r&&Y(e,t[s],t[s+1],t[s+2])}}function W(t,e,i,r,n,s,a){let o=K(t);const l=0===n?Q:tt;let c,h,u=t.start;for(let d=0;d<t.length-3;d+=3){const p=t[d],f=t[d+1],m=t[d+2],_=t[d+3],g=t[d+4],y=0===n?p:f,x=0===n?_:g;let v=!1;a&&(c=Math.sqrt(Math.pow(p-_,2)+Math.pow(f-g,2))),y<i?x>i&&(h=l(o,p,f,_,g,i),a&&(o.start=u+c*h)):y>r?x<r&&(h=l(o,p,f,_,g,r),a&&(o.start=u+c*h)):Y(o,p,f,m),x<i&&y>=i&&(h=l(o,p,f,_,g,i),v=!0),x>r&&y<=r&&(h=l(o,p,f,_,g,r),v=!0),!s&&v&&(a&&(o.end=u+c*h),e.push(o),o=K(t)),a&&(u+=c)}let d=t.length-3;const p=t[d],f=t[d+1],m=0===n?p:f;m>=i&&m<=r&&Y(o,p,f,t[d+2]),d=o.length-3,s&&d>=3&&(o[d]!==o[0]||o[d+1]!==o[1])&&Y(o,o[0],o[1],o[2]),o.length&&e.push(o)}function K(t){const e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function J(t,e,i,r,n,s){for(const a of t)W(a,e,i,r,n,s,!1)}function Y(t,e,i,r){t.push(e,i,r)}function Q(t,e,i,r,n,s){const a=(s-e)/(r-e);return Y(t,s,i+(n-i)*a,1),a}function tt(t,e,i,r,n,s){const a=(s-i)/(n-i);return Y(t,e+(r-e)*a,s,1),a}function et(t,e){const i=[];for(let r=0;r<t.length;r++){const n=t[r],s=n.type;let a;if("Point"===s||"MultiPoint"===s||"LineString"===s)a=it(n.geometry,e);else if("MultiLineString"===s||"Polygon"===s){a=[];for(const t of n.geometry)a.push(it(t,e))}else if("MultiPolygon"===s){a=[];for(const t of n.geometry){const i=[];for(const r of t)i.push(it(r,e));a.push(i)}}i.push(V(n.id,s,a,n.tags))}return i}function it(t,e){const i=[];i.size=t.size,void 0!==t.start&&(i.start=t.start,i.end=t.end);for(let r=0;r<t.length;r+=3)i.push(t[r]+e,t[r+1],t[r+2]);return i}function rt(t,e){if(t.transformed)return t;const i=1<<t.z,r=t.x,n=t.y;for(const s of t.features){const t=s.geometry,a=s.type;if(s.geometry=[],1===a)for(let a=0;a<t.length;a+=2)s.geometry.push(nt(t[a],t[a+1],e,i,r,n));else for(let a=0;a<t.length;a++){const o=[];for(let s=0;s<t[a].length;s+=2)o.push(nt(t[a][s],t[a][s+1],e,i,r,n));s.geometry.push(o)}}return t.transformed=!0,t}function nt(t,e,i,r,n,s){return[Math.round(i*(t*r-n)),Math.round(i*(e*r-s))]}function st(t,e,i,r,n){const s=e===n.maxZoom?0:n.tolerance/((1<<e)*n.extent),a={features:[],numPoints:0,numSimplified:0,numFeatures:t.length,source:null,x:i,y:r,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0};for(const e of t)at(a,e,s,n);return a}function at(t,e,i,r){const n=e.geometry,s=e.type,a=[];if(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),"Point"===s||"MultiPoint"===s)for(let e=0;e<n.length;e+=3)a.push(n[e],n[e+1]),t.numPoints++,t.numSimplified++;else if("LineString"===s)ot(a,n,t,i,!1,!1);else if("MultiLineString"===s||"Polygon"===s)for(let e=0;e<n.length;e++)ot(a,n[e],t,i,"Polygon"===s,0===e);else if("MultiPolygon"===s)for(let e=0;e<n.length;e++){const r=n[e];for(let e=0;e<r.length;e++)ot(a,r[e],t,i,!0,0===e)}if(a.length){let i=e.tags||null;if("LineString"===s&&r.lineMetrics){i={};for(const t in e.tags)i[t]=e.tags[t];i.mapbox_clip_start=n.start/n.size,i.mapbox_clip_end=n.end/n.size}const o={geometry:a,type:"Polygon"===s||"MultiPolygon"===s?3:"LineString"===s||"MultiLineString"===s?2:1,tags:i};null!==e.id&&(o.id=e.id),t.features.push(o)}}function ot(t,e,i,r,n,s){const a=r*r;if(r>0&&e.size<(n?a:r))return void(i.numPoints+=e.length/3);const o=[];for(let t=0;t<e.length;t+=3)(0===r||e[t+2]>a)&&(i.numSimplified++,o.push(e[t],e[t+1])),i.numPoints++;n&&function(t,e){let i=0;for(let e=0,r=t.length,n=r-2;e<r;n=e,e+=2)i+=(t[e]-t[n])*(t[e+1]+t[n+1]);if(i>0===e)for(let e=0,i=t.length;e<i/2;e+=2){const r=t[e],n=t[e+1];t[e]=t[i-2-e],t[e+1]=t[i-1-e],t[i-2-e]=r,t[i-1-e]=n}}(o,s),t.push(o)}const lt={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0};class ct{constructor(t,e){const i=(e=this.options=function(t,e){for(const i in e)t[i]=e[i];return t}(Object.create(lt),e)).debug;if(i&&console.time("preprocess data"),e.maxZoom<0||e.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");let r=function(t,e){const i=[];if("FeatureCollection"===t.type)for(let r=0;r<t.features.length;r++)j(i,t.features[r],e,r);else j(i,"Feature"===t.type?t:{geometry:t},e);return i}(t,e);this.tiles={},this.tileCoords=[],i&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),r=function(t,e){const i=e.buffer/e.extent;let r=t;const n=H(t,1,-1-i,i,0,-1,2,e),s=H(t,1,1-i,2+i,0,-1,2,e);return(n||s)&&(r=H(t,1,-i,1+i,0,-1,2,e)||[],n&&(r=et(n,1).concat(r)),s&&(r=r.concat(et(s,-1)))),r}(r,e),r.length&&this.splitTile(r,0,0,0),i&&(r.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}splitTile(t,e,i,r,n,s,a){const o=[t,e,i,r],l=this.options,c=l.debug;for(;o.length;){r=o.pop(),i=o.pop(),e=o.pop(),t=o.pop();const h=1<<e,u=ht(e,i,r);let d=this.tiles[u];if(!d&&(c>1&&console.time("creation"),d=this.tiles[u]=st(t,e,i,r,l),this.tileCoords.push({z:e,x:i,y:r}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,i,r,d.numFeatures,d.numPoints,d.numSimplified),console.timeEnd("creation"));const t=`z${e}`;this.stats[t]=(this.stats[t]||0)+1,this.total++}if(d.source=t,null==n){if(e===l.indexMaxZoom||d.numPoints<=l.indexMaxPoints)continue}else{if(e===l.maxZoom||e===n)continue;if(null!=n){const t=n-e;if(i!==s>>t||r!==a>>t)continue}}if(d.source=null,0===t.length)continue;c>1&&console.time("clipping");const p=.5*l.buffer/l.extent,f=.5-p,m=.5+p,_=1+p;let g=null,y=null,x=null,v=null,b=H(t,h,i-p,i+m,0,d.minX,d.maxX,l),w=H(t,h,i+f,i+_,0,d.minX,d.maxX,l);t=null,b&&(g=H(b,h,r-p,r+m,1,d.minY,d.maxY,l),y=H(b,h,r+f,r+_,1,d.minY,d.maxY,l),b=null),w&&(x=H(w,h,r-p,r+m,1,d.minY,d.maxY,l),v=H(w,h,r+f,r+_,1,d.minY,d.maxY,l),w=null),c>1&&console.timeEnd("clipping"),o.push(g||[],e+1,2*i,2*r),o.push(y||[],e+1,2*i,2*r+1),o.push(x||[],e+1,2*i+1,2*r),o.push(v||[],e+1,2*i+1,2*r+1)}}getTile(t,e,i){t=+t,e=+e,i=+i;const r=this.options,{extent:n,debug:s}=r;if(t<0||t>24)return null;const a=1<<t,o=ht(t,e=e+a&a-1,i);if(this.tiles[o])return rt(this.tiles[o],n);s>1&&console.log("drilling down to z%d-%d-%d",t,e,i);let l,c=t,h=e,u=i;for(;!l&&c>0;)c--,h>>=1,u>>=1,l=this.tiles[ht(c,h,u)];return l&&l.source?(s>1&&(console.log("found parent tile z%d-%d-%d",c,h,u),console.time("drilling down")),this.splitTile(l.source,c,h,u,t,e,i),s>1&&console.timeEnd("drilling down"),this.tiles[o]?rt(this.tiles[o],n):null):null}}function ht(t,e,i){return 32*((1<<t)*i+e)+t}function ut(t,e){return e?t.properties[e]:t.id}function dt(t,e){if(null==t)return!0;if("Feature"===t.type)return null!=ut(t,e);if("FeatureCollection"===t.type){const i=new Set;for(const r of t.features){const t=ut(r,e);if(null==t)return!1;if(i.has(t))return!1;i.add(t)}return!0}return!1}function pt(t,e){const i=new Map;if(null==t);else if("Feature"===t.type)i.set(ut(t,e),t);else for(const r of t.features)i.set(ut(r,e),r);return i}class ft extends s{constructor(){super(...arguments),this._dataUpdateable=new Map}loadVectorTile(e,i){return t._(this,void 0,void 0,function*(){const i=e.tileID.canonical;if(!this._geoJSONIndex)throw new Error("Unable to parse the data into a cluster or geojson");const r=this._geoJSONIndex.getTile(i.z,i.x,i.y);if(!r)return null;const n=new class{constructor(e){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=t.X,this.length=e.length,this._features=e}feature(e){return new class{constructor(e){this._feature=e,this.extent=t.X,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))}loadGeometry(){if(1===this._feature.type){const e=[];for(const i of this._feature.geometry)e.push([new t.P(i[0],i[1])]);return e}{const e=[];for(const i of this._feature.geometry){const r=[];for(const e of i)r.push(new t.P(e[0],e[1]));e.push(r)}return e}}toGeoJSON(t,e,i){return h.call(this,t,e,i)}}(this._features[e])}}(r.features);let s=A(n);return 0===s.byteOffset&&s.byteLength===s.buffer.byteLength||(s=new Uint8Array(s)),{vectorTile:n,rawData:s.buffer}})}loadData(e){return t._(this,void 0,void 0,function*(){var i;null===(i=this._pendingRequest)||void 0===i||i.abort();const r=!!(e&&e.request&&e.request.collectResourceTiming)&&new t.bv(e.request);this._pendingRequest=new AbortController;try{this._pendingData=this.loadAndProcessGeoJSON(e,this._pendingRequest),this._geoJSONIndex=e.cluster?new z(function({superclusterOptions:e,clusterProperties:i}){if(!i||!e)return e;const r={},n={},s={accumulated:null,zoom:0},a={properties:null},o=Object.keys(i);for(const e of o){const[s,a]=i[e],o=t.bC(a),l=t.bC("string"==typeof s?[s,["accumulated"],["get",e]]:s);r[e]=o.value,n[e]=l.value}return e.map=t=>{a.properties=t;const e={};for(const t of o)e[t]=r[t].evaluate(s,a);return e},e.reduce=(t,e)=>{a.properties=e;for(const e of o)s.accumulated=t[e],t[e]=n[e].evaluate(s,a)},e}(e)).load((yield this._pendingData).features):(n=yield this._pendingData,new ct(n,e.geojsonVtOptions)),this.loaded={};const i={};if(r){const t=r.finish();t&&(i.resourceTiming={},i.resourceTiming[e.source]=JSON.parse(JSON.stringify(t)))}return i}catch(e){if(delete this._pendingRequest,t.bB(e))return{abandoned:!0};throw e}var n})}getData(){return t._(this,void 0,void 0,function*(){return this._pendingData})}reloadTile(t){const e=this.loaded;return e&&e[t.uid]?super.reloadTile(t):this.loadTile(t)}loadAndProcessGeoJSON(e,i){return t._(this,void 0,void 0,function*(){let r=yield this.loadGeoJSON(e,i);if(delete this._pendingRequest,"object"!=typeof r)throw new Error(`Input data given to '${e.source}' is not a valid GeoJSON object.`);if(c(r,!0),e.filter){const i=t.bC(e.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===i.result)throw new Error(i.value.map(t=>`${t.key}: ${t.message}`).join(", "));const n=r.features.filter(t=>i.value.evaluate({zoom:0},t));r={type:"FeatureCollection",features:n}}return r})}loadGeoJSON(e,i){return t._(this,void 0,void 0,function*(){const{promoteId:r}=e;if(e.request){const n=yield t.h(e.request,i);return this._dataUpdateable=dt(n.data,r)?pt(n.data,r):void 0,n.data}if("string"==typeof e.data)try{const t=JSON.parse(e.data);return this._dataUpdateable=dt(t,r)?pt(t,r):void 0,t}catch(t){throw new Error(`Input data given to '${e.source}' is not a valid GeoJSON object.`)}if(!e.dataDiff)throw new Error(`Input data given to '${e.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${e.source}`);
313return function(t,e,i){var r,n,s,a;if(e.removeAll&&t.clear(),e.remove)for(const i of e.remove)t["delete"](i);if(e.add)for(const r of e.add){const e=ut(r,i);null!=e&&t.set(e,r)}if(e.update)for(const i of e.update){let e=t.get(i.id);if(null==e)continue;const o=!i.removeAllProperties&&((null===(r=i.removeProperties)||void 0===r?void 0:r.length)>0||(null===(n=i.addOrUpdateProperties)||void 0===n?void 0:n.length)>0);if((i.newGeometry||i.removeAllProperties||o)&&(e=Object.assign({},e),t.set(i.id,e),o&&(e.properties=Object.assign({},e.properties))),i.newGeometry&&(e.geometry=i.newGeometry),i.removeAllProperties)e.properties={};else if((null===(s=i.removeProperties)||void 0===s?void 0:s.length)>0)for(const t of i.removeProperties)Object.prototype.hasOwnProperty.call(e.properties,t)&&delete e.properties[t];if((null===(a=i.addOrUpdateProperties)||void 0===a?void 0:a.length)>0)for(const{key:t,value:r}of i.addOrUpdateProperties)e.properties[t]=r}}(this._dataUpdateable,e.dataDiff,r),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}})}removeSource(e){return t._(this,void 0,void 0,function*(){this._pendingRequest&&this._pendingRequest.abort()})}getClusterExpansionZoom(t){return this._geoJSONIndex.getClusterExpansionZoom(t.clusterId)}getClusterChildren(t){return this._geoJSONIndex.getChildren(t.clusterId)}getClusterLeaves(t){return this._geoJSONIndex.getLeaves(t.clusterId,t.limit,t.offset)}}class mt{constructor(e){this.self=e,this.actor=new t.F(e),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(t,e)=>{if(this.externalWorkerSourceTypes[t])throw new Error(`Worker source with name "${t}" already registered.`);this.externalWorkerSourceTypes[t]=e},this.self.addProtocol=t.bi,this.self.removeProtocol=t.bj,this.self.registerRTLTextPlugin=e=>{if(t.bD.isParsed())throw new Error("RTL text plugin already registered.");t.bD.setMethods(e)},this.actor.registerMessageHandler("LDT",(t,e)=>this._getDEMWorkerSource(t,e.source).loadTile(e)),this.actor.registerMessageHandler("RDT",(e,i)=>t._(this,void 0,void 0,function*(){this._getDEMWorkerSource(e,i.source).removeTile(i)})),this.actor.registerMessageHandler("GCEZ",(e,i)=>t._(this,void 0,void 0,function*(){return this._getWorkerSource(e,i.type,i.source).getClusterExpansionZoom(i)})),this.actor.registerMessageHandler("GCC",(e,i)=>t._(this,void 0,void 0,function*(){return this._getWorkerSource(e,i.type,i.source).getClusterChildren(i)})),this.actor.registerMessageHandler("GCL",(e,i)=>t._(this,void 0,void 0,function*(){return this._getWorkerSource(e,i.type,i.source).getClusterLeaves(i)})),this.actor.registerMessageHandler("LD",(t,e)=>this._getWorkerSource(t,e.type,e.source).loadData(e)),this.actor.registerMessageHandler("GD",(t,e)=>this._getWorkerSource(t,e.type,e.source).getData()),this.actor.registerMessageHandler("LT",(t,e)=>this._getWorkerSource(t,e.type,e.source).loadTile(e)),this.actor.registerMessageHandler("RT",(t,e)=>this._getWorkerSource(t,e.type,e.source).reloadTile(e)),this.actor.registerMessageHandler("AT",(t,e)=>this._getWorkerSource(t,e.type,e.source).abortTile(e)),this.actor.registerMessageHandler("RMT",(t,e)=>this._getWorkerSource(t,e.type,e.source).removeTile(e)),this.actor.registerMessageHandler("RS",(e,i)=>t._(this,void 0,void 0,function*(){if(!this.workerSources[e]||!this.workerSources[e][i.type]||!this.workerSources[e][i.type][i.source])return;const t=this.workerSources[e][i.type][i.source];delete this.workerSources[e][i.type][i.source],void 0!==t.removeSource&&t.removeSource(i)})),this.actor.registerMessageHandler("RM",e=>t._(this,void 0,void 0,function*(){delete this.layerIndexes[e],delete this.availableImages[e],delete this.workerSources[e],delete this.demWorkerSources[e]})),this.actor.registerMessageHandler("SR",(e,i)=>t._(this,void 0,void 0,function*(){this.referrer=i})),this.actor.registerMessageHandler("SRPS",(t,e)=>this._syncRTLPluginState(t,e)),this.actor.registerMessageHandler("IS",(e,i)=>t._(this,void 0,void 0,function*(){this.self.importScripts(i)})),this.actor.registerMessageHandler("SI",(t,e)=>this._setImages(t,e)),this.actor.registerMessageHandler("UL",(e,i)=>t._(this,void 0,void 0,function*(){this._getLayerIndex(e).update(i.layers,i.removedIds)})),this.actor.registerMessageHandler("SL",(e,i)=>t._(this,void 0,void 0,function*(){this._getLayerIndex(e).replace(i)}))}_setImages(e,i){return t._(this,void 0,void 0,function*(){this.availableImages[e]=i;for(const t in this.workerSources[e]){const r=this.workerSources[e][t];for(const t in r)r[t].availableImages=i}})}_syncRTLPluginState(e,i){return t._(this,void 0,void 0,function*(){if(t.bD.isParsed())return t.bD.getState();if("loading"!==i.pluginStatus)return t.bD.setState(i),i;const e=i.pluginURL;if(this.self.importScripts(e),t.bD.isParsed()){const i={pluginStatus:"loaded",pluginURL:e};return t.bD.setState(i),i}throw t.bD.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${e}`)})}_getAvailableImages(t){let e=this.availableImages[t];return e||(e=[]),e}_getLayerIndex(t){let i=this.layerIndexes[t];
vendor: 27,395 bytes, line 313
313return i||(i=this.layerIndexes[t]=new e),i}_getWorkerSource(t,e,i){if(this.workerSources[t]||(this.workerSources[t]={}),this.workerSources[t][e]||(this.workerSources[t][e]={}),!this.workerSources[t][e][i]){const r={sendAsync:(e,i)=>(e.targetMapId=t,this.actor.sendAsync(e,i))};switch(e){case"vector":this.workerSources[t][e][i]=new s(r,this._getLayerIndex(t),this._getAvailableImages(t));break;case"geojson":this.workerSources[t][e][i]=new ft(r,this._getLayerIndex(t),this._getAvailableImages(t));break;default:this.workerSources[t][e][i]=new this.externalWorkerSourceTypes[e](r,this._getLayerIndex(t),this._getAvailableImages(t))}}return this.workerSources[t][e][i]}_getDEMWorkerSource(t,e){return this.demWorkerSources[t]||(this.demWorkerSources[t]={}),this.demWorkerSources[t][e]||(this.demWorkerSources[t][e]=new a),this.demWorkerSources[t][e]}}return t.i(self)&&(self.worker=new mt(self)),mt}),i("index",0,function(t,e){var i="4.7.1";let r,n;const s={now:"undefined"!=typeof performance&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frameAsync:t=>new Promise((i,r)=>{const n=requestAnimationFrame(i);t.signal.addEventListener("abort",()=>{cancelAnimationFrame(n),r(e.c())})}),getImageData(t,e=0){return this.getImageCanvasContext(t).getImageData(-e,-e,t.width+2*e,t.height+2*e)},getImageCanvasContext(t){const e=window.document.createElement("canvas"),i=e.getContext("2d",{willReadFrequently:!0});if(!i)throw new Error("failed to create canvas 2d context");return e.width=t.width,e.height=t.height,i.drawImage(t,0,0,t.width,t.height),i},resolveURL:t=>(r||(r=document.createElement("a")),r.href=t,r.href),hardwareConcurrency:"undefined"!=typeof navigator&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(null==n&&(n=matchMedia("(prefers-reduced-motion: reduce)")),n.matches)}};class a{static testProp(t){if(!a.docStyle)return t[0];for(let e=0;e<t.length;e++)if(t[e]in a.docStyle)return t[e];return t[0]}static create(t,e,i){const r=window.document.createElement(t);return void 0!==e&&(r.className=e),i&&i.appendChild(r),r}static createNS(t,e){return window.document.createElementNS(t,e)}static disableDrag(){a.docStyle&&a.selectProp&&(a.userSelect=a.docStyle[a.selectProp],a.docStyle[a.selectProp]="none")}static enableDrag(){a.docStyle&&a.selectProp&&(a.docStyle[a.selectProp]=a.userSelect)}static setTransform(t,e){t.style[a.transformProp]=e}static addEventListener(t,e,i,r={}){t.addEventListener(e,i,"passive"in r?r:r.capture)}static removeEventListener(t,e,i,r={}){t.removeEventListener(e,i,"passive"in r?r:r.capture)}static suppressClickInternal(t){t.preventDefault(),t.stopPropagation(),window.removeEventListener("click",a.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",a.suppressClickInternal,!0),window.setTimeout(()=>{window.removeEventListener("click",a.suppressClickInternal,!0)},0)}static getScale(t){const e=t.getBoundingClientRect();return{x:e.width/t.offsetWidth||1,y:e.height/t.offsetHeight||1,boundingClientRect:e}}static getPoint(t,i,r){const n=i.boundingClientRect;return new e.P((r.clientX-n.left)/i.x-t.clientLeft,(r.clientY-n.top)/i.y-t.clientTop)}static mousePos(t,e){const i=a.getScale(t);return a.getPoint(t,i,e)}static touchPos(t,e){const i=[],r=a.getScale(t);for(let n=0;n<e.length;n++)i.push(a.getPoint(t,r,e[n]));return i}static mouseButton(t){return t.button}static remove(t){t.parentNode&&t.parentNode.removeChild(t)}}a.docStyle="undefined"!=typeof window&&window.document&&window.document.documentElement.style,a.selectProp=a.testProp(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),a.transformProp=a.testProp(["transform","WebkitTransform"]);const o={supported:!1,testSupport:function(t){!h&&c&&(u?d(t):l=t)}};let l,c,h=!1,u=!1;function d(t){const e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,c),t.isContextLost())return;o.supported=!0}catch(t){}t.deleteTexture(e),h=!0}var p;"undefined"!=typeof document&&(c=document.createElement("img"),c.onload=()=>{l&&d(l),l=null,u=!0},c.onerror=()=>{h=!0,l=null},c.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),function(t){let i,r,n,s;t.resetRequestQueue=()=>{i=[],r=0,n=0,s={}},t.addThrottleControl=t=>{const e=n++;return s[e]=t,e},t.removeThrottleControl=t=>{delete s[t],l()},t.getImage=(t,r,n=!0)=>new Promise((s,a)=>{o.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),e.e(t,{type:"image"}),i.push({abortController:r,requestParameters:t,supportImageRefresh:n,state:"queued",onError:t=>{a(t)},onSuccess:t=>{s(t)}}),l()});const a=t=>e._(this,void 0,void 0,function*(){t.state="running";const{requestParameters:i,supportImageRefresh:n,onError:s,onSuccess:a,abortController:o}=t,h=!1===n&&!e.i(self)&&!e.g(i.url)&&(!i.headers||Object.keys(i.headers).reduce((t,e)=>t&&"accept"===e,!0));r++;const u=h?c(i,o):e.m(i,o);try{const i=yield u;delete t.abortController,t.state="completed",i.data instanceof HTMLImageElement||e.b(i.data)?a(i):i.data&&a({data:yield(d=i.data,"function"==typeof createImageBitmap?e.d(d):e.f(d)),cacheControl:i.cacheControl,expires:i.expires})}catch(e){delete t.abortController,s(e)}finally{r--,l()}var d}),l=()=>{const t=(()=>{for(const t of Object.keys(s))if(s[t]())return!0;return!1})()?e.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:e.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let e=r;e<t&&i.length>0;e++){const t=i.shift();t.abortController.signal.aborted?e--:a(t)}},c=(t,i)=>new Promise((r,n)=>{const s=new Image,a=t.url,o=t.credentials;o&&"include"===o?s.crossOrigin="use-credentials":(o&&"same-origin"===o||!e.s(a))&&(s.crossOrigin="anonymous"),i.signal.addEventListener("abort",()=>{s.src="",n(e.c())}),s.fetchPriority="high",s.onload=()=>{s.onerror=s.onload=null,r({data:s})},s.onerror=()=>{s.onerror=s.onload=null,i.signal.aborted||n(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))},s.src=a})}(p||(p={})),p.resetRequestQueue();class f{constructor(t){this._transformRequestFn=t}transformRequest(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}}setTransformRequest(t){this._transformRequestFn=t}}function m(t){var i=new e.A(3);return i[0]=t[0],i[1]=t[1],i[2]=t[2],i}var _,g=function(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t[2]=e[2]-i[2],t};_=new e.A(3),e.A!=Float32Array&&(_[0]=0,_[1]=0,_[2]=0);var y=function(t){var e=t[0],i=t[1];return e*e+i*i};function x(t){const e=[];if("string"==typeof t)e.push({id:"default",url:t});else if(t&&t.length>0){const i=[];for(const{id:r,url:n}of t){const t=`${r}${n}`;-1===i.indexOf(t)&&(i.push(t),e.push({id:r,url:n}))}}return e}function v(t,e,i){const r=t.split("?");return r[0]+=`${e}${i}`,r.join("?")}!function(){var t=new e.A(2);e.A!=Float32Array&&(t[0]=0,t[1]=0)}();class b{constructor(t,e,i,r){this.context=t,this.format=i,this.texture=t.gl.createTexture(),this.update(e,r)}update(t,i,r){const{width:n,height:s}=t,a=!(this.size&&this.size[0]===n&&this.size[1]===s||r),{context:o}=this,{gl:l}=o;if(this.useMipmap=Boolean(i&&i.useMipmap),l.bindTexture(l.TEXTURE_2D,this.texture),o.pixelStoreUnpackFlipY.set(!1),o.pixelStoreUnpack.set(1),o.pixelStoreUnpackPremultiplyAlpha.set(this.format===l.RGBA&&(!i||!1!==i.premultiply)),a)this.size=[n,s],t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||e.b(t)?l.texImage2D(l.TEXTURE_2D,0,this.format,this.format,l.UNSIGNED_BYTE,t):l.texImage2D(l.TEXTURE_2D,0,this.format,n,s,0,this.format,l.UNSIGNED_BYTE,t.data);else{const{x:i,y:a}=r||{x:0,y:0};t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||e.b(t)?l.texSubImage2D(l.TEXTURE_2D,0,i,a,l.RGBA,l.UNSIGNED_BYTE,t):l.texSubImage2D(l.TEXTURE_2D,0,i,a,n,s,l.RGBA,l.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&l.generateMipmap(l.TEXTURE_2D)}bind(t,e,i){const{context:r}=this,{gl:n}=r;n.bindTexture(n.TEXTURE_2D,this.texture),i!==n.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(i=n.LINEAR),t!==this.filter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,t),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,i||t),this.filter=t),e!==this.wrap&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,e),this.wrap=e)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:t}=this.context;t.deleteTexture(this.texture),this.texture=null}}function w(t){const{userImage:e}=t;return!!(e&&e.render&&e.render())&&(t.data.replace(new Uint8Array(e.data.buffer)),!0)}class T extends e.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new e.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(t){if(this.loaded!==t&&(this.loaded=t,t)){for(const{ids:t,promiseResolve:e}of this.requestors)e(this._getImagesForIds(t));this.requestors=[]}}getImage(t){const i=this.images[t];if(i&&!i.data&&i.spriteData){const t=i.spriteData;i.data=new e.R({width:t.width,height:t.height},t.context.getImageData(t.x,t.y,t.width,t.height).data),i.spriteData=null}return i}addImage(t,e){if(this.images[t])throw new Error(`Image id ${t} already exist, use updateImage instead`);this._validate(t,e)&&(this.images[t]=e)}_validate(t,i){let r=!0;const n=i.data||i.spriteData;return this._validateStretch(i.stretchX,n&&n.width)||(this.fire(new e.j(new Error(`Image "${t}" has invalid "stretchX" value`))),r=!1),this._validateStretch(i.stretchY,n&&n.height)||(this.fire(new e.j(new Error(`Image "${t}" has invalid "stretchY" value`))),r=!1),this._validateContent(i.content,i)||(this.fire(new e.j(new Error(`Image "${t}" has invalid "content" value`))),r=!1),r}_validateStretch(t,e){if(!t)return!0;let i=0;for(const r of t){if(r[0]<i||r[1]<r[0]||e<r[1])return!1;i=r[1]}return!0}_validateContent(t,e){if(!t)return!0;if(4!==t.length)return!1;const i=e.spriteData,r=i&&i.width||e.data.width,n=i&&i.height||e.data.height;return!(t[0]<0||r<t[0]||t[1]<0||n<t[1]||t[2]<0||r<t[2]||t[3]<0||n<t[3]||t[2]<t[0]||t[3]<t[1])}updateImage(t,e,i=!0){const r=this.getImage(t);if(i&&(r.data.width!==e.data.width||r.data.height!==e.data.height))throw new Error(`size mismatch between old image (${r.data.width}x${r.data.height}) and new image (${e.data.width}x${e.data.height}).`);e.version=r.version+1,this.images[t]=e,this.updatedImages[t]=!0}removeImage(t){const e=this.images[t];delete this.images[t],delete this.patterns[t],e.userImage&&e.userImage.onRemove&&e.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(t){return new Promise((e,i)=>{let r=!0;if(!this.isLoaded())for(const e of t)this.images[e]||(r=!1);this.isLoaded()||r?e(this._getImagesForIds(t)):this.requestors.push({ids:t,promiseResolve:e})})}_getImagesForIds(t){const i={};for(const r of t){let t=this.getImage(r);t||(this.fire(new e.k("styleimagemissing",{id:r})),t=this.getImage(r)),t?i[r]={data:t.data.clone(),pixelRatio:t.pixelRatio,sdf:t.sdf,version:t.version,stretchX:t.stretchX,stretchY:t.stretchY,content:t.content,textFitWidth:t.textFitWidth,textFitHeight:t.textFitHeight,hasRenderCallback:Boolean(t.userImage&&t.userImage.render)}:e.w(`Image "${r}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}return i}getPixelSize(){const{width:t,height:e}=this.atlasImage;return{width:t,height:e}}getPattern(t){const i=this.patterns[t],r=this.getImage(t);if(!r)return null;if(i&&i.position.version===r.version)return i.position;if(i)i.position.version=r.version;else{const i={w:r.data.width+2,h:r.data.height+2,x:0,y:0},n=new e.I(i,r);this.patterns[t]={bin:i,position:n}}return this._updatePatternAtlas(),this.patterns[t].position}bind(t){const e=t.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new b(t,this.atlasImage,e.RGBA),this.atlasTexture.bind(e.LINEAR,e.CLAMP_TO_EDGE)}_updatePatternAtlas(){const t=[];for(const e in this.patterns)t.push(this.patterns[e].bin);const{w:i,h:r}=e.p(t),n=this.atlasImage;n.resize({width:i||1,height:r||1});for(const t in this.patterns){const{bin:i}=this.patterns[t],r=i.x+1,s=i.y+1,a=this.getImage(t).data,o=a.width,l=a.height;e.R.copy(a,n,{x:0,y:0},{x:r,y:s},{width:o,height:l}),e.R.copy(a,n,{x:0,y:l-1},{x:r,y:s-1},{width:o,height:1}),e.R.copy(a,n,{x:0,y:0},{x:r,y:s+l},{width:o,height:1}),e.R.copy(a,n,{x:o-1,y:0},{x:r-1,y:s},{width:1,height:l}),e.R.copy(a,n,{x:0,y:0},{x:r+o,y:s},{width:1,height:l})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(t){for(const i of t){if(this.callbackDispatchedThisFrame[i])continue;this.callbackDispatchedThisFrame[i]=!0;const t=this.getImage(i);t||e.w(`Image with ID: "${i}" was not found`),w(t)&&this.updateImage(i,t)}}}const S=1e20;function I(t,e,i,r,n,s,a,o,l){for(let c=e;c<e+r;c++)P(t,i*s+c,s,n,a,o,l);for(let c=i;c<i+n;c++)P(t,c*s+e,1,r,a,o,l)}function P(t,e,i,r,n,s,a){s[0]=0,a[0]=-S,a[1]=S,n[0]=t[e];for(let o=1,l=0,c=0;o<r;o++){n[o]=t[e+o*i];const r=o*o;do{const t=s[l];c=(n[o]-n[t]+r-t*t)/(o-t)/2}while(c<=a[l]&&--l>-1);l++,s[l]=o,a[l]=c,a[l+1]=S}for(let o=0,l=0;o<r;o++){for(;a[l+1]<o;)l++;const r=s[l],c=o-r;t[e+o*i]=n[r]+c*c}}class A{constructor(t,e){this.requestManager=t,this.localIdeographFontFamily=e,this.entries={}}setURL(t){this.url=t}getGlyphs(t){return e._(this,void 0,void 0,function*(){const e=[];for(const i in t)for(const r of t[i])e.push(this._getAndCacheGlyphsPromise(i,r));const i=yield Promise.all(e),r={};for(const{stack:t,id:e,glyph:n}of i)r[t]||(r[t]={}),r[t][e]=n&&{id:n.id,bitmap:n.bitmap.clone(),metrics:n.metrics};return r})}_getAndCacheGlyphsPromise(t,i){return e._(this,void 0,void 0,function*(){let e=this.entries[t];e||(e=this.entries[t]={glyphs:{},requests:{},ranges:{}});let r=e.glyphs[i];if(void 0!==r)return{stack:t,id:i,glyph:r};if(r=this._tinySDF(e,t,i),r)return e.glyphs[i]=r,{stack:t,id:i,glyph:r};const n=Math.floor(i/256);if(256*n>65535)throw new Error("glyphs > 65535 not supported");if(e.ranges[n])return{stack:t,id:i,glyph:r};if(!this.url)throw new Error("glyphsUrl is not set");if(!e.requests[n]){const i=A.loadGlyphRange(t,n,this.url,this.requestManager);e.requests[n]=i}const s=yield e.requests[n];for(const t in s)this._doesCharSupportLocalGlyph(+t)||(e.glyphs[+t]=s[+t]);return e.ranges[n]=!0,{stack:t,id:i,glyph:s[i]||null}})}_doesCharSupportLocalGlyph(t){return!!this.localIdeographFontFamily&&/\p{Ideo}|\p{sc=Hang}|\p{sc=Hira}|\p{sc=Kana}/u.test(String.fromCodePoint(t))}_tinySDF(t,i,r){const n=this.localIdeographFontFamily;if(!n)return;if(!this._doesCharSupportLocalGlyph(r))return;let s=t.tinySDF;if(!s){let e="400";/bold/i.test(i)?e="900":/medium/i.test(i)?e="500":/light/i.test(i)&&(e="200"),s=t.tinySDF=new A.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:n,fontWeight:e})}const a=s.draw(String.fromCharCode(r));return{id:r,bitmap:new e.o({width:a.width||60,height:a.height||60},a.data),metrics:{width:a.glyphWidth/2||24,height:a.glyphHeight/2||24,left:a.glyphLeft/2+.5||0,top:a.glyphTop/2-27.5||-8,advance:a.glyphAdvance/2||24,isDoubleResolution:!0}}}}A.loadGlyphRange=function(t,i,r,n){return e._(this,void 0,void 0,function*(){const s=256*i,a=s+255,o=n.transformRequest(r.replace("{fontstack}",t).replace("{range}",`${s}-${a}`),"Glyphs"),l=yield e.l(o,new AbortController);if(!l||!l.data)throw new Error(`Could not load glyph range. range: ${i}, ${s}-${a}`);const c={};for(const t of e.n(l.data))c[t.id]=t;return c})},A.TinySDF=class{constructor({fontSize:t=24,buffer:e=3,radius:i=8,cutoff:r=.25,fontFamily:n="sans-serif",fontWeight:s="normal",fontStyle:a="normal"}={}){this.buffer=e,this.cutoff=r,this.radius=i;const o=this.size=t+4*e,l=this._createCanvas(o),c=this.ctx=l.getContext("2d",{willReadFrequently:!0});c.font=`${a} ${s} ${t}px ${n}`,c.textBaseline="alphabetic",c.textAlign="left",c.fillStyle="black",this.gridOuter=new Float64Array(o*o),this.gridInner=new Float64Array(o*o),this.f=new Float64Array(o),this.z=new Float64Array(o+1),this.v=new Uint16Array(o)}_createCanvas(t){const e=document.createElement("canvas");return e.width=e.height=t,e}draw(t){const{width:e,actualBoundingBoxAscent:i,actualBoundingBoxDescent:r,actualBoundingBoxLeft:n,actualBoundingBoxRight:s}=this.ctx.measureText(t),a=Math.ceil(i),o=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(s-n))),l=Math.min(this.size-this.buffer,a+Math.ceil(r)),c=o+2*this.buffer,h=l+2*this.buffer,u=Math.max(c*h,0),d=new Uint8ClampedArray(u),p={data:d,width:c,height:h,glyphWidth:o,glyphHeight:l,glyphTop:a,glyphLeft:0,glyphAdvance:e};if(0===o||0===l)return p;const{ctx:f,buffer:m,gridInner:_,gridOuter:g}=this;f.clearRect(m,m,o,l),f.fillText(t,m,m+a);const y=f.getImageData(m,m,o,l);g.fill(S,0,u),_.fill(0,0,u);for(let t=0;t<l;t++)for(let e=0;e<o;e++){const i=y.data[4*(t*o+e)+3]/255;if(0===i)continue;const r=(t+m)*c+e+m;if(1===i)g[r]=0,_[r]=S;else{const t=.5-i;g[r]=t>0?t*t:0,_[r]=t<0?t*t:0}}I(g,0,0,c,h,c,this.f,this.v,this.z),I(_,m,m,o,l,c,this.f,this.v,this.z);for(let t=0;t<u;t++){const e=Math.sqrt(g[t])-Math.sqrt(_[t]);d[t]=Math.round(255-255*(e/this.radius+this.cutoff))}return p}};class M{constructor(){this.specification=e.v.light.position}possiblyEvaluate(t,i){return e.x(t.expression.evaluate(i))}interpolate(t,i,r){return{x:e.y.number(t.x,i.x,r),y:e.y.number(t.y,i.y,r),z:e.y.number(t.z,i.z,r)}}}let k;class C extends e.E{constructor(t){super(),k=k||new e.q({anchor:new e.D(e.v.light.anchor),position:new M,color:new e.D(e.v.light.color),intensity:new e.D(e.v.light.intensity)}),this._transitionable=new e.T(k),this.setLight(t),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(t,i={}){if(!this._validate(e.r,t,i))for(const e in t){const i=t[e];e.endsWith("-transition")?this._transitionable.setTransition(e.slice(0,-11),i):this._transitionable.setValue(e,i)}}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}_validate(t,i,r){return(!r||!1!==r.validate)&&e.t(this,t.call(e.u,{value:i,style:{glyphs:!0,sprite:!0},styleSpec:e.v}))}}const z=new e.q({"sky-color":new e.D(e.v.sky["sky-color"]),"horizon-color":new e.D(e.v.sky["horizon-color"]),"fog-color":new e.D(e.v.sky["fog-color"]),"fog-ground-blend":new e.D(e.v.sky["fog-ground-blend"]),"horizon-fog-blend":new e.D(e.v.sky["horizon-fog-blend"]),"sky-horizon-blend":new e.D(e.v.sky["sky-horizon-blend"]),"atmosphere-blend":new e.D(e.v.sky["atmosphere-blend"])});class E extends e.E{constructor(t){super(),this._transitionable=new e.T(z),this.setSky(t),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new e.z(0))}setSky(t,i={}){if(!this._validate(e.B,t,i)){t||(t={"sky-color":"transparent","horizon-color":"transparent","fog-color":"transparent","fog-ground-blend":1,"atmosphere-blend":0});for(const e in t){const i=t[e];e.endsWith("-transition")?this._transitionable.setTransition(e.slice(0,-11),i):this._transitionable.setValue(e,i)}}}getSky(){return this._transitionable.serialize()}updateTransitions(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(t){this.properties=this._transitioning.possiblyEvaluate(t)}_validate(t,i,r={}){return!1!==(null==r?void 0:r.validate)&&e.t(this,t.call(e.u,e.e({value:i,style:{glyphs:!0,sprite:!0},styleSpec:e.v})))}calculateFogBlendOpacity(t){return t<60?0:t<70?(t-60)/10:1}}class D{constructor(t,e){this.width=t,this.height=e,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(t,e){const i=t.join(",")+String(e);return this.dashEntry[i]||(this.dashEntry[i]=this.addDash(t,e)),this.dashEntry[i]}getDashRanges(t,e,i){const r=[];let n=t.length%2==1?-t[t.length-1]*i:0,s=t[0]*i,a=!0;r.push({left:n,right:s,isDash:a,zeroLength:0===t[0]});let o=t[0];for(let e=1;e<t.length;e++){a=!a;const l=t[e];n=o*i,o+=l,s=o*i,r.push({left:n,right:s,isDash:a,zeroLength:0===l})}return r}addRoundDash(t,e,i){const r=e/2;for(let e=-i;e<=i;e++){const n=this.width*(this.nextRow+i+e);let s=0,a=t[s];for(let o=0;o<this.width;o++){o/a.right>1&&(a=t[++s]);const l=Math.abs(o-a.left),c=Math.abs(o-a.right),h=Math.min(l,c);let u;const d=e/i*(r+1);if(a.isDash){const t=r-Math.abs(d);u=Math.sqrt(h*h+t*t)}else u=r-Math.sqrt(h*h+d*d);this.data[n+o]=Math.max(0,Math.min(255,u+128))}}}addRegularDash(t){for(let e=t.length-1;e>=0;--e){const i=t[e],r=t[e+1];i.zeroLength?t.splice(e,1):r&&r.isDash===i.isDash&&(r.left=i.left,t.splice(e,1))}const e=t[0],i=t[t.length-1];e.isDash===i.isDash&&(e.left=i.left-this.width,i.right=e.right+this.width);const r=this.width*this.nextRow;let n=0,s=t[n];for(let e=0;e<this.width;e++){e/s.right>1&&(s=t[++n]);const i=Math.abs(e-s.left),a=Math.abs(e-s.right),o=Math.min(i,a);this.data[r+e]=Math.max(0,Math.min(255,(s.isDash?o:-o)+128))}}addDash(t,i){const r=i?7:0,n=2*r+1;if(this.nextRow+n>this.height)return e.w("LineAtlas out of space"),null;let s=0;for(let e=0;e<t.length;e++)s+=t[e];if(0!==s){const e=this.width/s,n=this.getDashRanges(t,this.width,e);i?this.addRoundDash(n,e,r):this.addRegularDash(n)}const a={y:(this.nextRow+r+.5)/this.height,height:2*r/this.height,width:s};return this.nextRow+=n,this.dirty=!0,a}bind(t){const e=t.gl;this.texture?(e.bindTexture(e.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,e.texSubImage2D(e.TEXTURE_2D,0,0,0,this.width,this.height,e.ALPHA,e.UNSIGNED_BYTE,this.data))):(this.texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this.texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.REPEAT),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texImage2D(e.TEXTURE_2D,0,e.ALPHA,this.width,this.height,0,e.ALPHA,e.UNSIGNED_BYTE,this.data))}}const L="maplibre_preloaded_worker_pool";class R{constructor(){this.active={}}acquire(t){if(!this.workers)for(this.workers=[];this.workers.length<R.workerCount;)this.workers.push(new Worker(e.a.WORKER_URL));return this.active[t]=!0,this.workers.slice()}release(t){delete this.active[t],0===this.numActive()&&(this.workers.forEach(t=>{t.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[L]}numActive(){return Object.keys(this.active).length}}const B=Math.floor(s.hardwareConcurrency/2);let F,O;function V(){return F||(F=new R),F}R.workerCount=e.C(globalThis)?Math.max(Math.min(B,3),1):1;class N{constructor(t,i){this.workerPool=t,this.actors=[],this.currentActor=0,this.id=i;const r=this.workerPool.acquire(i);for(let t=0;t<r.length;t++){const n=new e.F(r[t],i);n.name=`Worker ${t}`,this.actors.push(n)}if(!this.actors.length)throw new Error("No actors found")}broadcast(t,e){const i=[];for(const r of this.actors)i.push(r.sendAsync({type:t,data:e}));return Promise.all(i)}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(t=!0){this.actors.forEach(t=>{t.remove()}),this.actors=[],t&&this.workerPool.release(this.id)}registerMessageHandler(t,e){for(const i of this.actors)i.registerMessageHandler(t,e)}}function j(){return O||(O=new N(V(),e.G),O.registerMessageHandler("GR",(t,i,r)=>e.m(i,r))),O}function U(t,i){const r=e.H();return e.J(r,r,[1,1,0]),e.K(r,r,[.5*t.width,.5*t.height,1]),e.L(r,r,t.calculatePosMatrix(i.toUnwrapped()))}function $(t,e,i,r,n,s){const a=function(t,e,i){if(t)for(const r of t){const t=e[r];if(t&&t.source===i&&"fill-extrusion"===t.type)return!0}else for(const t in e){const r=e[t];if(r.source===i&&"fill-extrusion"===r.type)return!0}return!1}(n&&n.layers,e,t.id),o=s.maxPitchScaleFactor(),l=t.tilesIn(r,o,a);l.sort(q);const c=[];for(const r of l)c.push({wrappedTileID:r.tileID.wrapped().key,queryResults:r.tile.queryRenderedFeatures(e,i,t._state,r.queryGeometry,r.cameraQueryGeometry,r.scale,n,s,o,U(t.transform,r.tileID))});const h=function(t){const e={},i={};for(const r of t){const t=r.queryResults,n=r.wrappedTileID,s=i[n]=i[n]||{};for(const i in t){const r=t[i],n=s[i]=s[i]||{},a=e[i]=e[i]||[];for(const t of r)n[t.featureIndex]||(n[t.featureIndex]=!0,a.push(t))}}return e}(c);for(const e in h)h[e].forEach(e=>{const i=e.feature,r=t.getFeatureState(i.layer["source-layer"],i.id);i.source=i.layer.source,i.layer["source-layer"]&&(i.sourceLayer=i.layer["source-layer"]),i.state=r});return h}function q(t,e){const i=t.tileID,r=e.tileID;return i.overscaledZ-r.overscaledZ||i.canonical.y-r.canonical.y||i.wrap-r.wrap||i.canonical.x-r.canonical.x}function Z(t,i,r){return e._(this,void 0,void 0,function*(){let n=t;if(t.url?n=(yield e.h(i.transformRequest(t.url,"Source"),r)).data:yield s.frameAsync(r),!n)return null;const a=e.M(e.e(n,t),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in n&&n.vector_layers&&(a.vectorLayerIds=n.vector_layers.map(t=>t.id)),a})}class G{constructor(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):Array.isArray(t)&&(4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1])))}setNorthEast(t){return this._ne=t instanceof e.N?new e.N(t.lng,t.lat):e.N.convert(t),this}setSouthWest(t){return this._sw=t instanceof e.N?new e.N(t.lng,t.lat):e.N.convert(t),this}extend(t){const i=this._sw,r=this._ne;let n,s;if(t instanceof e.N)n=t,s=t;else{if(!(t instanceof G))return Array.isArray(t)?4===t.length||t.every(Array.isArray)?this.extend(G.convert(t)):this.extend(e.N.convert(t)):t&&("lng"in t||"lon"in t)&&"lat"in t?this.extend(e.N.convert(t)):this;if(n=t._sw,s=t._ne,!n||!s)return this}return i||r?(i.lng=Math.min(n.lng,i.lng),i.lat=Math.min(n.lat,i.lat),r.lng=Math.max(s.lng,r.lng),r.lat=Math.max(s.lat,r.lat)):(this._sw=new e.N(n.lng,n.lat),this._ne=new e.N(s.lng,s.lat)),this}getCenter(){return new e.N((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new e.N(this.getWest(),this.getNorth())}getSouthEast(){return new e.N(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(t){const{lng:i,lat:r}=e.N.convert(t);let n=this._sw.lng<=i&&i<=this._ne.lng;return this._sw.lng>this._ne.lng&&(n=this._sw.lng>=i&&i>=this._ne.lng),this._sw.lat<=r&&r<=this._ne.lat&&n}static convert(t){return t instanceof G?t:t?new G(t):t}static fromLngLat(t,i=0){const r=360*i/40075017,n=r/Math.cos(Math.PI/180*t.lat);return new G(new e.N(t.lng-n,t.lat-r),new e.N(t.lng+n,t.lat+r))}adjustAntiMeridian(){const t=new e.N(this._sw.lng,this._sw.lat),i=new e.N(this._ne.lng,this._ne.lat);return new G(t,t.lng>i.lng?new e.N(i.lng+360,i.lat):i)}}class H{constructor(t,e,i){this.bounds=G.convert(this.validateBounds(t)),this.minzoom=e||0,this.maxzoom=i||24}
vendor: 2,341 bytes, line 313
313validateBounds(t){return Array.isArray(t)&&4===t.length?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]}contains(t){const i=Math.pow(2,t.z),r=Math.floor(e.O(this.bounds.getWest())*i),n=Math.floor(e.Q(this.bounds.getNorth())*i),s=Math.ceil(e.O(this.bounds.getEast())*i),a=Math.ceil(e.Q(this.bounds.getSouth())*i);return t.x>=r&&t.x<s&&t.y>=n&&t.y<a}}class X extends e.E{constructor(t,i,r,n){if(super(),this.id=t,this.dispatcher=r,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,e.e(this,e.M(i,["url","scheme","tileSize","promoteId"])),this._options=e.e({type:"vector"},i),this._collectResourceTiming=i.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(n)}load(){return e._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new e.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const t=yield Z(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),t&&(e.e(this,t),t.bounds&&(this.tileBounds=new H(t.bounds,this.minzoom,this.maxzoom)),this.fire(new e.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.k("data",{dataType:"source",sourceDataType:"content"})))}catch(t){this._tileJSONRequest=null,this.fire(new e.j(t))}})}loaded(){return this._loaded}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}onAdd(t){this.map=t,this.load()}setSourceProperty(t){this._tileJSONRequest&&this._tileJSONRequest.abort(),t(),this.load()}setTiles(t){return this.setSourceProperty(()=>{this._options.tiles=t}),this}setUrl(t){return this.setSourceProperty(()=>{this.url=t,this._options.url=t}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return e.e({},this._options)}loadTile(t){return e._(this,void 0,void 0,function*(){const e=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),i={request:this.map._requestManager.transformRequest(e,"Tile"),uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.t
313ype,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};i.request.collectResourceTiming=this._collectResourceTiming;let r="RT";if(t.actor&&"expired"!==t.state){if("loading"===t.state)return new Promise((e,i)=>{t.reloadPromise={resolve:e,reject:i}})}else t.actor=this.dispatcher.getActor(),r="LT";t.abortController=new AbortController;try{const e=yield t.actor.sendAsync({type:r,data:i},t.abortController);if(delete t.abortController,t.aborted)return;this._afterTileLoadWorkerResponse(t,e)}catch(e){if(delete t.abortController,t.aborted)return;if(e&&404!==e.status)throw e;this._afterTileLoadWorkerResponse(t,null)}})}_afterTileLoadWorkerResponse(t,e){if(e&&e.resourceTiming&&(t.resourceTiming=e.resourceTiming),e&&this.map._refreshExpiredTiles&&t.setExpiryData(e),t.loadVectorData(e,this.map.painter),t.reloadPromise){const e=t.reloadPromise;t.reloadPromise=null,this.loadTile(t).then(e.resolve)["catch"](e.reject)}}abortTile(t){return e._(this,void 0,void 0,function*(){t.abortController&&(t.abortController.abort(),delete t.abortController),t.actor&&(yield t.actor.sendAsync({type:"AT",data:{uid:t.uid,type:this.t
vendor: 4,116 bytes, line 313
313ype,source:this.id}}))})}unloadTile(t){return e._(this,void 0,void 0,function*(){t.unloadVectorData(),t.actor&&(yield t.actor.sendAsync({type:"RMT",data:{uid:t.uid,type:this.type,source:this.id}}))})}hasTransition(){return!1}}class W extends e.E{constructor(t,i,r,n){super(),this.id=t,this.dispatcher=r,this.setEventedParent(n),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=e.e({type:"raster"},i),e.e(this,e.M(i,["url","scheme","tileSize"]))}load(){return e._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new e.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const t=yield Z(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,t&&(e.e(this,t),t.bounds&&(this.tileBounds=new H(t.bounds,this.minzoom,this.maxzoom)),this.fire(new e.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.k("data",{dataType:"source",sourceDataType:"content"})))}catch(t){this._tileJSONRequest=null,this.fire(new e.j(t))}})}loaded(){return this._loaded}onAdd(t){this.map=t,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(t){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),t(),this.load()}setTiles(t){return this.setSourceProperty(()=>{this._options.tiles=t}),this}setUrl(t){return this.setSourceProperty(()=>{this.url=t,this._options.url=t}),this}serialize(){return e.e({},this._options)}hasTile(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)}loadTile(t){return e._(this,void 0,void 0,function*(){const e=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);t.abortController=new AbortController;try{const i=yield p.getImage(this.map._requestManager.transformRequest(e,"Tile"),t.abortController,this.map._refreshExpiredTiles);if(delete t.abortController,t.aborted)return void(t.state="unloaded");if(i&&i.data){this.map._refreshExpiredTiles&&i.cacheControl&&i.expires&&t.setExpiryData({cacheControl:i.cacheControl,expires:i.expires});const e=this.map.painter.context,r=e.gl,n=i.data;t.texture=this.map.painter.getTileTexture(n.width),t.texture?t.texture.update(n,{useMipmap:!0}):(t.texture=new b(e,n,r.RGBA,{useMipmap:!0}),t.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE,r.LINEAR_MIPMAP_NEAREST)),t.state="loaded"}}catch(e){if(delete t.abortController,t.aborted)t.state="unloaded";else if(e)throw t.state="errored",e}})}abortTile(t){return e._(this,void 0,void 0,function*(){t.abortController&&(t.abortController.abort(),delete t.abortController)})}unloadTile(t){return e._(this,void 0,void 0,function*(){t.texture&&this.map.painter.saveTileTexture(t.texture)})}hasTransition(){return!1}}class K extends W{constructor(t,i,r,n){super(t,i,r,n),this.type="raster-dem",this.maxzoom=22,this._options=e.e({type:"raster-dem"},i),this.encoding=i.encoding||"mapbox",this.redFactor=i.redFactor,this.greenFactor=i.greenFactor,this.blueFactor=i.blueFactor,this.baseShift=i.baseShift}loadTile(t){return e._(this,void 0,void 0,function*(){const i=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),r=this.map._requestManager.transformRequest(i,"Tile");t.neighboringTiles=this._getNeighboringTiles(t.tileID),t.abortController=new AbortController;try{const i=yield p.getImage(r,t.abortController,this.map._refreshExpiredTiles);if(delete t.abortController,t.aborted)return void(t.state="unloaded");if(i&&i.data){const r=i.data;this.map._refreshExpiredTiles&&i.cacheControl&&i.expires&&t.setExpiryData({cacheControl:i.cacheControl,expires:i.expires});const n=e.b(r)&&e.U()?r:yield this.readImageNow(r),s={type:this.type,uid:t.uid,source:this.id,rawImageData:n,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!t.actor||"expired"===t.state){t.actor=this.dispatcher.getActor();const e=yield t.actor.sendAsync({type:"LDT",data:s});t.dem=e,t.needsHillshadePrepare=!0,t.needsTerrainPrepare=!0,t.state="loaded"}}}
vendor: 14,229 bytes, line 313
313catch(e){if(delete t.abortController,t.aborted)t.state="unloaded";else if(e)throw t.state="errored",e}})}readImageNow(t){return e._(this,void 0,void 0,function*(){if("undefined"!=typeof VideoFrame&&e.V()){const i=t.width+2,r=t.height+2;try{return new e.R({width:i,height:r},yield e.W(t,-1,-1,i,r))}catch(t){}}return s.getImageData(t,1)})}_getNeighboringTiles(t){const i=t.canonical,r=Math.pow(2,i.z),n=(i.x-1+r)%r,s=0===i.x?t.wrap-1:t.wrap,a=(i.x+1+r)%r,o=i.x+1===r?t.wrap+1:t.wrap,l={};return l[new e.S(t.overscaledZ,s,i.z,n,i.y).key]={backfilled:!1},l[new e.S(t.overscaledZ,o,i.z,a,i.y).key]={backfilled:!1},i.y>0&&(l[new e.S(t.overscaledZ,s,i.z,n,i.y-1).key]={backfilled:!1},l[new e.S(t.overscaledZ,t.wrap,i.z,i.x,i.y-1).key]={backfilled:!1},l[new e.S(t.overscaledZ,o,i.z,a,i.y-1).key]={backfilled:!1}),i.y+1<r&&(l[new e.S(t.overscaledZ,s,i.z,n,i.y+1).key]={backfilled:!1},l[new e.S(t.overscaledZ,t.wrap,i.z,i.x,i.y+1).key]={backfilled:!1},l[new e.S(t.overscaledZ,o,i.z,a,i.y+1).key]={backfilled:!1}),l}unloadTile(t){return e._(this,void 0,void 0,function*(){t.demTexture&&this.map.painter.saveTileTexture(t.demTexture),t.fbo&&(t.fbo.destroy(),delete t.fbo),t.dem&&delete t.dem,delete t.neighboringTiles,t.state="unloaded",t.actor&&(yield t.actor.sendAsync({type:"RDT",data:{type:this.type,uid:t.uid,source:this.id}}))})}}class J extends e.E{constructor(t,i,r,n){super(),this.id=t,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._pendingLoads=0,this.actor=r.getActor(),this.setEventedParent(n),this._data=i.data,this._options=e.e({},i),this._collectResourceTiming=i.collectResourceTiming,void 0!==i.maxzoom&&(this.maxzoom=i.maxzoom),i.type&&(this.type=i.type),i.attribution&&(this.attribution=i.attribution),this.promoteId=i.promoteId;const s=e.X/this.tileSize;void 0!==i.clusterMaxZoom&&this.maxzoom<=i.clusterMaxZoom&&e.w(`The maxzoom value "${this.maxzoom}" is expected to be greater than the clusterMaxZoom value "${i.clusterMaxZoom}".`),this.workerOptions=e.e({source:this.id,cluster:i.cluster||!1,geojsonVtOptions:{buffer:(void 0!==i.buffer?i.buffer:128)*s,tolerance:(void 0!==i.tolerance?i.tolerance:.375)*s,extent:e.X,maxZoom:this.maxzoom,lineMetrics:i.lineMetrics||!1,generateId:i.generateId||!1},superclusterOptions:{maxZoom:void 0!==i.clusterMaxZoom?i.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,i.clusterMinPoints||2),extent:e.X,radius:(i.clusterRadius||50)*s,log:!1,generateId:i.generateId||!1},clusterProperties:i.clusterProperties,filter:i.filter},i.workerOptions),"string"==typeof this.promoteId&&(this.workerOptions.promoteId=this.promoteId)}load(){return e._(this,void 0,void 0,function*(){yield this._updateWorkerData()})}onAdd(t){this.map=t,this.load()}setData(t){return this._data=t,this._updateWorkerData(),this}updateData(t){return this._updateWorkerData(t),this}getData(){return e._(this,void 0,void 0,function*(){const t=e.e({type:this.type},this.workerOptions);return this.actor.sendAsync({type:"GD",data:t})})}setClusterOptions(t){return this.workerOptions.cluster=t.cluster,t&&(void 0!==t.clusterRadius&&(this.workerOptions.superclusterOptions.radius=t.clusterRadius),void 0!==t.clusterMaxZoom&&(this.workerOptions.superclusterOptions.maxZoom=t.clusterMaxZoom)),this._updateWorkerData(),this}getClusterExpansionZoom(t){return this.actor.sendAsync({type:"GCEZ",data:{type:this.type,clusterId:t,source:this.id}})}getClusterChildren(t){return this.actor.sendAsync({type:"GCC",data:{type:this.type,clusterId:t,source:this.id}})}getClusterLeaves(t,e,i){return this.actor.sendAsync({type:"GCL",data:{type:this.type,source:this.id,clusterId:t,limit:e,offset:i}})}_updateWorkerData(t){return e._(this,void 0,void 0,function*(){const i=e.e({type:this.type},this.workerOptions);t?i.dataDiff=t:"string"==typeof this._data?(i.request=this.map._requestManager.transformRequest(s.resolveURL(this._data),"Source"),i.request.collectResourceTiming=this._collectResourceTiming):i.data=JSON.stringify(this._data),this._pendingLoads++,this.fire(new e.k("dataloading",{dataType:"source"}));try{const t=yield this.actor.sendAsync({type:"LD",data:i});if(this._pendingLoads--,this._removed||t.abandoned)return void this.fire(new e.k("dataabort",{dataType:"source"}));let r=null;t.resourceTiming&&t.resourceTiming[this.id]&&(r=t.resourceTiming[this.id].slice(0));const n={dataType:"source"};this._collectResourceTiming&&r&&r.length>0&&e.e(n,{resourceTiming:r}),this.fire(new e.k("data",Object.assign(Object.assign({},n),{sourceDataType:"metadata"}))),this.fire(new e.k("data",Object.assign(Object.assign({},n),{sourceDataType:"content"})))}catch(t){if(this._pendingLoads--,this._removed)return void this.fire(new e.k("dataabort",{dataType:"source"}));this.fire(new e.j(t))}})}loaded(){return 0===this._pendingLoads}loadTile(t){return e._(this,void 0,void 0,function*(){const e=t.actor?"RT":"LT";t.actor=this.actor;const i={type:this.type,uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};t.abortController=new AbortController;const r=yield this.actor.sendAsync({type:e,data:i},t.abortController);delete t.abortController,t.unloadVectorData(),t.aborted||t.loadVectorData(r,this.map.painter,"RT"===e)})}abortTile(t){return e._(this,void 0,void 0,function*(){t.abortController&&(t.abortController.abort(),delete t.abortController),t.aborted=!0})}unloadTile(t){return e._(this,void 0,void 0,function*(){t.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:t.uid,type:this.type,source:this.id}})})}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return e.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var Y=e.Y([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class Q extends e.E{constructor(t,e,i,r){super(),this.id=t,this.dispatcher=i,this.coordinates=e.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(r),this.options=e}load(t){return e._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new e.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{const e=yield p.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,e&&e.data&&(this.image=e.data,t&&(this.coordinates=t),this._finishLoading())}catch(t){this._request=null,this._loaded=!0,this.fire(new e.j(t))}})}loaded(){return this._loaded}updateImage(t){return t.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=t.url,this.load(t.coordinates)["finally"](()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new e.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(t){this.map=t,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(t){this.coordinates=t;const i=t.map(e.Z.fromLngLat);this.tileID=function(t){let i=1/0,r=1/0,n=-1/0,s=-1/0;for(const e of t)i=Math.min(i,e.x),r=Math.min(r,e.y),n=Math.max(n,e.x),s=Math.max(s,e.y);const a=Math.max(n-i,s-r),o=Math.max(0,Math.floor(-Math.log(a)/Math.LN2)),l=Math.pow(2,o);return new e.a1(o,Math.floor((i+n)/2*l),Math.floor((r+s)/2*l))}(i),this.minzoom=this.maxzoom=this.tileID.z;const r=i.map(t=>this.tileID.getTilePoint(t)._round());return this._boundsArray=new e.$,this._boundsArray.emplaceBack(r[0].x,r[0].y,0,0),this._boundsArray.emplaceBack(r[1].x,r[1].y,e.X,0),this._boundsArray.emplaceBack(r[3].x,r[3].y,0,e.X),this._boundsArray.emplaceBack(r[2].x,r[2].y,e.X,e.X),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new e.k("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(0===Object.keys(this.tiles).length||!this.image)return;const t=this.map.painter.context,i=t.gl;this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,Y.members)),this.boundsSegments||(this.boundsSegments=e.a0.simpleSegment(0,0,4,2)),this.texture||(this.texture=new b(t,this.image,i.RGBA),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE));let r=!1;for(const t in this.tiles){const e=this.tiles[t];"loaded"!==e.state&&(e.state="loaded",e.texture=this.texture,r=!0)}r&&this.fire(new e.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(t){return e._(this,void 0,void 0,function*(){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t,t.buckets={}):t.state="errored"})}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class tt extends Q{constructor(t,e,i,r){super(t,e,i,r),this.roundZoom=!0,this.type="video",this.options=e}load(){return e._(this,void 0,void 0,function*(){this._loaded=!1;const t=this.options;this.urls=[];for(const e of t.urls)this.urls.push(this.map._requestManager.transformRequest(e,"Source").url);try{const t=yield e.a3(this.urls);if(this._loaded=!0,!t)return;this.video=t,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading()}catch(t){this.fire(new e.j(t))}})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(t){if(this.video){const i=this.video.seekable;t<i.start(0)||t>i.end(0)?this.fire(new e.j(new e.a2(`sources.${this.id}`,null,`Playback for this video can be set only between the ${i.start(0)} and ${i.end(0)}-second mark.`))):this.video.currentTime=t}}getVideo(){return this.video}onAdd(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(0===Object.keys(this.tiles).length||this.video.readyState<2)return;const t=this.map.painter.context,i=t.gl;this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,Y.members)),this.boundsSegments||(this.boundsSegments=e.a0.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE),i.texSubImage2D(i.TEXTURE_2D,0,0,0,i.RGBA,i.UNSIGNED_BYTE,this.video)):(this.texture=new b(t,this.video,i.RGBA),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE));let r=!1;for(const t in this.tiles){const e=this.tiles[t];"loaded"!==e.state&&(e.state="loaded",e.texture=this.texture,r=!0)}r&&this.fire(new e.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class et extends Q{constructor(t,i,r,n){super(t,i,r,n),i.coordinates?Array.isArray(i.coordinates)&&4===i.coordinates.length&&!i.coordinates.some(t=>!Array.isArray(t)||2!==t.length||t.some(t=>"number"!=typeof t))||this.fire(new e.j(new e.a2(`sources.${t}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new e.j(new e.a2(`sources.${t}`,null,'missing required property "coordinates"'))),i.animate&&"boolean"!=typeof i.animate&&this.fire(new e.j(new e.a2(`sources.${t}`,null,'optional "animate" property must be a boolean value'))),i.canvas?"string"==typeof i.canvas||i.canvas instanceof HTMLCanvasElement||this.fire(new e.j(new e.a2(`sources.${t}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new e.j(new e.a2(`sources.${t}`,null,'missing required property "canvas"'))),this.options=i,this.animate=void 0===i.animate||i.animate}load(){return e._(this,void 0,void 0,function*(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new e.j(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())})}getCanvas(){return this.canvas}onAdd(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let t=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,t=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,t=!0),this._hasInvalidDimensions())return;if(0===Object.keys(this.tiles).length)return;const i=this.map.painter.context,r=i.gl;this.boundsBuffer||(this.boundsBuffer=i.createVertexBuffer(this._boundsArray,Y.members)),this.boundsSegments||(this.boundsSegments=e.a0.simpleSegment(0,0,4,2)),this.texture?(t||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new b(i,this.canvas,r.RGBA,{premultiply:!0});let n=!1;for(const t in this.tiles){const e=this.tiles[t];"loaded"!==e.state&&(e.state="loaded",e.texture=this.texture,n=!0)}n&&this.fire(new e.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const t of[this.canvas.width,this.canvas.height])if(isNaN(t)||t<=0)return!0;return!1}}const it={},rt=t=>{switch(t){case"geojson":return J;case"image":return Q;case"raster":return W;case"raster-dem":return K;case"vector":return X;case"video":return tt;case"canvas":return et}return it[t]},nt="RTLPluginLoaded";class st extends e.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=j()}_syncState(t){return this.status=t,this.dispatcher.broadcast("SRPS",{pluginStatus:t,pluginURL:this.url})["catch"](t=>{throw this.status="error",t})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(t){return e._(this,arguments,void 0,function*(t,e=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=s.resolveURL(t),!this.url)throw new Error(`requested url ${t}
313 is invalid`);if("unavailable"===this.status){if(!e)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if("requested"===this.status)return this._requestImport()})}_requestImport(){return e._(this,void 0,void 0,function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new e.k(nt))})}lazyLoad(){"unavailable"===this.status?this.status="requested":"deferred"===this.status&&this._requestImport()}}let at=null;function ot(){return at||(at=new st),at}class lt{constructor(t,i){this.timeAdded=0,this.fadeEndTime=0,this.tileID=t,this.uid=e.a4(),this.uses=0,this.tileSize=i,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(t){const e=t+this.timeAdded;e<this.fadeEndTime||(this.fadeEndTime=e)}wasRequested(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state}clearTextures(t){this.demTexture&&t.saveTileTexture(this.demTexture),this.demTexture=null}loadVectorData(t,i,r){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",t){t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestFeatureIndex.rawTileData=t.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=function(t,e){const i={};if(!e)return i;for(const r of t){const t=r.layerIds.map(t=>e.getLayer(t)).filter(Boolean);if(0!==t.length){r.layers=t,r.stateDependentLayerIds&&(r.stateDependentLayers=r.stateDependentLayerIds.map(e=>t.filter(t=>t.id===e)[0]));for(const e of t)i[e.id]=r}}return i}(t.buckets,i.style),this.hasSymbolBuckets=!1;for(const t in this.buckets){const i=this.buckets[t];if(i instanceof e.a6){if(this.hasSymbolBuckets=!0,!r)break;i.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const t in this.buckets){const i=this.buckets[t];if(i instanceof e.a6&&i.hasRTLText){this.hasRTLText=!0,ot().lazyLoad();break}}this.queryPadding=0;for(const t in this.buckets){const e=this.buckets[t];this.queryPadding=Math.max(this.queryPadding,i.style.getLayer(t).queryRadius(e))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new e.a5}unloadVectorData(){for(const t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(t){return this.buckets[t.id]}upload(t){for(const e in this.buckets){const i=this.buckets[e];i.uploadPending()&&i.upload(t)}const e=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new b(t,this.imageAtlas.image,e.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new b(t,this.glyphAtlasImage,e.ALPHA),this.glyphAtlasImage=null)}prepare(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)}queryRenderedFeatures(t,e,i,r,n,s,a,o,l,c){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:r,cameraQueryGeometry:n,scale:s,tileSize:this.tileSize,pixelPosMatrix:c,transform:o,params:a,queryPadding:this.queryPadding*l},t,e,i):{}}querySourceFeatures(t,i){const r=this.latestFeatureIndex;if(!r||!r.rawTileData)return;const n=r.loadVTLayers(),s=i&&i.sourceLayer?i.sourceLayer:"",a=n._geojsonTileLayer||n[s];if(!a)return;const o=e.a7(i&&i.filter),{z:l,x:c,y:h}=this.tileID.canonical,u={z:l,x:c,y:h};for(let i=0;i<a.length;i++){const n=a.feature(i);if(o.needGeometry){const t=e.a8(n,!0);if(!o.filter(new e.z(this.tileID.overscaledZ),t,this.tileID.canonical))continue}else if(!o.filter(new e.z(this.tileID.overscaledZ),n))continue;const d=r.getId(n,s),p=new e.a9(n,l,c,h,d);p.tile=u,t.push(p)}}hasData(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(t){const i=this.expirationTime;if(t.cacheControl){const i=e.aa(t.cacheControl);i["max-age"]&&(this.expirationTime=Date.now()+1e3*i["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){const t=Date.now();let e=!1;if(this.expirationTime>t)e=!1;else if(i)if(this.expirationTime<i)e=!0;else{const r=this.expirationTime-i;r?this.expirationTime=t+Math.max(r,3e4):e=!0}else e=!0;e?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}}getExpiryTimeout(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-(new Date).getTime(),Math.pow(2,31)-1)}setFeatureState(t,e){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||0===Object.keys(t).length)return;const i=this.latestFeatureIndex.loadVTLayers();for(const r in this.buckets){if(!e.style.hasLayer(r))continue;const n=this.buckets[r],s=n.layers[0].sourceLayer||"_geojsonTileLayer",a=i[s],o=t[s];if(!a||!o||0===Object.keys(o).length)continue;n.update(o,a,this.imageAtlas&&this.imageAtlas.patternPositions||{});const l=e&&e.style&&e.style.getLayer(r);l&&(this.queryPadding=Math.max(this.queryPadding,l.queryRadius(n)))}}holdingForFade(){return void 0!==this.symbolFadeHoldUntil}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<s.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(t){this.symbolFadeHoldUntil=s.now()+t}
vendor: 17,366 bytes, line 313
313setDependencies(t,e){const i={};for(const t of e)i[t]=!0;this.dependencies[t]=i}hasDependency(t,e){for(const i of t){const t=this.dependencies[i];if(t)for(const i of e)if(t[i])return!0}return!1}}class ct{constructor(t,e){this.max=t,this.onRemove=e,this.reset()}reset(){for(const t in this.data)for(const e of this.data[t])e.timeout&&clearTimeout(e.timeout),this.onRemove(e.value);return this.data={},this.order=[],this}add(t,e,i){const r=t.wrapped().key;void 0===this.data[r]&&(this.data[r]=[]);const n={value:e,timeout:void 0};if(void 0!==i&&(n.timeout=setTimeout(()=>{this.remove(t,n)},i)),this.data[r].push(n),this.order.push(r),this.order.length>this.max){const t=this._getAndRemoveByKey(this.order[0]);t&&this.onRemove(t)}return this}has(t){return t.wrapped().key in this.data}getAndRemove(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null}_getAndRemoveByKey(t){const e=this.data[t].shift();return e.timeout&&clearTimeout(e.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),e.value}getByKey(t){const e=this.data[t];return e?e[0].value:null}get(t){return this.has(t)?this.data[t.wrapped().key][0].value:null}remove(t,e){if(!this.has(t))return this;const i=t.wrapped().key,r=void 0===e?0:this.data[i].indexOf(e),n=this.data[i][r];return this.data[i].splice(r,1),n.timeout&&clearTimeout(n.timeout),0===this.data[i].length&&delete this.data[i],this.onRemove(n.value),this.order.splice(this.order.indexOf(i),1),this}setMaxSize(t){for(this.max=t;this.order.length>this.max;){const t=this._getAndRemoveByKey(this.order[0]);t&&this.onRemove(t)}return this}filter(t){const e=[];for(const i in this.data)for(const r of this.data[i])t(r.value)||e.push(r);for(const t of e)this.remove(t.value.tileID,t)}}class ht{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(t,i,r){const n=String(i);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][n]=this.stateChanges[t][n]||{},e.e(this.stateChanges[t][n],r),null===this.deletedStates[t]){this.deletedStates[t]={};for(const e in this.state[t])e!==n&&(this.deletedStates[t][e]=null)}else if(this.deletedStates[t]&&null===this.deletedStates[t][n]){this.deletedStates[t][n]={};for(const e in this.state[t][n])r[e]||(this.deletedStates[t][n][e]=null)}else for(const e in r)this.deletedStates[t]&&this.deletedStates[t][n]&&null===this.deletedStates[t][n][e]&&delete this.deletedStates[t][n][e]}removeFeatureState(t,e,i){if(null===this.deletedStates[t])return;const r=String(e);if(this.deletedStates[t]=this.deletedStates[t]||{},i&&void 0!==e)null!==this.deletedStates[t][r]&&(this.deletedStates[t][r]=this.deletedStates[t][r]||{},this.deletedStates[t][r][i]=null);else if(void 0!==e)if(this.stateChanges[t]&&this.stateChanges[t][r])for(i in this.deletedStates[t][r]={},this.stateChanges[t][r])this.deletedStates[t][r][i]=null;else this.deletedStates[t][r]=null;else this.deletedStates[t]=null}getState(t,i){const r=String(i),n=e.e({},(this.state[t]||{})[r],(this.stateChanges[t]||{})[r]);if(null===this.deletedStates[t])return{};if(this.deletedStates[t]){const e=this.deletedStates[t][i];if(null===e)return{};for(const t in e)delete n[t]}return n}initializeTileState(t,e){t.setFeatureState(this.state,e)}coalesceChanges(t,i){const r={};for(const t in this.stateChanges){this.state[t]=this.state[t]||{};const i={};for(const r in this.stateChanges[t])this.state[t][r]||(this.state[t][r]={}),e.e(this.state[t][r],this.stateChanges[t][r]),i[r]=this.state[t][r];r[t]=i}for(const t in this.deletedStates){this.state[t]=this.state[t]||{};const i={};if(null===this.deletedStates[t])for(const e in this.state[t])i[e]={},this.state[t][e]={};else for(const e in this.deletedStates[t]){if(null===this.deletedStates[t][e])this.state[t][e]={};else for(const i of Object.keys(this.deletedStates[t][e]))delete this.state[t][e][i];i[e]=this.state[t][e]}r[t]=r[t]||{},e.e(r[t],i)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(r).length)for(const e in t)t[e].setFeatureState(r,i)}}class ut extends e.E{constructor(t,e,i){super(),this.id=t,this.dispatcher=i,this.on("data",t=>this._dataHandler(t)),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((t,e,i,r)=>{const n=new(rt(e.type))(t,e,i,r);if(n.id!==t)throw new Error(`Expected Source id to be ${t} instead of ${n.id}`);return n})(t,e,i,this),this._tiles={},this._cache=new ct(0,t=>this._unloadTile(t)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new ht,this._didEmitContent=!1,this._updated=!1}onAdd(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._maxTileCacheZoomLevels=t?t._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(t)}onRemove(t){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(t)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;if(!this._source.loaded())return!1;if(!(void 0===this.used&&void 0===this.usedForTerrain||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(const t in this._tiles){const e=this._tiles[t];if("loaded"!==e.state&&"errored"!==e.state)return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const t=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(t,i,r){return e._(this,void 0,void 0,function*(){try{yield this._source.loadTile(t),this._tileLoaded(t,i,r)}catch(i){t.state="errored",404!==i.status?this._source.fire(new e.j(i,{tile:t})):this.update(this.transform,this.terrain)}})}_unloadTile(t){this._source.unloadTile&&this._source.unloadTile(t)}_abortTile(t){this._source.abortTile&&this._source.abortTile(t),this._source.fire(new e.k("dataabort",{tile:t,coord:t.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(t){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const e in this._tiles){const i=this._tiles[e];i.upload(t),i.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(t=>t.tileID).sort(dt).map(t=>t.key)}getRenderableIds(t){const i=[];for(const e in this._tiles)this._isIdRenderable(e,t)&&i.push(this._tiles[e]);return t?i.sort((t,i)=>{const r=t.tileID,n=i.tileID,s=new e.P(r.canonical.x,r.canonical.y)._rotate(this.transform.angle),a=new e.P(n.canonical.x,n.canonical.y)._rotate(this.transform.angle);return r.overscaledZ-n.overscaledZ||a.y-s.y||a.x-s.x}).map(t=>t.tileID.key):i.map(t=>t.tileID).sort(dt).map(t=>t.key)}hasRenderableParent(t){const e=this.findLoadedParent(t,0);return!!e&&this._isIdRenderable(e.tileID.key)}_isIdRenderable(t,e){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(e||!this._tiles[t].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const t in this._tiles)"errored"!==this._tiles[t].state&&this._reloadTile(t,"reloading")}}_reloadTile(t,i){return e._(this,void 0,void 0,function*(){const e=this._tiles[t];e&&("loading"!==e.state&&(e.state=i),yield this._loadTile(e,t,i))})}_tileLoaded(t,i,r){t.timeAdded=s.now(),"expired"===r&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(i,t),"raster-dem"===this.getSource().type&&t.dem&&this._backfillDEM(t),this._state.initializeTileState(t,this.map?this.map.painter:null),t.aborted||this._source.fire(new e.k("data",{dataType:"source",tile:t,coord:t.tileID}))}_backfillDEM(t){const e=this.getRenderableIds();for(let r=0;r<e.length;r++){const n=e[r];if(t.neighboringTiles&&t.neighboringTiles[n]){const e=this.getTileByID(n);i(t,e),i(e,t)}}function i(t,e){t.needsHillshadePrepare=!0,t.needsTerrainPrepare=!0;let i=e.tileID.canonical.x-t.tileID.canonical.x;const r=e.tileID.canonical.y-t.tileID.canonical.y,n=Math.pow(2,t.tileID.canonical.z),s=e.tileID.key;0===i&&0===r||Math.abs(r)>1||(Math.abs(i)>1&&(1===Math.abs(i+n)?i+=n:1===Math.abs(i-n)&&(i-=n)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,i,r),t.neighboringTiles&&t.neighboringTiles[s]&&(t.neighboringTiles[s].backfilled=!0)))}}getTile(t){return this.getTileByID(t.key)}getTileByID(t){return this._tiles[t]}_retainLoadedChildren(t,e,i,r){for(const n in this._tiles){let s=this._tiles[n];if(r[n]||!s.hasData()||s.tileID.overscaledZ<=e||s.tileID.overscaledZ>i)continue;let a=s.tileID;for(;s&&s.tileID.overscaledZ>e+1;){const t=s.tileID.scaledTo(s.tileID.overscaledZ-1);s=this._tiles[t.key],s&&s.hasData()&&(a=t)}let o=a;for(;o.overscaledZ>e;)if(o=o.scaledTo(o.overscaledZ-1),t[o.key]){r[a.key]=a;break}}}findLoadedParent(t,e){if(t.key in this._loadedParentTiles){const i=this._loadedParentTiles[t.key];return i&&i.tileID.overscaledZ>=e?i:null}for(let i=t.overscaledZ-1;i>=e;i--){const e=t.scaledTo(i),r=this._getLoadedTile(e);if(r)return r}}findLoadedSibling(t){return this._getLoadedTile(t)}_getLoadedTile(t){const e=this._tiles[t.key];return e&&e.hasData()?e:this._cache.getByKey(t.wrapped().key)}updateCacheSize(t){const i=Math.ceil(t.width/this._source.tileSize)+1,r=Math.ceil(t.height/this._source.tileSize)+1,n=Math.floor(i*r*(null===this._maxTileCacheZoomLevels?e.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),s="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,n):n;this._cache.setMaxSize(s)}handleWrapJump(t){const e=Math.round((t-(void 0===this._prevLng?t:this._prevLng))/360);if(this._prevLng=t,e){const t={};for(const i in this._tiles){const r=this._tiles[i];r.tileID=r.tileID.unwrapTo(r.tileID.wrap+e),t[r.tileID.key]=r}this._tiles=t;for(const t in this._timers)clearTimeout(this._timers[t]),delete this._timers[t];for(const t in this._tiles)this._setTileReloadTimer(t,this._tiles[t])}}_updateCoveredAndRetainedTiles(t,e,i,r,n,a){const o={},l={},c=Object.keys(t),h=s.now();for(const i of c){const r=t[i],n=this._tiles[i];if(!n||0!==n.fadeEndTime&&n.fadeEndTime<=h)continue;const s=this.findLoadedParent(r,e),a=this.findLoadedSibling(r),c=s||a||null;c&&(this._addTile(c.tileID),o[c.tileID.key]=c.tileID),l[i]=r}this._retainLoadedChildren(l,r,i,t);for(const e in o)t[e]||(this._coveredTiles[e]=!0,t[e]=o[e]);if(a){const e={},i={};for(const t of n)this._tiles[t.key].hasData()?e[t.key]=t:i[t.key]=t;for(const r in i){const n=i[r].children(this._source.maxzoom);this._tiles[n[0].key]&&this._tiles[n[1].key]&&this._tiles[n[2].key]&&this._tiles[n[3].key]&&(e[n[0].key]=t[n[0].key]=n[0],e[n[1].key]=t[n[1].key]=n[1],e[n[2].key]=t[n[2].key]=n[2],e[n[3].key]=t[n[3].key]=n[3],delete i[r])}for(const r in i){const n=i[r],s=this.findLoadedParent(n,this._source.minzoom),a=this.findLoadedSibling(n),o=s||a||null;if(o){e[o.tileID.key]=t[o.tileID.key]=o.tileID;for(const t in e)e[t].isChildOf(o.tileID)&&delete e[t]}}for(const t in this._tiles)e[t]||(this._coveredTiles[t]=!0)}}update(t,i){if(!this._sourceLoaded||this._paused)return;let r;this.transform=t,this.terrain=i,this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?r=t.getVisibleUnwrappedCoordinates(this._source.tileID).map(t=>new e.S(t.canonical.z,t.wrap,t.canonical.z,t.canonical.x,t.canonical.y)):(r=t.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:i}),this._source.hasTile&&(r=r.filter(t=>this._source.hasTile(t)))):r=[];const n=t.coveringZoomLevel(this._source),s=Math.max(n-ut.maxOverzooming,this._source.minzoom),a=Math.max(n+ut.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const t={};for(const e of r)if(e.canonical.z>this._source.minzoom){const i=e.scaledTo(e.canonical.z-1);t[i.key]=i;const r=e.scaledTo(Math.max(this._source.minzoom,Math.min(e.canonical.z,5)));t[r.key]=r}r=r.concat(Object.values(t))}const o=0===r.length&&!this._updated&&this._didEmitContent;this._updated=!0,o&&this.fire(new e.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const l=this._updateRetainedTiles(r,n);pt(this._source.type)&&this._updateCoveredAndRetainedTiles(l,s,a,n,r,i);for(const t in l)this._tiles[t].clearFadeHold();const c=e.ab(this._tiles,l);for(const t of c){const e=this._tiles[t];e.hasSymbolBuckets&&!e.holdingForFade()?e.setHoldDuration(this.map._fadeDuration):e.hasSymbolBuckets&&!e.symbolFadeFinished()||this._removeTile(t)}this._updateLoadedParentTileCache(),this._updateLoadedSiblingTileCache()}releaseSymbolFadeTiles(){for(const t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(t)}_updateRetainedTiles(t,e){var i;const r={},n={},s=Math.max(e-ut.maxOverzooming,this._source.minzoom),a=Math.max(e+ut.maxUnderzooming,this._source.minzoom),o={};for(const i of t){const t=this._addTile(i);r[i.key]=i,t.hasData()||e<this._source.maxzoom&&(o[i.key]=i)}this._retainLoadedChildren(o,e,a,r);for(const a of t){let t=this._tiles[a.key];if(t.hasData())continue;if(e+1>this._source.maxzoom){const t=a.children(this._source.maxzoom)[0],e=this.getTile(t);if(e&&e.hasData()){r[t.key]=t;continue}}else{const t=a.children(this._source.maxzoom);if(r[t[0].key]&&r[t[1].key]&&r[t[2].key]&&r[t[3].key])continue}let o=t.wasRequested();for(let e=a.overscaledZ-1;e>=s;--e){const s=a.scaledTo(e);if(n[s.key])break;if(n[s.key]=!0,t=this.getTile(s),!t&&o&&(t=this._addTile(s)),t){const e=t.hasData();if((e||!(null===(i=this.map)||void 0===i?void 0:i.cancelPendingTileRequestsWhileZooming)||o)&&(r[s.key]=s),o=t.wasRequested(),e)break}}}return r}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const t in this._tiles){const e=[];let i,r=this._tiles[t].tileID;for(;r.overscaledZ>0;){if(r.key in this._loadedParentTiles){i=this._loadedParentTiles[r.key];break}e.push(r.key);const t=r.scaledTo(r.overscaledZ-1);if(i=this._getLoadedTile(t),i)break;r=t}for(const t of e)this._loadedParentTiles[t]=i}}_updateLoadedSiblingTileCache(){this._loadedSiblingTiles={};for(const t in this._tiles){const e=this._tiles[t].tileID,i=this._getLoadedTile(e);this._loadedSiblingTiles[e.key]=i}}_addTile(t){let i=this._tiles[t.key];if(i)return i;i=this._cache.getAndRemove(t),i&&(this._setTileReloadTimer(t.key,i),i.tileID=t,this._state.initializeTileState(i,this.map?this.map.painter:null),this._cacheTimers[t.key]&&(clearTimeout(this._cacheTimers[t.key]),delete this._cacheTimers[t.key],this._setTileReloadTimer(t.key,i)));const r=i;return i||(i=new lt(t,this._source.tileSize*t.overscaleFactor()),this._loadTile(i,t.key,i.state)),i.uses++,this._tiles[t.key]=i,r||this._source.fire(new e.k("dataloading",{tile:i,coord:i.tileID,dataType:"source"})),i}_setTileReloadTimer(t,e){t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]);const i=e.getExpiryTimeout();i&&(this._timers[t]=setTimeout(()=>{this._reloadTile(t,"expired"),delete this._timers[t]},i))}_removeTile(t){const e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),e.uses>0||(e.hasData()&&"reloading"!==e.state?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))))}_dataHandler(t){const e=t.sourceDataType;"source"===t.dataType&&"metadata"===e&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&"source"===t.dataType&&"content"===e&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const t in this._tiles)this._removeTile(t);this._cache.reset()}tilesIn(t,i,r){const n=[],s=this.transform;if(!s)return n;const a=r?s.getCameraQueryGeometry(t):t,o=t.map(t=>s.pointCoordinate(t,this.terrain)),l=a.map(t=>s.pointCoordinate(t,this.terrain)),c=this.getIds();let h=1/0,u=1/0,d=-1/0,p=-1/0;for(const t of l)h=Math.min(h,t.x),u=Math.min(u,t.y),d=Math.max(d,t.x),p=Math.max(p,t.y);for(let t=0;t<c.length;t++){const r=this._tiles[c[t]];if(r.holdingForFade())continue;const a=r.tileID,f=Math.pow(2,s.zoom-r.tileID.overscaledZ),m=i*r.queryPadding*e.X/r.tileSize/f,_=[a.getTilePoint(new e.Z(h,u)),a.getTilePoint(new e.Z(d,p))];if(_[0].x-m<e.X&&_[0].y-m<e.X&&_[1].x+m>=0&&_[1].y+m>=0){const t=o.map(t=>a.getTilePoint(t)),e=l.map(t=>a.getTilePoint(t));n.push({tile:r,tileID:a,queryGeometry:t,cameraQueryGeometry:e,scale:f})}}return n}getVisibleCoordinates(t){const e=this.getRenderableIds(t).map(t=>this._tiles[t].tileID);for(const t of e)t.posMatrix=this.transform.calculatePosMatrix(t.toUnwrapped());return e}hasTransition(){if(this._source.hasTransition())return!0;if(pt(this._source.type)){const t=s.now();for(const e in this._tiles)if(this._tiles[e].fadeEndTime>=t)return!0}return!1}setFeatureState(t,e,i){this._state.updateState(t=t||"_geojsonTileLayer",e,i)}removeFeatureState(t,e,i){this._state.removeFeatureState(t=t||"_geojsonTileLayer",e,i)}getFeatureState(t,e){return this._state.getState(t=t||"_geojsonTileLayer",e)}setDependencies(t,e,i){const r=this._tiles[t];r&&r.setDependencies(e,i)}reloadTilesForDependencies(t,e){for(const i in this._tiles)this._tiles[i].hasDependency(t,e)&&this._reloadTile(i,"reloading");this._cache.filter(i=>!i.hasDependency(t,e
vendor: 12,935 bytes, line 313
313))}}function dt(t,e){const i=Math.abs(2*t.wrap)-+(t.wrap<0),r=Math.abs(2*e.wrap)-+(e.wrap<0);return t.overscaledZ-e.overscaledZ||r-i||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function pt(t){return"raster"===t||"image"===t||"video"===t}ut.maxOverzooming=10,ut.maxUnderzooming=3;class ft{constructor(t,e){this.reset(t,e)}reset(t,e){this.points=t||[],this._distances=[0];for(let t=1;t<this.points.length;t++)this._distances[t]=this._distances[t-1]+this.points[t].dist(this.points[t-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(e||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(t){if(1===this.points.length)return this.points[0];t=e.ac(t,0,1);let i=1,r=this._distances[i];const n=t*this.paddedLength+this.padding;for(;r<n&&i<this._distances.length;)r=this._distances[++i];const s=i-1,a=this._distances[s],o=r-a,l=o>0?(n-a)/o:0;return this.points[s].mult(1-l).add(this.points[i].mult(l))}}function mt(t,e){let i=!0;return"always"===t||"never"!==t&&"never"!==e||(i=!1),i}class _t{constructor(t,e,i){const r=this.boxCells=[],n=this.circleCells=[];this.xCellCount=Math.ceil(t/i),this.yCellCount=Math.ceil(e/i);for(let t=0;t<this.xCellCount*this.yCellCount;t++)r.push([]),n.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=t,this.height=e,this.xScale=this.xCellCount/t,this.yScale=this.yCellCount/e,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(t,e,i,r,n){this._forEachCell(e,i,r,n,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(i),this.bboxes.push(r),this.bboxes.push(n)}insertCircle(t,e,i,r){this._forEachCell(e-r,i-r,e+r,i+r,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(i),this.circles.push(r)}_insertBoxCell(t,e,i,r,n,s){this.boxCells[n].push(s)}_insertCircleCell(t,e,i,r,n,s){this.circleCells[n].push(s)}_query(t,e,i,r,n,s,a){if(i<0||t>this.width||r<0||e>this.height)return[];const o=[];if(t<=0&&e<=0&&this.width<=i&&this.height<=r){if(n)return[{key:null,x1:t,y1:e,x2:i,y2:r}];for(let t=0;t<this.boxKeys.length;t++)o.push({key:this.boxKeys[t],x1:this.bboxes[4*t],y1:this.bboxes[4*t+1],x2:this.bboxes[4*t+2],y2:this.bboxes[4*t+3]});for(let t=0;t<this.circleKeys.length;t++){const e=this.circles[3*t],i=this.circles[3*t+1],r=this.circles[3*t+2];o.push({key:this.circleKeys[t],x1:e-r,y1:i-r,x2:e+r,y2:i+r})}}else this._forEachCell(t,e,i,r,this._queryCell,o,{hitTest:n,overlapMode:s,seenUids:{box:{},circle:{}}},a);return o}query(t,e,i,r){return this._query(t,e,i,r,!1,null)}hitTest(t,e,i,r,n,s){return this._query(t,e,i,r,!0,n,s).length>0}hitTestCircle(t,e,i,r,n){const s=t-i,a=t+i,o=e-i,l=e+i;if(a<0||s>this.width||l<0||o>this.height)return!1;const c=[];return this._forEachCell(s,o,a,l,this._queryCellCircle,c,{hitTest:!0,overlapMode:r,circle:{x:t,y:e,radius:i},seenUids:{box:{},circle:{}}},n),c.length>0}_queryCell(t,e,i,r,n,s,a,o){const{seenUids:l,hitTest:c,overlapMode:h}=a,u=this.boxCells[n];if(null!==u){const n=this.bboxes;for(const a of u)if(!l.box[a]){l.box[a]=!0;const u=4*a,d=this.boxKeys[a];if(t<=n[u+2]&&e<=n[u+3]&&i>=n[u+0]&&r>=n[u+1]&&(!o||o(d))&&(!c||!mt(h,d.overlapMode))&&(s.push({key:d,x1:n[u],y1:n[u+1],x2:n[u+2],y2:n[u+3]}),c))return!0}}const d=this.circleCells[n];if(null!==d){const n=this.circles;for(const a of d)if(!l.circle[a]){l.circle[a]=!0;const u=3*a,d=this.circleKeys[a];if(this._circleAndRectCollide(n[u],n[u+1],n[u+2],t,e,i,r)&&(!o||o(d))&&(!c||!mt(h,d.overlapMode))){const t=n[u],e=n[u+1],i=n[u+2];if(s.push({key:d,x1:t-i,y1:e-i,x2:t+i,y2:e+i}),c)return!0}}}return!1}_queryCellCircle(t,e,i,r,n,s,a,o){const{circle:l,seenUids:c,overlapMode:h}=a,u=this.boxCells[n];if(null!==u){const t=this.bboxes;for(const e of u)if(!c.box[e]){c.box[e]=!0;const i=4*e,r=this.boxKeys[e];if(this._circleAndRectCollide(l.x,l.y,l.radius,t[i+0],t[i+1],t[i+2],t[i+3])&&(!o||o(r))&&!mt(h,r.overlapMode))return s.push(!0),!0}}const d=this.circleCells[n];if(null!==d){const t=this.circles;for(const e of d)if(!c.circle[e]){c.circle[e]=!0;const i=3*e,r=this.circleKeys[e];if(this._circlesCollide(t[i],t[i+1],t[i+2],l.x,l.y,l.radius)&&(!o||o(r))&&!mt(h,r.overlapMode))return s.push(!0),!0}}}_forEachCell(t,e,i,r,n,s,a,o){const l=this._convertToXCellCoord(t),c=this._convertToYCellCoord(e),h=this._convertToXCellCoord(i),u=this._convertToYCellCoord(r);for(let d=l;d<=h;d++)for(let l=c;l<=u;l++)if(n.call(this,t,e,i,r,this.xCellCount*l+d,s,a,o))return}_convertToXCellCoord(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))}_convertToYCellCoord(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))}_circlesCollide(t,e,i,r,n,s){const a=r-t,o=n-e,l=i+s;return l*l>a*a+o*o}_circleAndRectCollide(t,e,i,r,n,s,a){const o=(s-r)/2,l=Math.abs(t-(r+o));if(l>o+i)return!1;const c=(a-n)/2,h=Math.abs(e-(n+c));if(h>c+i)return!1;if(l<=o||h<=c)return!0;const u=l-o,d=h-c;return u*u+d*d<=i*i}}function gt(t,i,r,n,s){const a=e.H();return i?(e.K(a,a,[1/s,1/s,1]),r||e.ad(a,a,n.angle)):e.L(a,n.labelPlaneMatrix,t),a}function yt(t,i,r,n,s){if(i){const i=e.ae(t);return e.K(i,i,[s,s,1]),r||e.ad(i,i,-n.angle),i}return n.glCoordMatrix}function xt(t,i,r,n){let s;n?(s=[t,i,n(t,i),1],e.af(s,s,r)):(s=[t,i,0,1],Lt(s,s,r));const a=s[3];return{point:new e.P(s[0]/a,s[1]/a),signedDistanceFromCamera:a,isOccluded:!1}}function vt(t,e){return.5+t/e*.5}function bt(t,e){return t.x>=-e[0]&&t.x<=e[0]&&t.y>=-e[1]&&t.y<=e[1]}function wt(t,i,r,n,s,a,o,l,c,h,u,d,p,f,m){const _=n?t.textSizeData:t.iconSizeData,g=e.ag(_,r.transform.zoom),y=[256/r.width*2+1,256/r.height*2+1],x=n?t.text.dynamicLayoutVertexArray:t.icon.dynamicLayoutVertexArray;x.clear();const v=t.lineVertexArray,b=n?t.text.placedSymbolArray:t.icon.placedSymbolArray,w=r.transform.width/r.transform.height;let T=!1;for(let n=0;n<b.length;n++){const S=b.get(n);if(S.hidden||S.writingMode===e.ah.vertical&&!T){Dt(S.numGlyphs,x);continue}T=!1;const I=xt(S.anchorX,S.anchorY,i,m);if(!bt(I.point,y)){Dt(S.numGlyphs,x);continue}const P=vt(r.transform.cameraToCenterDistance,I.signedDistanceFromCamera),A=e.ai(_,g,S),M=o?A/P:A*P,k={getElevation:m,labelPlaneMatrix:s,lineVertexArray:v,pitchWithMap:o,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},projection:h,tileAnchorPoint:new e.P(S.anchorX,S.anchorY),unwrappedTileID:u,width:d,height:p,translation:f},C=It(k,S,M,!1,l,i,a,t.glyphOffsetArray,x,w,c);T=C.useVertical,(C.notEnoughRoom||T||C.needsFlipping&&It(k,S,M,!0,l,i,a,t.glyphOffsetArray,x,w,c).notEnoughRoom)&&Dt(S.numGlyphs,x)}n?t.text.dynamicLayoutVertexBuffer.updateData(x):t.icon.dynamicLayoutVertexBuffer.updateData(x)}function Tt(t,e,i,r,n,s,a,o){const l=s.glyphStartIndex+s.numGlyphs,c=s.lineStartIndex,h=s.lineStartIndex+s.lineLength,u=e.getoffsetX(s.glyphStartIndex),d=e.getoffsetX(l-1),p=zt(t*u,i,r,n,s.segment,c,h,o,a);if(!p)return null;const f=zt(t*d,i,r,n,s.segment,c,h,o,a);return f?o.projectionCache.anyProjectionOccluded?null:{first:p,last:f}:null}function St(t,i,r,n){return t===e.ah.horizontal&&Math.abs(r.y-i.y)>Math.abs(r.x-i.x)*n?{useVertical:!0}:(t===e.ah.vertical?i.y<r.y:i.x>r.x)?{needsFlipping:!0}:null}function It(t,i,r,n,s,a,o,l,c,h,u){const d=r/24,p=i.lineOffsetX*d,f=i.lineOffsetY*d;let m;if(i.numGlyphs>1){const e=i.glyphStartIndex+i.numGlyphs,r=i.lineStartIndex,a=i.lineStartIndex+i.lineLength,c=Tt(d,l,p,f,n,i,u,t);if(!c)return{notEnoughRoom:!0};const _=xt(c.first.point.x,c.first.point.y,o,t.getElevation).point,g=xt(c.last.point.x,c.last.point.y,o,t.getElevation).point;if(s&&!n){const t=St(i.writingMode,_,g,h);if(t)return t}m=[c.first];for(let s=i.glyphStartIndex+1;s<e-1;s++)m.push(zt(d*l.getoffsetX(s),p,f,n,i.segment,r,a,t,u));m.push(c.last)}else{if(s&&!n){const r=xt(t.tileAnchorPoint.x,t.tileAnchorPoint.y,a,t.getElevation).point,n=i.lineStartIndex+i.segment+1,s=new e.P(t.lineVertexArray.getx(n),t.lineVertexArray.gety(n)),o=xt(s.x,s.y,a,t.getElevation),l=o.signedDistanceFromCamera>0?o.point:function(t,e,i,r,n,s){return Pt(t,e,i,1,n,s)}(t.tileAnchorPoint,s,r,0,a,t),c=St(i.writingMode,r,l,h);if(c)return c}const r=zt(d*l.getoffsetX(i.glyphStartIndex),p,f,n,i.segment,i.lineStartIndex,i.lineStartIndex+i.lineLength,t,u);if(!r||t.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};m=[r]}for(const t of m)e.aj(c,t.point,t.angle);return{}}function Pt(t,e,i,r,n,s){const a=t.add(t.sub(e)._unit()),o=void 0!==n?xt(a.x,a.y,n,s.getElevation).point:Mt(a.x,a.y,s).point,l=i.sub(o);return i.add(l._mult(r/l.mag()))}function At(t,i,r){const n=i.projectionCache;if(n.projections[t])return n.projections[t];const s=new e.P(i.lineVertexArray.getx(t),i.lineVertexArray.gety(t)),a=Mt(s.x,s.y,i);if(a.signedDistanceFromCamera>0)return n.projections[t]=a.point,n.anyProjectionOccluded=n.anyProjectionOccluded||a.isOccluded,a.point;const o=t-r.direction;return function(t,e,i,r,n){return Pt(t,e,i,r,void 0,n)}(0===r.distanceFromAnchor?i.tileAnchorPoint:new e.P(i.lineVertexArray.getx(o),i.lineVertexArray.gety(o)),s,r.previousVertex,r.absOffsetX-r.distanceFromAnchor+1,i)}function Mt(t,e,i){const r=t+i.translation[0],n=e+i.translation[1];let s;return!i.pitchWithMap&&i.projection.useSpecialProjectionForSymbols?(s=i.projection.projectTileCoordinates(r,n,i.unwrappedTileID,i.getElevation),s.point.x=(.5*s.point.x+.5)*i.width,s.point.y=(.5*-s.point.y+.5)*i.height):(s=xt(r,n,i.labelPlaneMatrix,i.getElevation),s.isOccluded=!1),s}function kt(t,e,i){return t._unit()._perp()._mult(e*i)}function Ct(t,i,r,n,s,a,o,l,c){if(l.projectionCache.offsets[t])return l.projectionCache.offsets[t];const h=r.add(i);if(t+c.direction<n||t+c.direction>=s)return l.projectionCache.offsets[t]=h,h;const u=At(t+c.direction,l,c),d=kt(u.sub(r),o,c.direction),p=r.add(d),f=u.add(d);return l.projectionCache.offsets[t]=e.ak(a,h,p,f)||h,l.projectionCache.offsets[t]}function zt(t,e,i,r,n,s,a,o,l){const c=r?t-e:t+e;let h=c>0?1:-1,u=0;r&&(h*=-1,u=Math.PI),h<0&&(u+=Math.PI);let d,p=h>0?s+n:s+n+1;o.projectionCache.cachedAnchorPoint?d=o.projectionCache.cachedAnchorPoint:(d=Mt(o.tileAnchorPoint.x,o.tileAnchorPoint.y,o).point,o.projectionCache.cachedAnchorPoint=d);let f,m,_=d,g=d,y=0,x=0;const v=Math.abs(c),b=[];let w;for(;y+x<=v;){if(p+=h,p<s||p>=a)return null;y+=x,g=_,m=f;const t={absOffsetX:v,direction:h,distanceFromAnchor:y,previousVertex:g};if(_=At(p,o,t),0===i)b.push(g),w=_.sub(g);else{let e;const r=_.sub(g);e=0===r.mag()?kt(At(p+h,o,t).sub(_),i,h):kt(r,i,h),m||(m=g.add(e)),f=Ct(p,e,_,s,a,m,i,o,t),b.push(m),w=f.sub(m)}x=w.mag()}const T=w._mult((v-y)/x)._add(m||g),S=u+Math.atan2(_.y-g.y,_.x-g.x);return b.push(T),{point:T,angle:l?S:0,path:b}}const Et=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Dt(t,e){for(let i=0;i<t;i++){const t=e.length;e.resize(t+4),e.float32.set(Et,3*t)}}function Lt(t,e,i){const r=e[0],n=e[1];return t[0]=i[0]*r+i[4]*n+i[12],t[1]=i[1]*r+i[5]*n+i[13],t[3]=i[3]*r+i[7]*n+i[15],t}const Rt=100;class Bt{constructor(t,e,i=new _t(t.width+200,t.height+200,25),r=new _t(t.width+200,t.height+200,25)){this.transform=t,this.mapProjection=e,this.grid=i,this.ignoredGrid=r,this.pitchFactor=Math.cos(t._pitch)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+Rt,this.screenBottomBoundary=t.height+Rt,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(t,e,i,r,n,s,a,o,l,c,h){const u=t.anchorPointX+o[0],d=t.anchorPointY+o[1],p=this.projectAndGetPerspectiveRatio(r,u,d,n,c),f=i*p.perspectiveRatio;let m;if(s||a)m=this._projectCollisionBox(t,f,r,n,s,a,o,p,c,h);else{const e=p.point.x+(h?h.x*f:0),i=p.point.y+(h?h.y*f:0);m={allPointsOccluded:!1,box:[e+t.x1*f,i+t.y1*f,e+t.x2*f,i+t.y2*f]}}const[_,g,y,x]=m.box;return this.mapProjection.useSpecialProjectionForSymbols&&(s?m.allPointsOccluded:this.mapProjection.isOccluded(u,d,n))||p.perspectiveRatio<this.perspectiveRatioCutoff||!this.isInsideGrid(_,g,y,x)||"always"!==e&&this.grid.hitTest(_,g,y,x,e,l)?{box:[_,g,y,x],placeable:!1,offscreen:!1}:{box:[_,g,y,x],placeable:!0,offscreen:this.isOffscreen(_,g,y,x)}}placeCollisionCircles(t,i,r,n,s,a,o,l,c,h,u,d,p,f,m,_){const g=[],y=new e.P(i.anchorX,i.anchorY),x=this.getPerspectiveRatio(a,y.x,y.y,o,_),v=(u?s/x:s*x)/e.ap,b={getElevation:_,labelPlaneMatrix:l,lineVertexArray:r,pitchWithMap:u,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},projection:this.mapProjection,tileAnchorPoint:y,unwrappedTileID:o,width:this.transform.width,height:this.transform.height,translation:m},w=Tt(v,n,i.lineOffsetX*v,i.lineOffsetY*v,!1,i,!1,b);let T=!1,S=!1,I=!0;if(w){const i=.5*p*x+f,r=new e.P(-100,-100),n=new e.P(this.screenRightBoundary,this.screenBottomBoundary),s=new ft,a=w.first,o=w.last;let l=[];for(let t=a.path.length-1;t>=1;t--)l.push(a.path[t]);for(let t=1;t<o.path.length;t++)l.push(o.path[t]);const u=2.5*i;if(c){const t=this.projectPathToScreenSpace(l,b,c);l=t.some(
vendor: 11,233 bytes, line 313
313t=>t.signedDistanceFromCamera<=0)?[]:t.map(t=>t.point)}let m=[];if(l.length>0){const t=l[0].clone(),i=l[0].clone();for(let e=1;e<l.length;e++)t.x=Math.min(t.x,l[e].x),t.y=Math.min(t.y,l[e].y),i.x=Math.max(i.x,l[e].x),i.y=Math.max(i.y,l[e].y);m=t.x>=r.x&&i.x<=n.x&&t.y>=r.y&&i.y<=n.y?[l]:i.x<r.x||t.x>n.x||i.y<r.y||t.y>n.y?[]:e.al([l],r.x,r.y,n.x,n.y)}for(const e of m){s.reset(e,.25*i);let r=0;r=s.length<=.5*i?1:Math.ceil(s.paddedLength/u)+1;for(let e=0;e<r;e++){const n=e/Math.max(r-1,1),a=s.lerp(n),o=a.x+Rt,l=a.y+Rt;g.push(o,l,i,0);const c=o-i,u=l-i,p=o+i,f=l+i;if(I=I&&this.isOffscreen(c,u,p,f),S=S||this.isInsideGrid(c,u,p,f),"always"!==t&&this.grid.hitTestCircle(o,l,i,t,d)&&(T=!0,!h))return{circles:[],offscreen:!1,collisionDetected:T}}}}return{circles:!h&&T||!S||x<this.perspectiveRatioCutoff?[]:g,offscreen:I,collisionDetected:T}}projectPathToScreenSpace(t,e,i){return t.map(t=>xt(t.x,t.y,i,e.getElevation))}queryRenderedSymbols(t){if(0===t.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};const i=[];let r=1/0,n=1/0,s=-1/0,a=-1/0;for(const o of t){const t=new e.P(o.x+Rt,o.y+Rt);r=Math.min(r,t.x),n=Math.min(n,t.y),s=Math.max(s,t.x),a=Math.max(a,t.y),i.push(t)}const o=this.grid.query(r,n,s,a).concat(this.ignoredGrid.query(r,n,s,a)),l={},c={};for(const t of o){const r=t.key;if(void 0===l[r.bucketInstanceId]&&(l[r.bucketInstanceId]={}),l[r.bucketInstanceId][r.featureIndex])continue;const n=[new e.P(t.x1,t.y1),new e.P(t.x2,t.y1),new e.P(t.x2,t.y2),new e.P(t.x1,t.y2)];e.am(i,n)&&(l[r.bucketInstanceId][r.featureIndex]=!0,void 0===c[r.bucketInstanceId]&&(c[r.bucketInstanceId]=[]),c[r.bucketInstanceId].push(r.featureIndex))}return c}insertCollisionBox(t,e,i,r,n,s){(i?this.ignoredGrid:this.grid).insert({bucketInstanceId:r,featureIndex:n,collisionGroupID:s,overlapMode:e},t[0],t[1],t[2],t[3])}insertCollisionCircles(t,e,i,r,n,s){const a=i?this.ignoredGrid:this.grid,o={bucketInstanceId:r,featureIndex:n,collisionGroupID:s,overlapMode:e};for(let e=0;e<t.length;e+=4)a.insertCircle(o,t[e],t[e+1],t[e+2])}projectAndGetPerspectiveRatio(t,i,r,n,s){let a;s?(a=[i,r,s(i,r),1],e.af(a,a,t)):(a=[i,r,0,1],Lt(a,a,t));const o=a[3];return{point:new e.P((a[0]/o+1)/2*this.transform.width+Rt,(-a[1]/o+1)/2*this.transform.height+Rt),perspectiveRatio:.5+this.transform.cameraToCenterDistance/o*.5,isOccluded:!1,signedDistanceFromCamera:o}}getPerspectiveRatio(t,e,i,r,n){const s=this.mapProjection.useSpecialProjectionForSymbols?this.mapProjection.projectTileCoordinates(e,i,r,n):xt(e,i,t,n);return.5+this.transform.cameraToCenterDistance/s.signedDistanceFromCamera*.5}isOffscreen(t,e,i,r){return i<Rt||t>=this.screenRightBoundary||r<Rt||e>this.screenBottomBoundary}isInsideGrid(t,e,i,r){return i>=0&&t<this.gridRightBoundary&&r>=0&&e<this.gridBottomBoundary}getViewportMatrix(){const t=e.an([]);return e.J(t,t,[-100,-100,0]),t}_projectCollisionBox(t,i,r,n,s,a,o,l,c,h){let u=new e.P(1,0),d=new e.P(0,1);const p=new e.P(t.anchorPointX+o[0],t.anchorPointY+o[1]);if(a&&!s){const t=this.projectAndGetPerspectiveRatio(r,p.x+1,p.y,n,c).point.sub(l.point).unit(),i=Math.atan(t.y/t.x)+(t.x<0?Math.PI:0),s=Math.sin(i),a=Math.cos(i);u=new e.P(a,s),d=new e.P(-s,a)}else if(!a&&s){const t=-this.transform.angle,i=Math.sin(t),r=Math.cos(t);u=new e.P(r,i),d=new e.P(-i,r)}let f=l.point,m=i;if(s){f=p;const t=this.transform.zoom-Math.floor(this.transform.zoom);m=Math.pow(2,-t),m*=this.mapProjection.getPitchedTextCorrection(this.transform,p,n),h||(m*=e.ac(.5+l.signedDistanceFromCamera/this.transform.cameraToCenterDistance*.5,0,4))}h&&(f=f.add(u.mult(h.x*m)).add(d.mult(h.y*m)));const _=t.x1*m,g=t.x2*m,y=(_+g)/2,x=t.y1*m,v=t.y2*m,b=(x+v)/2,w=[{offsetX:_,offsetY:x},{offsetX:y,offsetY:x},{offsetX:g,offsetY:x},{offsetX:g,offsetY:b},{offsetX:g,offsetY:v},{offsetX:y,offsetY:v},{offsetX:_,offsetY:v},{offsetX:_,offsetY:b}];let T=[];for(const{offsetX:t,offsetY:i}of w)T.push(new e.P(f.x+u.x*t+d.x*i,f.y+u.y*t+d.y*i));let S=!1;if(s){const t=T.map(t=>this.projectAndGetPerspectiveRatio(r,t.x,t.y,n,c));S=t.some(t=>!t.isOccluded),T=t.map(t=>t.point)}else S=!0;return{box:e.ao(T),allPointsOccluded:!S}}}function Ft(t,i,r){return i*(e.X/(t.tileSize*Math.pow(2,r-t.tileID.overscaledZ)))}class Ot{constructor(t,e,i,r){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?e:-e))):r&&i?1:0,this.placed=i}isHidden(){return 0===this.opacity&&!this.placed}}class Vt{constructor(t,e,i,r,n){this.text=new Ot(t?t.text:null,e,i,n),this.icon=new Ot(t?t.icon:null,e,r,n)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class Nt{constructor(t,e,i){this.text=t,this.icon=e,this.skipFade=i}}class jt{constructor(){this.invProjMatrix=e.H(),this.viewportMatrix=e.H(),this.circles=[]}}class Ut{constructor(t,e,i,r,n){this.bucketInstanceId=t,this.featureIndex=e,this.sourceLayerIndex=i,this.bucketIndex=r,this.tileID=n}}class $t{constructor(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}}get(t){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[t]){const e=++this.maxGroupID;this.collisionGroups[t]={ID:e,predicate:t=>t.collisionGroupID===e}}return this.collisionGroups[t]}}function qt(t,i,r,n,s){const{horizontalAlign:a,verticalAlign:o}=e.au(t);return new e.P(-(a-.5)*i+n[0]*s,-(o-.5)*r+n[1]*s)}class Zt{constructor(t,e,i,r,n,s){this.transform=t.clone(),this.terrain=i,this.collisionIndex=new Bt(this.transform,e),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=r,this.retainedQueryData={},this.collisionGroups=new $t(n),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=s,s&&(s.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(t){const e=this.terrain;return e?(i,r)=>e.getElevation(t,i,r):null}getBucketParts(t,i,r,n){const s=r.getBucket(i),a=r.latestFeatureIndex;if(!s||!a||i.id!==s.layerIds[0])return;const o=r.collisionBoxArray,l=s.layers[0].layout,c=s.layers[0].paint,h=Math.pow(2,this.transform.zoom-r.tileID.overscaledZ),u=r.tileSize/e.X,d=r.tileID.toUnwrapped(),p=this.transform.calculatePosMatrix(d),f="map"===l.get("text-pitch-alignment"),m="map"===l.get("text-rotation-alignment"),_=Ft(r,1,this.transform.zoom),g=this.collisionIndex.mapProjection.translatePosition(this.transform,r,c.get("text-translate"),c.get("text-translate-anchor")),y=this.collisionIndex.mapProjection.translatePosition(this.transform,r,c.get("icon-translate"),c.get("icon-translate-anchor")),x=gt(p,f,m,this.transform,_);let v=null;if(f){const t=yt(p,f,m,this.transform,_);v=e.L([],this.transform.labelPlaneMatrix,t)}this.retainedQueryData[s.bucketInstanceId]=new Ut(s.bucketInstanceId,a,s.sourceLayerIndex,s.index,r.tileID);const b={bucket:s,layout:l,translationText:g,translationIcon:y,posMatrix:p,unwrappedTileID:d,textLabelPlaneMatrix:x,labelToScreenMatrix:v,scale:h,textPixelRatio:u,holdingForFade:r.holdingForFade(),collisionBoxArray:o,partiallyEvaluatedTextSize:e.ag(s.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(s.sourceID)};if(n)for(const e of s.sortKeyRanges){const{sortKey:i,symbolInstanceStart:r,symbolInstanceEnd:n}=e;t.push({sortKey:i,symbolInstanceStart:r,symbolInstanceEnd:n,parameters:b})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:s.symbolInstances.length,parameters:b})}attemptAnchorPlacement(t,i,r,n,s,a,o,l,c,h,u,d,p,f,m,_,g,y,x){const v=e.aq[t.textAnchor],b=[t.textOffset0,t.textOffset1],w=qt(v,r,n,b,s),T=this.collisionIndex.placeCollisionBox(i,d,l,c,h,o,a,_,u.predicate,x,w);if((!y||this.collisionIndex.placeCollisionBox(y,d,l,c,h,o,a,g,u.predicate,x,w).placeable)&&T.placeable){let t;if(this.prevPlacement&&this.prevPlacement.variableOffsets[p.crossTileID]&&this.prevPlacement.placements[p.crossTileID]&&this.prevPlacement.placements[p.crossTileID].text&&(t=this.prevPlacement.variableOffsets[p.crossTileID].anchor),0===p.crossTileID)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[p.crossTileID]={textOffset:b,width:r,height:n,anchor:v,textBoxScale:s,prevAnchor:t},this.markUsedJustification(f,v,p,m),f.allowVerticalPlacement&&(this.markUsedOrientation(f,m,p),this.placedOrientations[p.crossTileID]=m),{shift:w,placedGlyphBoxes:T}}}placeLayerBucketPart(t,i,r){const{bucket:n,layout:s,translationText:a,translationIcon:o,posMatrix:l,unwrappedTileID:c,textLabelPlaneMatrix:h,labelToScreenMatrix:u,textPixelRatio:d,holdingForFade:p,collisionBoxArray:f,partiallyEvaluatedTextSize:m,collisionGroup:_}=t.parameters,g=s.get("text-optional"),y=s.get("icon-optional"),x=e.ar(s,"text-overlap","text-allow-overlap"),v="always"===x,b=e.ar(s,"icon-overlap","icon-allow-overlap"),w="always"===b,T="map"===s.get("text-rotation-alignment"),S="map"===s.get("text-pitch-alignment"),I="none"!==s.get("icon-text-fit"),P="viewport-y"===s.get("symbol-z-order"),A=v&&(w||!n.hasIconData()||y),M=w&&(v||!n.hasTextData()||g);!n.collisionArrays&&f&&n.deserializeCollisionBoxes(f);const k=this._getTerrainElevationFunc(this.retainedQueryData[n.bucketInstanceId].tileID),C=(t,f,w)=>{var P,C;if(i[t.crossTileID])return;if(p)return void(this.placements[t.crossTileID]=new Nt(!1,!1,!1));let z=!1,E=!1,D=!0,L=null,R={box:null,placeable:!1,offscreen:null},B={box:null,placeable:!1,offscreen:null},F=null,O=null,V=null,N=0,j=0,U=0;f.textFeatureIndex?N=f.textFeatureIndex:t.useRuntimeCollisionCircles&&(N=t.featureIndex),f.verticalTextFeatureIndex&&(j=f.verticalTextFeatureIndex);const $=f.textBox;if($){const i=i=>{let r=e.ah.horizontal;if(n.allowVerticalPlacement&&!i&&this.prevPlacement){const e=this.prevPlacement.placedOrientations[t.crossTileID];e&&(this.placedOrientations[t.crossTileID]=e,r=e,this.markUsedOrientation(n,r,t))}return r},s=(i,r)=>{if(n.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&f.verticalTextBox){for(const t of n.writingModes)if(t===e.ah.vertical?(R=r(),B=R):R=i(),R&&R.placeable)break}else R=i()},h=t.textAnchorOffsetStartIndex,u=t.textAnchorOffsetEndIndex;if(u===h){const r=(e,i)=>{const r=this.collisionIndex.placeCollisionBox(e,x,d,l,c,S,T,a,_.predicate,k);return r&&r.placeable&&(this.markUsedOrientation(n,i,t),this.placedOrientations[t.crossTileID]=i),r};s(()=>r($,e.ah.horizontal),()=>{const i=f.verticalTextBox;return n.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&i?r(i,e.ah.vertical):{box:null,offscreen:null}}),i(R&&R.placeable)}else{let p=e.aq[null===(C=null===(P=this.prevPlacement)||void 0===P?void 0:P.variableOffsets[t.crossTileID])||void 0===C?void 0:C.anchor];const m=(i,s,f)=>{const m=i.x2-i.x1,g=i.y2-i.y1,y=t.textBoxScale,v=I&&"never"===b?s:null;let w=null,P="never"===x?1:2,A="never";p&&P++;for(let e=0;e<P;e++){for(let e=h;e<u;e++){const r=n.textAnchorOffsets.get(e);if(p&&r.textAnchor!==p)continue;const s=this.attemptAnchorPlacement(r,i,m,g,y,T,S,d,l,c,_,A,t,n,f,a,o,v,k);if(s&&(w=s.placedGlyphBoxes,w&&w.placeable))return z=!0,L=s.shift,w}p?p=null:A=x}return r&&!w&&(w={box:this.collisionIndex.placeCollisionBox($,"always",d,l,c,S,T,a,_.predicate,k,new e.P(0,0)).box,offscreen:!1,placeable:!1}),w};s(()=>m($,f.iconBox,e.ah.horizontal),()=>{const i=f.verticalTextBox;return n.allowVerticalPlacement&&(!R||!R.placeable)&&t.numVerticalGlyphVertices>0&&i?m(i,f.verticalIconBox,e.ah.vertical):{box:null,occluded:!0,offscreen:null}}
vendor: 6,847 bytes, line 313
313),R&&(z=R.placeable,D=R.offscreen);const g=i(R&&R.placeable);if(!z&&this.prevPlacement){const e=this.prevPlacement.variableOffsets[t.crossTileID];e&&(this.variableOffsets[t.crossTileID]=e,this.markUsedJustification(n,e.anchor,t,g))}}}if(F=R,z=F&&F.placeable,D=F&&F.offscreen,t.useRuntimeCollisionCircles){const i=n.text.placedSymbolArray.get(t.centerJustifiedTextSymbolIndex),o=e.ai(n.textSizeData,m,i),d=s.get("text-padding");O=this.collisionIndex.placeCollisionCircles(x,i,n.lineVertexArray,n.glyphOffsetArray,o,l,c,h,u,r,S,_.predicate,t.collisionCircleDiameter,d,a,k),O.circles.length&&O.collisionDetected&&!r&&e.w("Collisions detected, but collision boxes are not shown"),z=v||O.circles.length>0&&!O.collisionDetected,D=D&&O.offscreen}if(f.iconFeatureIndex&&(U=f.iconFeatureIndex),f.iconBox){const t=t=>this.collisionIndex.placeCollisionBox(t,b,d,l,c,S,T,o,_.predicate,k,I&&L?L:void 0);B&&B.placeable&&f.verticalIconBox?(V=t(f.verticalIconBox),E=V.placeable):(V=t(f.iconBox),E=V.placeable),D=D&&V.offscreen}const q=g||0===t.numHorizontalGlyphVertices&&0===t.numVerticalGlyphVertices,Z=y||0===t.numIconVertices;q||Z?Z?q||(E=E&&z):z=E&&z:E=z=E&&z;const G=E&&V.placeable;if(z&&F.placeable&&this.collisionIndex.insertCollisionBox(F.box,x,s.get("text-ignore-placement"),n.bucketInstanceId,B&&B.placeable&&j?j:N,_.ID),G&&this.collisionIndex.insertCollisionBox(V.box,b,s.get("icon-ignore-placement"),n.bucketInstanceId,U,_.ID),O&&z&&this.collisionIndex.insertCollisionCircles(O.circles,x,s.get("text-ignore-placement"),n.bucketInstanceId,N,_.ID),r&&this.storeCollisionData(n.bucketInstanceId,w,f,F,V,O),0===t.crossTileID)throw new Error("symbolInstance.crossTileID can't be 0");if(0===n.bucketInstanceId)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[t.crossTileID]=new Nt(z||A,E||M,D||n.justReloaded),i[t.crossTileID]=!0};if(P){if(0!==t.symbolInstanceStart)throw new Error("bucket.bucketInstanceId should be 0");const e=n.getSortedSymbolIndexes(this.transform.angle);for(let t=e.length-1;t>=0;--t){const i=e[t];C(n.symbolInstances.get(i),n.collisionArrays[i],i)}}else for(let e=t.symbolInstanceStart;e<t.symbolInstanceEnd;e++)C(n.symbolInstances.get(e),n.collisionArrays[e],e);if(r&&n.bucketInstanceId in this.collisionCircleArrays){const t=this.collisionCircleArrays[n.bucketInstanceId];e.as(t.invProjMatrix,l),t.viewportMatrix=this.collisionIndex.getViewportMatrix()}n.justReloaded=!1}storeCollisionData(t,e,i,r,n,s){if(i.textBox||i.iconBox){let s,a;this.collisionBoxArrays.has(t)?s=this.collisionBoxArrays.get(t):(s=new Map,this.collisionBoxArrays.set(t,s)),s.has(e)?a=s.get(e):(a={text:null,icon:null},s.set(e,a)),i.textBox&&(a.text=r.box),i.iconBox&&(a.icon=n.box)}if(s){let e=this.collisionCircleArrays[t];void 0===e&&(e=this.collisionCircleArrays[t]=new jt);for(let t=0;t<s.circles.length;t+=4)e.circles.push(s.circles[t+0]),e.circles.push(s.circles[t+1]),e.circles.push(s.circles[t+2]),e.circles.push(s.collisionDetected?1:0)}}markUsedJustification(t,i,r,n){let s;s=n===e.ah.vertical?r.verticalPlacedTextSymbolIndex:{left:r.leftJustifiedTextSymbolIndex,center:r.centerJustifiedTextSymbolIndex,right:r.rightJustifiedTextSymbolIndex}[e.at(i)];const a=[r.leftJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.rightJustifiedTextSymbolIndex,r.verticalPlacedTextSymbolIndex];for(const e of a)e>=0&&(t.text.placedSymbolArray.get(e).crossTileID=s>=0&&e!==s?0:r.crossTileID)}markUsedOrientation(t,i,r){const n=i===e.ah.horizontal||i===e.ah.horizontalOnly?i:0,s=i===e.ah.vertical?i:0,a=[r.leftJustifiedTextSymbolIndex,r.centerJustifiedTextSymbolIndex,r.rightJustifiedTextSymbolIndex];for(const e of a)t.text.placedSymbolArray.get(e).placedOrientation=n;r.verticalPlacedTextSymbolIndex&&(t.text.placedSymbolArray.get(r.verticalPlacedTextSymbolIndex).placedOrientation=s)}commit(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;const e=this.prevPlacement;let i=!1;this.prevZoomAdjustment=e?e.zoomAdjustment(this.transform.zoom):0;const r=e?e.symbolFadeChange(t):1,n=e?e.opacities:{},s=e?e.variableOffsets:{},a=e?e.placedOrientations:{};for(const t in this.placements){const e=this.placements[t],s=n[t];s?(this.opacities[t]=new Vt(s,r,e.text,e.icon),i=i||e.text!==s.text.placed||e.icon!==s.icon.placed):(this.opacities[t]=new Vt(null,r,e.text,e.icon,e.skipFade),i=i||e.text||e.icon)}for(const t in n){const e=n[t];if(!this.opacities[t]){const n=new Vt(e,r,!1,!1);n.isHidden()||(this.opacities[t]=n,i=i||e.text.placed||e.icon.placed)}}for(const t in s)this.variableOffsets[t]||!this.opacities[t]||this.opacities[t].isHidden()||(this.variableOffsets[t]=s[t]);for(const t in a)this.placedOrientations[t]||!this.opacities[t]||this.opacities[t].isHidden()||(this.placedOrientations[t]=a[t]);if(e&&void 0===e.lastPlacementChangeTime)throw new Error("Last placement time for previous placement is not defined");i?this.lastPlacementChangeTime=t:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=e?e.lastPlacementChangeTime:t)}updateLayerOpacities(t,e){const i={};for(const r of e){const e=r.getBucket(t);e&&r.latestFeatureIndex&&t.id===e.layerIds[0]&&this.updateBucketOpacities(e,r.tileID,i,r.collisionBoxArray)}}updateBucketOpacities(t,i,r,n){t.hasTextData()&&(t.text.opacityVertexArray.clear(),t.text.hasVisibleVertices=!1),t.hasIconData()&&(t.icon.opacityVertexArray.clear(),t.icon.hasVisibleVertices=!1),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexArray.clear(),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexArray.clear();const s=t.layers[0],a=s.layout,o=new Vt(null,0,!1,!1,!0),l=a.get("text-allow-overlap"),c=a.get("icon-allow-overlap"),h=s._unevaluatedLayout.hasValue("text-variable-anchor")||s._unevaluatedLayout.hasValue("text-variable-anchor-offset"),u="map"===a.get("text-rotation-alignment"),d="map"===a.get("text-pitch-alignment"),p="none"!==a.get("icon-text-fit"),f=new Vt(null,0,l&&(c||!t.hasIconData()||a.get("icon-optional")),c&&(l||!t.hasTextData()||a.get("text-optional")),!0);!t.collisionArrays&&n&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(n);const m=(t,e,i)=>{for(let r=0;r<e/4;r++)t.opacityVertexArray.emplaceBack(i);t.hasVisibleVertices=t.hasVisibleVertices||i!==ee},_=this.collisionBoxArrays.get(t.bucketInstanceId);for(let i=0;i<t.symbolInstances.length;i++){const n=t.symbolInstances.get(i),{numHorizontalGlyphVertices:s,numVerticalGlyphVertices:a,crossTileID:l}=n;let c=this.opacities[l];r[l]?c=o:c||(c=f,this.opacities[l]=c),r[l]=!0;const g=n.numIconVertices>0,y=this.placedOrientations[n.crossTileID],x=y===e.ah.vertical,v=y===e.ah.horizontal||y===e.ah.horizontalOnly;if(s>0||a>0){const e=te(c.text);m(t.text,s,x?ee:e),m(t.text,a,v?ee:e);const i=c.text.isHidden();[n.rightJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.leftJustifiedTextSymbolIndex].forEach(
vendor: 34,475 bytes, line 313
313e=>{e>=0&&(t.text.placedSymbolArray.get(e).hidden=i||x?1:0)}),n.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(n.verticalPlacedTextSymbolIndex).hidden=i||v?1:0);const r=this.variableOffsets[n.crossTileID];r&&this.markUsedJustification(t,r.anchor,n,y);const o=this.placedOrientations[n.crossTileID];o&&(this.markUsedJustification(t,"left",n,o),this.markUsedOrientation(t,o,n))}if(g){const e=te(c.icon),i=!(p&&n.verticalPlacedIconSymbolIndex&&x);n.placedIconSymbolIndex>=0&&(m(t.icon,n.numIconVertices,i?e:ee),t.icon.placedSymbolArray.get(n.placedIconSymbolIndex).hidden=c.icon.isHidden()),n.verticalPlacedIconSymbolIndex>=0&&(m(t.icon,n.numVerticalIconVertices,i?ee:e),t.icon.placedSymbolArray.get(n.verticalPlacedIconSymbolIndex).hidden=c.icon.isHidden())}const b=_&&_.has(i)?_.get(i):{text:null,icon:null};if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){const r=t.collisionArrays[i];if(r){let i=new e.P(0,0);if(r.textBox||r.verticalTextBox){let e=!0;if(h){const t=this.variableOffsets[l];t?(i=qt(t.anchor,t.width,t.height,t.textOffset,t.textBoxScale),u&&i._rotate(d?this.transform.angle:-this.transform.angle)):e=!1}if(r.textBox||r.verticalTextBox){let n;r.textBox&&(n=x),r.verticalTextBox&&(n=v),Gt(t.textCollisionBox.collisionVertexArray,c.text.placed,!e||n,b.text,i.x,i.y)}}if(r.iconBox||r.verticalIconBox){const e=Boolean(!v&&r.verticalIconBox);let n;r.iconBox&&(n=e),r.verticalIconBox&&(n=!e),Gt(t.iconCollisionBox.collisionVertexArray,c.icon.placed,n,b.icon,p?i.x:0,p?i.y:0)}}}}if(t.sortFeatures(this.transform.angle),this.retainedQueryData[t.bucketInstanceId]&&(this.retainedQueryData[t.bucketInstanceId].featureSortOrder=t.featureSortOrder),t.hasTextData()&&t.text.opacityVertexBuffer&&t.text.opacityVertexBuffer.updateData(t.text.opacityVertexArray),t.hasIconData()&&t.icon.opacityVertexBuffer&&t.icon.opacityVertexBuffer.updateData(t.icon.opacityVertexArray),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexBuffer&&t.iconCollisionBox.collisionVertexBuffer.updateData(t.iconCollisionBox.collisionVertexArray),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexBuffer&&t.textCollisionBox.collisionVertexBuffer.updateData(t.textCollisionBox.collisionVertexArray),t.text.opacityVertexArray.length!==t.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${t.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${t.text.layoutVertexArray.length}) / 4`);if(t.icon.opacityVertexArray.length!==t.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${t.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${t.icon.layoutVertexArray.length}) / 4`);if(t.bucketInstanceId in this.collisionCircleArrays){const e=this.collisionCircleArrays[t.bucketInstanceId];t.placementInvProjMatrix=e.invProjMatrix,t.placementViewportMatrix=e.viewportMatrix,t.collisionCircleArray=e.circles,delete this.collisionCircleArrays[t.bucketInstanceId]}}symbolFadeChange(t){return 0===this.fadeDuration?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(t){return Math.max(0,(this.transform.zoom-t)/1.5)}hasTransitions(t){return this.stale||t-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(t,e){const i=this.zoomAtLastRecencyCheck===e?1-this.zoomAdjustment(e):1;return this.zoomAtLastRecencyCheck=e,this.commitTime+this.fadeDuration*i>t}setStale(){this.stale=!0}}function Gt(t,e,i,r,n,s){r&&0!==r.length||(r=[0,0,0,0]);const a=r[0]-Rt,o=r[1]-Rt,l=r[2]-Rt,c=r[3]-Rt;t.emplaceBack(e?1:0,i?1:0,n||0,s||0,a,o),t.emplaceBack(e?1:0,i?1:0,n||0,s||0,l,o),t.emplaceBack(e?1:0,i?1:0,n||0,s||0,l,c),t.emplaceBack(e?1:0,i?1:0,n||0,s||0,a,c)}const Ht=Math.pow(2,25),Xt=Math.pow(2,24),Wt=Math.pow(2,17),Kt=Math.pow(2,16),Jt=Math.pow(2,9),Yt=Math.pow(2,8),Qt=Math.pow(2,1);function te(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;const e=t.placed?1:0,i=Math.floor(127*t.opacity);return i*Ht+e*Xt+i*Wt+e*Kt+i*Jt+e*Yt+i*Qt+e}const ee=0;function ie(){return{isOccluded:(t,e,i)=>!1,getPitchedTextCorrection:(t,e,i)=>1,get useSpecialProjectionForSymbols(){return!1},projectTileCoordinates(t,e,i,r){throw new Error("Not implemented.")},translatePosition:(t,e,i,r)=>function(t,e,i,r,n=!1){if(!i[0]&&!i[1])return[0,0];const s=n?"map"===r?t.angle:0:"viewport"===r?-t.angle:0;if(s){const t=Math.sin(s),e=Math.cos(s);i=[i[0]*e-i[1]*t,i[0]*t+i[1]*e]}return[n?i[0]:Ft(e,i[0],t.zoom),n?i[1]:Ft(e,i[1],t.zoom)]}(t,e,i,r),getCircleRadiusCorrection:t=>1}}class re{constructor(t){this._sortAcrossTiles="viewport-y"!==t.layout.get("symbol-z-order")&&!t.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(t,e,i,r,n){const s=this._bucketParts;for(;this._currentTileIndex<t.length;)if(e.getBucketParts(s,r,t[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,n())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,s.sort((t,e)=>t.sortKey-e.sortKey));this._currentPartIndex<s.length;)if(e.placeLayerBucketPart(s[this._currentPartIndex],this._seenCrossTileIDs,i),this._currentPartIndex++,n())return!0;return!1}}class ne{constructor(t,e,i,r,n,s,a,o){this.placement=new Zt(t,ie(),e,s,a,o),this._currentPlacementIndex=i.length-1,this._forceFullPlacement=r,this._showCollisionBoxes=n,this._done=!1}isDone(){return this._done}continuePlacement(t,e,i){const r=s.now(),n=()=>!this._forceFullPlacement&&s.now()-r>2;for(;this._currentPlacementIndex>=0;){const r=e[t[this._currentPlacementIndex]],s=this.placement.collisionIndex.transform.zoom;if("symbol"===r.type&&(!r.minzoom||r.minzoom<=s)&&(!r.maxzoom||r.maxzoom>s)){if(this._inProgressLayer||(this._inProgressLayer=new re(r)),this._inProgressLayer.continuePlacement(i[r.source],this.placement,this._showCollisionBoxes,r,n))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(t){return this.placement.commit(t),this.placement}}const se=512/e.X/2;class ae{constructor(t,i,r){this.tileID=t,this.bucketInstanceId=r,this._symbolsByKey={};const n=new Map;for(let t=0;t<i.length;t++){const e=i.get(t),r=e.key,s=n.get(r);s?s.push(e):n.set(r,[e])}for(const[t,i]of n){const r={positions:i.map(t=>({x:Math.floor(t.anchorX*se),y:Math.floor(t.anchorY*se)})),crossTileIDs:i.map(t=>t.crossTileID)};if(r.positions.length>128){const t=new e.av(r.positions.length,16,Uint16Array);for(const{x:e,y:i}of r.positions)t.add(e,i);t.finish(),delete r.positions,r.index=t}this._symbolsByKey[t]=r}}getScaledCoordinates(t,i){const{x:r,y:n,z:s}=this.tileID.canonical,{x:a,y:o,z:l}=i.canonical,c=se/Math.pow(2,l-s),h=(o*e.X+t.anchorY)*c,u=n*e.X*se;return{x:Math.floor((a*e.X+t.anchorX)*c-r*e.X*se),y:Math.floor(h-u)}}findMatches(t,e,i){const r=this.tileID.canonical.z<e.canonical.z?1:Math.pow(2,this.tileID.canonical.z-e.canonical.z);for(let n=0;n<t.length;n++){const s=t.get(n);if(s.crossTileID)continue;const a=this._symbolsByKey[s.key];if(!a)continue;const o=this.getScaledCoordinates(s,e);if(a.index){const t=a.index.range(o.x-r,o.y-r,o.x+r,o.y+r).sort();for(const e of t){const t=a.crossTileIDs[e];if(!i[t]){i[t]=!0,s.crossTileID=t;break}}}else if(a.positions)for(let t=0;t<a.positions.length;t++){const e=a.positions[t],n=a.crossTileIDs[t];if(Math.abs(e.x-o.x)<=r&&Math.abs(e.y-o.y)<=r&&!i[n]){i[n]=!0,s.crossTileID=n;break}}}}getCrossTileIDsLists(){return Object.values(this._symbolsByKey).map(({crossTileIDs:t})=>t)}}class oe{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class le{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(t){const e=Math.round((t-this.lng)/360);if(0!==e)for(const t in this.indexes){const i=this.indexes[t],r={};for(const t in i){const n=i[t];n.tileID=n.tileID.unwrapTo(n.tileID.wrap+e),r[n.tileID.key]=n}this.indexes[t]=r}this.lng=t}addBucket(t,e,i){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===e.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(let t=0;t<e.symbolInstances.length;t++)e.symbolInstances.get(t).crossTileID=0;this.usedCrossTileIDs[t.overscaledZ]||(this.usedCrossTileIDs[t.overscaledZ]={});const r=this.usedCrossTileIDs[t.overscaledZ];for(const i in this.indexes){const n=this.indexes[i];if(Number(i)>t.overscaledZ)for(const i in n){const s=n[i];s.tileID.isChildOf(t)&&s.findMatches(e.symbolInstances,t,r)}else{const s=n[t.scaledTo(Number(i)).key];s&&s.findMatches(e.symbolInstances,t,r)}}for(let t=0;t<e.symbolInstances.length;t++){const n=e.symbolInstances.get(t);n.crossTileID||(n.crossTileID=i.generate(),r[n.crossTileID]=!0)}return void 0===this.indexes[t.overscaledZ]&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new ae(t,e.symbolInstances,e.bucketInstanceId),!0}removeBucketCrossTileIDs(t,e){for(const i of e.getCrossTileIDsLists())for(const e of i)delete this.usedCrossTileIDs[t][e]}removeStaleBuckets(t){let e=!1;for(const i in this.indexes){const r=this.indexes[i];for(const n in r)t[r[n].bucketInstanceId]||(this.removeBucketCrossTileIDs(i,r[n]),delete r[n],e=!0)}return e}}class ce{constructor(){this.layerIndexes={},this.crossTileIDs=new oe,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(t,e,i){let r=this.layerIndexes[t.id];void 0===r&&(r=this.layerIndexes[t.id]=new le);let n=!1;const s={};r.handleWrapJump(i);for(const i of e){const e=i.getBucket(t);e&&t.id===e.layerIds[0]&&(e.bucketInstanceId||(e.bucketInstanceId=++this.maxBucketInstanceId),r.addBucket(i.tileID,e,this.crossTileIDs)&&(n=!0),s[e.bucketInstanceId]=!0)}return r.removeStaleBuckets(s)&&(n=!0),n}pruneUnusedLayers(t){const e={};t.forEach(t=>{e[t]=!0});for(const t in this.layerIndexes)e[t]||delete this.layerIndexes[t]}}const he=(t,i)=>e.t(t,i&&i.filter(t=>"source.canvas"!==t.identifier)),ue=e.aw();class de extends e.E{constructor(t,i={}){super(),this._rtlPluginLoaded=()=>{for(const t in this.sourceCaches){const e=this.sourceCaches[t].getSource().type;"vector"!==e&&"geojson"!==e||this.sourceCaches[t].reload()}},this.map=t,this.dispatcher=new N(V(),t._getMapId()),this.dispatcher.registerMessageHandler("GG",(t,e)=>this.getGlyphs(t,e)),this.dispatcher.registerMessageHandler("GI",(t,e)=>this.getImages(t,e)),this.imageManager=new T,this.imageManager.setEventedParent(this),this.glyphManager=new A(t._requestManager,i.localIdeographFontFamily),this.lineAtlas=new D(256,512),this.crossTileSymbolIndex=new ce,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new e.ax,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("SR",e.ay()),ot().on(nt,this._rtlPluginLoaded),this.on("data",t=>{if("source"!==t.dataType||"metadata"!==t.sourceDataType)return;const e=this.sourceCaches[t.sourceId];if(!e)return;const i=e.getSource();if(i&&i.vectorLayerIds)for(const t in this._layers){const e=this._layers[t];e.source===i.id&&this._validateLayer(e)}})}loadURL(t,i={},r){this.fire(new e.k("dataloading",{dataType:"style"})),i.validate="boolean"!=typeof i.validate||i.validate;const n=this.map._requestManager.transformRequest(t,"Style");this._loadStyleRequest=new AbortController;const s=this._loadStyleRequest;e.h(n,this._loadStyleRequest).then(t=>{this._loadStyleRequest=null,this._load(t.data,i,r)})["catch"](t=>{this._loadStyleRequest=null,t&&!s.signal.aborted&&this.fire(new e.j(t))})}loadJSON(t,i={},r){this.fire(new e.k("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,s.frameAsync(this._frameRequest).then(()=>{this._frameRequest=null,i.validate=!1!==i.validate,this._load(t,i,r)})["catch"](()=>{})}loadEmpty(){this.fire(new e.k("dataloading",{dataType:"style"})),this._load(ue,{validate:!1})}_load(t,i,r){var n;const s=i.transformStyle?i.transformStyle(r,t):t;if(!i.validate||!he(this,e.u(s))){this._loaded=!0,this.stylesheet=s;for(const t in s.sources)this.addSource(t,s.sources[t],{validate:!1});s.sprite?this._loadSprite(s.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(s.glyphs),this._createLayers(),this.light=new C(this.stylesheet.light),this.sky=new E(this.stylesheet.sky),this.map.setTerrain(null!==(n=this.stylesheet.terrain)&&void 0!==n?n:null),this.fire(new e.k("data",{dataType:"style"})),this.fire(new e.k("style.load"))}}_createLayers(){const t=e.az(this.stylesheet.layers);this.dispatcher.broadcast("SL",t),this._order=t.map(t=>t.id),this._layers={},this._serializedLayers=null;for(const i of t){const t=e.aA(i);t.setEventedParent(this,{layer:{id:i.id}}),this._layers[i.id]=t}}_loadSprite(t,i=!1,r=void 0){let n;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,function(t,i,r,n){return e._(this,void 0,void 0,function*(){const a=x(t),o=r>1?"@2x":"",l={},c={};for(const{id:t,url:r}of a){const s=i.transformRequest(v(r,o,".json"),"SpriteJSON");l[t]=e.h(s,n);const a=i.transformRequest(v(r,o,".png"),"SpriteImage");c[t]=p.getImage(a,n)}return yield Promise.all([...Object.values(l),...Object.values(c)]),function(t,i){return e._(this,void 0,void 0,function*(){const e={};for(const r in t){e[r]={};const n=s.getImageCanvasContext((yield i[r]).data),a=(yield t[r]).data;for(const t in a){const{width:i,height:s,x:o,y:l,sdf:c,pixelRatio:h,stretchX:u,stretchY:d,content:p,textFitWidth:f,textFitHeight:m}=a[t];e[r][t]={data:null,pixelRatio:h,sdf:c,stretchX:u,stretchY:d,content:p,textFitWidth:f,textFitHeight:m,spriteData:{width:i,height:s,x:o,y:l,context:n}}}}return e})}(l,c)})}(t,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then(t=>{if(this._spriteRequest=null,t)for(const e in t){this._spritesImagesIds[e]=[];const r=this._spritesImagesIds[e]?this._spritesImagesIds[e].filter(e=>!(e in t)):[];for(const t of r)this.imageManager.removeImage(t),this._changedImages[t]=!0;for(const r in t[e]){const n="default"===e?r:`${e}:${r}`;this._spritesImagesIds[e].push(n),n in this.imageManager.images?this.imageManager.updateImage(n,t[e][r],!1):this.imageManager.addImage(n,t[e][r]),i&&(this._changedImages[n]=!0)}}})["catch"](t=>{this._spriteRequest=null,n=t,this.fire(new e.j(n))})["finally"](()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),i&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new e.k("data",{dataType:"style"})),r&&r(n)})}_unloadSprite(){for(const t of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(t),this._changedImages[t]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new e.k("data",{dataType:"style"}))}_validateLayer(t){const i=this.sourceCaches[t.source];if(!i)return;const r=t.sourceLayer;if(!r)return;const n=i.getSource();("geojson"===n.type||n.vectorLayerIds&&-1===n.vectorLayerIds.indexOf(r))&&this.fire(new e.j(new Error(`Source layer "${r}" does not exist on source "${n.id}" as specified by style layer "${t.id}".`)))}loaded(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(const t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(t,i=!1){const r=this._serializedAllLayers();if(!t||0===t.length)return Object.values(i?e.aB(r):r);const n=[];for(const s of t)if(r[s]){const t=i?e.aB(r[s]):r[s];n.push(t)}return n}_serializedAllLayers(){let t=this._serializedLayers;if(t)return t;t=this._serializedLayers={};const e=Object.keys(this._layers);for(const i of e){const e=this._layers[i];"custom"!==e.type&&(t[i]=e.serialize())}return t}hasTransitions(){if(this.light&&this.light.hasTransition())return!0;if(this.sky&&this.sky.hasTransition())return!0;for(const t in this.sourceCaches)if(this.sourceCaches[t].hasTransition())return!0;for(const t in this._layers)if(this._layers[t].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(t){if(!this._loaded)return;const i=this._changed;if(i){const e=Object.keys(this._updatedLayers),i=Object.keys(this._removedLayers);(e.length||i.length)&&this._updateWorkerLayers(e,i);for(const t in this._updatedSources){const e=this._updatedSources[t];if("reload"===e)this._reloadSource(t);else{if("clear"!==e)throw new Error(`Invalid action ${e}`);this._clearSource(t)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const e in this._updatedPaintProps)this._layers[e].updateTransitions(t);this.light.updateTransitions(t),this.sky.updateTransitions(t),this._resetUpdates()}const r={};for(const t in this.sourceCaches){const e=this.sourceCaches[t];r[t]=e.used,e.used=!1}for(const e of this._order){const i=this._layers[e];i.recalculate(t,this._availableImages),!i.isHidden(t.zoom)&&i.source&&(this.sourceCaches[i.source].used=!0)}for(const t in r){const i=this.sourceCaches[t];!!r[t]!=!!i.used&&i.fire(new e.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:t}))}this.light.recalculate(t),this.sky.recalculate(t),this.z=t.zoom,i&&this.fire(new e.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){const t=Object.keys(this._changedImages);if(t.length){for(const e in this.sourceCaches)this.sourceCaches[e].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const t in this.sourceCaches)this.sourceCaches[t].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(t,e){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(t,!1),removedIds:e})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(t,i={}){var r;this._checkLoaded();const n=this.serialize();if(t=i.transformStyle?i.transformStyle(n,t):t,(null===(r=i.validate)||void 0===r||r)&&he(this,e.u(t)))return!1;(t=e.aB(t)).layers=e.az(t.layers);const s=e.aC(n,t),a=this._getOperationsToPerform(s);if(a.unimplemented.length>0)throw new Error(`Unimplemented: ${a.unimplemented.join(", ")}.`);if(0===a.operations.length)return!1;for(const t of a.operations)t();return this.stylesheet=t,this._serializedLayers=null,!0}_getOperationsToPerform(t){const e=[],i=[];for(const r of t)switch(r.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":continue;case"addLayer":e.push(()=>this.addLayer.apply(this,r.args));break;case"removeLayer":e.push(()=>this.removeLayer.apply(this,r.args));break;case"setPaintProperty":e.push(()=>this.setPaintProperty.apply(this,r.args));break;case"setLayoutProperty":e.push(()=>this.setLayoutProperty.apply(this,r.args));break;case"setFilter":e.push(()=>this.setFilter.apply(this,r.args));break;case"addSource":e.push(()=>this.addSource.apply(this,r.args));break;case"removeSource":e.push(()=>this.removeSource.apply(this,r.args));break;case"setLayerZoomRange":e.push(()=>this.setLayerZoomRange.apply(this,r.args));break;case"setLight":e.push(()=>this.setLight.apply(this,r.args));break;case"setGeoJSONSourceData":e.push(()=>this.setGeoJSONSourceData.apply(this,r.args));break;case"setGlyphs":e.push(()=>this.setGlyphs.apply(this,r.args));break;case"setSprite":e.push(()=>this.setSprite.apply(this,r.args));break;case"setSky":e.push(()=>this.setSky.apply(this,r.args));break;case"setTerrain":e.push(()=>this.map.setTerrain.apply(this,r.args));break;case"setTransition":e.push(()=>{});break;default:i.push(r.command)}return{operations:e,unimplemented:i}}addImage(t,i){if(this.getImage(t))return this.fire(new e.j(new Error(`An image named "${t}" already exists.`)));this.imageManager.addImage(t,i),this._afterImageUpdated(t)}updateImage(t,e){this.imageManager.updateImage(t,e)}getImage(t){return this.imageManager.getImage(t)}removeImage(t){if(!this.getImage(t))return this.fire(new e.j(new Error(`An image named "${t}" does not exist.`)));this.imageManager.removeImage(t),this._afterImageUpdated(t)}_afterImageUpdated(t){this._availableImages=this.imageManager.listImages(),this._changedImages[t]=!0,this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new e.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(t,i,r={}){if(this._checkLoaded(),void 0!==this.sourceCaches[t])throw new Error(`Source "${t}" already exists.`);if(!i.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(i).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(i.type)>=0&&this._validate(e.u.source,`sources.${t}`,i,null,r))return;this.map&&this.map._collectResourceTiming&&(i.collectResourceTiming=!0);const n=this.sourceCaches[t]=new ut(t,i,this.dispatcher);n.style=this,n.setEventedParent(this,()=>({isSourceLoaded:n.loaded(),source:n.serialize(),sourceId:t})),n.onAdd(this.map),this._changed=!0}removeSource(t){if(this._checkLoaded(),void 0===this.sourceCaches[t])throw new Error("There is no source with this ID");for(const i in this._layers)if(this._layers[i].source===t)return this.fire(new e.j(new Error(`Source "${t}" cannot be removed while layer "${i}" is using it.`)));const i=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],i.fire(new e.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),i.setEventedParent(null),i.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(t,e){if(this._checkLoaded(),void 0===this.sourceCaches[t])throw new Error(`There is no source with this ID=${t}`);const i=this.sourceCaches[t].getSource();if("geojson"!==i.type)throw new Error(`geojsonSource.type is ${i.type}, which is !== 'geojson`);i.setData(e),this._changed=!0}getSource(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()}addLayer(t,i,r={}){this._checkLoaded();const n=t.id;if(this.getLayer(n))return void this.fire(new e.j(new Error(`Layer "${n}" already exists on this map.`)));let s;if("custom"===t.type){if(he(this,e.aD(t)))return;s=e.aA(t)}else{if("source"in t&&"object"==typeof t.source&&(this.addSource(n,t.source),t=e.aB(t),t=e.e(t,{source:n})),this._validate(e.u.layer,`layers.${n}`,t,{arrayIndex:-1},r))return;s=e.aA(t),this._validateLayer(s),s.setEventedParent(this,{layer:{id:n}})}const a=i?this._order.indexOf(i):this._order.length;if(i&&-1===a)this.fire(new e.j(new Error(`Cannot add layer "${n}" before non-existing layer "${i}".`)));else{if(this._order.splice(a,0,n),this._layerOrderChanged=!0,this._layers[n]=s,this._removedLayers[n]&&s.source&&"custom"!==s.type){const t=this._removedLayers[n];delete this._removedLayers[n],t.type!==s.type?this._updatedSources[s.source]="clear":(this._updatedSources[s.source]="reload",this.sourceCaches[s.source].pause())}this._updateLayer(s),s.onAdd&&s.onAdd(this.map)}}moveLayer(t,i){if(this._checkLoaded(),this._changed=!0,!this._layers[t])return void this.fire(new e.j(new Error(`The layer '${t}' does not exist in the map's style and cannot be moved.`)));if(t===i)return;const r=this._order.indexOf(t);this._order.splice(r,1);const n=i?this._order.indexOf(i):this._order.length;i&&-1===n?this.fire(new e.j(new Error(`Cannot move layer "${t}" before non-existing layer "${i}".`))):(this._order.splice(n,0,t),this._layerOrderChanged=!0)}removeLayer(t){this._checkLoaded();const i=this._layers[t];if(!i)return void this.fire(new e.j(new Error(`Cannot remove non-existing layer "${t}".`)));i.setEventedParent(null);const r=this._order.indexOf(t);this._order.splice(r,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=i,delete this._layers[t],this._serializedLayers&&delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],i.onRemove&&i.onRemove(this.map)}getLayer(t){return this._layers[t]}getLayersOrder(){return[...this._order]}hasLayer(t){return t in this._layers}setLayerZoomRange(t,i,r){this._checkLoaded();const n=this.getLayer(t);n?n.minzoom===i&&n.maxzoom===r||(null!=i&&(n.minzoom=i),null!=r&&(n.maxzoom=r),this._updateLayer(n)):this.fire(new e.j(new Error(`Cannot set the zoom range of non-existing layer "${t}".`)))}setFilter(t,i,r={}){this._checkLoaded();const n=this.getLayer(t);if(n){if(!e.aE(n.filter,i))return null==i?(n.filter=void 0,void this._updateLayer(n)):void(this._validate(e.u.filter,`layers.${n.id}.filter`,i,null,r)||(n.filter=e.aB(i),this._updateLayer(n)))}else this.fire(new e.j(new Error(`Cannot filter non-existing layer "${t}".`)))}getFilter(t){return e.aB(this.getLayer(t).filter)}setLayoutProperty(t,i,r,n={}){this._checkLoaded();const s=this.getLayer(t);s?e.aE(s.getLayoutProperty(i),r)||(s.setLayoutProperty(i,r,n),this._updateLayer(s)):this.fire(new e.j(new Error(`Cannot style non-existing layer "${t}".`)))}getLayoutProperty(t,i){const r=this.getLayer(t);if(r)return r.getLayoutProperty(i);this.fire(new e.j(new Error(`Cannot get style of non-existing layer "${t}".`)))}setPaintProperty(t,i,r,n={}){this._checkLoaded();const s=this.getLayer(t);s?e.aE(s.getPaintProperty(i),r)||(s.setPaintProperty(i,r,n)&&this._updateLayer(s),this._changed=!0,this._updatedPaintProps[t]=!0,this._serializedLayers=null):this.fire(new e.j(new Error(`Cannot style non-existing layer "${t}".`)))}getPaintProperty(t,e){return this.getLayer(t).getPaintProperty(e)}setFeatureState(t,i){this._checkLoaded();const r=t.source,n=t.sourceLayer,s=this.sourceCaches[r];if(void 0===s)return void this.fire(new e.j(new Error(`The source '${r}' does not exist in the map's style.`)));const a=s.getSource().type;"geojson"===a&&n?this.fire(new e.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==a||n?(void 0===t.id&&this.fire(new e.j(new Error("The feature id parameter must be provided."))),s.setFeatureState(n,t.id,i)):this.fire(new e.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(t,i){this._checkLoaded();const r=t.source,n=this.sourceCaches[r];if(void 0===n)return void this.fire(new e.j(new Error(`The source '${r}' does not exist in the map's style.`)));const s=n.getSource().type,a="vector"===s?t.sourceLayer:void 0;"vector"!==s||a?i&&"string"!=typeof t.id&&"number"!=typeof t.id?this.fire(new e.j(new Error("A feature id is required to remove its specific state property."))):n.removeFeatureState(a,t.id,i):this.fire(new e.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(t){this._checkLoaded();const i=t.source,r=t.sourceLayer,n=this.sourceCaches[i];if(void 0!==n)return"vector"!==n.getSource().type||r?(void 0===t.id&&this.fire(new e.j(new Error("The feature id parameter must be provided."))),n.getFeatureState(r,t.id)):void this.fire(new e.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new e.j(new Error(`The source '${i}' does not exist in the map's style.`)))}getTransition(){return e.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;const t=e.aF(this.sourceCaches,t=>t.serialize()),i=this._serializeByIds(this._order,!0),r=this.map.getTerrain()||void 0,n=this.stylesheet;return e.aG({version:n.version,name:n.name,metadata:n.metadata,light:n.light,sky:n.sky,center:n.center,zoom:n.zoom,bearing:n.bearing,pitch:n.pitch,sprite:n.sprite,glyphs:n.glyphs,transition:n.transition,sources:t,layers:i,terrain:r},t=>void 0!==t)}_updateLayer(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&"raster"!==this.sourceCaches[t.source].getSource().type&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(t){const e=t=>"fill-extrusion"===this._layers[t].type,i={},r=[];for(let n=this._order.length-1;n>=0;n--){const s=this._order[n];if(e(s)){i[s]=n;for(const e of t){const t=e[s];if(t)for(const e of t)r.push(e)}}}r.sort((t,e)=>e.intersectionZ-t.intersectionZ);const n=[];for(let s=this._order.length-1;s>=0;s--){const a=this._order[s];if(e(a))for(let t=r.length-1;t>=0;t--){const e=r[t].feature;if(i[e.layer.id]<s)break;n.push(e),r.pop()}else for(const e of t){const t=e[a];if(t)for(const e of t)n.push(e.feature)}}return n}queryRenderedFeatures(t,i,r){i&&i.filter&&this._validate(e.u.filter,"queryRenderedFeatures.filter",i.filter,null,i);const n={};if(i&&i.layers){if(!Array.isArray(i.layers))return this.fire(new e.j(new Error("parameters.layers must be an Array."))),[];for(const t of i.layers){const i=this._layers[t];if(!i)return this.fire(new e.j(new Error(`The layer '${t}' does not exist in the map's style and cannot be queried for features.`))),[];n[i.source]=!0}}const s=[];i.availableImages=this._availableImages;const a=this._serializedAllLayers();for(const e in this.sourceCaches)i.layers&&!n[e]||s.push($(this.sourceCaches[e],this._layers,a,t,i,r));return this.placement&&s.push(function(t,e,i,r,n,s,a){const o={},l=s.queryRenderedSymbols(r),c=[];for(const t of Object.keys(l).map(Number))c.push(a[t]);c.sort(q);for(const i of c){const r=i.featureIndex.lookupSymbolFeatures(l[i.bucketInstanceId],e,i.bucketIndex,i.sourceLayerIndex,n.filter,n.layers,n.availableImages,t);for(const t in r){const e=o[t]=o[t]||[],n=r[t];n.sort((t,e)=>{const r=i.featureSortOrder;if(r){const i=r.indexOf(t.featureIndex);return r.indexOf(e.featureIndex)-i}return e.featureIndex-t.featureIndex});for(const t of n)e.push(t)}}for(const e in o)o[e].forEach(r=>{const n=r.feature,s=i[t[e].source].getFeatureState(n.layer["source-layer"],n.id);n.source=n.layer.source,n.layer["source-layer"]&&(n.sourceLayer=n.layer["source-layer"]),n.state=s});return o}(this._layers,a,this.sourceCaches,t,i,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(s)}querySourceFeatures(t,i){i&&i.filter&&this._validate(e.u.filter,"querySourceFeatures.filter",i.filter,null,i);const r=this.sourceCaches[t];return r?function(t,e){const i=t.getRenderableIds().map(e=>t.getTileByID(e)),r=[],n={};for(let t=0;t<i.length;t++){const s=i[t],a=s.tileID.canonical.key;n[a]||(n[a]=!0,s.querySourceFeatures(r,e))}return r}(r,i):[]}getLight(){return this.light.getLight()}setLight(t,i={}){this._checkLoaded();const r=this.light.getLight();let n=!1;for(const i in t)if(!e.aE(t[i],r[i])){n=!0;break}if(!n)return;const a={now:s.now(),transition:e.e({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(t,i),this.light.updateTransitions(a)}getSky(){var t;return null===(t=this.stylesheet)||void 0===t?void 0:t.sky}setSky(t,i={}){const r=this.getSky();let n=!1;if(!t&&!r)return;if(t&&!r)n=!0;else if(!t&&r)n=!0;else for(const i in t)if(!e.aE(t[i],r[i])){n=!0;break}if(!n)return;const a={now:s.now(),transition:e.e({duration:300,delay:0},this.stylesheet.transition)};this.stylesheet.sky=t,this.sky.setSky(t,i),this.sky.updateTransitions(a)}_validate(t,i,r,n,s={}){return(!s||!1!==s.validate)&&he(this,t.call(e.u,e.e({key:i,style:this.serialize(),value:r,styleSpec:e.v},n)))}_remove(t=!0){this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._loadStyleRequest&&(this._loadStyleRequest.abort(),this._loadStyleRequest=null),this._spriteRequest&&(this._spriteRequest.abort(),this._spriteRequest=null),ot().off(nt,this._rtlPluginLoaded);for(const t in this._layers)this._layers[t].setEventedParent(null);for(const t in this.sourceCaches){const e=this.sourceCaches[t];e.setEventedParent(null),e.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),t&&this.dispatcher.broadcast("RM",void 0),this.dispatcher.remove(t)}_clearSource(t){this.sourceCaches[t].clearTiles()}_reloadSource(t){this.sourceCaches[t].resume(),this.sourceCaches[t].reload()}_updateSources(t){for(const e in this.sourceCaches)this.sourceCaches[e].update(t,this.map.terrain)}_generateCollisionBoxes(){for(const t in this.sourceCaches)this._reloadSource(t)}_updatePlacement(t,e,i,r,n=!1){let a=!1,o=!1;const l={};for(const e of this._order){const i=this._layers[e];if("symbol"!==i.type)continue;if(!l[i.source]){const t=this.sourceCaches[i.source];l[i.source]=t.getRenderableIds(!0).map(e=>t.getTileByID(e)).sort((t,e)=>e.tileID.overscaledZ-t.tileID.overscaledZ||(t.tileID.isLessThan(e.tileID)?-1:1))}const r=this.crossTileSymbolIndex.addLayer(i,l[i.source],t.center.lng);a=a||r}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((n=n||this._layerOrderChanged||0===i)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(s.now(),t.zoom))&&(this.pauseablePlacement=new ne(t,this.map.terrain,this._order,n,e,i,r,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,l),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(s.now()),o=!0),a&&this.pauseablePlacement.placement.setStale()),o||a)for(const t of this._order){const e=this._layers[t];"symbol"===e.type&&this.placement.updateLayerOpacities(e,l[e.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(s.now())}_releaseSymbolFadeTiles(){for(const t in this.sourceCaches)this.sourceCaches[t].releaseSymbolFadeTiles()}getImages(t,i){return e._(this,void 0,void 0,function*(){const t=yield this.imageManager.getImages(i.icons);this._updateTilesForChangedImages();const e=this.sourceCaches[i.source];return e&&e.setDependencies(i.tileID.key,i.type,i.icons),t})}getGlyphs(t,i){return e._(this,void 0,void 0,function*(){const t=yield this.glyphManager.getGlyphs(i.stacks),e=this.sourceCaches[i.source];return e&&e.setDependencies(i.tileID.key,i.type,[""]),t})}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(t,i={}){this._checkLoaded(),t&&this._validate(e.u.glyphs,"glyphs",t,null,i)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=t,this.glyphManager.entries={},this.glyphManager.setURL(t))}addSprite(t,i,r={},n){this._checkLoaded();const s=[{id:t,url:i}],a=[...x(this.stylesheet.sprite),...s];this._validate(e.u.sprite,"sprite",a,null,r)||(this.stylesheet.sprite=a,this._loadSprite(s,!0,n))}removeSprite(t){this._checkLoaded();const i=x(this.stylesheet.sprite);if(i.find(e=>e.id===t)){if(this._spritesImagesIds[t])for(const e of this._spritesImagesIds[t])this.imageManager.removeImage(e),this._changedImages[e]=!0;i.splice(i.findIndex(e=>e.id===t
vendor: 61,045 bytes, line 313
313),1),this.stylesheet.sprite=i.length>0?i:void 0,delete this._spritesImagesIds[t],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new e.k("data",{dataType:"style"}))}else this.fire(new e.j(new Error(`Sprite "${t}" doesn't exists on this map.`)))}getSprite(){return x(this.stylesheet.sprite)}setSprite(t,i={},r){this._checkLoaded(),t&&this._validate(e.u.sprite,"sprite",t,null,i)||(this.stylesheet.sprite=t,t?this._loadSprite(t,!0,r):(this._unloadSprite(),r&&r(null)))}}var pe=e.Y([{name:"a_pos",type:"Int16",components:2}]);const fe={prelude:me("#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\n","#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}\n#ifdef TERRAIN3D\nuniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth;\n#endif\nconst highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) {\n#ifdef TERRAIN3D\nhighp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0));\n#else\nreturn 1.0;\n#endif\n}float calculate_visibility(vec4 pos) {\n#ifdef TERRAIN3D\nvec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0;\n#else\nreturn 1.0;\n#endif\n}float ele(vec2 pos) {\n#ifdef TERRAIN3D\nvec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;\n#else\nreturn 0.0;\n#endif\n}float get_elevation(vec2 pos) {\n#ifdef TERRAIN3D\nvec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration;\n#else\nreturn 0.0;\n#endif\n}"),background:me("uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:me("uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:me("varying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);float antialiased_blur=v_data.z;float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}float antialiasblur=-max(1.0/u_device_pixel_ratio/(radius+stroke_width),blur);v_data=vec3(extrude.x,extrude.y,antialiasblur);}"),clippingMask:me("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:me("uniform highp float u_intensity;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,get_elevation(floor(a_pos*0.5)),1);gl_Position=u_matrix*pos;}"),heatmapTexture:me("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(0.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:me("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_anchor_pos;attribute vec2 a_placed;attribute vec2 a_box_real;uniform mat4 u_matrix;uniform vec2 u_pixel_extrude_scale;varying float v_placed;varying float v_notUsed;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}void main() {gl_Position=projectTileWithElevation(a_anchor_pos,get_elevation(a_anchor_pos));gl_Position.xy=((a_box_real+0.5)*u_pixel_extrude_scale*2.0-1.0)*vec2(1.0,-1.0)*gl_Position.w;if (gl_Position.z/gl_Position.w < 1.1) {gl_Position.z=0.5;}v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:me("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd  =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz  /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:me("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,get_elevation(a_pos),1);}"),fill:me("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),fillOutline:me("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),fillOutlinePattern:me("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),fillPattern:me("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}"),fillExtrusion:me("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;\n#ifdef TERRAIN3D\nattribute vec2 a_centroid;\n#endif\nvarying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;\n#ifdef TERRAIN3D\nfloat height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);\n#else\nfloat height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;\n#endif\nbase=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}"),fillExtrusionPattern:me("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;\n#ifdef TERRAIN3D\nattribute vec2 a_centroid;\n#endif\nvarying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;\n#ifdef TERRAIN3D\nfloat height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);\n#else\nfloat height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;\n#endif\nbase=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}"),hillshadePrepare:me("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:me("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;\n#define PI 3.141592653589793\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),line:me("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_width2=vec2(outset,inset);}"),lineGradient:me("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_width2=vec2(outset,inset);}"),linePattern:me("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),lineSDF:me("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}"),raster:me("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),symbolIcon:me("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec2 v_tex;varying float v_fade_opacity;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}gl_Position=finalPos;v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}"),symbolSDF:me("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float inner_edge=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);inner_edge=inner_edge+gamma*gamma_scale;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);if (u_is_halo) {lowp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha=min(smoothstep(halo_edge-gamma_scaled,halo_edge+gamma_scaled,dist),1.0-alpha);}gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec2 v_data0;varying vec3 v_data1;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),symbolTextAndIcon:me("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;varying vec4 v_data0;varying vec4 v_data1;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;vec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}"),terrain:me("uniform sampler2D u_texture;uniform vec4 u_fog_color;uniform vec4 u_horizon_color;uniform float u_fog_ground_blend;uniform float u_fog_ground_blend_opacity;uniform float u_horizon_fog_blend;varying vec2 v_texture_pos;varying float v_fog_depth;const float gamma=2.2;vec4 gammaToLinear(vec4 color) {return pow(color,vec4(gamma));}vec4 linearToGamma(vec4 color) {return pow(color,vec4(1.0/gamma));}void main() {vec4 surface_color=texture2D(u_texture,v_texture_pos);if (v_fog_depth > u_fog_ground_blend) {vec4 surface_color_linear=gammaToLinear(surface_color);float blend_color=smoothstep(0.0,1.0,max((v_fog_depth-u_horizon_fog_blend)/(1.0-u_horizon_fog_blend),0.0));vec4 fog_horizon_color_linear=mix(gammaToLinear(u_fog_color),gammaToLinear(u_horizon_color),blend_color);float factor_fog=max(v_fog_depth-u_fog_ground_blend,0.0)/(1.0-u_fog_ground_blend);gl_FragColor=linearToGamma(mix(surface_color_linear,fog_horizon_color_linear,pow(factor_fog,2.0)*u_fog_ground_blend_opacity));} else {gl_FragColor=surface_color;}}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform mat4 u_fog_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying float v_fog_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);vec4 pos=u_fog_matrix*vec4(a_pos3d.xy,ele,1.0);v_fog_depth=pos.z/pos.w*0.5+0.5;}"),terrainDepth:me("varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying float v_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}"),terrainCoords:me("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);}"),sky:me("uniform vec4 u_sky_color;uniform vec4 u_horizon_color;uniform float u_horizon;uniform float u_sky_horizon_blend;void main() {float y=gl_FragCoord.y;if (y > u_horizon) {float blend=y-u_horizon;if (blend < u_sky_horizon_blend) {gl_FragColor=mix(u_sky_color,u_horizon_color,pow(1.0-blend/u_sky_horizon_blend,2.0));} else {gl_FragColor=u_sky_color;}}}","attribute vec2 a_pos;void main() {gl_Position=vec4(a_pos,1.0,1.0);}")};function me(t,e){const i=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,r=e.match(/attribute ([\w]+) ([\w]+)/g),n=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),s=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),a=s?s.concat(n):n,o={};return{fragmentSource:t=t.replace(i,(
313t,e,i,r,n)=>(o[n]=!0,"define"===e?`\n#ifndef HAS_UNIFORM_u_${n}\nvarying ${i} ${r} ${n};\n#else\nuniform ${i} ${r} u_${n};\n#endif\n`:`\n#ifdef HAS_UNIFORM_u_${n}\n    ${i} ${r} ${n} = u_${n};\n#endif\n`)),vertexSource:e=e.replace(i,(t,e,i,r,n)=>{const s="float"===r?"vec2":"vec4",a=n.match(/color/)?"color":s;return o[n]?"define"===e?`\n#ifndef HAS_UNIFORM_u_${n}\nuniform lowp float u_${n}_t;\nattribute ${i} ${s} a_${n};\nvarying ${i} ${r} ${n};\n#else\nuniform ${i} ${r} u_${n};\n#endif\n`:"vec4"===a?`\n#ifndef HAS_UNIFORM_u_${n}\n    ${n} = a_${n};\n#else\n    ${i} ${r} ${n} = u_${n};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${n}\n    ${n} = unpack_mix_${a}(a_${n}, u_${n}_t);\n#else\n    ${i} ${r} ${n} = u_${n};\n#endif\n`:"define"===e?`\n#ifndef HAS_UNIFORM_u_${n}\nuniform lowp float u_${n}_t;\nattribute ${i} ${s} a_${n};\n#else\nuniform ${i} ${r} u_${n};\n#endif\n`:"vec4"===a?`\n#ifndef HAS_UNIFORM_u_${n}\n    ${i} ${r} ${n} = a_${n};\n#else\n    ${i} ${r} ${n} = u_${n};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${n}\n    ${i} ${r} ${n} = unpack_mix_${a}(a_${n}, u_${n}_t);\n#else\n    ${i} ${r} ${n} = u_${n};\n#endif\n`}
vendor: 22,812 bytes, line 313
313),staticAttributes:r,staticUniforms:a}}class _e{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(t,e,i,r,n,s,a,o,l){this.context=t;let c=this.boundPaintVertexBuffers.length!==r.length;for(let t=0;!c&&t<r.length;t++)this.boundPaintVertexBuffers[t]!==r[t]&&(c=!0);!this.vao||this.boundProgram!==e||this.boundLayoutVertexBuffer!==i||c||this.boundIndexBuffer!==n||this.boundVertexOffset!==s||this.boundDynamicVertexBuffer!==a||this.boundDynamicVertexBuffer2!==o||this.boundDynamicVertexBuffer3!==l?this.freshBind(e,i,r,n,s,a,o,l):(t.bindVertexArray.set(this.vao),a&&a.bind(),n&&n.dynamicDraw&&n.bind(),o&&o.bind(),l&&l.bind())}freshBind(t,e,i,r,n,s,a,o){const l=t.numAttributes,c=this.context,h=c.gl;this.vao&&this.destroy(),this.vao=c.createVertexArray(),c.bindVertexArray.set(this.vao),this.boundProgram=t,this.boundLayoutVertexBuffer=e,this.boundPaintVertexBuffers=i,this.boundIndexBuffer=r,this.boundVertexOffset=n,this.boundDynamicVertexBuffer=s,this.boundDynamicVertexBuffer2=a,this.boundDynamicVertexBuffer3=o,e.enableAttributes(h,t);for(const e of i)e.enableAttributes(h,t);s&&s.enableAttributes(h,t),a&&a.enableAttributes(h,t),o&&o.enableAttributes(h,t),e.bind(),e.setVertexAttribPointers(h,t,n);for(const e of i)e.bind(),e.setVertexAttribPointers(h,t,n);s&&(s.bind(),s.setVertexAttribPointers(h,t,n)),r&&r.bind(),a&&(a.bind(),a.setVertexAttribPointers(h,t,n)),o&&(o.bind(),o.setVertexAttribPointers(h,t,n)),c.currentNumAttributes=l}destroy(){this.vao&&(this.context.deleteVertexArray(this.vao),this.vao=null)}}const ge=(t,i,r,n,s)=>({u_matrix:t,u_texture:0,u_ele_delta:i,u_fog_matrix:r,u_fog_color:n?n.properties.get("fog-color"):e.aM.white,u_fog_ground_blend:n?n.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:n?n.calculateFogBlendOpacity(s):0,u_horizon_color:n?n.properties.get("horizon-color"):e.aM.white,u_horizon_fog_blend:n?n.properties.get("horizon-fog-blend"):1});function ye(t){const e=[];for(let i=0;i<t.length;i++){if(null===t[i])continue;const r=t[i].split(" ");e.push(r.pop())}return e}class xe{constructor(t,i,r,n,s,a){const o=t.gl;this.program=o.createProgram();const l=ye(i.staticAttributes),c=r?r.getBinderAttributes():[],h=l.concat(c),u=fe.prelude.staticUniforms?ye(fe.prelude.staticUniforms):[],d=i.staticUniforms?ye(i.staticUniforms):[],p=r?r.getBinderUniforms():[],f=u.concat(d).concat(p),m=[];for(const t of f)m.indexOf(t)<0&&m.push(t);const _=r?r.defines():[];s&&_.push("#define OVERDRAW_INSPECTOR;"),a&&_.push("#define TERRAIN3D;");const g=_.concat(fe.prelude.fragmentSource,i.fragmentSource).join("\n"),y=_.concat(fe.prelude.vertexSource,i.vertexSource).join("\n"),x=o.createShader(o.FRAGMENT_SHADER);if(o.isContextLost())return void(this.failedToCreate=!0);if(o.shaderSource(x,g),o.compileShader(x),!o.getShaderParameter(x,o.COMPILE_STATUS))throw new Error(`Could not compile fragment shader: ${o.getShaderInfoLog(x)}`);o.attachShader(this.program,x);const v=o.createShader(o.VERTEX_SHADER);if(o.isContextLost())return void(this.failedToCreate=!0);if(o.shaderSource(v,y),o.compileShader(v),!o.getShaderParameter(v,o.COMPILE_STATUS))throw new Error(`Could not compile vertex shader: ${o.getShaderInfoLog(v)}`);o.attachShader(this.program,v),this.attributes={};const b={};this.numAttributes=h.length;for(let t=0;t<this.numAttributes;t++)h[t]&&(o.bindAttribLocation(this.program,t,h[t]),this.attributes[h[t]]=t);if(o.linkProgram(this.program),!o.getProgramParameter(this.program,o.LINK_STATUS))throw new Error(`Program failed to link: ${o.getProgramInfoLog(this.program)}`);o.deleteShader(v),o.deleteShader(x);for(let t=0;t<m.length;t++){const e=m[t];if(e&&!b[e]){const t=o.getUniformLocation(this.program,e);t&&(b[e]=t)}}this.fixedUniforms=n(t,b),this.terrainUniforms=((t,i)=>({u_depth:new e.aH(t,i.u_depth),u_terrain:new e.aH(t,i.u_terrain),u_terrain_dim:new e.aI(t,i.u_terrain_dim),u_terrain_matrix:new e.aJ(t,i.u_terrain_matrix),u_terrain_unpack:new e.aK(t,i.u_terrain_unpack),u_terrain_exaggeration:new e.aI(t,i.u_terrain_exaggeration)}))(t,b),this.binderUniforms=r?r.getUniforms(t,b):[]}draw(t,e,i,r,n,s,a,o,l,c,h,u,d,p,f,m,_,g){const y=t.gl;if(this.failedToCreate)return;if(t.program.set(this.program),t.setDepthMode(i),t.setStencilMode(r),t.setColorMode(n),t.setCullFace(s),o){t.activeTexture.set(y.TEXTURE2),y.bindTexture(y.TEXTURE_2D,o.depthTexture),t.activeTexture.set(y.TEXTURE3),y.bindTexture(y.TEXTURE_2D,o.texture);for(const t in this.terrainUniforms)this.terrainUniforms[t].set(o[t])}for(const t in this.fixedUniforms)this.fixedUniforms[t].set(a[t]);f&&f.setUniforms(t,this.binderUniforms,d,{zoom:p});let x=0;switch(e){case y.LINES:x=2;break;case y.TRIANGLES:x=3;break;case y.LINE_STRIP:x=1}for(const i of u.get()){const r=i.vaos||(i.vaos={});(r[l]||(r[l]=new _e)).bind(t,this,c,f?f.getPaintVertexBuffers():[],h,i.vertexOffset,m,_,g),y.drawElements(e,i.primitiveLength*x,y.UNSIGNED_SHORT,i.primitiveOffset*x*2)}}}function ve(t,e,i){const r=1/Ft(i,1,e.transform.tileZoom),n=Math.pow(2,i.tileID.overscaledZ),s=i.tileSize*Math.pow(2,e.transform.tileZoom)/n,a=s*(i.tileID.canonical.x+i.tileID.wrap*n),o=s*i.tileID.canonical.y;return{u_image:0,u_texsize:i.imageAtlasTexture.size,u_scale:[r,t.fromScale,t.toScale],u_fade:t.t,u_pixel_coord_upper:[a>>16,o>>16],u_pixel_coord_lower:[65535&a,65535&o]}}const be=(t,i,r,n)=>{const s=i.style.light,a=s.properties.get("position"),o=[a.x,a.y,a.z],l=function(){var t=new e.A(9);return e.A!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}();"viewport"===s.properties.get("anchor")&&function(t,e){var i=Math.sin(e),r=Math.cos(e);t[0]=r,t[1]=i,t[2]=0,t[3]=-i,t[4]=r,t[5]=0,t[6]=0,t[7]=0,t[8]=1}(l,-i.transform.angle),function(t,e,i){var r=e[0],n=e[1],s=e[2];t[0]=r*i[0]+n*i[3]+s*i[6],t[1]=r*i[1]+n*i[4]+s*i[7],t[2]=r*i[2]+n*i[5]+s*i[8]}(o,o,l);const c=s.properties.get("color");return{u_matrix:t,u_lightpos:o,u_lightintensity:s.properties.get("intensity"),u_lightcolor:[c.r,c.g,c.b],u_vertical_gradient:+r,u_opacity:n}},we=(t,i,r,n,s,a,o)=>e.e(be(t,i,r,n),ve(a,i,o),{u_height_factor:-Math.pow(2,s.overscaledZ)/o.tileSize/8}),Te=t=>({u_matrix:t}),Se=(t,i,r,n)=>e.e(Te(t),ve(r,i,n)),Ie=(t,e)=>({u_matrix:t,u_world:e}),Pe=(t,i,r,n,s)=>e.e(Se(t,i,r,n),{u_world:s}),Ae=(t,e,i,r)=>{const n=t.transform;let s,a;if("map"===r.paint.get("circle-pitch-alignment")){const t=Ft(i,1,n.zoom);s=!0,a=[t,t]}else s=!1,a=n.pixelsToGLUnits;return{u_camera_to_center_distance:n.cameraToCenterDistance,u_scale_with_map:+("map"===r.paint.get("circle-pitch-scale")),u_matrix:t.translatePosMatrix(e.posMatrix,i,r.paint.get("circle-translate"),r.paint.get("circle-translate-anchor")),u_pitch_with_map:+s,u_device_pixel_ratio:t.pixelRatio,u_extrude_scale:a}},Me=(t,e,i)=>({u_matrix:t,u_inv_matrix:e,u_camera_to_center_distance:i.cameraToCenterDistance,u_viewport_size:[i.width,i.height]}),ke=(t,e,i=1)=>({u_matrix:t,u_color:e,u_overlay:0,u_overlay_scale:i}),Ce=t=>({u_matrix:t}),ze=(t,e,i,r)=>({u_matrix:t,u_extrude_scale:Ft(e,1,i),u_intensity:r}),Ee=(t,i,r,n)=>{const s=e.H();e.aP(s,0,t.width,t.height,0,0,1);const a=t.context.gl;return{u_matrix:s,u_world:[a.drawingBufferWidth,a.drawingBufferHeight],u_image:r,u_color_ramp:n,u_opacity:i.paint.get("heatmap-opacity")}};function De(t,i){const r=Math.pow(2,i.canonical.z),n=i.canonical.y;return[new e.Z(0,n/r).toLngLat().lat,new e.Z(0,(n+1)/r).toLngLat().lat]}const Le=(t,e,i,r)=>{const n=t.transform;return{u_matrix:Ve(t,e,i,r),u_ratio:1/Ft(e,1,n.zoom),u_device_pixel_ratio:t.pixelRatio,u_units_to_pixels:[1/n.pixelsToGLUnits[0],1/n.pixelsToGLUnits[1]]}},Re=(t,i,r,n,s)=>e.e(Le(t,i,r,s),{u_image:0,u_image_height:n}),Be=(t,e,i,r,n)=>{const s=t.transform,a=Oe(e,s);return{u_matrix:Ve(t,e,i,n),u_texsize:e.imageAtlasTexture.size,u_ratio:1/Ft(e,1,s.zoom),u_device_pixel_ratio:t.pixelRatio,u_image:0,u_scale:[a,r.fromScale,r.toScale],u_fade:r.t,u_units_to_pixels:[1/s.pixelsToGLUnits[0],1/s.pixelsToGLUnits[1]]}},Fe=(t,i,r,n,s,a)=>{const o=t.lineAtlas,l=Oe(i,t.transform),c="round"===r.layout.get("line-cap"),h=o.getDash(n.from,c),u=o.getDash(n.to,c),d=h.width*s.fromScale,p=u.width*s.toScale;return e.e(Le(t,i,r,a),{u_patternscale_a:[l/d,-h.height/2],u_patternscale_b:[l/p,-u.height/2],u_sdfgamma:o.width/(256*Math.min(d,p)*t.pixelRatio)/2,u_image:0,u_tex_y_a:h.y,u_tex_y_b:u.y,u_mix:s.t})};function Oe(t,e){return 1/Ft(t,1,e.tileZoom)}function Ve(t,e,i,r){return t.translatePosMatrix(r?r.posMatrix:e.tileID.posMatrix,e,i.paint.get("line-translate"),i.paint.get("line-translate-anchor"))}const Ne=(t,e,i,r,n)=>{return{u_matrix:t,u_tl_parent:e,u_scale_parent:i,u_buffer_scale:1,u_fade_t:r.mix,u_opacity:r.opacity*n.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:n.paint.get("raster-brightness-min"),u_brightness_high:n.paint.get("raster-brightness-max"),u_saturation_factor:(a=n.paint.get("raster-saturation"),a>0?1-1/(1.001-a):-a),u_contrast_factor:(s=n.paint.get("raster-contrast"),s>0?1/(1-s):1+s),u_spin_weights:je(n.paint.get("raster-hue-rotate"))};var s,a};function je(t){t*=Math.PI/180;const e=Math.sin(t),i=Math.cos(t);return[(2*i+1)/3,(-Math.sqrt(3)*e-i+1)/3,(Math.sqrt(3)*e-i+1)/3]}const Ue=(t,e,i,r,n,s,a,o,l,c,h,u,d,p)=>{const f=a.transform;return{u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:f.cameraToCenterDistance,u_pitch:f.pitch/360*2*Math.PI,u_rotate_symbol:+i,u_aspect_ratio:f.width/f.height,u_fade_change:a.options.fadeDuration?a.symbolFadeChange:1,u_matrix:o,u_label_plane_matrix:l,u_coord_matrix:c,u_is_text:+u,u_pitch_with_map:+r,u_is_along_line:n,u_is_variable_anchor:s,u_texsize:d,u_texture:0,u_translation:h,u_pitched_scale:p}},$e=(t,i,r,n,s,a,o,l,c,h,u,d,p,f,m)=>{const _=o.transform;return e.e(Ue(t,i,r,n,s,a,o,l,c,h,u,d,p,m),{u_gamma_scale:n?Math.cos(_._pitch)*_.cameraToCenterDistance:1,u_device_pixel_ratio:o.pixelRatio,u_is_halo:+f})},qe=(t,i,r,n,s,a,o,l,c,h,u,d,p,f)=>e.e($e(t,i,r,n,s,a,o,l,c,h,u,!0,d,!0,f),{u_texsize_icon:p,u_texture_icon:1}),Ze=(t,e,i)=>({u_matrix:t,u_opacity:e,u_color:i}),Ge=(t,i,r,n,s,a)=>e.e(function(t,e,i,r){const n=i.imageManager.getPattern(t.from.toString()),s=i.imageManager.getPattern(t.to.toString()),{width:a,height:o}=i.imageManager.getPixelSize(),l=Math.pow(2,r.tileID.overscaledZ),c=r.tileSize*Math.pow(2,i.transform.tileZoom)/l,h=c*(r.tileID.canonical.x+r.tileID.wrap*l),u=c*r.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:n.tl,u_pattern_br_a:n.br,u_pattern_tl_b:s.tl,u_pattern_br_b:s.br,u_texsize:[a,o],u_mix:e.t,u_pattern_size_a:n.displaySize,u_pattern_size_b:s.displaySize,u_scale_a:e.fromScale,u_scale_b:e.toScale,u_tile_units_to_pixels:1/Ft(r,1,i.transform.tileZoom),u_pixel_coord_upper:[h>>16,u>>16],u_pixel_coord_lower:[65535&h,65535&u]}}(n,a,r,s),{u_matrix:t,u_opacity:i}),He={fillExtrusion:(t,i)=>({u_matrix:new e.aJ(t,i.u_matrix),u_lightpos:new e.aN(t,i.u_lightpos),u_lightintensity:new e.aI(t,i.u_lightintensity),u_lightcolor:new e.aN(t,i.u_lightcolor),u_vertical_gradient:new e.aI(t,i.u_vertical_gradient),u_opacity:new e.aI(t,i.u_opacity)}),fillExtrusionPattern:(t,i)=>({u_matrix:new e.aJ(t,i.u_matrix),u_lightpos:new e.aN(t,i.u_lightpos),u_lightintensity:new e.aI(t,i.u_lightintensity),u_lightcolor:new e.aN(t,i.u_lightcolor),u_vertical_gradient:new e.aI(t,i.u_vertical_gradient),u_height_factor:new e.aI(t,i.u_height_factor),u_image:new e.aH(t,i.u_image),u_texsize:new e.aO(t,i.u_texsize),u_pixel_coord_upper:new e.aO(t,i.u_pixel_coord_upper),u_pixel_coord_lower:new e.aO(t,i.u_pixel_coord_lower),u_scale:new e.aN(t,i.u_scale),u_fade:new e.aI(t,i.u_fade),u_opacity:new e.aI(t,i.u_opacity)}),fill:(t,i)=>({u_matrix:new e.aJ(t,i.u_matrix)}),fillPattern:(t,i)=>({u_matrix:new e.aJ(t,i.u_matrix),u_image:new e.aH(t,i.u_image),u_texsize:new e.aO(t,i.u_texsize),u_pixel_coord_upper:new e.aO(t,i.u_pixel_coord_upper),u_pixel_coord_lower:new e.aO(t,i.u_pixel_coord_lower),u_scale:new e.aN(t,i.u_scale),u_fade:new e.aI(t,i.u_fade)}),fillOutline:(t,i)=>({u_matrix:new e.aJ(t,i.u_matrix),u_world:new e.aO(t,i.u_world)}),fillOutlinePattern:(t,i)=>({u_matrix:new e.aJ(t,i.u_matrix),u_world:new e.aO(t,i.u_world),u_image:new e.aH(t,i.u_image),u_texsize:new e.aO(t,i.u_texsize),u_pixel_coord_upper:new e.aO(t,i.u_pixel_coord_upper),u_pixel_coord_lower:new e.aO(t,i.u_pixel_coord_lower),u_scale:new e.aN(t,i.u_scale),u_fade:new e.aI(t,i.u_fade)}),circle:(t,i)=>({u_camera_to_center_distance:new e.aI(t,i.u_camera_to_center_distance),u_scale_with_map:new e.aH(t,i.u_scale_with_map),u_pitch_with_map:new e.aH(t,i.u_pitch_with_map),u_extrude_scale:new e.aO(t,i.u_extrude_scale),u_device_pixel_ratio:new e.aI(t,i.u_device_pixel_ratio),u_matrix:new e.aJ(t,i.u_matrix)}),collisionBox:(t,i)=>({u_matrix:new e.aJ(t,i.u_matrix),u_pixel_extrude_scale:new e.aO(t,i.u_pixel_extrude_scale)}),collisionCircle:(t,i)=>({u_matrix:new e.aJ(t,i.u_matrix),u_inv_matrix:new e.aJ(t,i.u_inv_matrix),u_camera_to_center_distance:new e.aI(t,i.u_camera_to_center_distance),u_viewport_size:new e.aO(t,i.u_viewport_size)}),debug:(t,i)=>({u_color:new e.aL(t,i.u_color),u_matrix:new e.aJ(t,i.u_matrix),u_overlay:new e.aH(t,i.u_overlay),u_overlay_scale:new e.aI(t,i.u_overlay_scale)}),clippingMask:(t,i)=>({u_matrix:new e.aJ(t,i.u_matrix)}),heatmap:(t,i)=>({u_extrude_scale:new e.aI(t,i.u_extrude_scale),u_intensity:new e.aI(t,i.u_intensity),u_matrix:new e.aJ(t,i.u_matrix)}),heatmapTexture:(t,i)=>({u_matrix:new e.aJ(t,i.u_matrix),u_world:new e.aO(t,i.u_world),u_image:new e.aH(t,i.u_image),u_color_ramp:new e.aH(t,i.u_color_ramp),u_opacity:new e.aI(t,i.u_opacity)}),hillshade:(t,i)=>({u_matrix:new e.aJ(t,i.u_matrix),u_image:new e.aH(t,i.u_image),u_latrange:new e.aO(t,i.u_latrange),u_light:new e.aO(t,i.u_light),u_shadow:new e.aL(t,i.u_shadow),u_highlight:new e.aL(t,i.u_highlight),u_accent:new e.aL(t,i.u_accent)}),hillshadePrepare:(t,i)=>({u_matrix:new e.aJ(t,i.u_matrix),u_image:new e.aH(t,i.u_image),u_dimension:new e.aO(t,i.u_dimension),u_zoom:new e.aI(t,i.u_zoom),u_unpack:new e.aK(t,i.u_unpack)}),line:(t,i)=>({u_matrix:new e.aJ(t,i.u_matrix),u_ratio:new e.aI(t,i.u_ratio),u_device_pixel_ratio:new e.aI(t,i.u_device_pixel_ratio),u_units_to_pixels:new e.aO(t,i.u_units_to_pixels)}),lineGradient:(t,i)=>({u_matrix:new e.aJ(t,i.u_matrix),u_ratio:new e.aI(t,i.u_ratio),u_device_pixel_ratio:new e.aI(t,i.u_device_pixel_ratio),u_units_to_pixels:new e.aO(t,i.u_units_to_pixels),u_image:new e.aH(t,i.u_image),u_image_height:new e.aI(t,i.u_image_height)}),linePattern:(t,i)=>({u_matrix:new e.aJ(t,i.u_matrix),u_texsize:new e.aO(t,i.u_texsize),u_ratio:new e.aI(t,i.u_ratio),u_device_pixel_ratio:new e.aI(t,i.u_device_pixel_ratio),u_image:new e.aH(t,i.u_image),u_units_to_pixels:new e.aO(t,i.u_units_to_pixels),u_scale:new e.aN(t,i.u_scale),u_fade:new e.aI(t,i.u_fade)}),lineSDF:(t,i)=>({u_matrix:new e.aJ(t,i.u_matrix),u_ratio:new e.aI(t,i.u_ratio),u_device_pixel_ratio:new e.aI(t,i.u_device_pixel_ratio),u_units_to_pixels:new e.aO(t,i.u_units_to_pixels),u_patternscale_a:new e.aO(t,i.u_patternscale_a),u_patternscale_b:new e.aO(t,i.u_patternscale_b),u_sdfgamma:new e.aI(t,i.u_sdfgamma),u_image:new e.aH(t,i.u_image),u_tex_y_a:new e.aI(t,i.u_tex_y_a),u_tex_y_b:new e.aI(t,i.u_tex_y_b),u_mix:new e.aI(t,i.u_mix)}),raster:(t,i)=>({u_matrix:new e.aJ(t,i.u_matrix),u_tl_parent:new e.aO(t,i.u_tl_parent),u_scale_parent:new e.aI(t,i.u_scale_parent),u_buffer_scale:new e.aI(t,i.u_buffer_scale),u_fade_t:new e.aI(t,i.u_fade_t),u_opacity:new e.aI(t,i.u_opacity),u_image0:new e.aH(t,i.u_image0),u_image1:new e.aH(t,i.u_image1),u_brightness_low:new e.aI(t,i.u_brightness_low),u_brightness_high:new e.aI(t,i.u_brightness_high),u_saturation_factor:new e.aI(t,i.u_saturation_factor),u_contrast_factor:new e.aI(t,i.u_contrast_factor),u_spin_weights:new e.aN(t,i.u_spin_weights)}),symbolIcon:(t,i)=>({u_is_size_zoom_constant:new e.aH(t,i.u_is_size_zoom_constant),u_is_size_feature_constant:new e.aH(t,i.u_is_size_feature_constant),u_size_t:new e.aI(t,i.u_size_t),u_size:new e.aI(t,i.u_size),u_camera_to_center_distance:new e.aI(t,i.u_camera_to_center_distance),u_pitch:new e.aI(t,i.u_pitch),u_rotate_symbol:new e.aH(t,i.u_rotate_symbol),u_aspect_ratio:new e.aI(t,i.u_aspect_ratio),u_fade_change:new e.aI(t,i.u_fade_change),u_matrix:new e.aJ(t,i.u_matrix),u_label_plane_matrix:new e.aJ(t,i.u_label_plane_matrix),u_coord_matrix:new e.aJ(t,i.u_coord_matrix),u_is_text:new e.aH(t,i.u_is_text),u_pitch_with_map:new e.aH(t,i.u_pitch_with_map),u_is_along_line:new e.aH(t,i.u_is_along_line),u_is_variable_anchor:new e.aH(t,i.u_is_variable_anchor),u_texsize:new e.aO(t,i.u_texsize),u_texture:new e.aH(t,i.u_texture),u_translation:new e.aO(t,i.u_translation),u_pitched_scale:new e.aI(t,i.u_pitched_scale)}),symbolSDF:(t,i)=>({u_is_size_zoom_constant:new e.aH(t,i.u_is_size_zoom_constant),u_is_size_feature_constant:new e.aH(t,i.u_is_size_feature_constant),u_size_t:new e.aI(t,i.u_size_t),u_size:new e.aI(t,i.u_size),u_camera_to_center_distance:new e.aI(t,i.u_camera_to_center_distance),u_pitch:new e.aI(t,i.u_pitch),u_rotate_symbol:new e.aH(t,i.u_rotate_symbol),u_aspect_ratio:new e.aI(t,i.u_aspect_ratio),u_fade_change:new e.aI(t,i.u_fade_change),u_matrix:new e.aJ(t,i.u_matrix),u_label_plane_matrix:new e.aJ(t,i.u_label_plane_matrix),u_coord_matrix:new e.aJ(t,i.u_coord_matrix),u_is_text:new e.aH(t,i.u_is_text),u_pitch_with_map:new e.aH(t,i.u_pitch_with_map),u_is_along_line:new e.aH(t,i.u_is_along_line),u_is_variable_anchor:new e.aH(t,i.u_is_variable_anchor),u_texsize:new e.aO(t,i.u_texsize),u_texture:new e.aH(t,i.u_texture),u_gamma_scale:new e.aI(t,i.u_gamma_scale),u_device_pixel_ratio:new e.aI(t,i.u_device_pixel_ratio),u_is_halo:new e.aH(t,i.u_is_halo),u_translation:new e.aO(t,i.u_translation),u_pitched_scale:new e.aI(t,i.u_pitched_scale)}),symbolTextAndIcon:(t,i)=>({u_is_size_zoom_constant:new e.aH(t,i.u_is_size_zoom_constant),u_is_size_feature_constant:new e.aH(t,i.u_is_size_feature_constant),u_size_t:new e.aI(t,i.u_size_t),u_size:new e.aI(t,i.u_size),u_camera_to_center_distance:new e.aI(t,i.u_camera_to_center_distance),u_pitch:new e.aI(t,i.u_pitch),u_rotate_symbol:new e.aH(t,i.u_rotate_symbol),u_aspect_ratio:new e.aI(t,i.u_aspect_ratio),u_fade_change:new e.aI(t,i.u_fade_change),u_matrix:new e.aJ(t,i.u_matrix),u_label_plane_matrix:new e.aJ(t,i.u_label_plane_matrix),u_coord_matrix:new e.aJ(t,i.u_coord_matrix),u_is_text:new e.aH(t,i.u_is_text),u_pitch_with_map:new e.aH(t,i.u_pitch_with_map),u_is_along_line:new e.aH(t,i.u_is_along_line),u_is_variable_anchor:new e.aH(t,i.u_is_variable_anchor),u_texsize:new e.aO(t,i.u_texsize),u_texsize_icon:new e.aO(t,i.u_texsize_icon),u_texture:new e.aH(t,i.u_texture),u_texture_icon:new e.aH(t,i.u_texture_icon),u_gamma_scale:new e.aI(t,i.u_gamma_scale),u_device_pixel_ratio:new e.aI(t,i.u_device_pixel_ratio),u_is_halo:new e.aH(t,i.u_is_halo),u_translation:new e.aO(t,i.u_translation),u_pitched_scale:new e.aI(t,i.u_pitched_scale)}),background:(t,i)=>({u_matrix:new e.aJ(t,i.u_matrix),u_opacity:new e.aI(t,i.u_opacity),u_color:new e.aL(t,i.u_color)}),backgroundPattern:(t,i)=>({u_matrix:new e.aJ(t,i.u_matrix),u_opacity:new e.aI(t,i.u_opacity),u_image:new e.aH(t,i.u_image),u_pattern_tl_a:new e.aO(t,i.u_pattern_tl_a),u_pattern_br_a:new e.aO(t,i.u_pattern_br_a),u_pattern_tl_b:new e.aO(t,i.u_pattern_tl_b),u_pattern_br_b:new e.aO(t,i.u_pattern_br_b),u_texsize:new e.aO(t,i.u_texsize),u_mix:new e.aI(t,i.u_mix),u_pattern_size_a:new e.aO(t,i.u_pattern_size_a),u_pattern_size_b:new e.aO(t,i.u_pattern_size_b),u_scale_a:new e.aI(t,i.u_scale_a),u_scale_b:new e.aI(t,i.u_scale_b),u_pixel_coord_upper:new e.aO(t,i.u_pixel_coord_upper),u_pixel_coord_lower:new e.aO(t,i.u_pixel_coord_lower),u_tile_units_to_pixels:new e.aI(t,i.u_tile_units_to_pixels)}),terrain:(t,i)=>({u_matrix:new e.aJ(t,i.u_matrix),u_texture:new e.aH(t,i.u_texture),u_ele_delta:new e.aI(t,i.u_ele_delta),u_fog_matrix:new e.aJ(t,i.u_fog_matrix),u_fog_color:new e.aL(t,i.u_fog_color),u_fog_ground_blend:new e.aI(t,i.u_fog_ground_blend),u_fog_ground_blend_opacity:new e.aI(t,i.u_fog_ground_blend_opacity),u_horizon_color:new e.aL(t,i.u_horizon_color),u_horizon_fog_blend:new e.aI(t,i.u_horizon_fog_blend)}),terrainDepth:(t,i)=>({u_matrix:new e.aJ(t,i.u_matrix),u_ele_delta:new e.aI(t,i.u_ele_delta)}),terrainCoords:(t,i)=>({u_matrix:new e.aJ(t,i.u_matrix),u_texture:new e.aH(t,i.u_texture),u_terrain_coords_id:new e.aI(t,i.u_terrain_coords_id),u_ele_delta:new e.aI(t,i.u_ele_delta)}),sky:(t,i)=>({u_sky_color:new e.aL(t,i.u_sky_color),u_horizon_color:new e.aL(t,i.u_horizon_color),u_horizon:new e.aI(t,i.u_horizon),u_sky_horizon_blend:new e.aI(t,i.u_sky_horizon_blend)})};class Xe{constructor(t,e,i){this.context=t;const r=t.gl;this.buffer=r.createBuffer(),this.dynamicDraw=Boolean(i),this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),r.bufferData(r.ELEMENT_ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?r.DYNAMIC_DRAW:r.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(t){const e=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const We={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Ke{constructor(t,e,i,r){this.length=e.length,this.attributes=i,this.itemSize=e.bytesPerElement,this.dynamicDraw=r,this.context=t;const n=t.gl;this.buffer=n.createBuffer(),t.bindVertexBuffer.set(this.buffer),n.bufferData(n.ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(t){if(t.length!==this.length)throw new Error(`Length of new data is ${t.length}, which doesn't match current length of ${this.length}`);const e=this.context.gl;this.bind(),e.bufferSubData(e.ARRAY_BUFFER,0,t.arrayBuffer)}enableAttributes(t,e){for(let i=0;i<this.attributes.length;i++){const r=e.attributes[this.attributes[i].name];void 0!==r&&t.enableVertexAttribArray(r)}}setVertexAttribPointers(t,e,i){for(let r=0;r<this.attributes.length;r++){const n=this.attributes[r],s=e.attributes[n.name];void 0!==s&&t.vertexAttribPointer(s,n.components,t[We[n.type]],!1,this.itemSize,n.offset+this.itemSize*(i||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const Je=new WeakMap;function Ye(t){var e;if(Je.has(t))return Je.get(t);{const i=null===(e=t.getParameter(t.VERSION))||void 0===e?void 0:e.startsWith("WebGL 2.0");return Je.set(t,i),i}}class Qe{constructor(t){this.gl=t.gl,this
313["default"]=this.getDefault(),this.current=this["default"],this.dirty=!1}get(){return this.current}set(t){}getDefault(){return this["default"]}setDefault(){this.set(this["default"]
vendor: 19,367 bytes, line 313
313)}}class ti extends Qe{getDefault(){return e.aM.transparent}set(t){const e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.clearColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}}class ei extends Qe{getDefault(){return 1}set(t){(t!==this.current||this.dirty)&&(this.gl.clearDepth(t),this.current=t,this.dirty=!1)}}class ii extends Qe{getDefault(){return 0}set(t){(t!==this.current||this.dirty)&&(this.gl.clearStencil(t),this.current=t,this.dirty=!1)}}class ri extends Qe{getDefault(){return[!0,!0,!0,!0]}set(t){const e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.colorMask(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}}class ni extends Qe{getDefault(){return!0}set(t){(t!==this.current||this.dirty)&&(this.gl.depthMask(t),this.current=t,this.dirty=!1)}}class si extends Qe{getDefault(){return 255}set(t){(t!==this.current||this.dirty)&&(this.gl.stencilMask(t),this.current=t,this.dirty=!1)}}class ai extends Qe{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(t){const e=this.current;(t.func!==e.func||t.ref!==e.ref||t.mask!==e.mask||this.dirty)&&(this.gl.stencilFunc(t.func,t.ref,t.mask),this.current=t,this.dirty=!1)}}class oi extends Qe{getDefault(){const t=this.gl;return[t.KEEP,t.KEEP,t.KEEP]}set(t){const e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||this.dirty)&&(this.gl.stencilOp(t[0],t[1],t[2]),this.current=t,this.dirty=!1)}}class li extends Qe{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;t?e.enable(e.STENCIL_TEST):e.disable(e.STENCIL_TEST),this.current=t,this.dirty=!1}}class ci extends Qe{getDefault(){return[0,1]}set(t){const e=this.current;(t[0]!==e[0]||t[1]!==e[1]||this.dirty)&&(this.gl.depthRange(t[0],t[1]),this.current=t,this.dirty=!1)}}class hi extends Qe{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;t?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),this.current=t,this.dirty=!1}}class ui extends Qe{getDefault(){return this.gl.LESS}set(t){(t!==this.current||this.dirty)&&(this.gl.depthFunc(t),this.current=t,this.dirty=!1)}}class di extends Qe{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;t?e.enable(e.BLEND):e.disable(e.BLEND),this.current=t,this.dirty=!1}}class pi extends Qe{getDefault(){const t=this.gl;return[t.ONE,t.ZERO]}set(t){const e=this.current;(t[0]!==e[0]||t[1]!==e[1]||this.dirty)&&(this.gl.blendFunc(t[0],t[1]),this.current=t,this.dirty=!1)}}class fi extends Qe{getDefault(){return e.aM.transparent}set(t){const e=this.current;(t.r!==e.r||t.g!==e.g||t.b!==e.b||t.a!==e.a||this.dirty)&&(this.gl.blendColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)}}class mi extends Qe{getDefault(){return this.gl.FUNC_ADD}set(t){(t!==this.current||this.dirty)&&(this.gl.blendEquation(t),this.current=t,this.dirty=!1)}}class _i extends Qe{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;t?e.enable(e.CULL_FACE):e.disable(e.CULL_FACE),this.current=t,this.dirty=!1}}class gi extends Qe{getDefault(){return this.gl.BACK}set(t){(t!==this.current||this.dirty)&&(this.gl.cullFace(t),this.current=t,this.dirty=!1)}}class yi extends Qe{getDefault(){return this.gl.CCW}set(t){(t!==this.current||this.dirty)&&(this.gl.frontFace(t),this.current=t,this.dirty=!1)}}class xi extends Qe{getDefault(){return null}set(t){(t!==this.current||this.dirty)&&(this.gl.useProgram(t),this.current=t,this.dirty=!1)}}class vi extends Qe{getDefault(){return this.gl.TEXTURE0}set(t){(t!==this.current||this.dirty)&&(this.gl.activeTexture(t),this.current=t,this.dirty=!1)}}class bi extends Qe{getDefault(){const t=this.gl;return[0,0,t.drawingBufferWidth,t.drawingBufferHeight]}set(t){const e=this.current;(t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||this.dirty)&&(this.gl.viewport(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)}}class wi extends Qe{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.bindFramebuffer(e.FRAMEBUFFER,t),this.current=t,this.dirty=!1}}class Ti extends Qe{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.bindRenderbuffer(e.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class Si extends Qe{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.bindTexture(e.TEXTURE_2D,t),this.current=t,this.dirty=!1}}class Ii extends Qe{getDefault(){return null}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.bindBuffer(e.ARRAY_BUFFER,t),this.current=t,this.dirty=!1}}class Pi extends Qe{getDefault(){return null}set(t){const e=this.gl;e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1}}class Ai extends Qe{getDefault(){return null}set(t){var e;if(t===this.current&&!this.dirty)return;const i=this.gl;Ye(i)?i.bindVertexArray(t):null===(e=i.getExtension("OES_vertex_array_object"))||void 0===e||e.bindVertexArrayOES(t),this.current=t,this.dirty=!1}}class Mi extends Qe{getDefault(){return 4}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.pixelStorei(e.UNPACK_ALIGNMENT,t),this.current=t,this.dirty=!1}}class ki extends Qe{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t,this.dirty=!1}}class Ci extends Qe{getDefault(){return!1}set(t){if(t===this.current&&!this.dirty)return;const e=this.gl;e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1}}class zi extends Qe{constructor(t,e){super(t),this.context=t,this.parent=e}getDefault(){return null}}class Ei extends zi{setDirty(){this.dirty=!0}set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const e=this.gl;e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0),this.current=t,this.dirty=!1}}class Di extends zi{set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const e=this.gl;e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class Li extends zi{set(t){if(t===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const e=this.gl;e.framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_STENCIL_ATTACHMENT,e.RENDERBUFFER,t),this.current=t,this.dirty=!1}}class Ri{constructor(t,e,i,r,n){this.context=t,this.width=e,this.height=i;const s=t.gl,a=this.framebuffer=s.createFramebuffer();if(this.colorAttachment=new Ei(t,a),r)this.depthAttachment=n?new Li(t,a):new Di(t,a);else if(n)throw new Error("Stencil cannot be set without depth");if(s.checkFramebufferStatus(s.FRAMEBUFFER)!==s.FRAMEBUFFER_COMPLETE)throw new Error("Framebuffer is not complete")}destroy(){const t=this.context.gl,e=this.colorAttachment.get();if(e&&t.deleteTexture(e),this.depthAttachment){const e=this.depthAttachment.get();e&&t.deleteRenderbuffer(e)}t.deleteFramebuffer(this.framebuffer)}}class Bi{constructor(t,e,i){this.blendFunction=t,this.blendColor=e,this.mask=i}}Bi.Replace=[1,0],Bi.disabled=new Bi(Bi.Replace,e.aM.transparent,[!1,!1,!1,!1]),Bi.unblended=new Bi(Bi.Replace,e.aM.transparent,[!0,!0,!0,!0]),Bi.alphaBlended=new Bi([1,771],e.aM.transparent,[!0,!0,!0,!0]);class Fi{constructor(t){var e,i;if(this.gl=t,this.clearColor=new ti(this),this.clearDepth=new ei(this),this.clearStencil=new ii(this),this.colorMask=new ri(this),this.depthMask=new ni(this),this.stencilMask=new si(this),this.stencilFunc=new ai(this),this.stencilOp=new oi(this),this.stencilTest=new li(this),this.depthRange=new ci(this),this.depthTest=new hi(this),this.depthFunc=new ui(this),this.blend=new di(this),this.blendFunc=new pi(this),this.blendColor=new fi(this),this.blendEquation=new mi(this),this.cullFace=new _i(this),this.cullFaceSide=new gi(this),this.frontFace=new yi(this),this.program=new xi(this),this.activeTexture=new vi(this),this.viewport=new bi(this),this.bindFramebuffer=new wi(this),this.bindRenderbuffer=new Ti(this),this.bindTexture=new Si(this),this.bindVertexBuffer=new Ii(this),this.bindElementBuffer=new Pi(this),this.bindVertexArray=new Ai(this),this.pixelStoreUnpack=new Mi(this),this.pixelStoreUnpackPremultiplyAlpha=new ki(this),this.pixelStoreUnpackFlipY=new Ci(this),this.extTextureFilterAnisotropic=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=t.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.maxTextureSize=t.getParameter(t.MAX_TEXTURE_SIZE),Ye(t)){this.HALF_FLOAT=t.HALF_FLOAT;const r=t.getExtension("EXT_color_buffer_half_float");this.RGBA16F=null!==(e=t.RGBA16F)&&void 0!==e?e:null==r?void 0:r.RGBA16F_EXT,this.RGB16F=null!==(i=t.RGB16F)&&void 0!==i?i:null==r?void 0:r.RGB16F_EXT,t.getExtension("EXT_color_buffer_float")}else{t.getExtension("EXT_color_buffer_half_float"),t.getExtension("OES_texture_half_float_linear");const e=t.getExtension("OES_texture_half_float");this.HALF_FLOAT=null==e?void 0:e.HALF_FLOAT_OES}}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.bindVertexArray.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(t,e){return new Xe(this,t,e)}createVertexBuffer(t,e,i){return new Ke(this,t,e,i)}createRenderbuffer(t,e,i){const r=this.gl,n=r.createRenderbuffer();return this.bindRenderbuffer.set(n),r.renderbufferStorage(r.RENDERBUFFER,t,e,i),this.bindRenderbuffer.set(null),n}createFramebuffer(t,e,i,r){return new Ri(this,t,e,i,r)}clear({color:t,depth:e,stencil:i}){const r=this.gl;let n=0;t&&(n|=r.COLOR_BUFFER_BIT,this.clearColor.set(t),this.colorMask.set([!0,!0,!0,!0])),void 0!==e&&(n|=r.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(e),this.depthMask.set(!0)),void 0!==i&&(n|=r.STENCIL_BUFFER_BIT,this.clearStencil.set(i),this.stencilMask.set(255)),r.clear(n)}setCullFace(t){!1===t.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(t.mode),this.frontFace.set(t.frontFace))}setDepthMode(t){t.func!==this.gl.ALWAYS||t.mask?(this.depthTest.set(!0),this.depthFunc.set(t.func),this.depthMask.set(t.mask),this.depthRange.set(t.range)):this.depthTest.set(!1)}setStencilMode(t){t.test.func!==this.gl.ALWAYS||t.mask?(this.stencilTest.set(!0),this.stencilMask.set(t.mask),this.stencilOp.set([t.fail,t.depthFail,t.pass]),this.stencilFunc.set({func:t.test.func,ref:t.ref,mask:t.test.mask})):this.stencilTest.set(!1)}setColorMode(t){e.aE(t.blendFunction,Bi.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(t.blendFunction),this.blendColor.set(t.blendColor)),this.colorMask.set(t.mask)}createVertexArray(){var t;return Ye(this.gl)?this.gl.createVertexArray():null===(t=this.gl.getExtension("OES_vertex_array_object"))||void 0===t?void 0:t.createVertexArrayOES()}deleteVertexArray(t){var e;return Ye(this.gl)?this.gl.deleteVertexArray(t):null===(e=this.gl.getExtension("OES_vertex_array_object"))||void 0===e?void 0:e.deleteVertexArrayOES(t)}unbindVAO(){this.bindVertexArray.set(null)}}class Oi{constructor(t,e,i){this.func=t,this.mask=e,this.range=i}}Oi.ReadOnly=!1,Oi.ReadWrite=!0,Oi.disabled=new Oi(519,Oi.ReadOnly,[0,1]);const Vi=7680;class Ni{constructor(t,e,i,r,n,s){this.test=t,this.ref=e,this.mask=i,this.fail=r,this.depthFail=n,this.pass=s}}Ni.disabled=new Ni({func:519,mask:0},0,0,Vi,Vi,Vi);class ji{constructor(t,e,i){this.enable=t,this.mode=e,this.frontFace=i}}let Ui;function $i(t,i,r,n,s){const a=t.context,o=a.gl,l=t.useProgram("collisionBox"),c=[];let h=0,u=0;for(let p=0;p<n.length;p++){const f=n[p],m=i.getTile(f).getBucket(r);if(!m)continue;const _=s?m.textCollisionBox:m.iconCollisionBox,g=m.collisionCircleArray;if(g.length>0){const i=e.H();e.aQ(i,m.placementInvProjMatrix,t.transform.glCoordMatrix),e.aQ(i,i,m.placementViewportMatrix),c.push({circleArray:g,circleOffset:u,transform:f.posMatrix,invTransform:i,coord:f}),h+=g.length/4,u=h}_&&l.draw(a,o.LINES,Oi.disabled,Ni.disabled,t.colorModeForRenderPass(),ji.disabled,{u_matrix:f.posMatrix,u_pixel_extrude_scale:[1/(d=t.transform).width,1/d.height]},t.style.map.terrain&&t.style.map.terrain.getTerrainData(f),r.id,_.layoutVertexBuffer,_.indexBuffer,_.segments,null,t.transform.zoom,null,null,_.collisionVertexBuffer)}var d;if(!s||!c.length)return;const p=t.useProgram("collisionCircle"),f=new e.aR;f.resize(4*h),f._trim();let m=0;for(const t of c)for(let e=0;e<t.circleArray.length/4;e++){const i=4*e,r=t.circleArray[i+0],n=t.circleArray[i+1],s=t.circleArray[i+2],a=t.circleArray[i+3];f.emplace(m++,r,n,s,a,0),f.emplace(m++,r,n,s,a,1),f.emplace(m++,r,n,s,a,2),f.emplace(m++,r,n,s,a,3)}(!Ui||Ui.length<2*h)&&(Ui=function(t){const i=2*t,r=new e.aT;r.resize(i),r._trim();for(let t=0;t<i;t++){const e=6*t;r.uint16[e+0]=4*t+0,r.uint16[e+1]=4*t+1,r.uint16[e+2]=4*t+2,r.uint16[e+3]=4*t+2,r.uint16[e+4]=4*t+3,r.uint16[e+5]=4*t+0}return r}(h));const _=a.createIndexBuffer(Ui,!0),g=a.createVertexBuffer(f,e.aS.members,!0);for(const i of c){const n=Me(i.transform,i.invTransform,t.transform);p.draw(a,o.TRIANGLES,Oi.disabled,Ni.disabled,t.colorModeForRenderPass(),ji.disabled,n,t.style.map.terrain&&t.style.map.terrain.getTerrainData(i.coord),r.id,g,_,e.a0.simpleSegment(0,2*i.circleOffset,i.circleArray.length,i.circleArray.length/2),null,t.transform.zoom,null,null,null)}g.destroy(),_.destroy()}ji.disabled=new ji(!1,1029,2305),ji.backCCW=new ji(!0,1029,2305);const qi=e.an(new Float32Array(16));function Zi(t,i,r,n,s,a){const{horizontalAlign:o,verticalAlign:l}=e.au(t);return new e.P((-(o-.5)*i/s+n[0])*a,(-(l-.5)*r/s+n[1])*a)}function Gi(t,i,r,n,s,a){const o=i.tileAnchorPoint.add(new e.P(i.translation[0],i.translation[1]));if(i.pitchWithMap){let t=n.mult(a);r||(t=t.rotate(-s));const e=o.add(t);return xt(e.x,e.y,i.labelPlaneMatrix,i.getElevation).point}if(r){const e=Mt(i.tileAnchorPoint.x+1,i.tileAnchorPoint.y,i).point.sub(t),r=Math.atan(e.y/e.x)+(e.x<0?Math.PI:0);return t.add(n.rotate(r))}return t.add(n)}function Hi(t,i,r,n,s,a,o,l,c,h,u,d,p,f){const m=t.text.placedSymbolArray,_=t.text.dynamicLayoutVertexArray,g=t.icon.dynamicLayoutVertexArray,y={};_.clear();for(let g=0;g<m.length;g++){const x=m.get(g),v=x.hidden||!x.crossTileID||t.allowVerticalPlacement&&!x.placedOrientation?null:n[x.crossTileID];if(v){const n=new e.P(x.anchorX,x.anchorY),m={getElevation:f,width:s.width,height:s.height,labelPlaneMatrix:a,lineVertexArray:null,pitchWithMap:r,projection:u,projectionCache:null,tileAnchorPoint:n,translation:d,unwrappedTileID:p},g=r?xt(n.x,n.y,o,f):Mt(n.x,n.y,m),b=vt(s.cameraToCenterDistance,g.signedDistanceFromCamera);let w=e.ai(t.textSizeData,c,x)*b/e.ap;r&&(w*=t.tilePixelRatio/l);const{width:T,height:S,anchor:I,textOffset:P,textBoxScale:A}=v,M=Zi(I,T,S,P,A,w),k=u.getPitchedTextCorrection(s,n.add(new e.P(d[0],d[1])),p),C=Gi(g.point,m,i,M,s.angle,k),z=t.allowVerticalPlacement&&x.placedOrientation===e.ah.vertical?Math.PI/2:0;for(let t=0;t<x.numGlyphs;t++)e.aj(_,C,z);h&&x.associatedIconIndex>=0&&(y[x.associatedIconIndex]={shiftedAnchor:C,angle:z})}else Dt(x.numGlyphs,_)}if(h){g.clear();const i=t.icon.placedSymbolArray;for(let t=0;t<i.length;t++){const r=i.get(t);if(r.hidden)Dt(r.numGlyphs,g);else{const i=y[t];if(i)for(let t=0;t<r.numGlyphs;t++)e.aj(g,i.shiftedAnchor,i.angle);else Dt(r.numGlyphs,g)}}t.icon.dynamicLayoutVertexBuffer.updateData(g)}t.text.dynamicLayoutVertexBuffer.updateData(_)}function Xi(t,e,i){return i.iconsInText&&e?"symbolTextAndIcon":t?"symbolSDF":"symbolIcon"}function Wi(t,i,r,n,s,a,o,l,c,h,u,d){const p=t.context,f=p.gl,m=t.transform,_=ie(),g="map"===l,y="map"===c,x="viewport"!==l&&"point"!==r.layout.get("symbol-placement"),v=g&&!y&&!x,b=!y&&x,w=!r.layout.get("symbol-sort-key").isConstant();let T=!1;const S=t.depthModeForSublayer(0,Oi.ReadOnly),I=r._unevaluatedLayout.hasValue("text-variable-anchor")||r._unevaluatedLayout.hasValue("text-variable-anchor-offset"),P=[],A=_.getCircleRadiusCorrection(m);for(const l of n){const n=i.getTile(l),c=n.getBucket(r);if(!c)continue;const u=s?c.text:c.icon;if(!u||!u.segments.get().length||!u.hasVisibleVertices)continue;const d=u.programConfigurations.get(r.id),p=s||c.sdfIcons,S=s?c.textSizeData:c.iconSizeData,M=y||0!==m.pitch,k=t.useProgram(Xi(p,s,c),d),C=e.ag(S,m.zoom),z=t.style.map.terrain&&t.style.map.terrain.getTerrainData(l);let E,D,L,R,B=[0,0],F=null;if(s)D=n.glyphAtlasTexture,L=f.LINEAR,E=n.glyphAtlasTexture.size,c.iconsInText&&(B=n.imageAtlasTexture.size,F=n.imageAtlasTexture,R=M||t.options.rotating||t.options.zooming||"composite"===S.kind||"camera"===S.kind?f.LINEAR:f.NEAREST);else{const e=1!==r.layout.get("icon-size").constantOr(0)||c.iconsNeedLinear;D=n.imageAtlasTexture,L=p||t.options.rotating||t.options.zooming||e||M?f.LINEAR:f.NEAREST,E=n.imageAtlasTexture.size}const O=Ft(n,1,t.transform.zoom),V=b?l.posMatrix:qi,N=gt(V,y,g,t.transform,O),j=yt(V,y,g,t.transform,O),U=yt(l.posMatrix,y,g,t.transform,O),$=_.translatePosition(t.transform,n,a,o),q=I&&c.hasTextData(),Z="none"!==r.layout.get("icon-text-fit")&&q&&c.hasIconData();if(x){const e=t.style.map.terrain?(e,i)=>t.style.map.terrain.getElevation(l,e,i):null,i="map"===r.layout.get("text-rotation-alignment");wt(c,l.posMatrix,t,s,N,U,y,h,i,_,l.toUnwrapped(),m.width,m.height,$,e)}const G=l.posMatrix,H=s&&I||Z,X=x||H?qi:N,W=j,K=p&&0!==r.paint.get(s?"text-halo-width":"icon-halo-width").constantOr(1);let J;J=p?c.iconsInText?qe(S.kind,C,v,y,x,H,t,G,X,W,$,E,B,A):$e(S.kind,C,v,y,x,H,t,G,X,W,$,s,E,!0,A):Ue(S.kind,C,v,y,x,H,t,G,X,W,$,s,E,A);const Y={program:k,buffers:u,uniformValues:J,atlasTexture:D,atlasTextureIcon:F,atlasInterpolation:L,atlasInterpolationIcon:R,isSDF:p,hasHalo:K};if(w&&c.canOverlap){T=!0;const t=u.segments.get();for(const i of t)P.push({segments:new e.a0([i]),sortKey:i.sortKey,state:Y,terrainData:z})}else P.push({segments:u.segments,sortKey:0,state:Y,terrainData:z})}T&&P.sort((
vendor: 17,282 bytes, line 313
313t,e)=>t.sortKey-e.sortKey);for(const e of P){const i=e.state;if(p.activeTexture.set(f.TEXTURE0),i.atlasTexture.bind(i.atlasInterpolation,f.CLAMP_TO_EDGE),i.atlasTextureIcon&&(p.activeTexture.set(f.TEXTURE1),i.atlasTextureIcon&&i.atlasTextureIcon.bind(i.atlasInterpolationIcon,f.CLAMP_TO_EDGE)),i.isSDF){const n=i.uniformValues;i.hasHalo&&(n.u_is_halo=1,Ki(i.buffers,e.segments,r,t,i.program,S,u,d,n,e.terrainData)),n.u_is_halo=0}Ki(i.buffers,e.segments,r,t,i.program,S,u,d,i.uniformValues,e.terrainData)}}function Ki(t,e,i,r,n,s,a,o,l,c){const h=r.context;n.draw(h,h.gl.TRIANGLES,s,a,o,ji.disabled,l,c,i.id,t.layoutVertexBuffer,t.indexBuffer,e,i.paint,r.transform.zoom,t.programConfigurations.get(i.id),t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer)}function Ji(t,i,r,n){const s=t.context,a=s.gl,o=Ni.disabled,l=new Bi([a.ONE,a.ONE],e.aM.transparent,[!0,!0,!0,!0]),c=i.getBucket(r);if(!c)return;const h=n.key;let u=r.heatmapFbos.get(h);u||(u=Qi(s,i.tileSize,i.tileSize),r.heatmapFbos.set(h,u)),s.bindFramebuffer.set(u.framebuffer),s.viewport.set([0,0,i.tileSize,i.tileSize]),s.clear({color:e.aM.transparent});const d=c.programConfigurations.get(r.id),p=t.useProgram("heatmap",d),f=t.style.map.terrain.getTerrainData(n);p.draw(s,a.TRIANGLES,Oi.disabled,o,l,ji.disabled,ze(n.posMatrix,i,t.transform.zoom,r.paint.get("heatmap-intensity")),f,r.id,c.layoutVertexBuffer,c.indexBuffer,c.segments,r.paint,t.transform.zoom,d)}function Yi(t,e,i){const r=t.context,n=r.gl;r.setColorMode(t.colorModeForRenderPass());const s=tr(r,e),a=i.key,o=e.heatmapFbos.get(a);o&&(r.activeTexture.set(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,o.colorAttachment.get()),r.activeTexture.set(n.TEXTURE1),s.bind(n.LINEAR,n.CLAMP_TO_EDGE),t.useProgram("heatmapTexture").draw(r,n.TRIANGLES,Oi.disabled,Ni.disabled,t.colorModeForRenderPass(),ji.disabled,Ee(t,e,0,1),null,e.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments,e.paint,t.transform.zoom),o.destroy(),e.heatmapFbos["delete"](a))}function Qi(t,e,i){var r,n;const s=t.gl,a=s.createTexture();s.bindTexture(s.TEXTURE_2D,a),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_S,s.CLAMP_TO_EDGE),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_T,s.CLAMP_TO_EDGE),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MIN_FILTER,s.LINEAR),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_MAG_FILTER,s.LINEAR);const o=null!==(r=t.HALF_FLOAT)&&void 0!==r?r:s.UNSIGNED_BYTE,l=null!==(n=t.RGBA16F)&&void 0!==n?n:s.RGBA;s.texImage2D(s.TEXTURE_2D,0,l,e,i,0,s.RGBA,o,null);const c=t.createFramebuffer(e,i,!1,!1);return c.colorAttachment.set(a),c}function tr(t,e){return e.colorRampTexture||(e.colorRampTexture=new b(t,e.colorRamp,t.gl.RGBA)),e.colorRampTexture}function er(t,e,i,r,n){if(!i||!r||!r.imageAtlas)return;const s=r.imageAtlas.patternPositions;let a=s[i.to.toString()],o=s[i.from.toString()];if(!a&&o&&(a=o),!o&&a&&(o=a),!a||!o){const t=n.getPaintProperty(e);a=s[t],o=s[t]}a&&o&&t.setConstantPatternPositions(a,o)}function ir(t,e,i,r,n,s,a){const o=t.context.gl,l="fill-pattern",c=i.paint.get(l),h=c&&c.constantOr(1),u=i.getCrossfadeParameters();let d,p,f,m,_;a?(p=h&&!i.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",d=o.LINES):(p=h?"fillPattern":"fill",d=o.TRIANGLES);const g=c.constantOr(null);for(const c of r){const r=e.getTile(c);if(h&&!r.patternsLoaded())continue;const y=r.getBucket(i);if(!y)continue;const x=y.programConfigurations.get(i.id),v=t.useProgram(p,x),b=t.style.map.terrain&&t.style.map.terrain.getTerrainData(c);h&&(t.context.activeTexture.set(o.TEXTURE0),r.imageAtlasTexture.bind(o.LINEAR,o.CLAMP_TO_EDGE),x.updatePaintBuffers(u)),er(x,l,g,r,i);const w=b?c:null,T=t.translatePosMatrix(w?w.posMatrix:c.posMatrix,r,i.paint.get("fill-translate"),i.paint.get("fill-translate-anchor"));if(a){m=y.indexBuffer2,_=y.segments2;const e=[o.drawingBufferWidth,o.drawingBufferHeight];f="fillOutlinePattern"===p&&h?Pe(T,t,u,r,e):Ie(T,e)}else m=y.indexBuffer,_=y.segments,f=h?Se(T,t,u,r):Te(T);v.draw(t.context,d,n,t.stencilModeForClipping(c),s,ji.disabled,f,b,i.id,y.layoutVertexBuffer,m,_,i.paint,t.transform.zoom,x)}}function rr(t,e,i,r,n,s,a){const o=t.context,l=o.gl,c="fill-extrusion-pattern",h=i.paint.get(c),u=h.constantOr(1),d=i.getCrossfadeParameters(),p=i.paint.get("fill-extrusion-opacity"),f=h.constantOr(null);for(const h of r){const r=e.getTile(h),m=r.getBucket(i);if(!m)continue;const _=t.style.map.terrain&&t.style.map.terrain.getTerrainData(h),g=m.programConfigurations.get(i.id),y=t.useProgram(u?"fillExtrusionPattern":"fillExtrusion",g);u&&(t.context.activeTexture.set(l.TEXTURE0),r.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),g.updatePaintBuffers(d)),er(g,c,f,r,i);const x=t.translatePosMatrix(h.posMatrix,r,i.paint.get("fill-extrusion-translate"),i.paint.get("fill-extrusion-translate-anchor")),v=i.paint.get("fill-extrusion-vertical-gradient"),b=u?we(x,t,v,p,h,d,r):be(x,t,v,p);y.draw(o,o.gl.TRIANGLES,n,s,a,ji.backCCW,b,_,i.id,m.layoutVertexBuffer,m.indexBuffer,m.segments,i.paint,t.transform.zoom,g,t.style.map.terrain&&m.centroidVertexBuffer)}}function nr(t,e,i,r,n,s,a){const o=t.context,l=o.gl,c=i.fbo;if(!c)return;const h=t.useProgram("hillshade"),u=t.style.map.terrain&&t.style.map.terrain.getTerrainData(e);o.activeTexture.set(l.TEXTURE0),l.bindTexture(l.TEXTURE_2D,c.colorAttachment.get()),h.draw(o,l.TRIANGLES,n,s,a,ji.disabled,((t,e,i,r)=>{const n=i.paint.get("hillshade-shadow-color"),s=i.paint.get("hillshade-highlight-color"),a=i.paint.get("hillshade-accent-color");let o=i.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===i.paint.get("hillshade-illumination-anchor")&&(o-=t.transform.angle);const l=!t.options.moving;return{u_matrix:r?r.posMatrix:t.transform.calculatePosMatrix(e.tileID.toUnwrapped(),l),u_image:0,u_latrange:De(0,e.tileID),u_light:[i.paint.get("hillshade-exaggeration"),o],u_shadow:n,u_highlight:s,u_accent:a}})(t,i,r,u?e:null),u,r.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments)}function sr(t,i,r,n,s,a){const o=t.context,l=o.gl,c=i.dem;if(c&&c.data){const h=c.dim,u=c.stride,d=c.getPixels();if(o.activeTexture.set(l.TEXTURE1),o.pixelStoreUnpackPremultiplyAlpha.set(!1),i.demTexture=i.demTexture||t.getTileTexture(u),i.demTexture){const t=i.demTexture;t.update(d,{premultiply:!1}),t.bind(l.NEAREST,l.CLAMP_TO_EDGE)}else i.demTexture=new b(o,d,l.RGBA,{premultiply:!1}),i.demTexture.bind(l.NEAREST,l.CLAMP_TO_EDGE);o.activeTexture.set(l.TEXTURE0);let p=i.fbo;if(!p){const t=new b(o,{width:h,height:h,data:null},l.RGBA);t.bind(l.LINEAR,l.CLAMP_TO_EDGE),p=i.fbo=o.createFramebuffer(h,h,!0,!1),p.colorAttachment.set(t.texture)}o.bindFramebuffer.set(p.framebuffer),o.viewport.set([0,0,h,h]),t.useProgram("hillshadePrepare").draw(o,l.TRIANGLES,n,s,a,ji.disabled,((t,i)=>{const r=i.stride,n=e.H();return e.aP(n,0,e.X,-e.X,0,0,1),e.J(n,n,[0,-e.X,0]),{u_matrix:n,u_image:1,u_dimension:[r,r],u_zoom:t.overscaledZ,u_unpack:i.getUnpackVector()}})(i.tileID,c),null,r.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments),i.needsHillshadePrepare=!1}}function ar(t,i,r,n,a,o){const l=n.paint.get("raster-fade-duration");if(!o&&l>0){const n=s.now(),o=(n-t.timeAdded)/l,c=i?(n-i.timeAdded)/l:-1,h=r.getSource(),u=a.coveringZoomLevel({tileSize:h.tileSize,roundZoom:h.roundZoom}),d=!i||Math.abs(i.tileID.overscaledZ-u)>Math.abs(t.tileID.overscaledZ-u),p=d&&t.refreshedUponExpiration?1:e.ac(d?o:1-c,0,1);return t.refreshedUponExpiration&&o>=1&&(t.refreshedUponExpiration=!1),i?{opacity:1,mix:1-p}:{opacity:p,mix:0}}return{opacity:1,mix:0}}const or=new e.aM(1,0,0,1),lr=new e.aM(0,1,0,1),cr=new e.aM(0,0,1,1),hr=new e.aM(1,0,1,1),ur=new e.aM(0,1,1,1);function dr(t,e,i,r){fr(t,0,e+i/2,t.transform.width,i,r)}function pr(t,e,i,r){fr(t,e-i/2,0,i,t.transform.height,r)}function fr(t,e,i,r,n,s){const a=t.context,o=a.gl;o.enable(o.SCISSOR_TEST),o.scissor(e*t.pixelRatio,i*t.pixelRatio,r*t.pixelRatio,n*t.pixelRatio),a.clear({color:s}),o.disable(o.SCISSOR_TEST)}function mr(t,i,r){const n=t.context,s=n.gl,a=r.posMatrix,o=t.useProgram("debug"),l=Oi.disabled,c=Ni.disabled,h=t.colorModeForRenderPass(),u="$debug",d=t.style.map.terrain&&t.style.map.terrain.getTerrainData(r);n.activeTexture.set(s.TEXTURE0);const p=i.getTileByID(r.key).latestRawTileData,f=Math.floor((p&&p.byteLength||0)/1024),m=i.getTile(r).tileSize,_=512/Math.min(m,512)*(r.overscaledZ/t.transform.zoom)*.5;let g=r.canonical.toString();r.overscaledZ!==r.canonical.z&&(g+=` => ${r.overscaledZ}`),function(t,e){t.initDebugOverlayCanvas();const i=t.debugOverlayCanvas,r=t.context.gl,n=t.debugOverlayCanvas.getContext("2d");n.clearRect(0,0,i.width,i.height),n.shadowColor="white",n.shadowBlur=2,n.lineWidth=1.5,n.strokeStyle="white",n.textBaseline="top",n.font="bold 36px Open Sans, sans-serif",n.fillText(e,5,5),n.strokeText(e,5,5),t.debugOverlayTexture.update(i),t.debugOverlayTexture.bind(r.LINEAR,r.CLAMP_TO_EDGE)}(t,`${g} ${f}kB`),o.draw(n,s.TRIANGLES,l,c,Bi.alphaBlended,ji.disabled,ke(a,e.aM.transparent,_),null,u,t.debugBuffer,t.quadTriangleIndexBuffer,t.debugSegments),o.draw(n,s.LINE_STRIP,l,c,h,ji.disabled,ke(a,e.aM.red),d,u,t.debugBuffer,t.tileBorderIndexBuffer,t.debugSegments)}function _r(t,e,i){const r=t.context,n=r.gl,s=t.colorModeForRenderPass(),a=new Oi(n.LEQUAL,Oi.ReadWrite,t.depthRangeFor3D),o=t.useProgram("terrain"),l=e.getTerrainMesh();r.bindFramebuffer.set(null),r.viewport.set([0,0,t.width,t.height]);for(const c of i){const i=t.renderToTexture.getTexture(c),h=e.getTerrainData(c.tileID);r.activeTexture.set(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,i.texture);const u=t.transform.calculatePosMatrix(c.tileID.toUnwrapped()),d=e.getMeshFrameDelta(t.transform.zoom),p=t.transform.calculateFogMatrix(c.tileID.toUnwrapped()),f=ge(u,d,p,t.style.sky,t.transform.pitch);o.draw(r,n.TRIANGLES,a,Ni.disabled,s,ji.backCCW,f,h,"terrain",l.vertexBuffer,l.indexBuffer,l.segments)}}class gr{constructor(t,e,i){this.vertexBuffer=t,this.indexBuffer=e,this.segments=i}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}class yr{constructor(t,i){this.context=new Fi(t),this.transform=i,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:e.an(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=ut.maxUnderzooming+ut.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new ce}resize(t,e,i){if(this.width=Math.floor(t*i),this.height=Math.floor(e*i),this.pixelRatio=i,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const t of this.style._order)this.style._layers[t].resize()}setup(){const t=this.context,i=new e.aX;i.emplaceBack(0,0),i.emplaceBack(e.X,0),i.emplaceBack(0,e.X),i.emplaceBack(e.X,e.X),this.tileExtentBuffer=t.createVertexBuffer(i,pe.members),this.tileExtentSegments=e.a0.simpleSegment(0,0,4,2);const r=new e.aX;r.emplaceBack(0,0),r.emplaceBack(e.X,0),r.emplaceBack(0,e.X),r.emplaceBack(e.X,e.X),this.debugBuffer=t.createVertexBuffer(r,pe.members),this.debugSegments=e.a0.simpleSegment(0,0,4,5);const n=new e.$;n.emplaceBack(0,0,0,0),n.emplaceBack(e.X,0,e.X,0),n.emplaceBack(0,e.X,0,e.X),n.emplaceBack(e.X,e.X,e.X,e.X),this.rasterBoundsBuffer=t.createVertexBuffer(n,Y.members),this.rasterBoundsSegments=e.a0.simpleSegment(0,0,4,2);const s=new e.aX;s.emplaceBack(0,0),s.emplaceBack(1,0),s.emplaceBack(0,1),s.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(s,pe.members),this.viewportSegments=e.a0.simpleSegment(0,0,4,2);const a=new e.aZ;a.emplaceBack(0),a.emplaceBack(1),a.emplaceBack(3),a.emplaceBack(2),a.emplaceBack(0),this.tileBorderIndexBuffer=t.createIndexBuffer(a);const o=new e.aY;o.emplaceBack(0,1,2),o.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(o);const l=this.context.gl;this.stencilClearMode=new Ni({func:l.ALWAYS,mask:0},0,255,l.ZERO,l.ZERO,l.ZERO)}clearStencil(){const t=this.context,i=t.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const r=e.H();e.aP(r,0,this.width,this.height,0,0,1),e.K(r,r,[i.drawingBufferWidth,i.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(t,i.TRIANGLES,Oi.disabled,this.stencilClearMode,Bi.disabled,ji.disabled,Ce(r),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(t,e){if(this.currentStencilSource===t.source||!t.isTileClipped()||!e||!e.length)return;this.currentStencilSource=t.source;const i=this.context,r=i.gl;this.nextStencilID+e.length>256&&this.clearStencil(),i.setColorMode(Bi.disabled),i.setDepthMode(Oi.disabled);const n=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const t of e){const e=this._tileClippingMaskIDs[t.key]=this.nextStencilID++,s=this.style.map.terrain&&this.style.map.terrain.getTerrainData(t);n.draw(i,r.TRIANGLES,Oi.disabled,new Ni({func:r.ALWAYS,mask:0},e,255,r.KEEP,r.KEEP,r.REPLACE),Bi.disabled,ji.disabled,Ce(t.posMatrix),s,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const t=this.nextStencilID++,e=this.context.gl;return new Ni({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)}stencilModeForClipping(t){const e=this.context.gl;return new Ni({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)}stencilConfigForOverlap(t){const e=this.context.gl,i=t.sort((t,e)=>e.overscaledZ-t.overscaledZ),r=i[i.length-1].overscaledZ,n=i[0].overscaledZ-r+1;if(n>1){this.currentStencilSource=void 0,this.nextStencilID+n>256&&this.clearStencil();const t={};for(let i=0;i<n;i++)t[i+r]=new Ni({func:e.GEQUAL,mask:255},i+this.nextStencilID,255,e.KEEP,e.KEEP,e.REPLACE);return this.nextStencilID+=n,[t,i]}return[{[r]:Ni.disabled},i]}colorModeForRenderPass(){const t=this.context.gl;if(this._showOverdrawInspector){const i=1/8;return new Bi([t.CONSTANT_COLOR,t.ONE],new e.aM(i,i,i,0),[!0,!0,!0,!0])}return"opaque"===this.renderPass?Bi.unblended:Bi.alphaBlended}depthModeForSublayer(t,e,i){if(!this.opaquePassEnabledForLayer())return Oi.disabled;const r=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon;return new Oi(i||this.context.gl.LEQUAL,e,[r,r])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(t,i){this.style=t,this.options=i,this.lineAtlas=t.lineAtlas,this.imageManager=t.imageManager,this.glyphManager=t.glyphManager,this.symbolFadeChange=t.placement.symbolFadeChange(s.now()),this.imageManager.beginFrame();const r=this.style._order,n=this.style.sourceCaches,a={},o={},l={};for(const t in n){const e=n[t];e.used&&e.prepare(this.context),a[t]=e.getVisibleCoordinates(),o[t]=a[t].slice().reverse(),l[t]=e.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let t=0;t<r.length;t++)if(this.style._layers[r[t]].is3D()){this.opaquePassCutoff=t;break}this.maybeDrawDepthAndCoords(!1),this.renderToTexture&&(this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0),this.renderPass="offscreen";for(const t of r){const e=this.style._layers[t];if(!e.hasOffscreenPass()||e.isHidden(this.transform.zoom))continue;const i=o[e.source];("custom"===e.type||i.length)&&this.renderLayer(this,n[e.source],e,i)}if(this.context.bindFramebuffer.set(null),this.context.clear({color:i.showOverdrawInspector?e.aM.black:e.aM.transparent,depth:1}),this.clearStencil(),this.style.sky&&function(t,i){const r=t.context,n=r.gl,s=((t,e,i)=>({u_sky_color:t.properties.get("sky-color"),u_horizon_color:t.properties.get("horizon-color"),u_horizon:(e.height/2+e.getHorizon())*i,u_sky_horizon_blend:t.properties.get("sky-horizon-blend")*e.height/2*i}))(i,t.style.map.transform,t.pixelRatio),a=new Oi(n.LEQUAL,Oi.ReadWrite,[0,1]),o=Ni.disabled,l=t.colorModeForRenderPass(),c=t.useProgram("sky");if(!i.mesh){const t=new e.aX;t.emplaceBack(-1,-1),t.emplaceBack(1,-1),t.emplaceBack(1,1),t.emplaceBack(-1,1);const n=new e.aY;n.emplaceBack(0,1,2),n.emplaceBack(0,2,3),i.mesh=new gr(r.createVertexBuffer(t,pe.members),r.createIndexBuffer(n),e.a0.simpleSegment(0,0,t.length,n.length))}c.draw(r,n.TRIANGLES,a,o,l,ji.disabled,s,void 0,"sky",i.mesh.vertexBuffer,i.mesh.indexBuffer,i.mesh.segments)}(this,this.style.sky),this._showOverdrawInspector=i.showOverdrawInspector,this.depthRangeFor3D=[0,1-(t._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=r.length-1;this.currentLayer>=0;this.currentLayer--){const t=this.style._layers[r[this.currentLayer]],e=n[t.source],i=a[t.source];this._renderTileClippingMasks(t,i),this.renderLayer(this,e,t,i)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<r.length;this.currentLayer++){const t=this.style._layers[r[this.currentLayer]],e=n[t.source];if(this.renderToTexture&&this.renderToTexture.renderLayer(t))continue;const i=("symbol"===t.type?l:o)[t.source];this._renderTileClippingMasks(t,a[t.source]),this.renderLayer(this,e,t,i)}if(this.options.showTileBoundaries){const t=function(t,e){let i=null;const r=Object.values(t._layers).flatMap(i=>i.source&&!i.isHidden(e)?[t.sourceCaches[i.source]]:[]),n=r.filter(t=>"vector"===t.getSource().type),s=r.filter(t=>"vector"!==t.getSource().type),a=t=>{(!i||i.getSource().maxzoom<t.getSource().maxzoom)&&(i=t)};return n.forEach(t=>a(t)),i||s.forEach(t=>a(t
vendor: 5,258 bytes, line 313
313)),i}(this.style,this.transform.zoom);t&&function(t,e,i){for(let r=0;r<i.length;r++)mr(t,e,i[r])}(this,t,t.getVisibleCoordinates())}this.options.showPadding&&function(t){const e=t.transform.padding;dr(t,t.transform.height-(e.top||0),3,or),dr(t,e.bottom||0,3,lr),pr(t,e.left||0,3,cr),pr(t,t.transform.width-(e.right||0),3,hr);const i=t.transform.centerPoint;!function(t,e,i,r){fr(t,e-1,i-10,2,20,r),fr(t,e-10,i-1,20,2,r)}(t,i.x,t.transform.height-i.y,ur)}(this),this.context.setDefault()}maybeDrawDepthAndCoords(t){if(!this.style||!this.style.map||!this.style.map.terrain)return;const i=this.terrainFacilitator.matrix,r=this.transform.modelViewProjectionMatrix;let n=this.terrainFacilitator.dirty;n||(n=t?!e.a_(i,r):!e.a$(i,r)),n||(n=this.style.map.terrain.sourceCache.tilesAfterTime(this.terrainFacilitator.renderTime).length>0),n&&(e.b0(i,r),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(t,i){const r=t.context,n=r.gl,s=Bi.unblended,a=new Oi(n.LEQUAL,Oi.ReadWrite,[0,1]),o=i.getTerrainMesh(),l=i.sourceCache.getRenderableTiles(),c=t.useProgram("terrainDepth");r.bindFramebuffer.set(i.getFramebuffer("depth").framebuffer),r.viewport.set([0,0,t.width/devicePixelRatio,t.height/devicePixelRatio]),r.clear({color:e.aM.transparent,depth:1});for(const e of l){const l=i.getTerrainData(e.tileID),h={u_matrix:t.transform.calculatePosMatrix(e.tileID.toUnwrapped()),u_ele_delta:i.getMeshFrameDelta(t.transform.zoom)};c.draw(r,n.TRIANGLES,a,Ni.disabled,s,ji.backCCW,h,l,"terrain",o.vertexBuffer,o.indexBuffer,o.segments)}r.bindFramebuffer.set(null),r.viewport.set([0,0,t.width,t.height])}(this,this.style.map.terrain),function(t,i){const r=t.context,n=r.gl,s=Bi.unblended,a=new Oi(n.LEQUAL,Oi.ReadWrite,[0,1]),o=i.getTerrainMesh(),l=i.getCoordsTexture(),c=i.sourceCache.getRenderableTiles(),h=t.useProgram("terrainCoords");r.bindFramebuffer.set(i.getFramebuffer("coords").framebuffer),r.viewport.set([0,0,t.width/devicePixelRatio,t.height/devicePixelRatio]),r.clear({color:e.aM.transparent,depth:1}),i.coordsIndex=[];for(const e of c){const c=i.getTerrainData(e.tileID);r.activeTexture.set(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,l.texture);const u={u_matrix:t.transform.calculatePosMatrix(e.tileID.toUnwrapped()),u_terrain_coords_id:(255-i.coordsIndex.length)/255,u_texture:0,u_ele_delta:i.getMeshFrameDelta(t.transform.zoom)};h.draw(r,n.TRIANGLES,a,Ni.disabled,s,ji.backCCW,u,c,"terrain",o.vertexBuffer,o.indexBuffer,o.segments),i.coordsIndex.push(e.tileID.key)}r.bindFramebuffer.set(null),r.viewport.set([0,0,t.width,t.height])}(this,this.style.map.terrain))}renderLayer(t,i,r,n){if(!r.isHidden(this.transform.zoom)&&("background"===r.type||"custom"===r.type||(n||[]).length))switch(this.id=r.id,r.type){case"symbol":!function(t,i,r,n,s){if("translucent"!==t.renderPass)return;const a=Ni.disabled,o=t.colorModeForRenderPass();(r._unevaluatedLayout.hasValue("text-variable-anchor")||r._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(t,i,r,n,s,a,o,l,c){const h=i.transform,u=ie(),d="map"===s,p="map"===a;for(const s of t){const t=n.getTile(s),a=t.getBucket(r);if(!a||!a.text||!a.text.segments.get().length)continue;const f=e.ag(a.textSizeData,h.zoom),m=Ft(t,1,i.transform.zoom),_=gt(s.posMatrix,p,d,i.transform,m),g="none"!==r.layout.get("icon-text-fit")&&a.hasIconData();if(f){const e=Math.pow(2,h.zoom-t.tileID.overscaledZ),r=i.style.map.terrain?(t,e)=>i.style.map.terrain.getElevation(s,t,e):null,n=u.translatePosition(h,t,o,l);Hi(a,d,p,c,h,_,s.posMatrix,e,f,g,u,n,s.toUnwrapped(),r)}}}(n,t,r,i,r.layout.get("text-rotation-alignment"),r.layout.get("text-pitch-alignment"),r.paint.get("text-translate"),r.paint.get("text-translate-anchor"),s),0!==r.paint.get("icon-opacity").constantOr(1)&&Wi(t,i,r,n,!1,r.paint.get("icon-translate"),r.paint.get("icon-translate-anchor"),r.layout.get("icon-rotation-alignment"),r.layout.get("icon-pitch-alignment"),r.layout.get("icon-keep-upright"),a,o),0!==r.paint.get("text-opacity").constantOr(1)&&Wi(t,i,r,n,!0,r.paint.get("text-translate"),r.paint.get("text-translate-anchor"),r.layout.get("text-rotation-alignment"),r.layout.get("text-pitch-alignment"),r.layout.get("text-keep-upright"),a,o),i.map.showCollisionBoxes&&($i(t,i,r,n,!0),$i(t,i,r,n,!1))}(t,i,r,n,this.style.placement.variableOffsets);break;case"circle":!function(t,i,r,n){if("translucent"!==t.renderPass)return;const s=r.paint.get("circle-opacity"),a=r.paint.get("circle-stroke-width"),o=r.paint.get("circle-stroke-opacity"),l=!r.layout.get("circle-sort-key").isConstant();if(0===s.constantOr(1)&&(0===a.constantOr(1)||0===o.constantOr(1)))return;const c=t.context,h=c.gl,u=t.depthModeForSublayer(0,Oi.ReadOnly),d=Ni.disabled,p=t.colorModeForRenderPass(),f=[];for(let s=0;s<n.length;s++){const a=n[s],o=i.getTile(a),c=o.getBucket(r);if(!c)continue;const h=c.programConfigurations.get(r.id),u=t.useProgram("circle",h),d=c.layoutVertexBuffer,p=c.indexBuffer,m=t.style.map.terrain&&t.style.map.terrain.getTerrainData(a),_={programConfiguration:h,program:u,layoutVertexBuffer:d,indexBuffer:p,uniformValues:Ae(t,a,o,r),terrainData:m};if(l){const t=c.segments.get();for(const i of t)f.push({segments:new e.a0([i]),sortKey:i.sortKey,state:_})}else f.push({segments:c.segments,sortKey:0,state:_})}l&&f.sort((
vendor: 11,937 bytes, line 313
313t,e)=>t.sortKey-e.sortKey);for(const e of f){const{programConfiguration:i,program:n,layoutVertexBuffer:s,indexBuffer:a,uniformValues:o,terrainData:l}=e.state;n.draw(c,h.TRIANGLES,u,d,p,ji.disabled,o,l,r.id,s,a,e.segments,r.paint,t.transform.zoom,i)}}(t,i,r,n);break;case"heatmap":!function(t,i,r,n){if(0===r.paint.get("heatmap-opacity"))return;const s=t.context;if(t.style.map.terrain){for(const e of n){const n=i.getTile(e);i.hasRenderableParent(e)||("offscreen"===t.renderPass?Ji(t,n,r,e):"translucent"===t.renderPass&&Yi(t,r,e))}s.viewport.set([0,0,t.width,t.height])}else"offscreen"===t.renderPass?function(t,i,r,n){const s=t.context,a=s.gl,o=Ni.disabled,l=new Bi([a.ONE,a.ONE],e.aM.transparent,[!0,!0,!0,!0]);(function(t,i,r){const n=t.gl;t.activeTexture.set(n.TEXTURE1),t.viewport.set([0,0,i.width/4,i.height/4]);let s=r.heatmapFbos.get(e.aU);s?(n.bindTexture(n.TEXTURE_2D,s.colorAttachment.get()),t.bindFramebuffer.set(s.framebuffer)):(s=Qi(t,i.width/4,i.height/4),r.heatmapFbos.set(e.aU,s))})(s,t,r),s.clear({color:e.aM.transparent});for(let e=0;e<n.length;e++){const c=n[e];if(i.hasRenderableParent(c))continue;const h=i.getTile(c),u=h.getBucket(r);if(!u)continue;const d=u.programConfigurations.get(r.id),p=t.useProgram("heatmap",d),{zoom:f}=t.transform;p.draw(s,a.TRIANGLES,Oi.disabled,o,l,ji.disabled,ze(c.posMatrix,h,f,r.paint.get("heatmap-intensity")),null,r.id,u.layoutVertexBuffer,u.indexBuffer,u.segments,r.paint,t.transform.zoom,d)}s.viewport.set([0,0,t.width,t.height])}(t,i,r,n):"translucent"===t.renderPass&&function(t,i){const r=t.context,n=r.gl;r.setColorMode(t.colorModeForRenderPass());const s=i.heatmapFbos.get(e.aU);s&&(r.activeTexture.set(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,s.colorAttachment.get()),r.activeTexture.set(n.TEXTURE1),tr(r,i).bind(n.LINEAR,n.CLAMP_TO_EDGE),t.useProgram("heatmapTexture").draw(r,n.TRIANGLES,Oi.disabled,Ni.disabled,t.colorModeForRenderPass(),ji.disabled,Ee(t,i,0,1),null,i.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments,i.paint,t.transform.zoom))}(t,r)}(t,i,r,n);break;case"line":!function(t,i,r,n){if("translucent"!==t.renderPass)return;const s=r.paint.get("line-opacity"),a=r.paint.get("line-width");if(0===s.constantOr(1)||0===a.constantOr(1))return;const o=t.depthModeForSublayer(0,Oi.ReadOnly),l=t.colorModeForRenderPass(),c=r.paint.get("line-dasharray"),h=r.paint.get("line-pattern"),u=h.constantOr(1),d=r.paint.get("line-gradient"),p=r.getCrossfadeParameters(),f=u?"linePattern":c?"lineSDF":d?"lineGradient":"line",m=t.context,_=m.gl;let g=!0;for(const s of n){const n=i.getTile(s);if(u&&!n.patternsLoaded())continue;const a=n.getBucket(r);if(!a)continue;const y=a.programConfigurations.get(r.id),x=t.context.program.get(),v=t.useProgram(f,y),w=g||v.program!==x,T=t.style.map.terrain&&t.style.map.terrain.getTerrainData(s),S=h.constantOr(null);if(S&&n.imageAtlas){const t=n.imageAtlas,e=t.patternPositions[S.to.toString()],i=t.patternPositions[S.from.toString()];e&&i&&y.setConstantPatternPositions(e,i)}const I=T?s:null,P=u?Be(t,n,r,p,I):c?Fe(t,n,r,c,p,I):d?Re(t,n,r,a.lineClipsArray.length,I):Le(t,n,r,I);if(u)m.activeTexture.set(_.TEXTURE0),n.imageAtlasTexture.bind(_.LINEAR,_.CLAMP_TO_EDGE),y.updatePaintBuffers(p);else if(c&&(w||t.lineAtlas.dirty))m.activeTexture.set(_.TEXTURE0),t.lineAtlas.bind(m);else if(d){const n=a.gradients[r.id];let o=n.texture;if(r.gradientVersion!==n.version){let l=256;if(r.stepInterpolant){const r=i.getSource().maxzoom,n=s.canonical.z===r?Math.ceil(1<<t.transform.maxZoom-s.canonical.z):1;l=e.ac(e.aV(a.maxLineLength/e.X*1024*n),256,m.maxTextureSize)}n.gradient=e.aW({expression:r.gradientExpression(),evaluationKey:"lineProgress",resolution:l,image:n.gradient||void 0,clips:a.lineClipsArray}),n.texture?n.texture.update(n.gradient):n.texture=new b(m,n.gradient,_.RGBA),n.version=r.gradientVersion,o=n.texture}m.activeTexture.set(_.TEXTURE0),o.bind(r.stepInterpolant?_.NEAREST:_.LINEAR,_.CLAMP_TO_EDGE)}v.draw(m,_.TRIANGLES,o,t.stencilModeForClipping(s),l,ji.disabled,P,T,r.id,a.layoutVertexBuffer,a.indexBuffer,a.segments,r.paint,t.transform.zoom,y,a.layoutVertexBuffer2),g=!1}}(t,i,r,n);break;case"fill":!function(t,i,r,n){const s=r.paint.get("fill-color"),a=r.paint.get("fill-opacity");if(0===a.constantOr(1))return;const o=t.colorModeForRenderPass(),l=r.paint.get("fill-pattern"),c=t.opaquePassEnabledForLayer()&&!l.constantOr(1)&&1===s.constantOr(e.aM.transparent).a&&1===a.constantOr(0)?"opaque":"translucent";if(t.renderPass===c){const e=t.depthModeForSublayer(1,"opaque"===t.renderPass?Oi.ReadWrite:Oi.ReadOnly);ir(t,i,r,n,e,o,!1)}if("translucent"===t.renderPass&&r.paint.get("fill-antialias")){const e=t.depthModeForSublayer(r.getPaintProperty("fill-outline-color")?2:0,Oi.ReadOnly);ir(t,i,r,n,e,o,!0)}}(t,i,r,n);break;case"fill-extrusion":!function(t,e,i,r){const n=i.paint.get("fill-extrusion-opacity");if(0!==n&&"translucent"===t.renderPass){const s=new Oi(t.context.gl.LEQUAL,Oi.ReadWrite,t.depthRangeFor3D);if(1!==n||i.paint.get("fill-extrusion-pattern").constantOr(1))rr(t,e,i,r,s,Ni.disabled,Bi.disabled),rr(t,e,i,r,s,t.stencilModeFor3D(),t.colorModeForRenderPass());else{const n=t.colorModeForRenderPass();rr(t,e,i,r,s,Ni.disabled,n)}}}(t,i,r,n);break;case"hillshade":!function(t,e,i,r){if("offscreen"!==t.renderPass&&"translucent"!==t.renderPass)return;const n=t.context,s=t.depthModeForSublayer(0,Oi.ReadOnly),a=t.colorModeForRenderPass(),[o,l]="translucent"===t.renderPass?t.stencilConfigForOverlap(r):[{},r];for(const r of l){const n=e.getTile(r);void 0!==n.needsHillshadePrepare&&n.needsHillshadePrepare&&"offscreen"===t.renderPass?sr(t,n,i,s,Ni.disabled,a):"translucent"===t.renderPass&&nr(t,r,n,i,s,o[r.overscaledZ],a)}n.viewport.set([0,0,t.width,t.height])}(t,i,r,n);break;case"raster":!function(t,e,i,r){if("translucent"!==t.renderPass)return;if(0===i.paint.get("raster-opacity"))return;if(!r.length)return;const n=t.context,s=n.gl,a=e.getSource(),o=t.useProgram("raster"),l=t.colorModeForRenderPass(),[c,h]=a instanceof Q?[{},r]:t.stencilConfigForOverlap(r),u=h[h.length-1].overscaledZ,d=!t.options.moving;for(const r of h){const h=t.depthModeForSublayer(r.overscaledZ-u,1===i.paint.get("raster-opacity")?Oi.ReadWrite:Oi.ReadOnly,s.LESS),p=e.getTile(r);p.registerFadeDuration(i.paint.get("raster-fade-duration"));const f=e.findLoadedParent(r,0),m=e.findLoadedSibling(r),_=ar(p,f||m||null,e,i,t.transform,t.style.map.terrain);let g,y;const x="nearest"===i.paint.get("raster-resampling")?s.NEAREST:s.LINEAR;n.activeTexture.set(s.TEXTURE0),p.texture.bind(x,s.CLAMP_TO_EDGE,s.LINEAR_MIPMAP_NEAREST),n.activeTexture.set(s.TEXTURE1),f?(f.texture.bind(x,s.CLAMP_TO_EDGE,s.LINEAR_MIPMAP_NEAREST),g=Math.pow(2,f.tileID.overscaledZ-p.tileID.overscaledZ),y=[p.tileID.canonical.x*g%1,p.tileID.canonical.y*g%1]):p.texture.bind(x,s.CLAMP_TO_EDGE,s.LINEAR_MIPMAP_NEAREST),p.texture.useMipmap&&n.extTextureFilterAnisotropic&&t.transform.pitch>20&&s.texParameterf(s.TEXTURE_2D,n.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,n.extTextureFilterAnisotropicMax);const v=t.style.map.terrain&&t.style.map.terrain.getTerrainData(r),b=v?r:null,w=b?b.posMatrix:t.transform.calculatePosMatrix(r.toUnwrapped(),d),T=Ne(w,y||[0,0],g||1,_,i);a instanceof Q?o.draw(n,s.TRIANGLES,h,Ni.disabled,l,ji.disabled,T,v,i.id,a.boundsBuffer,t.quadTriangleIndexBuffer,a.boundsSegments):o.draw(n,s.TRIANGLES,h,c[r.overscaledZ],l,ji.disabled,T,v,i.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments)}}(t,i,r,n);break;case"background":!function(t,e,i,r){const n=i.paint.get("background-color"),s=i.paint.get("background-opacity");if(0===s)return;const a=t.context,o=a.gl,l=t.transform,c=l.tileSize,h=i.paint.get("background-pattern");if(t.isPatternMissing(h))return;const u=!h&&1===n.a&&1===s&&t.opaquePassEnabledForLayer()?"opaque":"translucent";if(t.renderPass!==u)return;const d=Ni.disabled,p=t.depthModeForSublayer(0,"opaque"===u?Oi.ReadWrite:Oi.ReadOnly),f=t.colorModeForRenderPass(),m=t.useProgram(h?"backgroundPattern":"background"),_=r||l.coveringTiles({tileSize:c,terrain:t.style.map.terrain});h&&(a.activeTexture.set(o.TEXTURE0),t.imageManager.bind(t.context));const g=i.getCrossfadeParameters();for(const e of _){const l=r?e.posMatrix:t.transform.calculatePosMatrix(e.toUnwrapped()),u=h?Ge(l,s,t,h,{tileID:e,tileSize:c},g):Ze(l,s,n),_=t.style.map.terrain&&t.style.map.terrain.getTerrainData(e);m.draw(a,o.TRIANGLES,p,d,f,ji.disabled,u,_,i.id,t.tileExtentBuffer,t.quadTriangleIndexBuffer,t.tileExtentSegments)}}(t,0,r,n);break;case"custom":!function(t,e,i){const r=t.context,n=i.implementation;if("offscreen"===t.renderPass){const e=n.prerender;e&&(t.setCustomLayerDefaults(),r.setColorMode(t.colorModeForRenderPass()),e.call(n,r.gl,t.transform.customLayerMatrix()),r.setDirty(),t.setBaseState())}else if("translucent"===t.renderPass){t.setCustomLayerDefaults(),r.setColorMode(t.colorModeForRenderPass()),r.setStencilMode(Ni.disabled);const e="3d"===n.renderingMode?new Oi(t.context.gl.LEQUAL,Oi.ReadWrite,t.depthRangeFor3D):t.depthModeForSublayer(0,Oi.ReadOnly);r.setDepthMode(e),n.render(r.gl,t.transform.customLayerMatrix(),{farZ:t.transform.farZ,nearZ:t.transform.nearZ,fov:t.transform._fov,modelViewProjectionMatrix:t.transform.modelViewProjectionMatrix,projectionMatrix:t.transform.projectionMatrix}),r.setDirty(),t.setBaseState(),r.bindFramebuffer.set(null)}}(t,0,r)}}translatePosMatrix(t,i,r,n,s){if(!r[0]&&!r[1])return t;const a=s?"map"===n?this.transform.angle:0:"viewport"===n?-this.transform.angle:0;if(a){const t=Math.sin(a),e=Math.cos(a);r=[r[0]*e-r[1]*t,r[0]*t+r[1]*e]}const o=[s?r[0]:Ft(i,r[0],this.transform.zoom),s?r[1]:Ft(i,r[1],this.transform.zoom),0],l=new Float32Array(16);return e.J(l,t,o),l}saveTileTexture(t){const e=this._tileTextures[t.size[0]];e?e.push(t):this._tileTextures[t.size[0]]=[t]}getTileTexture(t){const e=this._tileTextures[t];return e&&e.length>0?e.pop():null}isPatternMissing(t){if(!t)return!1;if(!t.from||!t.to)return!0;const e=this.imageManager.getPattern(t.from.toString()),i=this.imageManager.getPattern(t.to.toString());return!e||!i}useProgram(t,e){this.cache=this.cache||{};const i=t+(e?e.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[i]||(this.cache[i]=new xe(this.context,fe[t],e,He[t],this._showOverdrawInspector,this.style.map.terrain)),this.cache[i]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)}initDebugOverlayCanvas(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new b(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:t,drawingBufferHeight:e}=this.context.gl;return this.width!==t||this.height!==e}}class xr{constructor(t,e){this.points=t,this.planes=e}static fromInvProjectionMatrix(t,i,r){const n=Math.pow(2,r),s=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(r=>{const s=1/(r=e.af([],r,t))[3]/i*n;return e.b1(r,r,[s,s,1/r[3],s])}),a=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(t=>{const e=function(t,e){var i=e[0],r=e[1],n=e[2],s=i*i+r*r+n*n;return s>0&&(s=1/Math.sqrt(s)),t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s,t}([],function(t,e,i){var r=e[0],n=e[1],s=e[2],a=i[0],o=i[1],l=i[2];return t[0]=n*l-s*o,t[1]=s*a-r*l,t[2]=r*o-n*a,t}([],g([],s[t[0]],s[t[1]]),g([],s[t[2]],s[t[1]]))),i=-((r=e)[0]*(n=s[t[1]])[0]+r[1]*n[1]+r[2]*n[2]);var r,n;return e.concat(i)}
vendor: 8,088 bytes, line 313
313);return new xr(s,a)}}class vr{constructor(t,e){this.min=t,this.max=e,this.center=function(t,e){return t[0]=.5*e[0],t[1]=.5*e[1],t[2]=.5*e[2],t}([],function(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t[2]=e[2]+i[2],t}([],this.min,this.max))}quadrant(t){const e=[t%2==0,t<2],i=m(this.min),r=m(this.max);for(let t=0;t<e.length;t++)i[t]=e[t]?this.min[t]:this.center[t],r[t]=e[t]?this.center[t]:this.max[t];return r[2]=this.max[2],new vr(i,r)}distanceX(t){return Math.max(Math.min(this.max[0],t[0]),this.min[0])-t[0]}distanceY(t){return Math.max(Math.min(this.max[1],t[1]),this.min[1])-t[1]}intersects(t){const i=[[this.min[0],this.min[1],this.min[2],1],[this.max[0],this.min[1],this.min[2],1],[this.max[0],this.max[1],this.min[2],1],[this.min[0],this.max[1],this.min[2],1],[this.min[0],this.min[1],this.max[2],1],[this.max[0],this.min[1],this.max[2],1],[this.max[0],this.max[1],this.max[2],1],[this.min[0],this.max[1],this.max[2],1]];let r=!0;for(let n=0;n<t.planes.length;n++){const s=t.planes[n];let a=0;for(let t=0;t<i.length;t++)e.b2(s,i[t])>=0&&a++;if(0===a)return 0;a!==i.length&&(r=!1)}if(r)return 2;for(let e=0;e<3;e++){let i=Number.MAX_VALUE,r=-Number.MAX_VALUE;for(let n=0;n<t.points.length;n++){const s=t.points[n][e]-this.min[e];i=Math.min(i,s),r=Math.max(r,s)}if(r<0||i>this.max[e]-this.min[e])return 0}return 1}}class br{constructor(t=0,e=0,i=0,r=0){if(isNaN(t)||t<0||isNaN(e)||e<0||isNaN(i)||i<0||isNaN(r)||r<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=e,this.left=i,this.right=r}interpolate(t,i,r){return null!=i.top&&null!=t.top&&(this.top=e.y.number(t.top,i.top,r)),null!=i.bottom&&null!=t.bottom&&(this.bottom=e.y.number(t.bottom,i.bottom,r)),null!=i.left&&null!=t.left&&(this.left=e.y.number(t.left,i.left,r)),null!=i.right&&null!=t.right&&(this.right=e.y.number(t.right,i.right,r)),this}getCenter(t,i){const r=e.ac((this.left+t-this.right)/2,0,t),n=e.ac((this.top+i-this.bottom)/2,0,i);return new e.P(r,n)}equals(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right}clone(){return new br(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}const wr=85.051129;class Tr{constructor(t,i,r,n,s){this.tileSize=512,this._renderWorldCopies=void 0===s||!!s,this._minZoom=t||0,this._maxZoom=i||22,this._minPitch=null==r?0:r,this._maxPitch=null==n?60:n,this.setMaxBounds(),this.width=0,this.height=0,this._center=new e.N(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new br,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={},this.minElevationForCurrentTile=0}clone(){const t=new Tr(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t.apply(this),t}apply(t){this.tileSize=t.tileSize,this.latRange=t.latRange,this.lngRange=t.lngRange,this.width=t.width,this.height=t.height,this._center=t._center,this._elevation=t._elevation,this.minElevationForCurrentTile=t.minElevationForCurrentTile,this.zoom=t.zoom,this.angle=t.angle,this._fov=t._fov,this._pitch=t._pitch,this._unmodified=t._unmodified,this._edgeInsets=t._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))}get maxZoom(){return this._maxZoom}set maxZoom(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))}get minPitch(){return this._minPitch}set minPitch(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))}get maxPitch(){return this._maxPitch}set maxPitch(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new e.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(t){const i=-e.b3(t,-180,180)*Math.PI/180;this.angle!==i&&(this._unmodified=!1,this.angle=i,this._calcMatrices(),this.rotationMatrix=function(){var t=new e.A(4);return e.A!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t}(),function(t,e,i){var r=e[0],n=e[1],s=e[2],a=e[3],o=Math.sin(i),l=Math.cos(i);t[0]=r*l+s*o,t[1]=n*l+a*o,t[2]=r*-o+s*l,t[3]=n*-o+a*l}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(t){const i=e.ac(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==i&&(this._unmodified=!1,this._pitch=i,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(t){const e=Math.min(Math.max(t,this.minZoom),this.maxZoom);this._zoom!==e&&(this._unmodified=!1,this._zoom=e,this.tileZoom=Math.max(0,Math.floor(e)),this.scale=this.zoomScale(e),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(t){t!==this._elevation&&(this._elevation=t,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(t){return this._edgeInsets.equals(t)}interpolatePadding(t,e,i){this._unmodified=!1,this._edgeInsets.interpolate(t,e,i),this._constrain(),this._calcMatrices()}coveringZoomLevel(t){const e=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize));return Math.max(0,e)}getVisibleUnwrappedCoordinates(t){const i=[new e.b4(0,t)];if(this._renderWorldCopies){const r=this.pointCoordinate(new e.P(0,0)),n=this.pointCoordinate(new e.P(this.width,0)),s=this.pointCoordinate(new e.P(this.width,this.height)),a=this.pointCoordinate(new e.P(0,this.height)),o=Math.floor(Math.min(r.x,n.x,s.x,a.x)),l=Math.floor(Math.max(r.x,n.x,s.x,a.x)),c=1;for(let r=o-c;r<=l+c;r++)0!==r&&i.push(new e.b4(r,t))}return i}coveringTiles(t){var i,r;let n=this.coveringZoomLevel(t);const s=n;if(void 0!==t.minzoom&&n<t.minzoom)return[];void 0!==t.maxzoom&&n>t.maxzoom&&(n=t.maxzoom);const a=this.pointCoordinate(this.getCameraPoint()),o=e.Z.fromLngLat(this.center),l=Math.pow(2,n),c=[l*a.x,l*a.y,0],h=[l*o.x,l*o.y,0],u=xr.fromInvProjectionMatrix(this.invModelViewProjectionMatrix,this.worldSize,n);let d=t.minzoom||0;!t.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(d=n);const p=t.terrain?2/Math.min(this.tileSize,t.tileSize)*this.tileSize:3,f=t=>({aabb:new vr([t*l,0,0],[(t+1)*l,l,0]),zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}),m=[],_=[],g=n,x=t.reparseOverscaled?s:n;if(this._renderWorldCopies)for(let t=1;t<=3;t++)m.push(f(-t)),m.push(f(t));for(m.push(f(0));m.length>0;){const n=m.pop(),s=n.x,a=n.y;let o=n.fullyVisible;if(!o){const t=n.aabb.intersects(u);if(0===t)continue;o=2===t}const l=t.terrain?c:h,f=n.aabb.distanceX(l),v=n.aabb.distanceY(l),b=Math.max(Math.abs(f),Math.abs(v));if(n.zoom===g||b>p+(1<<g-n.zoom)-2&&n.zoom>=d){const t=g-n.zoom,i=c[0]-.5-(s<<t),r=c[1]-.5-(a<<t);_.push({tileID:new e.S(n.zoom===g?x:n.zoom,n.wrap,n.zoom,s,a),distanceSq:y([h[0]-.5-s,h[1]-.5-a]),tileDistanceToCamera:Math.sqrt(i*i+r*r)})}else for(let l=0;l<4;l++){const c=(s<<1)+l%2,h=(a<<1)+(l>>1),u=n.zoom+1;let d=n.aabb.quadrant(l);if(t.terrain){const s=new e.S(u,n.wrap,u,c,h),a=t.terrain.getMinMaxElevation(s),o=null!==(i=a.minElevation)&&void 0!==i?i:this.elevation,l=null!==(r=a.maxElevation)&&void 0!==r?r:this.elevation;d=new vr([d.min[0],d.min[1],o],[d.max[0],d.max[1],l])}m.push({aabb:d,zoom:u,x:c,y:h,wrap:n.wrap,fullyVisible:o})}}return _.sort((
313t,e)=>t.distanceSq-e.distanceSq).map(t=>t.tileID
vendor: 8,518 bytes, line 313
313)}resize(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(t){return Math.pow(2,t)}scaleZoom(t){return Math.log(t)/Math.LN2}project(t){const i=e.ac(t.lat,-85.051129,wr);return new e.P(e.O(t.lng)*this.worldSize,e.Q(i)*this.worldSize)}unproject(t){return new e.Z(t.x/this.worldSize,t.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(t){const i=this.elevation,r=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,n=this.pointLocation(this.centerPoint,t),s=t.getElevationForLngLatZoom(n,this.tileZoom);if(!(this.elevation-s))return;const a=r+i-s,o=Math.cos(this._pitch)*this.cameraToCenterDistance/a/e.b5(1,n.lat),l=this.scaleZoom(o/this.tileSize);this._elevation=s,this._center=n,this.zoom=l}setLocationAtPoint(t,i){const r=this.pointCoordinate(i),n=this.pointCoordinate(this.centerPoint),s=this.locationCoordinate(t),a=new e.Z(s.x-(r.x-n.x),s.y-(r.y-n.y));this.center=this.coordinateLocation(a),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(t,e){return e?this.coordinatePoint(this.locationCoordinate(t),e.getElevationForLngLatZoom(t,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(t))}pointLocation(t,e){return this.coordinateLocation(this.pointCoordinate(t,e))}locationCoordinate(t){return e.Z.fromLngLat(t)}coordinateLocation(t){return t&&t.toLngLat()}pointCoordinate(t,i){if(i){const e=i.pointCoordinate(t);if(null!=e)return e}const r=[t.x,t.y,0,1],n=[t.x,t.y,1,1];e.af(r,r,this.pixelMatrixInverse),e.af(n,n,this.pixelMatrixInverse);const s=r[3],a=n[3],o=r[1]/s,l=n[1]/a,c=r[2]/s,h=n[2]/a,u=c===h?0:(0-c)/(h-c);return new e.Z(e.y.number(r[0]/s,n[0]/a,u)/this.worldSize,e.y.number(o,l,u)/this.worldSize)}coordinatePoint(t,i=0,r=this.pixelMatrix){const n=[t.x*this.worldSize,t.y*this.worldSize,i,1];return e.af(n,n,r),new e.P(n[0]/n[3],n[1]/n[3])}getBounds(){const t=Math.max(0,this.height/2-this.getHorizon());return(new G).extend(this.pointLocation(new e.P(0,t))).extend(this.pointLocation(new e.P(this.width,t))).extend(this.pointLocation(new e.P(this.width,this.height))).extend(this.pointLocation(new e.P(0,this.height)))}getMaxBounds(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new G([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,wr])}calculateTileMatrix(t){const i=t.canonical,r=this.worldSize/this.zoomScale(i.z),n=i.x+Math.pow(2,i.z)*t.wrap,s=e.an(new Float64Array(16));return e.J(s,s,[n*r,i.y*r,0]),e.K(s,s,[r/e.X,r/e.X,1]),s}calculatePosMatrix(t,i=!1){const r=t.key,n=i?this._alignedPosMatrixCache:this._posMatrixCache;if(n[r])return n[r];const s=this.calculateTileMatrix(t);return e.L(s,i?this.alignedModelViewProjectionMatrix:this.modelViewProjectionMatrix,s),n[r]=new Float32Array(s),n[r]}calculateFogMatrix(t){const i=t.key,r=this._fogMatrixCache;if(r[i])return r[i];const n=this.calculateTileMatrix(t);return e.L(n,this.fogMatrix,n),r[i]=new Float32Array(n),r[i]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(t,i){i=e.ac(+i,this.minZoom,this.maxZoom);const r={center:new e.N(t.lng,t.lat),zoom:i};let n=this.lngRange;if(!this._renderWorldCopies&&null===n){const t=180-1e-10;n=[-t,t]}const s=this.tileSize*this.zoomScale(r.zoom);let a=0,o=s,l=0,c=s,h=0,u=0;const{x:d,y:p}=this.size;if(this.latRange){const t=this.latRange;a=e.Q(t[1])*s,o=e.Q(t[0])*s,o-a<p&&(h=p/(o-a))}n&&(l=e.b3(e.O(n[0])*s,0,s),c=e.b3(e.O(n[1])*s,0,s),c<l&&(c+=s),c-l<d&&(u=d/(c-l)));const{x:f,y:m}=this.project.call({worldSize:s},t);let _,g;const y=Math.max(u||0,h||0);if(y){const t=new e.P(u?(c+l)/2:f,h?(o+a)/2:m);return r.center=this.unproject.call({worldSize:s},t).wrap(),r.zoom+=this.scaleZoom(y),r}if(this.latRange){const t=p/2;m-t<a&&(g=a+t),m+t>o&&(g=o-t)}if(n){const t=(l+c)/2;let i=f;this._renderWorldCopies&&(i=e.b3(f,t-s/2,t+s/2));const r=d/2;i-r<l&&(_=l+r),i+r>c&&(_=c-r)}if(void 0!==_||void 0!==g){const t=new e.P(null!=_?_:f,null!=g?g:m);r.center=this.unproject.call({worldSize:s},t).wrap()}return r}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const t=this._unmodified,{center:e,zoom:i}=this.getConstrained(this.center,this.zoom);this.center=e,this.zoom=i,this._unmodified=t,this._constraining=!1}_calcMatrices(){if(!this.height)return;const t=this.centerOffset,i=this.point.x,r=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=e.b5(1,this.center.lat)*this.worldSize;let n=e.an(new Float64Array(16));e.K(n,n,[this.width/2,-this.height/2,1]),e.J(n,n,[1,-1,0]),this.labelPlaneMatrix=n,n=e.an(new Float64Array(16)),e.K(n,n,[1,-1,1]),e.J(n,n,[-1,-1,0]),e.K(n,n,[2/this.width,2/this.height,1]),this.glCoordMatrix=n;const s=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),a=Math.min(this.elevation,this.minElevationForCurrentTile),o=s-a*this._pixelPerMeter/Math.cos(this._pitch),l=a<0?o:s,c=Math.PI/2+this._pitch,h=this._fov*(.5+t.y/this.height),u=Math.sin(h)*l/Math.sin(e.ac(Math.PI-c-h,.01,Math.PI-.01)),d=this.getHorizon(),p=2*Math.atan(d/this.cameraToCenterDistance)*(.5+t.y/(2*d)),f=Math.sin(p)*l/Math.sin(e.ac(Math.PI-c-p,.01,Math.PI-.01)),m=Math.min(u,f);this.farZ=1.01*(Math.cos(Math.PI/2-this._pitch)*m+l),this.nearZ=this.height/50,n=new Float64Array(16),e.b6(n,this._fov,this.width/this.height,this.nearZ,this.farZ),n[8]=2*-t.x/this.width,n[9]=2*t.y/this.height,this.projectionMatrix=e.ae(n),e.K(n,n,[1,-1,1]),e.J(n,n,[0,0,-this.cameraToCenterDistance]),e.b7(n,n,this._pitch),e.ad(n,n,this.angle),e.J(n,n,[-i,-r,0]),this.mercatorMatrix=e.K([],n,[this.worldSize,this.worldSize,this.worldSize]),e.K(n,n,[1,1,this._pixelPerMeter]),this.pixelMatrix=e.L(new Float64Array(16),this.labelPlaneMatrix,n),e.J(n,n,[0,0,-this.elevation]),this.modelViewProjectionMatrix=n,this.invModelViewProjectionMatrix=e.as([],n),this.fogMatrix=new Float64Array(16),e.b6(this.fogMatrix,this._fov,this.width/this.height,s,this.farZ),this.fogMatrix[8]=2*-t.x/this.width,this.fogMatrix[9]=2*t.y/this.height,e.K(this.fogMatrix,this.fogMatrix,[1,-1,1]),e.J(this.fogMatrix,this.fogMatrix,[0,0,-this.cameraToCenterDistance]),e.b7(this.fogMatrix,this.fogMatrix,this._pitch),e.ad(this.fogMatrix,this.fogMatrix,this.angle),e.J(this.fogMatrix,this.fogMatrix,[-i,-r,0]),e.K(this.fogMatrix,this.fogMatrix,[1,1,this._pixelPerMeter]),e.J(this.fogMatrix,this.fogMatrix,[0,0,-this.elevation]),this.pixelMatrix3D=e.L(new Float64Array(16),this.labelPlaneMatrix,n);const _=this.width%2/2,g=this.height%2/2,y=Math.cos(this.angle),x=Math.sin(this.angle),v=i-Math.round(i)+y*_+x*g,b=r-Math.round(r)+y*g+x*_,w=new Float64Array(n);if(e.J(w,w,[v>.5?v-1:v,b>.5?b-1:b,0]),this.alignedModelViewProjectionMatrix=w,n=e.as(new Float64Array(16),this.pixelMatrix),!n)throw new Error("failed to invert matrix");this.pixelMatrixInverse=n,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const t=this.pointCoordinate(new e.P(0,0)),i=[t.x*this.worldSize,t.y*this.worldSize,0,1];return e.af(i,i,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const t=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new e.P(0,t))}getCameraQueryGeometry(t){const i=this.getCameraPoint();if(1===t.length)return[t[0],i];{let r=i.x,n=i.y,s=i.x,a=i.y;for(const e of t)r=Math.min(r,e.x),n=Math.min(n,e.y),s=Math.max(s,e.x),a=Math.max(a,e.y);return[new e.P(r,n),new e.P(s,n),new e.P(s,a),new e.P(r,a),new e.P(r,n)]}}lngLatToCameraDepth(t,i){const r=this.locationCoordinate(t),n=[r.x*this.worldSize,r.y*this.worldSize,i,1];return e.af(n,n,this.modelViewProjectionMatrix),n[2]/n[3]}}function Sr(t,e){let i,r=!1,n=null,s=null;const a=()=>{n=null,r&&(t.apply(s,i),n=setTimeout(a,e),r=!1)};return(...t)=>(r=!0,s=this,i=t,n||a(),n)}class Ir{constructor(t){this._getCurrentHash=()=>{const t=window.location.hash.replace("#","");if(this._hashName){let e;return t.split("&").map(
313t=>
vendor: 1,708 bytes, line 313
313t.split("=")).forEach(t=>{t[0]===this._hashName&&(e=t)}),(e&&e[1]||"").split("/")}return t.split("/")},this._onHashChange=()=>{const t=this._getCurrentHash();if(t.length>=3&&!t.some(t=>isNaN(t))){const e=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:e,pitch:+(t[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{const t=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,t)},this._removeHash=()=>{const t=this._getCurrentHash();if(0===t.length)return;const e=t.join("/");let i=e;i.split("&").length>0&&(i=i.split("&")[0]),this._hashName&&(i=`${this._hashName}=${e}`);let r=window.location.hash.replace(i,"");r.startsWith("#&")?r=r.slice(0,1)+r.slice(2):"#"===r&&(r="");let n=window.location.href.replace(/(#.+)?$/,r);n=n.replace("&&","&"),window.history.replaceState(window.history.state,null,n)},this._updateHash=Sr(this._updateHashUnthrottled,300),this._hashName=t&&encodeURIComponent(t)}addTo(t){return this._map=t,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(t){const e=this._map.getCenter(),i=Math.round(100*this._map.getZoom())/100,r=Math.ceil((i*Math.LN2+Math.log(512/360/.5))/Math.LN10),n=Math.pow(10,r),s=Math.round(e.lng*n)/n,a=Math.round(e.lat*n)/n,o=this._map.getBearing(),l=this._map.getPitch();let c="";if(c+=t?`/${s}/${a}/${i}`:`${i}/${a}/${s}
313`,(o||l)&&(c+="/"+Math.round(10*o)/10),l&&(c+=`/${Math.round(l)}`),this._hashName){const t=this._hashName;let e=!1;const i=window.location.hash.slice(1).split("&").map(i=>{const r=i.split("=")[0];return r===t?(e=!0,`${r}=${c}`):i}).filter(t=>t);return e||i.push(`${t}=${c}`),`#${i.join("&")}`}return`#${c}`}}const Pr={linearity:.3,easing:e.b8(0,0,.3,1)},Ar=e.e({deceleration:2500,maxSpeed:1400},Pr),Mr=e.e({deceleration:20,maxSpeed:1400},Pr),kr=e.e({deceleration:1e3,maxSpeed:360},Pr),Cr=e.e({deceleration:1e3,maxSpeed:90},Pr);class zr{constructor(t){this._map=t,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:s.now(),settings:t})}_drainInertiaBuffer(){const t=this._inertiaBuffer,e=s.now();for(;t.length>0&&e-t[0].time>160;)t.shift()}_onMoveEnd(t){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const i={zoom:0,bearing:0,pitch:0,pan:new e.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:t}of this._inertiaBuffer)i.zoom+=t.zoomDelta||0,i.bearing+=t.bearingDelta||0,i.pitch+=t.pitchDelta||0,t.panDelta&&i.pan._add(t.panDelta),t.around&&(i.around=t.around),t.pinchAround&&(i.pinchAround=t.pinchAround);const r=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,n={};if(i.pan.mag()){const s=Dr(i.pan.mag(),r,e.e({},Ar,t||{}));n.offset=i.pan.mult(s.amount/i.pan.mag()),n.center=this._map.transform.center,Er(n,s)}if(i.zoom){const t=Dr(i.zoom,r,Mr);n.zoom=this._map.transform.zoom+t.amount,Er(n,t)}if(i.bearing){const t=Dr(i.bearing,r,kr);n.bearing=this._map.transform.bearing+e.ac(t.amount,-179,179),Er(n,t)}if(i.pitch){const t=Dr(i.pitch,r,Cr);n.pitch=this._map.transform.pitch+t.amount,Er(n,t)}if(n.zoom||n.bearing){const t=void 0===i.pinchAround?i.around:i.pinchAround;n.around=t?this._map.unproject(t):this._map.getCenter()}return this.clear(),e.e(n,{noMoveStart:!0})}}function Er(t,e){(!t.duration||t.duration<e.duration)&&(t.duration=e.duration,t.easing=e.easing)}function Dr(t,i,r){const{maxSpeed:n,linearity:s,deceleration:a}=r,o=e.ac(t*s/(i/1e3),-n,n),l=Math.abs(o)/(a*s);return{easing:r.easing,duration:1e3*l,amount:o*(l/2)}}class Lr extends e.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,i,r,n={}){const s=a.mousePos(i.getCanvas(),r),o=i.unproject(s);super(t,e.e({point:s,lngLat:o,originalEvent:r},n)),this._defaultPrevented=!1,this.target=i}}class Rr extends e.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,i,r){const n="touchend"===t?r.changedTouches:r.touches,s=a.touchPos(i.getCanvasContainer(),n),o=s.map(t=>i.unproject(t)),l=s.reduce((t,e,i,r)=>t.add(e.div(r.length)),new e.P(0,0));super(t,{points:s,point:l,lngLats:o,lngLat:i.unproject(l),originalEvent:r}),this._defaultPrevented=!1}}class Br extends e.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(t,e,i){super(t,{originalEvent:i}),this._defaultPrevented=!1}}class Fr{constructor(t,e){this._map=t,this._clickTolerance=e.clickTolerance}reset(){delete this._mousedownPos}wheel(t){return this._firePreventable(new Br(t.type,this._map,t))}mousedown(t,e){return this._mousedownPos=e,this._firePreventable(new Lr(t.type,this._map,t))}mouseup(t){this._map.fire(new Lr(t.type,this._map,t))}click(t,e){this._mousedownPos&&this._mousedownPos.dist(e)>=this._clickTolerance||this._map.fire(new Lr(t.type,this._map,t))}dblclick(t){return this._firePreventable(new Lr(t.type,this._map,t))}mouseover(t){this._map.fire(new Lr(t.type,this._map,t))}mouseout(t){this._map.fire(new Lr(t.type,this._map,t))}touchstart(t){return this._firePreventable(new Rr(t.type,this._map,t))}touchmove(t){this._map.fire(new Rr(t.type,this._map,t))}touchend(t){this._map.fire(new Rr(t.type,this._map,t))}touchcancel(t){this._map.fire(new Rr(t.type,this._map,t))}_firePreventable(t){if(this._map.fire(t),t.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Or{constructor(t){this._map=t}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(t){this._map.fire(new Lr(t.type,this._map,t))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Lr("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(t){this._delayContextMenu?this._contextMenuEvent=t:this._ignoreContextMenu||this._map.fire(new Lr(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Vr{constructor(t){this._map=t}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(t){return this.transform.pointLocation(e.P.convert(t),this._map.terrain)}}class Nr{constructor(t,e){this._map=t,this._tr=new Vr(t),this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(t,e){this.isEnabled()&&t.shiftKey&&0===t.button&&(a.disableDrag(),this._startPos=this._lastPos=e,this._active=!0)}mousemoveWindow(t,e){if(!this._active)return;const i=e;if(this._lastPos.equals(i)||!this._box&&i.dist(this._startPos)<this._clickTolerance)return;const r=this._startPos;this._lastPos=i,this._box||(this._box=a.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",t));const n=Math.min(r.x,i.x),s=Math.max(r.x,i.x),o=Math.min(r.y,i.y),l=Math.max(r.y,i.y);a.setTransform(this._box,`translate(${n}px,${o}px)`),this._box.style.width=s-n+"px",this._box.style.height=l-o+"px"}mouseupWindow(t,i){if(!this._active)return;if(0!==t.button)return;const r=this._startPos,n=i;if(this.reset(),a.suppressClick(),r.x!==n.x||r.y!==n.y)return this._map.fire(new e.k("boxzoomend",{originalEvent:t})),{cameraAnimation:t=>t.fitScreenCoordinates(r,n,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",t)}keydown(t){this._active&&27===t.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",t))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(a.remove(this._box),this._box=null),a.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(t,i){return this._map.fire(new e.k(t,{originalEvent:i}))}}function jr(t,e){if(t.length!==e.length)throw new Error(`The number of touches and points are not equal - touches ${t.length}, points ${e.length}`);const i={};for(let r=0;r<t.length;r++)i[t[r].identifier]=e[r];return i}
vendor: 85,145 bytes, line 313
313class Ur{constructor(t){this.reset(),this.numTouches=t.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(t,i,r){(this.centroid||r.length>this.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=t.timeStamp),r.length===this.numTouches&&(this.centroid=function(t){const i=new e.P(0,0);for(const e of t)i._add(e);return i.div(t.length)}(i),this.touches=jr(r,i)))}touchmove(t,e,i){if(this.aborted||!this.centroid)return;const r=jr(i,e);for(const t in this.touches){const e=r[t];(!e||e.dist(this.touches[t])>30)&&(this.aborted=!0)}}touchend(t,e,i){if((!this.centroid||t.timeStamp-this.startTime>500)&&(this.aborted=!0),0===i.length){const t=!this.aborted&&this.centroid;if(this.reset(),t)return t}}}class $r{constructor(t){this.singleTap=new Ur(t),this.numTaps=t.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(t,e,i){this.singleTap.touchstart(t,e,i)}touchmove(t,e,i){this.singleTap.touchmove(t,e,i)}touchend(t,e,i){const r=this.singleTap.touchend(t,e,i);if(r){const e=t.timeStamp-this.lastTime<500,i=!this.lastTap||this.lastTap.dist(r)<30;if(e&&i||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=r,this.count===this.numTaps)return this.reset(),r}}}class qr{constructor(t){this._tr=new Vr(t),this._zoomIn=new $r({numTouches:1,numTaps:2}),this._zoomOut=new $r({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(t,e,i){this._zoomIn.touchstart(t,e,i),this._zoomOut.touchstart(t,e,i)}touchmove(t,e,i){this._zoomIn.touchmove(t,e,i),this._zoomOut.touchmove(t,e,i)}touchend(t,e,i){const r=this._zoomIn.touchend(t,e,i),n=this._zoomOut.touchend(t,e,i),s=this._tr;return r?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:e=>e.easeTo({duration:300,zoom:s.zoom+1,around:s.unproject(r)},{originalEvent:t})}):n?(this._active=!0,t.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:e=>e.easeTo({duration:300,zoom:s.zoom-1,around:s.unproject(n)},{originalEvent:t})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Zr{constructor(t){this._enabled=!!t.enable,this._moveStateManager=t.moveStateManager,this._clickTolerance=t.clickTolerance||1,this._moveFunction=t.move,this._activateOnStart=!!t.activateOnStart,t.assignEvents(this),this.reset()}reset(t){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(t)}_move(...t){const e=this._moveFunction(...t);if(e.bearingDelta||e.pitchDelta||e.around||e.panDelta)return this._active=!0,e}dragStart(t,e){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(t)&&(this._moveStateManager.startMove(t),this._lastPoint=e.length?e[0]:e,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(t,e){if(!this.isEnabled())return;const i=this._lastPoint;if(!i)return;if(t.preventDefault(),!this._moveStateManager.isValidMoveEvent(t))return void this.reset(t);const r=e.length?e[0]:e;return!this._moved&&r.dist(i)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=r,this._move(i,r))}dragEnd(t){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(t)&&(this._moved&&a.suppressClick(),this.reset(t))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}}const Gr={0:1,2:2};class Hr{constructor(t){this._correctEvent=t.checkCorrectEvent}startMove(t){const e=a.mouseButton(t);this._eventButton=e}endMove(t){delete this._eventButton}isValidStartEvent(t){return this._correctEvent(t)}isValidMoveEvent(t){return!function(t,e){const i=Gr[e];return void 0===t.buttons||(t.buttons&i)!==i}(t,this._eventButton)}isValidEndEvent(t){return a.mouseButton(t)===this._eventButton}}class Xr{constructor(){this._firstTouch=void 0}_isOneFingerTouch(t){return 1===t.targetTouches.length}_isSameTouchEvent(t){return t.targetTouches[0].identifier===this._firstTouch}startMove(t){this._firstTouch=t.targetTouches[0].identifier}endMove(t){delete this._firstTouch}isValidStartEvent(t){return this._isOneFingerTouch(t)}isValidMoveEvent(t){return this._isOneFingerTouch(t)&&this._isSameTouchEvent(t)}isValidEndEvent(t){return this._isOneFingerTouch(t)&&this._isSameTouchEvent(t)}}const Wr=t=>{t.mousedown=t.dragStart,t.mousemoveWindow=t.dragMove,t.mouseup=t.dragEnd,t.contextmenu=t=>{t.preventDefault()}},Kr=({enable:t,clickTolerance:e,bearingDegreesPerPixelMoved:i=.8})=>{const r=new Hr({checkCorrectEvent:t=>0===a.mouseButton(t)&&t.ctrlKey||2===a.mouseButton(t)});return new Zr({clickTolerance:e,move:(t,e)=>({bearingDelta:(e.x-t.x)*i}),moveStateManager:r,enable:t,assignEvents:Wr})},Jr=({enable:t,clickTolerance:e,pitchDegreesPerPixelMoved:i=-.5})=>{const r=new Hr({checkCorrectEvent:t=>0===a.mouseButton(t)&&t.ctrlKey||2===a.mouseButton(t)});return new Zr({clickTolerance:e,move:(t,e)=>({pitchDelta:(e.y-t.y)*i}),moveStateManager:r,enable:t,assignEvents:Wr})};class Yr{constructor(t,e){this._clickTolerance=t.clickTolerance||1,this._map=e,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new e.P(0,0)}_shouldBePrevented(t){return t<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(t,e,i){return this._calculateTransform(t,e,i)}touchmove(t,e,i){if(this._active){if(!this._shouldBePrevented(i.length))return t.preventDefault(),this._calculateTransform(t,e,i);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",t)}}touchend(t,e,i){this._calculateTransform(t,e,i),this._active&&this._shouldBePrevented(i.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(t,i,r){r.length>0&&(this._active=!0);const n=jr(r,i),s=new e.P(0,0),a=new e.P(0,0);let o=0;for(const t in n){const e=n[t],i=this._touches[t];i&&(s._add(e),a._add(e.sub(i)),o++,n[t]=e)}if(this._touches=n,this._shouldBePrevented(o)||!a.mag())return;const l=a.div(o);return this._sum._add(l),this._sum.mag()<this._clickTolerance?void 0:{around:s.div(o),panDelta:l}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Qr{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(t,e,i){this._firstTwoTouches||i.length<2||(this._firstTwoTouches=[i[0].identifier,i[1].identifier],this._start([e[0],e[1]]))}touchmove(t,e,i){if(!this._firstTwoTouches)return;t.preventDefault();const[r,n]=this._firstTwoTouches,s=tn(i,e,r),a=tn(i,e,n);if(!s||!a)return;const o=this._aroundCenter?null:s.add(a).div(2);return this._move([s,a],o,t)}touchend(t,e,i){if(!this._firstTwoTouches)return;const[r,n]=this._firstTwoTouches,s=tn(i,e,r),o=tn(i,e,n);s&&o||(this._active&&a.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(t){this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}}function tn(t,e,i){for(let r=0;r<t.length;r++)if(t[r].identifier===i)return e[r]}function en(t,e){return Math.log(t/e)/Math.LN2}class rn extends Qr{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(t){this._startDistance=this._distance=t[0].dist(t[1])}_move(t,e){const i=this._distance;if(this._distance=t[0].dist(t[1]),this._active||!(Math.abs(en(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:en(this._distance,i),pinchAround:e}}}function nn(t,e){return 180*t.angleWith(e)/Math.PI}class sn extends Qr{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(t){this._startVector=this._vector=t[0].sub(t[1]),this._minDiameter=t[0].dist(t[1])}_move(t,e,i){const r=this._vector;if(this._vector=t[0].sub(t[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:nn(this._vector,r),pinchAround:e}}_isBelowThreshold(t){this._minDiameter=Math.min(this._minDiameter,t.mag());const e=25/(Math.PI*this._minDiameter)*360,i=nn(t,this._startVector);return Math.abs(i)<e}}function an(t){return Math.abs(t.y)>Math.abs(t.x)}class on extends Qr{constructor(t){super(),this._currentTouchCount=0,this._map=t}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(t,e,i){super.touchstart(t,e,i),this._currentTouchCount=i.length}_start(t){this._lastPoints=t,an(t[0].sub(t[1]))&&(this._valid=!1)}_move(t,e,i){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const r=t[0].sub(this._lastPoints[0]),n=t[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(r,n,i.timeStamp),this._valid?(this._lastPoints=t,this._active=!0,{pitchDelta:(r.y+n.y)/2*-.5}):void 0}gestureBeginsVertically(t,e,i){if(void 0!==this._valid)return this._valid;const r=t.mag()>=2,n=e.mag()>=2;if(!r&&!n)return;if(!r||!n)return void 0===this._firstMove&&(this._firstMove=i),i-this._firstMove<100&&void 0;const s=t.y>0==e.y>0;return an(t)&&an(e)&&s}}const ln={panStep:100,bearingStep:15,pitchStep:10};class cn{constructor(t){this._tr=new Vr(t);const e=ln;this._panStep=e.panStep,this._bearingStep=e.bearingStep,this._pitchStep=e.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(t){if(t.altKey||t.ctrlKey||t.metaKey)return;let e=0,i=0,r=0,n=0,s=0;switch(t.keyCode){case 61:case 107:case 171:case 187:e=1;break;case 189:case 109:case 173:e=-1;break;case 37:t.shiftKey?i=-1:(t.preventDefault(),n=-1);break;case 39:t.shiftKey?i=1:(t.preventDefault(),n=1);break;case 38:t.shiftKey?r=1:(t.preventDefault(),s=-1);break;case 40:t.shiftKey?r=-1:(t.preventDefault(),s=1);break;default:return}return this._rotationDisabled&&(i=0,r=0),{cameraAnimation:a=>{const o=this._tr;a.easeTo({duration:300,easeId:"keyboardHandler",easing:hn,zoom:e?Math.round(o.zoom)+e*(t.shiftKey?2:1):o.zoom,bearing:o.bearing+i*this._bearingStep,pitch:o.pitch+r*this._pitchStep,offset:[-n*this._panStep,-s*this._panStep],center:o.center},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function hn(t){return t*(2-t)}const un=4.000244140625;class dn{constructor(t,e){this._onTimeout=t=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},this._map=t,this._tr=new Vr(t),this._triggerRenderFrame=e,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(t){this._defaultZoomRate=t}setWheelZoomRate(t){this._wheelZoomRate=t}isEnabled(){return!!this._enabled}isActive(){return!!this._active||void 0!==this._finishTimeout}isZooming(){return!!this._zooming}enable(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around)}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(t){return!!this._map.cooperativeGestures.isEnabled()&&!(t.ctrlKey||this._map.cooperativeGestures.isBypassed(t))}wheel(t){if(!this.isEnabled())return;if(this._shouldBePrevented(t))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",t);let e=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY;const i=s.now(),r=i-(this._lastWheelEventTime||0);this._lastWheelEventTime=i,0!==e&&e%un==0?this._type="wheel":0!==e&&Math.abs(e)<4?this._type="trackpad":r>400?(this._type=null,this._lastValue=e,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(r*e)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,e+=this._lastValue)),t.shiftKey&&e&&(e/=4),this._type&&(this._lastWheelEvent=t,this._delta-=e,this._active||this._start(t)),t.preventDefault()}_start(t){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const i=a.mousePos(this._map.getCanvas(),t),r=this._tr;this._around=i.y>r.transform.height/2-r.transform.getHorizon()?e.N.convert(this._aroundCenter?r.center:r.unproject(i)):e.N.convert(r.center),this._aroundPoint=r.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId)return;if(this._frameId=null,!this.isActive())return;const t=this._tr.transform;if(0!==this._delta){const e="wheel"===this._type&&Math.abs(this._delta)>un?this._wheelZoomRate:this._defaultZoomRate;let i=2/(1+Math.exp(-Math.abs(this._delta*e)));this._delta<0&&0!==i&&(i=1/i);const r="number"==typeof this._targetZoom?t.zoomScale(this._targetZoom):t.scale;this._targetZoom=Math.min(t.maxZoom,Math.max(t.minZoom,t.scaleZoom(r*i))),"wheel"===this._type&&(this._startZoom=t.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const i="number"==typeof this._targetZoom?this._targetZoom:t.zoom,r=this._startZoom,n=this._easing;let a,o=!1;const l=s.now()-this._lastWheelEventTime;if("wheel"===this._type&&r&&n&&l){const t=Math.min(l/200,1),s=n(t);a=e.y.number(r,i,s),t<1?this._frameId||(this._frameId=!0):o=!0}else a=i,o=!0;return this._active=!0,o&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!o,zoomDelta:a-t.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let i=e.b9;if(this._prevEase){const t=this._prevEase,r=(s.now()-t.start)/t.duration,n=t.easing(r+.01)-t.easing(r),a=.27/Math.sqrt(n*n+1e-4)*.01,o=Math.sqrt(.0729-a*a);i=e.b8(a,o,.25,1)}return this._prevEase={start:s.now(),duration:t,easing:i},i}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class pn{constructor(t,e){this._clickZoom=t,this._tapZoom=e}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class fn{constructor(t){this._tr=new Vr(t),this.reset()}reset(){this._active=!1}dblclick(t,e){return t.preventDefault(),{cameraAnimation:i=>{i.easeTo({duration:300,zoom:this._tr.zoom+(t.shiftKey?-1:1),around:this._tr.unproject(e)},{originalEvent:t})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class mn{constructor(){this._tap=new $r({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(t,e,i){if(!this._swipePoint)if(this._tapTime){const r=e[0],n=t.timeStamp-this._tapTime<500,s=this._tapPoint.dist(r)<30;n&&s?i.length>0&&(this._swipePoint=r,this._swipeTouch=i[0].identifier):this.reset()}else this._tap.touchstart(t,e,i)}touchmove(t,e,i){if(this._tapTime){if(this._swipePoint){if(i[0].identifier!==this._swipeTouch)return;const r=e[0],n=r.y-this._swipePoint.y;return this._swipePoint=r,t.preventDefault(),this._active=!0,{zoomDelta:n/128}}}else this._tap.touchmove(t,e,i)}touchend(t,e,i){if(this._tapTime)this._swipePoint&&0===i.length&&this.reset();else{const r=this._tap.touchend(t,e,i);r&&(this._tapTime=t.timeStamp,this._tapPoint=r)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class _n{constructor(t,e,i){this._el=t,this._mousePan=e,this._touchPan=i}enable(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class gn{constructor(t,e,i){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=e,this._mousePitch=i}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class yn{constructor(t,e,i,r){this._el=t,this._touchZoom=e,this._touchRotate=i,this._tapDragZoom=r,this._rotationDisabled=!1,this._enabled=!0}enable(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class xn{constructor(t,e){this._bypassKey=-1!==navigator.userAgent.indexOf("Mac")?"metaKey":"ctrlKey",this._map=t,this._options=e,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const t=this._map.getCanvasContainer();t.classList.add("maplibregl-cooperative-gestures"),this._container=a.create("div","maplibregl-cooperative-gesture-screen",t);let e=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");"metaKey"===this._bypassKey&&(e=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const i=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),r=document.createElement("div");r.className="maplibregl-desktop-message",r.textContent=e,this._container.appendChild(r);const n=document.createElement("div");n.className="maplibregl-mobile-message",n.textContent=i,this._container.appendChild(n),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(a.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(t){return t[this._bypassKey]}notifyGestureBlocked(t,i){this._enabled&&(this._map.fire(new e.k("cooperativegestureprevented",{gestureType:t,originalEvent:i})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}const vn=t=>t.zoom||t.drag||t.pitch||t.rotate;class bn extends e.k{}function wn(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta}class Tn{constructor(t,e){this.handleWindowEvent=t=>{this.handleEvent(t,`${t.type}Window`)},this.handleEvent=(t,e)=>{if("blur"===t.type)return void this.stop(!0);this._updatingCamera=!0;const i="renderFrame"===t.type?void 0:t,r={needsRenderFrame:!1},n={},s={},o=t.touches,l=o?this._getMapTouches(o):void 0,c=l?a.touchPos(this._map.getCanvas(),l):a.mousePos(this._map.getCanvas(),t);for(const{handlerName:a,handler:o,allowed:h}of this._handlers){if(!o.isEnabled())continue;let u;this._blockedByActive(s,h,a)?o.reset():o[e||t.type]&&(u=o[e||t.type](t,c,l),this.mergeHandlerResult(r,n,u,a,i),u&&u.needsRenderFrame&&this._triggerRenderFrame()),(u||o.isActive())&&(s[a]=o)}const h={};for(const t in this._previousActiveHandlers)s[t]||(h[t]=i);this._previousActiveHandlers=s,(Object.keys(h).length||wn(r))&&(this._changes.push([r,n,h]),this._triggerRenderFrame()),(Object.keys(s).length||wn(r))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:u}=r;u&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],u(this._map))},this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new zr(t),this._bearingSnap=e.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(e);const i=this._el;this._listeners=[[i,"touchstart",{passive:!0}],[i,"touchmove",{passive:!1}],[i,"touchend",void 0],[i,"touchcancel",void 0],[i,"mousedown",void 0],[i,"mousemove",void 0],[i,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[i,"mouseover",void 0],[i,"mouseout",void 0],[i,"dblclick",void 0],[i,"click",void 0],[i,"keydown",{capture:!1}],[i,"keyup",void 0],[i,"wheel",{passive:!1}],[i,"contextmenu",void 0],[window,"blur",void 0]];for(const[t,e,i]of this._listeners)a.addEventListener(t,e,t===document?this.handleWindowEvent:this.handleEvent,i)}destroy(){for(const[t,e,i]of this._listeners)a.removeEventListener(t,e,t===document?this.handleWindowEvent:this.handleEvent,i)}_addDefaultHandlers(t){const e=this._map,i=e.getCanvasContainer();this._add("mapEvent",new Fr(e,t));const r=e.boxZoom=new Nr(e,t);this._add("boxZoom",r),t.interactive&&t.boxZoom&&r.enable();const n=e.cooperativeGestures=new xn(e,t.cooperativeGestures);this._add("cooperativeGestures",n),t.cooperativeGestures&&n.enable();const s=new qr(e),o=new fn(e);e.doubleClickZoom=new pn(o,s),this._add("tapZoom",s),this._add("clickZoom",o),t.interactive&&t.doubleClickZoom&&e.doubleClickZoom.enable();const l=new mn;this._add("tapDragZoom",l);const c=e.touchPitch=new on(e);this._add("touchPitch",c),t.interactive&&t.touchPitch&&e.touchPitch.enable(t.touchPitch);const h=Kr(t),u=Jr(t);e.dragRotate=new gn(t,h,u),this._add("mouseRotate",h,["mousePitch"]),this._add("mousePitch",u,["mouseRotate"]),t.interactive&&t.dragRotate&&e.dragRotate.enable();const d=(({enable:t,clickTolerance:e})=>{const i=new Hr({checkCorrectEvent:t=>0===a.mouseButton(t)&&!t.ctrlKey});return new Zr({clickTolerance:e,move:(t,e)=>({around:e,panDelta:e.sub(t)}),activateOnStart:!0,moveStateManager:i,enable:t,assignEvents:Wr})})(t),p=new Yr(t,e);e.dragPan=new _n(i,d,p),this._add("mousePan",d),this._add("touchPan",p,["touchZoom","touchRotate"]),t.interactive&&t.dragPan&&e.dragPan.enable(t.dragPan);const f=new sn,m=new rn;e.touchZoomRotate=new yn(i,m,f,l),this._add("touchRotate",f,["touchPan","touchZoom"]),this._add("touchZoom",m,["touchPan","touchRotate"]),t.interactive&&t.touchZoomRotate&&e.touchZoomRotate.enable(t.touchZoomRotate);const _=e.scrollZoom=new dn(e,()=>this._triggerRenderFrame());this._add("scrollZoom",_,["mousePan"]),t.interactive&&t.scrollZoom&&e.scrollZoom.enable(t.scrollZoom);const g=e.keyboard=new cn(e);this._add("keyboard",g),t.interactive&&t.keyboard&&e.keyboard.enable(),this._add("blockableMapEvent",new Or(e))}_add(t,e,i){this._handlers.push({handlerName:t,handler:e,allowed:i}),this._handlersById[t]=e}stop(t){if(!this._updatingCamera){for(const{handler:t}of this._handlers)t.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[]}}isActive(){for(const{handler:t}of this._handlers)if(t.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return Boolean(vn(this._eventsInProgress))||this.isZooming()}_blockedByActive(t,e,i){for(const r in t)if(r!==i&&(!e||e.indexOf(r)<0))return!0;return!1}_getMapTouches(t){const e=[];for(const i of t)this._el.contains(i.target)&&e.push(i);return e}mergeHandlerResult(t,i,r,n,s){if(!r)return;e.e(t,r);const a={handlerName:n,originalEvent:r.originalEvent||s};void 0!==r.zoomDelta&&(i.zoom=a),void 0!==r.panDelta&&(i.drag=a),void 0!==r.pitchDelta&&(i.pitch=a),void 0!==r.bearingDelta&&(i.rotate=a)}_applyChanges(){const t={},i={},r={};for(const[n,s,a]of this._changes)n.panDelta&&(t.panDelta=(t.panDelta||new e.P(0,0))._add(n.panDelta)),n.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+n.zoomDelta),n.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+n.bearingDelta),n.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+n.pitchDelta),void 0!==n.around&&(t.around=n.around),void 0!==n.pinchAround&&(t.pinchAround=n.pinchAround),n.noInertia&&(t.noInertia=n.noInertia),e.e(i,s),e.e(r,a);this._updateMapTransform(t,i,r),this._changes=[]}_updateMapTransform(t,e,i){const r=this._map,n=r._getTransformForUpdate(),s=r.terrain;if(!(wn(t)||s&&this._terrainMovement))return this._fireEvents(e,i,!0);let{panDelta:a,zoomDelta:o,bearingDelta:l,pitchDelta:c,around:h,pinchAround:u}=t;void 0!==u&&(h=u),r._stop(!0),h=h||r.transform.centerPoint;const d=n.pointLocation(a?h.sub(a):h);l&&(n.bearing+=l),c&&(n.pitch+=c),o&&(n.zoom+=o),s?this._terrainMovement||!e.drag&&!e.zoom?e.drag&&this._terrainMovement?n.center=n.pointLocation(n.centerPoint.sub(a)):n.setLocationAtPoint(d,h):(this._terrainMovement=!0,this._map._elevationFreeze=!0,n.setLocationAtPoint(d,h)):n.setLocationAtPoint(d,h),r._applyUpdatedTransform(n),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(e,i,!0)}_fireEvents(t,i,r){const n=vn(this._eventsInProgress),a=vn(t),o={};for(const e in t){const{originalEvent:i}=t[e];this._eventsInProgress[e]||(o[`${e}start`]=i),this._eventsInProgress[e]=t[e]}!n&&a&&this._fireEvent("movestart",a.originalEvent);for(const t in o)this._fireEvent(t,o[t]);a&&this._fireEvent("move",a.originalEvent);for(const e in t){const{originalEvent:i}=t[e];this._fireEvent(e,i)}const l={};let c;for(const t in this._eventsInProgress){const{handlerName:e,originalEvent:r}=this._eventsInProgress[t];this._handlersById[e].isActive()||(delete this._eventsInProgress[t],c=i[e]||r,l[`${t}end`]=c)}for(const t in l)this._fireEvent(t,l[t]);const h=vn(this._eventsInProgress),u=(n||a)&&!h;if(u&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;const t=this._map._getTransformForUpdate();t.recalculateZoom(this._map.terrain),this._map._applyUpdatedTransform(t)}if(r&&u){this._updatingCamera=!0;const t=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),i=t=>0!==t&&-this._bearingSnap<t&&t<this._bearingSnap;!t||!t.essential&&s.prefersReducedMotion?(this._map.fire(new e.k("moveend",{originalEvent:c})),i(this._map.getBearing())&&this._map.resetNorth()):(i(t.bearing||this._map.getBearing())&&(t.bearing=0),t.freezeElevation=!0,this._map.easeTo(t,{originalEvent:c})),this._updatingCamera=!1}}_fireEvent(t,i){this._map.fire(new e.k(t,i?{originalEvent:i}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(t=>{delete this._frameId,this.handleEvent(new bn("renderFrame",{timeStamp:t})),this._applyChanges()})}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}class Sn extends e.E{constructor(t,e){super(),this._renderFrameCallback=()=>{const t=Math.min((s.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(t)),t<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=t,this._bearingSnap=e.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new e.N(this.transform.center.lng,this.transform.center.lat)}setCenter(t,e){return this.jumpTo({center:t},e)}panBy(t,i,r){return t=e.P.convert(t).mult(-1),this.panTo(this.transform.center,e.e({offset:t},i),r)}panTo(t,i,r){return this.easeTo(e.e({center:t},i),r)}getZoom(){return this.transform.zoom}setZoom(t,e){return this.jumpTo({zoom:t},e),this}zoomTo(t,i,r){return this.easeTo(e.e({zoom:t},i),r)}zoomIn(t,e){return this.zoomTo(this.getZoom()+1,t,e),this}zoomOut(t,e){return this.zoomTo(this.getZoom()-1,t,e),this}getBearing(){return this.transform.bearing}setBearing(t,e){return this.jumpTo({bearing:t},e),this}getPadding(){return this.transform.padding}setPadding(t,e){return this.jumpTo({padding:t},e),this}rotateTo(t,i,r){return this.easeTo(e.e({bearing:t},i),r)}resetNorth(t,i){return this.rotateTo(0,e.e({duration:1e3},t),i),this}resetNorthPitch(t,i){return this.easeTo(e.e({bearing:0,pitch:0,duration:1e3},t),i),this}snapToNorth(t,e){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,e):this}getPitch(){return this.transform.pitch}setPitch(t,e){return this.jumpTo({pitch:t},e),this}cameraForBounds(t,e){t=G.convert(t).adjustAntiMeridian();const i=e&&e.bearing||0;return this._cameraForBoxAndBearing(t.getNorthWest(),t.getSouthEast(),i,e)}_cameraForBoxAndBearing(t,i,r,n){const s={top:0,bottom:0,right:0,left:0};if("number"==typeof(n=e.e({padding:s,offset:[0,0],maxZoom:this.transform.maxZoom},n)).padding){const t=n.padding;n.padding={top:t,bottom:t,right:t,left:t}}n.padding=e.e(s,n.padding);const a=this.transform,o=a.padding,l=new G(t,i),c=a.project(l.getNorthWest()),h=a.project(l.getNorthEast()),u=a.project(l.getSouthEast()),d=a.project(l.getSouthWest()),p=e.ba(-r),f=c.rotate(p),m=h.rotate(p),_=u.rotate(p),g=d.rotate(p),y=new e.P(Math.max(f.x,m.x,g.x,_.x),Math.max(f.y,m.y,g.y,_.y)),x=new e.P(Math.min(f.x,m.x,g.x,_.x),Math.min(f.y,m.y,g.y,_.y)),v=y.sub(x),b=(a.width-(o.left+o.right+n.padding.left+n.padding.right))/v.x,w=(a.height-(o.top+o.bottom+n.padding.top+n.padding.bottom))/v.y;if(w<0||b<0)return void e.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");const T=Math.min(a.scaleZoom(a.scale*Math.min(b,w)),n.maxZoom),S=e.P.convert(n.offset),I=new e.P((n.padding.left-n.padding.right)/2,(n.padding.top-n.padding.bottom)/2).rotate(e.ba(r)),P=S.add(I).mult(a.scale/a.zoomScale(T));return{center:a.unproject(c.add(u).div(2).sub(P)),zoom:T,bearing:r}}fitBounds(t,e,i){return this._fitInternal(this.cameraForBounds(t,e),e,i)}fitScreenCoordinates(t,i,r,n,s){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(e.P.convert(t)),this.transform.pointLocation(e.P.convert(i)),r,n),n,s)}_fitInternal(t,i,r){return t?(delete(i=e.e(t,i)).padding,i.linear?this.easeTo(i,r):this.flyTo(i,r)):this}jumpTo(t,i){this.stop();const r=this._getTransformForUpdate();let n=!1,s=!1,a=!1;return"zoom"in t&&r.zoom!==+t.zoom&&(n=!0,r.zoom=+t.zoom),void 0!==t.center&&(r.center=e.N.convert(t.center)),"bearing"in t&&r.bearing!==+t.bearing&&(s=!0,r.bearing=+t.bearing),"pitch"in t&&r.pitch!==+t.pitch&&(a=!0,r.pitch=+t.pitch),null==t.padding||r.isPaddingEqual(t.padding)||(r.padding=t.padding),this._applyUpdatedTransform(r),this.fire(new e.k("movestart",i)).fire(new e.k("move",i)),n&&this.fire(new e.k("zoomstart",i)).fire(new e.k("zoom",i)).fire(new e.k("zoomend",i)),s&&this.fire(new e.k("rotatestart",i)).fire(new e.k("rotate",i)).fire(new e.k("rotateend",i)),a&&this.fire(new e.k("pitchstart",i)).fire(new e.k("pitch",i)).fire(new e.k("pitchend",i)),this.fire(new e.k("moveend",i))}calculateCameraOptionsFromTo(t,i,r,n=0){const s=e.Z.fromLngLat(t,i),a=e.Z.fromLngLat(r,n),o=a.x-s.x,l=a.y-s.y,c=a.z-s.z,h=Math.hypot(o,l,c);if(0===h)throw new Error("Can't calculate camera options with same From and To");const u=Math.hypot(o,l),d=this.transform.scaleZoom(this.transform.cameraToCenterDistance/h/this.transform.tileSize),p=180*Math.atan2(o,-l)/Math.PI;let f=180*Math.acos(u/h)/Math.PI;return f=c<0?90-f:90+f,{center:a.toLngLat(),zoom:d,pitch:f,bearing:p}}easeTo(t,i){var r;this._stop(!1,t.easeId),(!1===(t=e.e({offset:[0,0],duration:500,easing:e.b9},t)).animate||!t.essential&&s.prefersReducedMotion)&&(t.duration=0);const n=this._getTransformForUpdate(),a=n.zoom,o=n.bearing,l=n.pitch,c=n.padding,h="bearing"in t?this._normalizeBearing(t.bearing,o):o,u="pitch"in t?+t.pitch:l,d="padding"in t?t.padding:n.padding,p=e.P.convert(t.offset);let f=n.centerPoint.add(p);const m=n.pointLocation(f),{center:_,zoom:g}=n.getConstrained(e.N.convert(t.center||m),null!==(r=t.zoom)&&void 0!==r?r:a);this._normalizeCenter(_,n);const y=n.project(m),x=n.project(_).sub(y),v=n.zoomScale(g-a);let b,w;t.around&&(b=e.N.convert(t.around),w=n.locationPoint(b));const T={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||g!==a,this._rotating=this._rotating||o!==h,this._pitching=this._pitching||u!==l,this._padding=!n.isPaddingEqual(d),this._easeId=t.easeId,this._prepareEase(i,t.noMoveStart,T),this.terrain&&this._prepareElevation(_),this._ease(r=>{if(this._zooming&&(n.zoom=e.y.number(a,g,r)),this._rotating&&(n.bearing=e.y.number(o,h,r)),this._pitching&&(n.pitch=e.y.number(l,u,r)),this._padding&&(n.interpolatePadding(c,d,r),f=n.centerPoint.add(p)),this.terrain&&!t.freezeElevation&&this._updateElevation(r),b)n.setLocationAtPoint(b,w);else{const t=n.zoomScale(n.zoom-a),e=g>a?Math.min(2,v):Math.max(.5,v),i=Math.pow(e,1-r),s=n.unproject(y.add(x.mult(r*i)).mult(t));n.setLocationAtPoint(n.renderWorldCopies?s.wrap():s,f)}this._applyUpdatedTransform(n),this._fireMoveEvents(i)},e=>{this.terrain&&t.freezeElevation&&this._finalizeElevation(),this._afterEase(i,e)},t),this}_prepareEase(t,i,r={}){this._moving=!0,i||r.moving||this.fire(new e.k("movestart",t)),this._zooming&&!r.zooming&&this.fire(new e.k("zoomstart",t)),this._rotating&&!r.rotating&&this.fire(new e.k("rotatestart",t)),this._pitching&&!r.pitching&&this.fire(new e.k("pitchstart",t))}_prepareElevation(t){this._elevationCenter=t,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(t,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(t){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);const i=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(t<1&&i!==this._elevationTarget){const e=this._elevationTarget-this._elevationStart;this._elevationStart+=t*(e-(i-(e*t+this._elevationStart))/(1-t)),this._elevationTarget=i}this.transform.elevation=e.y.number(this._elevationStart,this._elevationTarget,t)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(t){const e=t.getCameraPosition(),i=this.terrain.getElevationForLngLatZoom(e.lngLat,t.zoom);if(e.altitude<i){const r=this.calculateCameraOptionsFromTo(e.lngLat,i,t.center,t.elevation);return{pitch:r.pitch,zoom:r.zoom}}return{}}_applyUpdatedTransform(t){const e=[];if(this.terrain&&e.push(t=>this._elevateCameraIfInsideTerrain(t)),this.transformCameraUpdate&&e.push(t=>this.transformCameraUpdate(t)),!e.length)return;const i=t.clone();for(const t of e){const e=i.clone(),{center:r,zoom:n,pitch:s,bearing:a,elevation:o}=t(e);r&&(e.center=r),void 0!==n&&(e.zoom=n),void 0!==s&&(e.pitch=s),void 0!==a&&(e.bearing=a),void 0!==o&&(e.elevation=o),i.apply(e)}this.transform.apply(i)}_fireMoveEvents(t){this.fire(new e.k("move",t)),this._zooming&&this.fire(new e.k("zoom",t)),this._rotating&&this.fire(new e.k("rotate",t)),this._pitching&&this.fire(new e.k("pitch",t))}_afterEase(t,i){if(this._easeId&&i&&this._easeId===i)return;delete this._easeId;const r=this._zooming,n=this._rotating,s=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,r&&this.fire(new e.k("zoomend",t)),n&&this.fire(new e.k("rotateend",t)),s&&this.fire(new e.k("pitchend",t)),this.fire(new e.k("moveend",t))}flyTo(t,i){var r;if(!t.essential&&s.prefersReducedMotion){const r=e.M(t,["center","zoom","bearing","pitch","around"]);return this.jumpTo(r,i)}this.stop(),t=e.e({offset:[0,0],speed:1.2,curve:1.42,easing:e.b9},t);const n=this._getTransformForUpdate(),a=n.zoom,o=n.bearing,l=n.pitch,c=n.padding,h="bearing"in t?this._normalizeBearing(t.bearing,o):o,u="pitch"in t?+t.pitch:l,d="padding"in t?t.padding:n.padding,p=e.P.convert(t.offset);let f=n.centerPoint.add(p);const m=n.pointLocation(f),{center:_,zoom:g}=n.getConstrained(e.N.convert(t.center||m),null!==(r=t.zoom)&&void 0!==r?r:a);this._normalizeCenter(_,n);const y=n.zoomScale(g-a),x=n.project(m),v=n.project(_).sub(x);let b=t.curve;const w=Math.max(n.width,n.height),T=w/y,S=v.mag();if("minZoom"in t){const i=e.ac(Math.min(t.minZoom,a,g),n.minZoom,n.maxZoom),r=w/n.zoomScale(i-a);b=Math.sqrt(r/S*2)}const I=b*b;function P(t){const e=(T*T-w*w+(t?-1:1)*I*I*S*S)/(2*(t?T:w)*I*S);return Math.log(Math.sqrt(e*e+1)-e)}function A(t){return(Math.exp(t)-Math.exp(-t))/2}function M(t){return(Math.exp(t)+Math.exp(-t))/2}const k=P(!1);let C=function(t){return M(k)/M(k+b*t)},z=function(t){return w*((M(k)*(A(e=k+b*t)/M(e))-A(k))/I)/S;var e},E=(P(!0)-k)/b;if(Math.abs(S)<1e-6||!isFinite(E)){if(Math.abs(w-T)<1e-6)return this.easeTo(t,i);const e=T<w?-1:1;E=Math.abs(Math.log(T/w))/b,z=()=>0,C=t=>Math.exp(e*b*t)}return t.duration="duration"in t?+t.duration:1e3*E/("screenSpeed"in t?+t.screenSpeed/b:+t.speed),t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=o!==h,this._pitching=u!==l,this._padding=!n.isPaddingEqual(d),this._prepareEase(i,!1),this.terrain&&this._prepareElevation(_),this._ease(r=>{const s=r*E,m=1/C(s);n.zoom=1===r?g:a+n.scaleZoom(m),this._rotating&&(n.bearing=e.y.number(o,h,r)),this._pitching&&(n.pitch=e.y.number(l,u,r)),this._padding&&(n.interpolatePadding(c,d,r),f=n.centerPoint.add(p)),this.terrain&&!t.freezeElevation&&this._updateElevation(r);const y=1===r?_:n.unproject(x.add(v.mult(z(s))).mult(m));n.setLocationAtPoint(n.renderWorldCopies?y.wrap():y,f),this._applyUpdatedTransform(n),this._fireMoveEvents(i)},()=>{this.terrain&&t.freezeElevation&&this._finalizeElevation(),this._afterEase(i)},t),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(t,e){var i;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const t=this._onEaseEnd;delete this._onEaseEnd,t.call(this,e)}return t||null===(i=this.handlers)||void 0===i||i.stop(!1),this}_ease(t,e,i){!1===i.animate||0===i.duration?(t(1),e()):(this._easeStart=s.now(),this._easeOptions=i,this._onEaseFrame=t,this._onEaseEnd=e,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(t,i){t=e.b3(t,-180,180);const r=Math.abs(t-i);return Math.abs(t-360-i)<r&&(t-=360),Math.abs(t+360-i)<r&&(t+=360),t}_normalizeCenter(t,e){if(!e.renderWorldCopies||e.lngRange)return;const i=t.lng-e.center.lng;t.lng+=i>180?-360:i<-180?360:0}queryTerrainElevation(t){return this.terrain?this.terrain.getElevationForLngLatZoom(e.N.convert(t),this.transform.tileZoom)-this.transform.elevation:null}}const In={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};class Pn{constructor(t=In){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=t=>{!t||"metadata"!==t.sourceDataType&&"visibility"!==t.sourceDataType&&"style"!==t.dataType&&"terrain"!==t.type||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1===this._compact?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=t}getDefaultPosition(){return"bottom-right"}onAdd(t){return this._map=t,this._compact=this.options.compact,this._container=a.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=a.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=a.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){a.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(t,e){const i=this._map._getUIString(`AttributionControl.${e}`);t.title=i,t.setAttribute("aria-label",i)}_updateAttributions(){if(!this._map.style)return;let t=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map(t=>"string"!=typeof t?"":t)):"string"==typeof this.options.customAttribution&&t.push(this.options.customAttribution)),this._map.style.stylesheet){const t=this._map.style.stylesheet;this.styleOwner=t.owner,this.styleId=t.id}const e=this._map.style.sourceCaches;for(const i in e){const r=e[i];if(r.used||r.usedForTerrain){const e=r.getSource();e.attribution&&t.indexOf(e.attribution)<0&&t.push(e.attribution)}}t=t.filter(t=>String(t).trim()),t.sort((t,e)=>t.length-e.length),t=t.filter((e,i)=>{for(let r=i+1;r<t.length;r++)if(t[r].indexOf(e)>=0)return!1;return!0});const i=t.join(" | ");i!==this._attribHTML&&(this._attribHTML=i,t.length?(this._innerContainer.innerHTML=i,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class An{constructor(t={}){this._updateCompact=()=>{const t=this._container.children;if(t.length){const e=t[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1!==this._compact&&e.classList.add("maplibregl-compact"):e.classList.remove("maplibregl-compact")}},this.options=t}getDefaultPosition(){return"bottom-left"}onAdd(t){this._map=t,this._compact=this.options&&this.options.compact,this._container=a.create("div","maplibregl-ctrl");const e=a.create("a","maplibregl-ctrl-logo");return e.target="_blank",e.rel="noopener nofollow",e.href="https://maplibre.org/",e.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),e.setAttribute("rel","noopener nofollow"),this._container.appendChild(e),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){a.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class Mn{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(t){const e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e}remove(t){const e=this._currentlyRunning,i=e?this._queue.concat(e):this._queue;for(const e of i)if(e.id===t)return void(e.cancelled=!0)}run(t=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const e=this._currentlyRunning=this._queue;this._queue=[];for(const i of e)if(!i.cancelled&&(i.callback(t),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var kn=e.Y([{name:"a_pos3d",type:"Int16",components:3}]);class Cn extends e.E{constructor(t){super(),this.sourceCache=t,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,t.usedForTerrain=!0,t.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(t,i){this.sourceCache.update(t,i),this._renderableTilesKeys=[];const r={};for(const n of t.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:i}))r[n.key]=!0,this._renderableTilesKeys.push(n.key),this._tiles[n.key]||(n.posMatrix=new Float64Array(16),e.aP(n.posMatrix,0,e.X,0,e.X,0,1),this._tiles[n.key]=new lt(n,this.tileSize));for(const t in this._tiles)r[t]||delete this._tiles[t]}freeRtt(t){for(const e in this._tiles){const i=this._tiles[e];(!t||i.tileID.equals(t)||i.tileID.isChildOf(t)||t.isChildOf(i.tileID))&&(i.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(t=>this.getTileByID(t))}getTileByID(t){return this._tiles[t]}getTerrainCoords(t){const i={};for(const r of this._renderableTilesKeys){const n=this._tiles[r].tileID;if(n.canonical.equals(t.canonical)){const n=t.clone();n.posMatrix=new Float64Array(16),e.aP(n.posMatrix,0,e.X,0,e.X,0,1),i[r]=n}else if(n.canonical.isChildOf(t.canonical)){const s=t.clone();s.posMatrix=new Float64Array(16);const a=n.canonical.z-t.canonical.z,o=n.canonical.x-(n.canonical.x>>a<<a),l=n.canonical.y-(n.canonical.y>>a<<a),c=e.X>>a;e.aP(s.posMatrix,0,c,0,c,0,1),e.J(s.posMatrix,s.posMatrix,[-o*c,-l*c,0]),i[r]=s}else if(t.canonical.isChildOf(n.canonical)){const s=t.clone();s.posMatrix=new Float64Array(16);const a=t.canonical.z-n.canonical.z,o=t.canonical.x-(t.canonical.x>>a<<a),l=t.canonical.y-(t.canonical.y>>a<<a),c=e.X>>a;e.aP(s.posMatrix,0,e.X,0,e.X,0,1),e.J(s.posMatrix,s.posMatrix,[o*c,l*c,0]),e.K(s.posMatrix,s.posMatrix,[1/2**a,1/2**a,0]),i[r]=s}}return i}getSourceTile(t,e){const i=this.sourceCache._source;let r=t.overscaledZ-this.deltaZoom;if(r>i.maxzoom&&(r=i.maxzoom),r<i.minzoom)return null;this._sourceTileCache[t.key]||(this._sourceTileCache[t.key]=t.scaledTo(r).key);let n=this.sourceCache.getTileByID(this._sourceTileCache[t.key]);if((!n||!n.dem)&&e)for(;r>=i.minzoom&&(!n||!n.dem);)n=this.sourceCache.getTileByID(t.scaledTo(r--).key);return n}tilesAfterTime(t=Date.now()){return Object.values(this._tiles).filter(e=>e.timeAdded>=t)}}class zn{constructor(t,e,i){this.painter=t,this.sourceCache=new Cn(e),this.options=i,this.exaggeration="number"==typeof i.exaggeration?i.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(t,i,r,n=e.X){var s;if(!(i>=0&&i<n&&r>=0&&r<n))return 0;const a=this.getTerrainData(t),o=null===(s=a.tile)||void 0===s?void 0:s.dem;if(!o)return 0;const l=function(t,e,i){var r=e[0],n=e[1];return t[0]=i[0]*r+i[4]*n+i[12],t[1]=i[1]*r+i[5]*n+i[13],t}([],[i/n*e.X,r/n*e.X],a.u_terrain_matrix),c=[l[0]*o.dim,l[1]*o.dim],h=Math.floor(c[0]),u=Math.floor(c[1]),d=c[0]-h,p=c[1]-u;return o.get(h,u)*(1-d)*(1-p)+o.get(h+1,u)*d*(1-p)+o.get(h,u+1)*(1-d)*p+o.get(h+1,u+1)*d*p}getElevationForLngLatZoom(t,i){if(!e.bb(i,t.wrap()))return 0;const{tileID:r,mercatorX:n,mercatorY:s}=this._getOverscaledTileIDFromLngLatZoom(t,i);return this.getElevation(r,n%e.X,s%e.X,e.X)}getElevation(t,i,r,n=e.X){return this.getDEMElevation(t,i,r,n)*this.exaggeration}getTerrainData(t){if(!this._emptyDemTexture){const t=this.painter.context,i=new e.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new b(t,i,t.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new b(t,new e.R({width:1,height:1}),t.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=e.an([])}const i=this.sourceCache.getSourceTile(t,!0);if(i&&i.dem&&(!i.demTexture||i.needsTerrainPrepare)){const t=this.painter.context;i.demTexture=this.painter.getTileTexture(i.dem.stride),i.demTexture?i.demTexture.update(i.dem.getPixels(),{premultiply:!1}):i.demTexture=new b(t,i.dem.getPixels(),t.gl.RGBA,{premultiply:!1}),i.demTexture.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),i.needsTerrainPrepare=!1}const r=i&&i+i.tileID.key+t.key;if(r&&!this._demMatrixCache[r]){const r=this.sourceCache.sourceCache._source.maxzoom;let n=t.canonical.z-i.tileID.canonical.z;t.overscaledZ>t.canonical.z&&(t.canonical.z>=r?n=t.canonical.z-r:e.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const s=t.canonical.x-(t.canonical.x>>n<<n),a=t.canonical.y-(t.canonical.y>>n<<n),o=e.bc(new Float64Array(16),[1/(e.X<<n),1/(e.X<<n),0]);e.J(o,o,[s*e.X,a*e.X,0]),this._demMatrixCache[t.key]={matrix:o,coord:t}}return{u_depth:2,u_terrain:3,u_terrain_dim:i&&i.dem&&i.dem.dim||1,u_terrain_matrix:r?this._demMatrixCache[t.key].matrix:this._emptyDemMatrix,u_terrain_unpack:i&&i.dem&&i.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(i&&i.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:i}}getFramebuffer(t){const e=this.painter,i=e.width/devicePixelRatio,r=e.height/devicePixelRatio;return!this._fbo||this._fbo.width===i&&this._fbo.height===r||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new b(e.context,{width:i,height:r,data:null},e.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(e.context.gl.NEAREST,e.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new b(e.context,{width:i,height:r,data:null},e.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(e.context.gl.NEAREST,e.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=e.context.createFramebuffer(i,r,!0,!1),this._fbo.depthAttachment.set(e.context.createRenderbuffer(e.context.gl.DEPTH_COMPONENT16,i,r))),this._fbo.colorAttachment.set("coords"===t?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){const t=this.painter.context;if(this._coordsTexture)return this._coordsTexture;const i=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let t=0,e=0;t<this._coordsTextureSize;t++)for(let r=0;r<this._coordsTextureSize;r++,e+=4)i[e+0]=255&r,i[e+1]=255&t,i[e+2]=r>>8<<4|t>>8,i[e+3]=0;const r=new e.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(i.buffer)),n=new b(t,r,t.gl.RGBA,{premultiply:!1});return n.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this._coordsTexture=n,n}pointCoordinate(t){this.painter.maybeDrawDepthAndCoords(!0);const i=new Uint8Array(4),r=this.painter.context,n=r.gl,s=Math.round(t.x*this.painter.pixelRatio/devicePixelRatio),a=Math.round(t.y*this.painter.pixelRatio/devicePixelRatio),o=Math.round(this.painter.height/devicePixelRatio);r.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),n.readPixels(s,o-a-1,1,1,n.RGBA,n.UNSIGNED_BYTE,i),r.bindFramebuffer.set(null);const l=i[0]+(i[2]>>4<<8),c=i[1]+((15&i[2])<<8),h=this.coordsIndex[255-i[3]],u=h&&this.sourceCache.getTileByID(h);if(!u)return null;const d=this._coordsTextureSize,p=(1<<u.tileID.canonical.z)*d;return new e.Z((u.tileID.canonical.x*d+l)/p+u.tileID.wrap,(u.tileID.canonical.y*d+c)/p,this.getElevation(u.tileID,l,c,d))}depthAtPoint(t){const e=new Uint8Array(4),i=this.painter.context,r=i.gl;return i.bindFramebuffer.set(this.getFramebuffer("depth").framebuffer),r.readPixels(t.x,this.painter.height/devicePixelRatio-t.y-1,1,1,r.RGBA,r.UNSIGNED_BYTE,e),i.bindFramebuffer.set(null),(e[0]/16777216+e[1]/65536+e[2]/256+e[3])/256}getTerrainMesh(){if(this._mesh)return this._mesh;const t=this.painter.context,i=new e.bd,r=new e.aY,n=this.meshSize,s=e.X/n,a=n*n;for(let t=0;t<=n;t++)for(let e=0;e<=n;e++)i.emplaceBack(e*s,t*s,0);for(let t=0;t<a;t+=n+1)for(let e=0;e<n;e++)r.emplaceBack(e+t,n+e+t+1,n+e+t+2),r.emplaceBack(e+t,n+e+t+2,e+t+1);const o=i.length,l=o+2*(n+1);for(const t of[0,1])for(let r=0;r<=n;r++)for(const n of[0,1])i.emplaceBack(r*s,t*e.X,n);for(let t=0;t<2*n;t+=2)r.emplaceBack(l+t,l+t+1,l+t+3),r.emplaceBack(l+t,l+t+3,l+t+2),r.emplaceBack(o+t,o+t+3,o+t+1),r.emplaceBack(o+t,o+t+2,o+t+3);const c=i.length,h=c+2*(n+1);for(const t of[0,1])for(let r=0;r<=n;r++)for(const n of[0,1])i.emplaceBack(t*e.X,r*s,n);for(let t=0;t<2*n;t+=2)r.emplaceBack(c+t,c+t+1,c+t+3),r.emplaceBack(c+t,c+t+3,c+t+2),r.emplaceBack(h+t,h+t+3,h+t+1),r.emplaceBack(h+t,h+t+2,h+t+3);return this._mesh=new gr(t.createVertexBuffer(i,kn.members),t.createIndexBuffer(r),e.a0.simpleSegment(0,0,i.length,r.length)),this._mesh}getMeshFrameDelta(t){return 2*Math.PI*e.be/Math.pow(2,t)/5}getMinTileElevationForLngLatZoom(t,e){var i;const{tileID:r}=this._getOverscaledTileIDFromLngLatZoom(t,e);return null!==(i=this.getMinMaxElevation(r).minElevation)&&void 0!==i?i:0}getMinMaxElevation(t){const e=this.getTerrainData(t).tile,i={minElevation:null,maxElevation:null};return e&&e.dem&&(i.minElevation=e.dem.min*this.exaggeration,i.maxElevation=e.dem.max*this.exaggeration),i}_getOverscaledTileIDFromLngLatZoom(t,i){const r=e.Z.fromLngLat(t.wrap()),n=(1<<i)*e.X,s=r.x*n,a=r.y*n,o=Math.floor(s/e.X),l=Math.floor(a/e.X);return{tileID:new e.S(i,0,i,o,l),mercatorX:s,mercatorY:a}}}class En{constructor(t,e,i){this._context=t,this._size=e,this._tileSize=i,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(const t of this._objects)t.texture.destroy(),t.fbo.destroy()}_createObject(t){const e=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),i=new b(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return i.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),e.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),e.colorAttachment.set(i.texture),{id:t,fbo:e,texture:i,stamp:-1,inUse:!1}}getObjectForId(t){return this._objects[t]}useObject(t){t.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter(e=>t.id!==e),this._recentlyUsed.push(t.id)}stampObject(t){t.stamp=++this._stamp}getOrCreateFreeObject(){for(const t of this._recentlyUsed)if(!this._objects[t].inUse)return this._objects[t];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const t=this._createObject(this._objects.length);return this._objects.push(t),t}freeObject(t){t.inUse=!1}freeAllObjects(){for(const t of this._objects)this.freeObject(t)}isFull(){return!(this._objects.length<this._size)&&!1===this._objects.some(t=>!t.inUse)}}const Dn={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class Ln{constructor(t,e){this.painter=t,this.terrain=e,this.pool=new En(t.context,30,e.sourceCache.tileSize*e.qualityFactor)}destruct(){this.pool.destruct()}getTexture(t){return this.pool.getObjectForId(t.rtt[this._stacks.length-1].id).texture}prepareForRender(t,e){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=t._order.filter(i=>!t._layers[i].isHidden(e)),this._coordsDescendingInv={};for(const e in t.sourceCaches){this._coordsDescendingInv[e]={};const i=t.sourceCaches[e].getVisibleCoordinates();for(const t of i){const i=this.terrain.sourceCache.getTerrainCoords(t);for(const t in i)this._coordsDescendingInv[e][t]||(this._coordsDescendingInv[e][t]=[]),this._coordsDescendingInv[e][t].push(i[t])}}this._coordsDescendingInvStr={};for(const e of t._order){const i=t._layers[e],r=i.source;if(Dn[i.type]&&!this._coordsDescendingInvStr[r]){this._coordsDescendingInvStr[r]={};for(const t in this._coordsDescendingInv[r])this._coordsDescendingInvStr[r][t]=this._coordsDescendingInv[r][t].map(t=>t.key).sort().join()}}for(const t of this._renderableTiles)for(const e in this._coordsDescendingInvStr){const i=this._coordsDescendingInvStr[e][t.tileID.key];i&&i!==t.rttCoords[e]&&(t.rtt=[])}}renderLayer(t){if(t.isHidden(this.painter.transform.zoom))return!1;const i=t.type,r=this.painter,n=this._renderableLayerIds[this._renderableLayerIds.length-1]===t.id;if(Dn[i]&&(this._prevType&&Dn[this._prevType]||this._stacks.push([]),this._prevType=i,this._stacks[this._stacks.length-1].push(t.id),!n))return!0;if(Dn[this._prevType]||Dn[i]&&n){this._prevType=i;const t=this._stacks.length-1,n=this._stacks[t]||[];for(const i of this._renderableTiles){if(this.pool.isFull()&&(_r(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(i),i.rtt[t]){const e=this.pool.getObjectForId(i.rtt[t].id);if(e.stamp===i.rtt[t].stamp){this.pool.useObject(e);continue}}const s=this.pool.getOrCreateFreeObject();this.pool.useObject(s),this.pool.stampObject(s),i.rtt[t]={id:s.id,stamp:s.stamp},r.context.bindFramebuffer.set(s.fbo.framebuffer),r.context.clear({color:e.aM.transparent,stencil:0}),r.currentStencilSource=void 0;for(let t=0;t<n.length;t++){const e=r.style._layers[n[t]],a=e.source?this._coordsDescendingInv[e.source][i.tileID.key]:[i.tileID];r.context.viewport.set([0,0,s.fbo.width,s.fbo.height]),r._renderTileClippingMasks(e,a),r.renderLayer(r,r.style.sourceCaches[e.source],e,a),e.source&&(i.rttCoords[e.source]=this._coordsDescendingInvStr[e.source][i.tileID.key])}}return _r(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects(),Dn[i]}return!1}}const Rn={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"MapLibre logo","Map.Title":"Map","Marker.Title":"Map marker","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","Popup.Close":"Close popup","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","TerrainControl.Enable":"Enable terrain","TerrainControl.Disable":"Disable terrain","CooperativeGesturesHandler.WindowsHelpText":"Use Ctrl + scroll to zoom the map","CooperativeGesturesHandler.MacHelpText":"Use ⌘ + scroll to zoom the map","CooperativeGesturesHandler.MobileHelpText":"Use two fingers to move the map"},Bn=i,Fn={hash:!1,interactive:!0,bearingSnap:7,attributionControl:In,maplibreLogo:!1,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,refreshExpiredTiles:!0,scrollZoom:!0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,trackResize:!0,center:[0,0],zoom:0,bearing:0,pitch:0,renderWorldCopies:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:e.a.MAX_TILE_CACHE_ZOOM_LEVELS,transformRequest:null,transformCameraUpdate:null,fadeDuration:300,crossSourceCollisions:!0,clickTolerance:3,localIdeographFontFamily:"sans-serif",pitchWithRotate:!0,validateStyle:!0,maxCanvasSize:[4096,4096],cancelPendingTileRequestsWhileZooming:!0},On=t=>{t.touchstart=t.dragStart,t.touchmoveWindow=t.dragMove,t.touchend=t.dragEnd},Vn={showCompass:!0,showZoom:!0,visualizePitch:!1};class Nn{constructor(t,i,r=!1){this.mousedown=t=>{this.startMouse(e.e({},t,{ctrlKey:!0,preventDefault:()=>t.preventDefault()}),a.mousePos(this.element,t)),a.addEventListener(window,"mousemove",this.mousemove),a.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=t=>{this.moveMouse(t,a.mousePos(this.element,t))},this.mouseup=t=>{this.mouseRotate.dragEnd(t),this.mousePitch&&this.mousePitch.dragEnd(t),this.offTemp()},this.touchstart=t=>{1!==t.targetTouches.length?this.reset():(this._startPos=this._lastPos=a.touchPos(this.element,t.targetTouches)[0],this.startTouch(t,this._startPos),a.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),a.addEventListener(window,"touchend",this.touchend))},this.touchmove=t=>{1!==t.targetTouches.length?this.reset():(this._lastPos=a.touchPos(this.element,t.targetTouches)[0],this.moveTouch(t,this._lastPos))},this.touchend=t=>{0===t.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),delete this._startPos,delete this._lastPos,this.offTemp()},this.reset=()=>{this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;const n=t.dragRotate._mouseRotate.getClickTolerance(),s=t.dragRotate._mousePitch.getClickTolerance();this.element=i,this.mouseRotate=Kr({clickTolerance:n,enable:!0}),this.touchRotate=(({enable:t,clickTolerance:e,bearingDegreesPerPixelMoved:i=.8})=>{const r=new Xr;return new Zr({clickTolerance:e,move:(t,e)=>({bearingDelta:(e.x-t.x)*i}),moveStateManager:r,enable:t,assignEvents:On})})({clickTolerance:n,enable:!0}),this.map=t,r&&(this.mousePitch=Jr({clickTolerance:s,enable:!0}),this.touchPitch=(({enable:t,clickTolerance:e,pitchDegreesPerPixelMoved:i=-.5})=>{const r=new Xr;return new Zr({clickTolerance:e,move:(t,e)=>({pitchDelta:(e.y-t.y)*i}),moveStateManager:r,enable:t,assignEvents:On})})({clickTolerance:s,enable:!0})),a.addEventListener(i,"mousedown",this.mousedown),a.addEventListener(i,"touchstart",this.touchstart,{passive:!1}),a.addEventListener(i,"touchcancel",this.reset)}startMouse(t,e){this.mouseRotate.dragStart(t,e),this.mousePitch&&this.mousePitch.dragStart(t,e),a.disableDrag()}startTouch(t,e){this.touchRotate.dragStart(t,e),this.touchPitch&&this.touchPitch.dragStart(t,e),a.disableDrag()}moveMouse(t,e){const i=this.map,{bearingDelta:r}=this.mouseRotate.dragMove(t,e)||{};if(r&&i.setBearing(i.getBearing()+r),this.mousePitch){const{pitchDelta:r}=this.mousePitch.dragMove(t,e)||{};r&&i.setPitch(i.getPitch()+r)}}moveTouch(t,e){const i=this.map,{bearingDelta:r}=this.touchRotate.dragMove(t,e)||{};if(r&&i.setBearing(i.getBearing()+r),this.touchPitch){const{pitchDelta:r}=this.touchPitch.dragMove(t,e)||{};r&&i.setPitch(i.getPitch()+r)}}off(){const t=this.element;a.removeEventListener(t,"mousedown",this.mousedown),a.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),a.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),a.removeEventListener(window,"touchend",this.touchend),a.removeEventListener(t,"touchcancel",this.reset),this.offTemp()}offTemp(){a.enableDrag(),a.removeEventListener(window,"mousemove",this.mousemove),a.removeEventListener(window,"mouseup",this.mouseup),a.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),a.removeEventListener(window,"touchend",this.touchend)}}let jn;function Un(t,i,r){const n=new e.N(t.lng,t.lat);if(t=new e.N(t.lng,t.lat),i){const n=new e.N(t.lng-360,t.lat),s=new e.N(t.lng+360,t.lat),a=r.locationPoint(t).distSqr(i);r.locationPoint(n).distSqr(i)<a?t=n:r.locationPoint(s).distSqr(i)<a&&(t=s)}for(;Math.abs(t.lng-r.center.lng)>180;){const e=r.locationPoint(t);if(e.x>=0&&e.y>=0&&e.x<=r.width&&e.y<=r.height)break;t.lng>r.center.lng?t.lng-=360:t.lng+=360}return t.lng!==n.lng&&r.locationPoint(t).y>r.height/2-r.getHorizon()?t:n}const $n={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function qn(t,e,i){const r=t.classList;for(const t in $n)r.remove(`maplibregl-${i}-anchor-${t}`);r.add(`maplibregl-${i}-anchor-${e}`)}class Zn extends e.E{constructor(t){if(super(),this._onKeyPress=t=>{const e=t.code,i=t.charCode||t.keyCode;"Space"!==e&&"Enter"!==e&&32!==i&&13!==i||this.togglePopup()},this._onMapClick=t=>{const e=t.originalEvent.target,i=this._element;this._popup&&(e===i||i.contains(e))&&this.togglePopup()},this._update=t=>{var e;if(!this._map)return;const i=this._map.loaded()&&!this._map.isMoving();("terrain"===(null==t?void 0:t.type)||"render"===(null==t?void 0:t.type)&&!i)&&this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?Un(this._lngLat,this._flatPos,this._map.transform):null===(e=this._lngLat)||void 0===e?void 0:e.wrap(),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationPoint(this._lngLat)._add(this._offset));let r="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?r=`rotateZ(${this._rotation}deg)`:"map"===this._rotationAlignment&&(r=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let n="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?n="rotateX(0deg)":"map"===this._pitchAlignment&&(n=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||t&&"moveend"!==t.type||(this._pos=this._pos.round()),a.setTransform(this._element,`${$n[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${n} ${r}`),s.frameAsync(new AbortController).then(()=>{this._updateOpacity(t&&"moveend"===t.type)})["catch"](()=>{})},this._onMove=t=>{if(!this._isDragging){const e=this._clickTolerance||this._map._clickTolerance;this._isDragging=t.point.dist(this._pointerdownPos)>=e}this._isDragging&&(this._pos=t.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new e.k("dragstart"))),this.fire(new e.k("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new e.k("dragend")),this._state="inactive"},this._addDragHandler=t=>{this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._pointerdownPos=t.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=t&&t.anchor||"center",this._color=t&&t.color||"#3FB1CE",this._scale=t&&t.scale||1,this._draggable=t&&t.draggable||!1,this._clickTolerance=t&&t.clickTolerance||0,this._subpixelPositioning=t&&t.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=t&&t.rotation||0,this._rotationAlignment=t&&t.rotationAlignment||"auto",this._pitchAlignment=t&&t.pitchAlignment&&"auto"!==t.pitchAlignment?t.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(null==t?void 0:t.opacity,null==t?void 0:t.opacityWhenCovered),t&&t.element)this._element=t.element,this._offset=e.P.convert(t&&t.offset||[0,0]);else{this._defaultMarker=!0,this._element=a.create("div");const i=a.createNS("http://www.w3.org/2000/svg","svg"),r=41,n=27;i.setAttributeNS(null,"display","block"),i.setAttributeNS(null,"height",`${r}px`),i.setAttributeNS(null,"width",`${n}px`),i.setAttributeNS(null,"viewBox",`0 0 ${n} ${r}`);const s=a.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"stroke","none"),s.setAttributeNS(null,"stroke-width","1"),s.setAttributeNS(null,"fill","none"),s.setAttributeNS(null,"fill-rule","evenodd");const o=a.createNS("http://www.w3.org/2000/svg","g");o.setAttributeNS(null,"fill-rule","nonzero");const l=a.createNS("http://www.w3.org/2000/svg","g");l.setAttributeNS(null,"transform","translate(3.0, 29.0)"),l.setAttributeNS(null,"fill","#000000");const c=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(const t of c){const e=a.createNS("http://www.w3.org/2000/svg","ellipse");e.setAttributeNS(null,"opacity","0.04"),e.setAttributeNS(null,"cx","10.5"),e.setAttributeNS(null,"cy","5.80029008"),e.setAttributeNS(null,"rx",t.rx),e.setAttributeNS(null,"ry",t.ry),l.appendChild(e)}const h=a.createNS("http://www.w3.org/2000/svg","g");h.setAttributeNS(null,"fill",this._color);const u=a.createNS("http://www.w3.org/2000/svg","path");u.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),h.appendChild(u);const d=a.createNS("http://www.w3.org/2000/svg","g");d.setAttributeNS(null,"opacity","0.25"),d.setAttributeNS(null,"fill","#000000");const p=a.createNS("http://www.w3.org/2000/svg","path");p.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),d.appendChild(p);const f=a.createNS("http://www.w3.org/2000/svg","g");f.setAttributeNS(null,"transform","translate(6.0, 7.0)"),f.setAttributeNS(null,"fill","#FFFFFF");const m=a.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"transform","translate(8.0, 8.0)");const _=a.createNS("http://www.w3.org/2000/svg","circle");_.setAttributeNS(null,"fill","#000000"),_.setAttributeNS(null,"opacity","0.25"),_.setAttributeNS(null,"cx","5.5"),_.setAttributeNS(null,"cy","5.5"),_.setAttributeNS(null,"r","5.4999962");const g=a.createNS("http://www.w3.org/2000/svg","circle");g.setAttributeNS(null,"fill","#FFFFFF"),g.setAttributeNS(null,"cx","5.5"),g.setAttributeNS(null,"cy","5.5"),g.setAttributeNS(null,"r","5.4999962"),m.appendChild(_),m.appendChild(g),o.appendChild(l),o.appendChild(h),o.appendChild(d),o.appendChild(f),o.appendChild(m),i.appendChild(o),i.setAttributeNS(null,"height",r*this._scale+"px"),i.setAttributeNS(null,"width",n*this._scale+"px"),this._element.appendChild(i),this._offset=e.P.convert(t&&t.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",t=>{t.preventDefault()}),this._element.addEventListener("mousedown",t=>{t.preventDefault()}),qn(this._element,this._anchor,"marker"),t&&t.className)for(const e of t.className.split(" "))this._element.classList.add(e);this._popup=null}addTo(t){return this.remove(),this._map=t,this._element.setAttribute("aria-label",t._getUIString("Marker.Title")),t.getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),t.on("terrain",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),a.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=e.N.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(t){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),t){if(!("offset"in t.options)){const e=38.1,i=13.5,r=Math.abs(i)/Math.SQRT2;t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-e],"bottom-left":[r,-1*(e-i+r)],"bottom-right":[-r,-1*(e-i+r)],left:[i,-1*(e-i)],right:[-i,-1*(e-i)]}:this._offset}this._popup=t,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(t){return this._subpixelPositioning=t,this}getPopup(){return this._popup}togglePopup(){const t=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:t?(t.isOpen()?t.remove():(t.setLngLat(this._lngLat),t.addTo(this._map)),this):this}_updateOpacity(t=!1){var i,r;if(!(null===(i=this._map)||void 0===i?void 0:i.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(t)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}const n=this._map,s=n.terrain.depthAtPoint(this._pos),a=n.terrain.getElevationForLngLatZoom(this._lngLat,n.transform.tileZoom);if(n.transform.lngLatToCameraDepth(this._lngLat,a)-s<.006)return void(this._element.style.opacity=this._opacity);const o=-this._offset.y/n.transform._pixelPerMeter,l=Math.sin(n.getPitch()*Math.PI/180)*o,c=n.terrain.depthAtPoint(new e.P(this._pos.x,this._pos.y-this._offset.y)),h=n.transform.lngLatToCameraDepth(this._lngLat,a+l)-c>.006;(null===(r=this._popup)||void 0===r?void 0:r.isOpen())&&h&&this._popup.remove(),this._element.style.opacity=h?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(t){return this._offset=e.P.convert(t),this._update(),this}addClassName(t){this._element.classList.add(t)}removeClassName(t){this._element.classList.remove(t)}toggleClassName(t){return this._element.classList.toggle(t)}setDraggable(t){return this._draggable=!!t,this._map&&(t?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(t){return this._rotation=t||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(t){return this._rotationAlignment=t||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(t){return this._pitchAlignment=t&&"auto"!==t?t:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(t,e){return void 0===t&&void 0===e&&(this._opacity="1",this._opacityWhenCovered="0.2"),void 0!==t&&(this._opacity=t),void 0!==e&&(this._opacityWhenCovered=e),this._map&&this._updateOpacity(!0),this}}const Gn={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let Hn=0,Xn=!1;const Wn={maxWidth:100,unit:"metric"};function Kn(t,e,i){const r=i&&i.maxWidth||100,n=t._container.clientHeight/2,s=t.unproject([0,n]),a=t.unproject([r,n]),o=s.distanceTo(a);if(i&&"imperial"===i.unit){const i=3.2808*o;i>5280?Jn(e,r,i/5280,t._getUIString("ScaleControl.Miles")):Jn(e,r,i,t._getUIString("ScaleControl.Feet"))}else i&&"nautical"===i.unit?Jn(e,r,o/1852,t._getUIString("ScaleControl.NauticalMiles")):o>=1e3?Jn(e,r,o/1e3,t._getUIString("ScaleControl.Kilometers")):Jn(e,r,o,t._getUIString("ScaleControl.Meters"))}function Jn(t,e,i,r){const n=function(t){const e=Math.pow(10,`${Math.floor(t)}`.length-1);let i=t/e;return i=i>=10?10:i>=5?5:i>=3?3:i>=2?2:i>=1?1:function(t){const e=Math.pow(10,Math.ceil(-Math.log(t)/Math.LN10));return Math.round(t*e)/e}(i),e*i}(i);t.style.width=e*(n/i)+"px",t.innerHTML=`${n}&nbsp;${r}`}const Yn={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},Qn=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function ts(t){if(t){if("number"==typeof t){const i=Math.round(Math.abs(t)/Math.SQRT2);return{center:new e.P(0,0),top:new e.P(0,t),"top-left":new e.P(i,i),"top-right":new e.P(-i,i),bottom:new e.P(0,-t),"bottom-left":new e.P(i,-i),"bottom-right":new e.P(-i,-i),left:new e.P(t,0),right:new e.P(-t,0)}}if(t instanceof e.P||Array.isArray(t)){const i=e.P.convert(t);return{center:i,top:i,"top-left":i,"top-right":i,bottom:i,"bottom-left":i,"bottom-right":i,left:i,right:i}}return{center:e.P.convert(t.center||[0,0]),top:e.P.convert(t.top||[0,0]),"top-left":e.P.convert(t["top-left"]||[0,0]),"top-right":e.P.convert(t["top-right"]||[0,0]),bottom:e.P.convert(t.bottom||[0,0]),"bottom-left":e.P.convert(t["bottom-left"]||[0,0]),"bottom-right":e.P.convert(t["bottom-right"]||[0,0]),left:e.P.convert(t.left||[0,0]),right:e.P.convert(t.right||[0,0])}}return ts(new e.P(0,0))}const es=i;t.AJAXError=e.bh,t.Evented=e.E,t.LngLat=e.N,t.MercatorCoordinate=e.Z,t.Point=e.P,t.addProtocol=e.bi,t.config=e.a,t.removeProtocol=e.bj,t.AttributionControl=Pn,t.BoxZoomHandler=Nr,t.CanvasSource=et,t.CooperativeGesturesHandler=xn,t.DoubleClickZoomHandler=pn,t.DragPanHandler=_n,t.DragRotateHandler=gn,t.EdgeInsets=br,t.FullscreenControl=class extends e.E{constructor(t={}){super(),this._onFullscreenChange=()=>{var t;let e=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;null===(t=null==e?void 0:e.shadowRoot)||void 0===t?void 0:t.fullscreenElement;)e=e.shadowRoot.fullscreenElement;e===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,t&&t.container&&(t.container instanceof HTMLElement?this._container=t.container:e.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(t){return this._map=t,this._container||(this._container=this._map.getContainer()),this._controlContainer=a.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){a.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const t=this._fullscreenButton=a.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);a.create("span","maplibregl-ctrl-icon",t).setAttribute("aria-hidden","true"),t.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new e.k("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new e.k("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},t.GeoJSONSource=J,t.GeolocateControl=class extends e.E{constructor(t){super(),this._onSuccess=t=>{if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new e.k("outofmaxbounds",t)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=t,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(t),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new e.k("geolocate",t)),this._finish()}},this._updateCamera=t=>{const i=new e.N(t.coords.longitude,t.coords.latitude),r=t.coords.accuracy,n=this._map.getBearing(),s=e.e({bearing:n},this.options.fitBoundsOptions),a=G.fromLngLat(i,r);this._map.fitBounds(a,s,{geolocateSource:!0})},this._updateMarker=t=>{if(t){const i=new e.N(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(i).addTo(this._map),this._userLocationDotMarker.setLngLat(i).addTo(this._map),this._accuracy=t.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=t=>{if(this._map){if(this.options.trackUserLocation)if(1===t.code){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;const t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===t.code&&Xn)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new e.k("error",t)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",t=>t.preventDefault()),this._geolocateButton=a.create("button","maplibregl-ctrl-geolocate",this._container),a.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=t=>{if(this._map){if(!1===t){e.w("Geolocation support is not available so the GeolocateControl will be disabled.");const t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t)}else{const t=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","fal
313se"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=a.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new Zn({element:this._dotElement}),this._circleElement=a.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Zn({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",t=>{t.geolocateSource||"ACTIVE_LOCK"!==this._watchState||t.originalEvent&&"resize"===t.originalEvent.type||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new e.k("trackuserlocationend")),this.fire(new e.k("userlocationlostfocus")))})}},this.options=e.e({},Gn,t)}onAdd(t){return this._map=t,this._container=a.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),function(){return e._(this,arguments,void 0,function*(t=!1){if(void 0!==jn&&!t)return jn;if(void 0===window.navigator.permissions)return jn=!!window.navigator.geolocation,jn;try{const t=yield window.navigator.permissions.query({name:"geolocation"});jn="denied"!==t.state}catch(t){jn=!!window.navigator.geolocation}return jn})}().then(t=>this._finishSetupUI(t)),this._container}onRemove(){void 0!==this._geolocationWatchID&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),a.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Hn=0,Xn=!1}_isOutOfMapMaxBounds(t){const e=this._map.getMaxBounds(),i=t.coords;return e&&(i.longitude<e.getWest()||i.longitude>e.getEast()||i.latitude<e.getSouth()||i.latitude>e.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){const t=this._map.getBounds(),e=t.getSouthEast(),i=t.getNorthEast(),r=e.distanceTo(i),n=Math.ceil(this._accuracy/(r/this._map._container.clientHeight)*2);this._circleElement.style.width=`${n}px`,this._circleElement.style.height=`${n}px`}trigger(){if(!this._setup)return e.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new e.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Hn--,Xn=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new e.k("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new e.k("trackuserlocationstart")),this.fire(new e.k("userlocationfocus"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){let t;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Hn++,Hn>1?(t={maximumAge:6e5,timeout:0},Xn=!0):(t=this.options.positionOptions,Xn=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,t)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","fal
313se"),this.options.showUserLocation&&this._updateMarker(null)}},t.Hash=Ir,t.ImageSource=Q,t.KeyboardHandler=cn,t.LngLatBounds=G,t.LogoControl=An,t.Map=class extends Sn{constructor(t){e.bf.mark(e.bg.create);const i=Object.assign(Object.assign({},Fn),t);if(null!=i.minZoom&&null!=i.maxZoom&&i.minZoom>i.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=i.minPitch&&null!=i.maxPitch&&i.minPitch>i.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=i.minPitch&&i.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=i.maxPitch&&i.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new Tr(i.minZoom,i.maxZoom,i.minPitch,i.maxPitch,i.renderWorldCopies),{bearingSnap:i.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new Mn,this._controls=[],this._mapId=e.a4(),this._contextLost=t=>{t.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new e.k("webglcontextlost",{originalEvent:t}))},this._contextRestored=t=>{this._setupPainter(),this.resize(),this._update(),this.fire(new e.k("webglcontextrestored",{originalEvent:t}))},this._onMapScroll=t=>{if(t.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=i.interactive,this._maxTileCacheSize=i.maxTileCacheSize,this._maxTileCacheZoomLevels=i.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=!0===i.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=!0===i.preserveDrawingBuffer,this._antialias=!0===i.antialias,this._trackResize=!0===i.trackResize,this._bearingSnap=i.bearingSnap,this._refreshExpiredTiles=!0===i.refreshExpiredTiles,this._fadeDuration=i.fadeDuration,this._crossSourceCollisions=!0===i.crossSourceCollisions,this._collectResourceTiming=!0===i.collectResourceTiming,this._locale=Object.assign(Object.assign({},Rn),i.locale),this._clickTolerance=i.clickTolerance,this._overridePixelRatio=i.pixelRatio,this._maxCanvasSize=i.maxCanvasSize,this.transformCameraUpdate=i.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=!0===i.cancelPendingTileRequestsWhileZooming,this._imageQueueHandle=p.addThrottleControl(()=>this.isMoving()),this._requestManager=new f(i.transformRequest),"string"==typeof i.container){if(this._container=document.getElementById(i.container),!this._container)throw new Error(`Container '${i.container}' not found.`)}else{if(!(i.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=i.container}if(i.maxBounds&&this.setMaxBounds(i.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)).on("moveend",()=>this._update(!1)).on("zoom",()=>this._update(!0)).on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}).once("idle",()=>{this._idleTriggered=!0}),"undefined"!=typeof window){addEventListener("online",this._onWindowOnline,!1);let t=!1;const e=Sr(t=>{this._trackResize&&!this._removed&&(this.resize(t),this.redraw())},50);this._resizeObserver=new ResizeObserver(i=>{t?e(i):t=!0}),this._resizeObserver.observe(this._container)}this.handlers=new Tn(this,i),this._hash=i.hash&&new Ir("string"==typeof i.hash&&i.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:i.center,zoom:i.zoom,bearing:i.bearing,pitch:i.pitch}),i.bounds&&(this.resize(),this.fitBounds(i.bounds,e.e({},i.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=i.localIdeographFontFamily,this._validateStyle=i.validateStyle,i.style&&this.setStyle(i.style,{localIdeographFontFamily:i.localIdeographFontFamily}),i.attributionControl&&this.addControl(new Pn("boolean"==typeof i.attributionControl?void 0:i.attributionControl)),i.maplibreLogo&&this.addControl(new An,i.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",t=>{this._update("style"===t.dataType),this.fire(new e.k(`${t.dataType}data`,t))}),this.on("dataloading",t=>{this.fire(new e.k(`${t.dataType}dataloading`,t))}),this.on("dataabort",t=>{this.fire(new e.k("sourcedataabort",t))})}_getMapId(){return this._mapId}addControl(t,i){if(void 0===i&&(i=t.getDefaultPosition?t.getDefaultPosition():"top-right"),!t||!t.onAdd)return this.fire(new e.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const r=t.onAdd(this);this._controls.push(t);const n=this._controlPositions[i];
vendor: 14,928 bytes, line 313
313return-1!==i.indexOf("bottom")?n.insertBefore(r,n.firstChild):n.appendChild(r),this}removeControl(t){if(!t||!t.onRemove)return this.fire(new e.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const i=this._controls.indexOf(t);return i>-1&&this._controls.splice(i,1),t.onRemove(this),this}hasControl(t){return this._controls.indexOf(t)>-1}calculateCameraOptionsFromTo(t,e,i,r){return null==r&&this.terrain&&(r=this.terrain.getElevationForLngLatZoom(i,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(t,e,i,r)}resize(t){var i;const r=this._containerDimensions(),n=r[0],s=r[1],a=this._getClampedPixelRatio(n,s);if(this._resizeCanvas(n,s,a),this.painter.resize(n,s,a),this.painter.overLimit()){const t=this.painter.context.gl;this._maxCanvasSize=[t.drawingBufferWidth,t.drawingBufferHeight];const e=this._getClampedPixelRatio(n,s);this._resizeCanvas(n,s,e),this.painter.resize(n,s,e)}this.transform.resize(n,s),null===(i=this._requestedCameraState)||void 0===i||i.resize(n,s);const o=!this._moving;return o&&(this.stop(),this.fire(new e.k("movestart",t)).fire(new e.k("move",t))),this.fire(new e.k("resize",t)),o&&this.fire(new e.k("moveend",t)),this}_getClampedPixelRatio(t,e){const{0:i,1:r}=this._maxCanvasSize,n=this.getPixelRatio(),s=t*n,a=e*n;return Math.min(s>i?i/s:1,a>r?r/a:1)*n}getPixelRatio(){var t;return null!==(t=this._overridePixelRatio)&&void 0!==t?t:devicePixelRatio}setPixelRatio(t){this._overridePixelRatio=t,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(t){return this.transform.setMaxBounds(G.convert(t)),this._update()}setMinZoom(t){if((t=null==t?-2:t)>=-2&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()<t&&this.setZoom(t),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(t){if((t=null==t?22:t)>=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(t){if((t=null==t?0:t)<0)throw new Error("minPitch must be greater than or equal to 0");if(t>=0&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this._update(),this.getPitch()<t&&this.setPitch(t),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(t){if((t=null==t?60:t)>85)throw new Error("maxPitch must be less than or equal to 85");if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this._update(),this.getPitch()>t&&this.setPitch(t),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(t){return this.transform.renderWorldCopies=t,this._update()}project(t){return this.transform.locationPoint(e.N.convert(t),this.style&&this.terrain)}unproject(t){return this.transform.pointLocation(e.P.convert(t),this.terrain)}isMoving(){var t;return this._moving||(null===(t=this.handlers)||void 0===t?void 0:t.isMoving())}isZooming(){var t;return this._zooming||(null===(t=this.handlers)||void 0===t?void 0:t.isZooming())}isRotating(){var t;return this._rotating||(null===(t=this.handlers)||void 0===t?void 0:t.isRotating())}_createDelegatedListener(t,e,i){if("mouseenter"===t||"mouseover"===t){let r=!1;const n=n=>{const s=e.filter(t=>this.getLayer(t)),a=0!==s.length?this.queryRenderedFeatures(n.point,{layers:s}):[];a.length?r||(r=!0,i.call(this,new Lr(t,this,n.originalEvent,{features:a}))):r=!1};return{layers:e,listener:i,delegates:{mousemove:n,mouseout:()=>{r=!1}}}}if("mouseleave"===t||"mouseout"===t){let r=!1;const n=n=>{const s=e.filter(t=>this.getLayer(t));(0!==s.length?this.queryRenderedFeatures(n.point,{layers:s}):[]).length?r=!0:r&&(r=!1,i.call(this,new Lr(t,this,n.originalEvent)))},s=e=>{r&&(r=!1,i.call(this,new Lr(t,this,e.originalEvent)))};return{layers:e,listener:i,delegates:{mousemove:n,mouseout:s}}}{const r=t=>{const r=e.filter(t=>this.getLayer(t)),n=0!==r.length?this.queryRenderedFeatures(t.point,{layers:r}):[];n.length&&(t.features=n,i.call(this,t),delete t.features)};return{layers:e,listener:i,delegates:{[t]:r}}}}_saveDelegatedListener(t,e){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(e)}_removeDelegatedListener(t,e,i){if(!this._delegatedListeners||!this._delegatedListeners[t])return;const r=this._delegatedListeners[t];for(let t=0;t<r.length;t++){const n=r[t];if(n.listener===i&&n.layers.length===e.length&&n.layers.every(t=>e.includes(t))){for(const t in n.delegates)this.off(t,n.delegates[t]);return void r.splice(t,1)}}}on(t,e,i){if(void 0===i)return super.on(t,e);const r=this._createDelegatedListener(t,"string"==typeof e?[e]:e,i);this._saveDelegatedListener(t,r);for(const t in r.delegates)this.on(t,r.delegates[t]);return this}once(t,e,i){if(void 0===i)return super.once(t,e);const r="string"==typeof e?[e]:e,n=this._createDelegatedListener(t,r,i);for(const e in n.delegates){const s=n.delegates[e];n.delegates[e]=(...e)=>{this._removeDelegatedListener(t,r,i),s(...e)}}this._saveDelegatedListener(t,n);for(const t in n.delegates)this.once(t,n.delegates[t]);return this}off(t,e,i){return void 0===i?super.off(t,e):(this._removeDelegatedListener(t,"string"==typeof e?[e]:e,i),this)}queryRenderedFeatures(t,i){if(!this.style)return[];let r;const n=t instanceof e.P||Array.isArray(t),s=n?t:[[0,0],[this.transform.width,this.transform.height]];if(i=i||(n?{}:t)||{},s instanceof e.P||"number"==typeof s[0])r=[e.P.convert(s)];else{const t=e.P.convert(s[0]),i=e.P.convert(s[1]);r=[t,new e.P(i.x,t.y),i,new e.P(t.x,i.y),t]}return this.style.queryRenderedFeatures(r,i,this.transform)}querySourceFeatures(t,e){return this.style.querySourceFeatures(t,e)}setStyle(t,i){return!1!==(i=e.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},i)).diff&&i.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&t?(this._diffStyle(t,i),this):(this._localIdeographFontFamily=i.localIdeographFontFamily,this._updateStyle(t,i))}setTransformRequest(t){return this._requestManager.setTransformRequest(t),this}_getUIString(t){const e=this._locale[t];if(null==e)throw new Error(`Missing UI string '${t}'`);return e}_updateStyle(t,e){if(e.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(t,e));const i=this.style&&e.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!t)),t?(this.style=new de(this,e||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof t?this.style.loadURL(t,e,i):this.style.loadJSON(t,e,i),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new de(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(t,i){if("string"==typeof t){const r=this._requestManager.transformRequest(t,"Style");e.h(r,new AbortController).then(t=>{this._updateDiff(t.data,i)})["catch"](t=>{t&&this.fire(new e.j(t))})}else"object"==typeof t&&this._updateDiff(t,i)}_updateDiff(t,i){try{this.style.setState(t,i)&&this._update(!0)}catch(r){e.w(`Unable to perform style diff: ${r.message||r.error||r}.  Rebuilding the style from scratch.`),this._updateStyle(t,i)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():e.w("There is no style added to the map.")}addSource(t,e){return this._lazyInitEmptyStyle(),this.style.addSource(t,e),this._update(!0)}isSourceLoaded(t){const i=this.style&&this.style.sourceCaches[t];if(void 0!==i)return i.loaded();this.fire(new e.j(new Error(`There is no source with ID '${t}'`)))}setTerrain(t){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),t){const i=this.style.sourceCaches[t.source];if(!i)throw new Error(`cannot load terrain, because there exists no source with ID: ${t.source}`);null===this.terrain&&i.reload();for(const i in this.style._layers){const r=this.style._layers[i];"hillshade"===r.type&&r.source===t.source&&e.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new zn(this.painter,i,t),this.painter.renderToTexture=new Ln(this.painter,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=e=>{"style"===e.dataType?this.terrain.sourceCache.freeRtt():"source"===e.dataType&&e.tile&&(e.sourceId!==t.source||this._elevationFreeze||(this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(e.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.minElevationForCurrentTile=0,this.transform.elevation=0;return this.fire(new e.k("terrain",{terrain:t})),this}getTerrain(){var t,e;return null!==(e=null===(t=this.terrain)||void 0===t?void 0:t.options)&&void 0!==e?e:null}areTilesLoaded(){const t=this.style&&this.style.sourceCaches;for(const e in t){const i=t[e]._tiles;for(const t in i){const e=i[t];if("loaded"!==e.state&&"errored"!==e.state)return!1}}return!0}removeSource(t){return this.style.removeSource(t),this._update(!0)}getSource(t){return this.style.getSource(t)}addImage(t,i,r={}){const{pixelRatio:n=1,sdf:a=!1,stretchX:o,stretchY:l,content:c,textFitWidth:h,textFitHeight:u}=r;if(this._lazyInitEmptyStyle(),!(i instanceof HTMLImageElement||e.b(i))){if(void 0===i.width||void 0===i.height)return this.fire(new e.j(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{const{width:r,height:s,data:d}=i,p=i;return this.style.addImage(t,{data:new e.R({width:r,height:s},new Uint8Array(d)),pixelRatio:n,stretchX:o,stretchY:l,content:c,textFitWidth:h,textFitHeight:u,sdf:a,version:0,userImage:p}),p.onAdd&&p.onAdd(this,t),this}}{const{width:r,height:d,data:p}=s.getImageData(i);this.style.addImage(t,{data:new e.R({width:r,height:d},p),pixelRatio:n,stretchX:o,stretchY:l,content:c,textFitWidth:h,textFitHeight:u,sdf:a,version:0})}}updateImage(t,i){const r=this.style.getImage(t);if(!r)return this.fire(new e.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const n=i instanceof HTMLImageElement||e.b(i)?s.getImageData(i):i,{width:a,height:o,data:l}=n;if(void 0===a||void 0===o)return this.fire(new e.j(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(a!==r.data.width||o!==r.data.height)return this.fire(new e.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));const c=!(i instanceof HTMLImageElement||e.b(i));return r.data.replace(l,c),this.style.updateImage(t,r),this}getImage(t){return this.style.getImage(t)}hasImage(t){return t?!!this.style.getImage(t):(this.fire(new e.j(new Error("Missing required image id"))),!1)}removeImage(t){this.style.removeImage(t)}loadImage(t){return p.getImage(this._requestManager.transformRequest(t,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(t,e){return this._lazyInitEmptyStyle(),this.style.addLayer(t,e),this._update(!0)}moveLayer(t,e){return this.style.moveLayer(t,e),this._update(!0)}removeLayer(t){return this.style.removeLayer(t),this._update(!0)}getLayer(t){return this.style.getLayer(t)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(t,e,i){return this.style.setLayerZoomRange(t,e,i),this._update(!0)}setFilter(t,e,i={}){return this.style.setFilter(t,e,i),this._update(!0)}getFilter(t){return this.style.getFilter(t)}setPaintProperty(t,e,i,r={}){return this.style.setPaintProperty(t,e,i,r),this._update(!0)}getPaintProperty(t,e){return this.style.getPaintProperty(t,e)}setLayoutProperty(t,e,i,r={}){return this.style.setLayoutProperty(t,e,i,r),this._update(!0)}getLayoutProperty(t,e){return this.style.getLayoutProperty(t,e)}setGlyphs(t,e={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(t,e),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(t,e,i={}){return this._lazyInitEmptyStyle(),this.style.addSprite(t,e,i,t=>{t||this._update(!0)}),this}removeSprite(t){return this._lazyInitEmptyStyle(),this.style.removeSprite(t),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(t,e={}){return this._lazyInitEmptyStyle(),this.style.setSprite(t,e,t=>{t||this._update(!0)}),this}setLight(t,e={}){return this._lazyInitEmptyStyle(),this.style.setLight(t,e),this._update(!0)}getLight(){return this.style.getLight()}setSky(t){return this._lazyInitEmptyStyle(),this.style.setSky(t),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(t,e){return this.style.setFeatureState(t,e),this._update()}removeFeatureState(t,e){return this.style.removeFeatureState(t,e),this._update()}getFeatureState(t){return this.style.getFeatureState(t)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let t=0,e=0;return this._container&&(t=this._container.clientWidth||400,e=this._container.clientHeight||300),[t,e]}_setupContainer(){const t=this._container;t.classList.add("maplibregl-map");const e=this._canvasContainer=a.create("div","maplibregl-canvas-container",t);this._interactive&&e.classList.add("maplibregl-interactive"),this._canvas=a.create("canvas","maplibregl-canvas",e),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","regi
313on");const i=this._containerDimensions(),r=this._getClampedPixelRatio(i[0],i[1]);this._resizeCanvas(i[0],i[1],r);const n=this._controlContainer=a.create("div","maplibregl-control-container",t),s=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(t=>{s[t]=a.create("div",`maplibregl-ctrl-${t} `,n)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(t,e,i){this._canvas.width=Math.floor(i*t),this._canvas.height=Math.floor(i*e),this._canvas.style.width=`${t}px`,this._canvas.style.height=`${e}px`}_setupPainter(){const t={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let e=null;this._canvas.addEventListener("webglcontextcreationerror",i=>{e={requestedAttributes:t},i&&(e.statusMessage=i.statusMessage,e.type=i.type)},{once:!0});const i=this._canvas.getContext("webgl2",t)||this._canvas.getContext("webgl",t);if(!i){const t="Failed to initialize WebGL";throw e?(e.message=t,new Error(JSON.stringify(e))):new Error(t)}this.painter=new yr(i,this.transform),o.testSupport(i)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(t){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(t){return this._update(),this._renderTaskQueue.add(t)}_cancelRenderFrame(t){this._renderTaskQueue.remove(t)}_render(t){const i=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(t),this._removed)return;let r=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const t=this.transform.zoom,n=s.now();this.style.zoomHistory.update(t,n);const a=new e.z(t,{now:n,fadeDuration:i,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),o=a.crossFadingFactor();1===o&&o===this._crossFadingFactor||(r=!0,this._crossFadingFactor=o),this.style.update(a)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.minElevationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,i,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:i,showPadding:this.showPadding}),this.fire(new e.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,e.bf.mark(e.bg.load),this.fire(new e.k("load"))),this.style&&(this.style.hasTransitions()||r)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const n=this._sourcesDirty||this._styleDirty||this._placementDirty;return n||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new e.k("idle")),!this._loaded||this._fullyLoaded||n||(this._fullyLoaded=!0,e.bf.mark(e.bg.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var t;this._hash&&this._hash.remove();for(const t of this._controls)t.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),"undefined"!=typeof window&&removeEventListener("online",this._onWindowOnline,!1),p.removeThrottleControl(this._imageQueueHandle),null===(t=this._resizeObserver)||void 0===t||t.disconnect();const i=this.painter.context.gl.getExtension("WEBGL_lose_context");(null==i?void 0:i.loseContext)&&i.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),a.remove(this._canvasContainer),a.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),e.bf.clearMetrics(),this._removed=!0,this.fire(new e.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,s.frameAsync(this._frameRequest).then(t=>{e.bf.frame(t),this._frameRequest=null,this._render(t)})["catch"](()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())}get showPadding(){return!!this._showPadding}set showPadding(t){this._showPadding!==t&&(this._showPadding=t,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(t){this._showCollisionBoxes!==t&&(this._showCollisionBoxes=t,t?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())}get repaint(){return!!this._repaint}set repaint(t){this._repaint!==t&&(this._repaint=t,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(t){this._vertices=t,this._update()}get version(){return Bn}getCameraTargetElevation(){return this.transform.elevation}},t.MapMouseEvent=Lr,t.MapTouchEvent=Rr,t.MapWheelEvent=Br,t.Marker=Zn,t.NavigationControl
vendor: 8,273 bytes, line 313
313=class{constructor(t){this._updateZoomButtons=()=>{const t=this._map.getZoom(),e=t===this._map.getMaxZoom(),i=t===this._map.getMinZoom();this._zoomInButton.disabled=e,this._zoomOutButton.disabled=i,this._zoomInButton.setAttribute("aria-disabled",e.toString()),this._zoomOutButton.setAttribute("aria-disabled",i.toString())},this._rotateCompassArrow=()=>{const t=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=t},this._setButtonTitle=(t,e)=>{const i=this._map._getUIString(`NavigationControl.${e}`);t.title=i,t.setAttribute("aria-label",i)},this.options=e.e({},Vn,t),this._container=a.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",t=>t.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",t=>this._map.zoomIn({},{originalEvent:t})),a.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",t=>this._map.zoomOut({},{originalEvent:t})),a.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",t=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:t}):this._map.resetNorth({},{originalEvent:t})}),this._compassIcon=a.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(t){return this._map=t,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Nn(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){a.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(t,e){const i=a.create("button",t,this._container);return i.type="button",i.addEventListener("click",e),i}},t.Popup=class extends e.E{constructor(t){super(),this.remove=()=>(this._content&&a.remove(this._content),this._container&&(a.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new e.k("close"))),this),this._onMouseUp=t=>{this._update(t.point)},this._onMouseMove=t=>{this._update(t.point)},this._onDrag=t=>{this._update(t.point)},this._update=t=>{var e;if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=a.create("div","maplibregl-popup",this._map.getContainer()),this._tip=a.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const t of this.options.className.split(" "))this._container.classList.add(t);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=this._map.transform.renderWorldCopies&&!this._trackPointer?Un(this._lngLat,this._flatPos,this._map.transform):null===(e=this._lngLat)||void 0===e?void 0:e.wrap(),this._trackPointer&&!t)return;const i=this._flatPos=this._pos=this._trackPointer&&t?t:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&t?t:this._map.transform.locationPoint(this._lngLat));let r=this.options.anchor;const n=ts(this.options.offset);if(!r){const t=this._container.offsetWidth,e=this._container.offsetHeight;let s;s=i.y+n.bottom.y<e?["top"]:i.y>this._map.transform.height-e?["bottom"]:[],i.x<t/2?s.push("left"):i.x>this._map.transform.width-t/2&&s.push("right"),r=0===s.length?"bottom":s.join("-")}let s=i.add(n[r]);this.options.subpixelPositioning||(s=s.round()),a.setTransform(this._container,`${$n[r]} translate(${s.x}px,${s.y}px)`),qn(this._container,r,"popup")},this._onClose=()=>{this.remove()},this.options=e.e(Object.create(Yn),t)}addTo(t){return this._map&&this.remove(),this._map=t,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new e.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=e.N.convert(t),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(t){return this.setDOMContent(document.createTextNode(t))}setHTML(t){const e=document.createDocumentFragment(),i=document.createElement("body");let r;for(i.innerHTML=t;r=i.firstChild,r;)e.appendChild(r);return this.setDOMContent(e)}getMaxWidth(){var t;return null===(t=this._container)||void 0===t?void 0:t.style.maxWidth}setMaxWidth(t){return this.options.maxWidth=t,this._update(),this}setDOMContent(t){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=a.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(t),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(t){return this._container&&this._container.classList.add(t),this}removeClassName(t){return this._container&&this._container.classList.remove(t),this}setOffset(t){return this.options.offset=t,this._update(),this}toggleClassName(t){if(this._container)return this._container.classList.toggle(t)}setSubpixelPositioning(t){this.options.subpixelPositioning=t}_createCloseButton(){this.options.closeButton&&(this._closeButton=a.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const t=this._container.querySelector(Qn);t&&t.focus()}},t.RasterDEMTileSource=K,t.RasterTileSource=W,t.ScaleControl=class{constructor(t){this._onMove=()=>{Kn(this._map,this._container,this.options)},this.setUnit=t=>{this.options.unit=t,Kn(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({}
313,Wn),t)}getDefaultPosition(){return"bottom-left"}onAdd(t){return this._map=t,this._container=a.create("div","maplibregl-ctrl maplibregl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){a.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},t.ScrollZoomHandler=dn,t.Style=de,t.TerrainControl=class{constructor(t){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=t}onAdd(t){return this._map=t,this._container=a.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=a.create("button","maplibregl-ctrl-terrain",this._container),a.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){a.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},t.TwoFingersTouchPitchHandler=on,t.TwoFingersTouchRotateHandler=sn,t.TwoFingersTouchZoomHandler=rn,t.TwoFingersTouchZoomRotateHandler=yn,t.VectorTileSource=X,t.VideoSource=tt,t.addSourceType=(t,i)=>e._(void 0,void 0,void 0,function*(){if(rt(t))throw new Error(`A source type called "${t}" already exists.`);((t,e)=>{it[t]=e})(t,i)}),t.clearPrewarmedResources=function(){const t=F;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(L),F=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},t.getMaxParallelImageRequests=function(){return e.a.MAX_PARALLEL_IMAGE_REQUESTS},t.getRTLTextPluginStatus=function(){return ot().getRTLTextPluginStatus()},t.getVersion=function(){return es},t.getWorkerCount=function(){return R.workerCount},t.getWorkerUrl=function(){return e.a.WORKER_URL},t.importScriptInWorkers=function(t){return j().broadcast("IS",t)},t.prewarm=function(){V().acquire(L)},t.setMaxParallelImageRequests=function(t){e.a.MAX_PARALLEL_IMAGE_REQUESTS=t},t.setRTLTextPlugin=function(t,e){return ot().setRTLTextPlugin(t,e)},t.setWorkerCount=function(t){R.workerCount=t},t.setWorkerUrl=function(t){e.a.WORKER_URL=t}}),t});;/**
314 * 2007-2026 PrestaShop
315 *
316 * NOTICE OF LICENSE
317 *
318 * This source file is subject to the Academic Free License (AFL 3.0)
319 * that is bundled with this package in the file LICENSE.txt.
320 * It is also available through the world-wide-web at this URL:
321 * http://opensource.org/licenses/afl-3.0.php
322 * If you did not receive a copy of the license and are unable to
323 * obtain it through the world-wide-web, please send an email
324 * to [email protected] so we can send you a copy immediately.
325 *
326 * DISCLAIMER
327 *
328 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
329 * versions in the future. If you wish to customize PrestaShop for your
330 * needs please refer to http://www.prestashop.com for more information.
331 *
332 * @author    La Poste
333 * @copyright 2007-2026 PrestaShop SA / 2024-2026 La Poste
334 * @license   http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
335 * International Registered Trademark & Property of PrestaShop SA
336 */var pluginParcelPoint=pluginParcelPoint||{};pluginParcelPoint["lp"]=pluginParcelPoint["lp"]?pluginParcelPoint["lp"]:{},pluginParcelPoint["lp"]={branding:"lp",trigger:".lp-select-parcel",initialized:!1,mapContainer:null,map:null,markers:[],webglEnabled:!1,carrierTextCache:{},getData:function(){let e=null;return pluginData&&pluginData.lp&&(e=pluginData.lp),e},init:function(){const e=this;e.initialized||(e.webglEnabled=e.isWebglEnabled(),e.initialized=!0,e.initCarriers(),e.on("body","click",e.trigger,function(){e.initMap(function(){e.openMap(),e.getPoints()})}),window.MutationObserver?(e.observeDomMutations(e.getAllCarrierInputsSelector(),function(){e.initCarriers()}),e.on("body","click",e.getAllCarrierInputsSelector(),function(){e.initCarriers()})):e.on("body","change",e.getAllCarrierInputsSelector(),function(){e.initCarriers()}),e.on("body","click","."+this.branding+"-parcel-point-button",function(t){e.selectPoint(this.getAttribute("data-code"),unescape(this.getAttribute("data-name")),this.getAttribute("data-network"),unescape(this.getAttribute("data-street")),unescape(this.getAttribute("data-zipcode")),unescape(this.getAttribute("data-city")),unescape(this.getAttribute("data-country")),unescape(this.getAttribute("data-openinghours")),unescape(this.getAttribute("data-distance")),function(){e.initCarriers(),e.closeMap()},function(t){e.showError(t)})}))},isWebglEnabled:function(){return document.createElement("canvas").getContext("webgl")instanceof WebGLRenderingContext},initMapContainer:function(e){const t=this,n=document.createElement("div"),r=t.getData();n.setAttribute("class",this.branding+"-close"),n.setAttribute("title",r.translation.text.closeMap),n.addEventListener("click",function(){t.closeMap()});const o=document.createElement("div");o.setAttribute("id",this.branding+"-map-canvas");const i=document.createElement("div");i.setAttribute("id",this.branding+"-map-container"),i.appendChild(o);const a=document.createElement("div");a.setAttribute("id",this.branding+"-pp-container");const c=document.createElement("div");c.setAttribute("id",this.branding+"-map-inner"),t.webglEnabled?c.className="with-map":c.className="without-map",c.appendChild(n),c.appendChild(i),c.appendChild(a),t.mapContainer=document.createElement("div"),t.mapContainer.setAttribute("id",this.branding+"-map"),t.mapContainer.appendChild(c),document.body.appendChild(t.mapContainer),t.webglEnabled?(t.map=new maplibregl.Map({container:this.branding+"-map-canvas",style:e,zoom:14}),t.map.addControl(new maplibregl.NavigationControl)):document.getElementById(this.branding+"-map-canvas").innerHTML=r.translation.error.webglNotSupported;const s=document.createElement("img");s.setAttribute("src",r.mapLogoImageUrl);const l=document.createElement("a");l.setAttribute("href",r.mapLogoHrefUrl),l.setAttribute("target","_blank"),l.a
336ppendChild(s);const d=document.createElement("div");d.setAttribute("id",this.branding+"-logo"),d.appendChild(l);const p=document.querySelector(".maplibre-ctrl-top-left");p&&p.appendChild(d)},initMap:function(e){const t=this;null===t.mapContainer?t.getMapUrl(function(n){t.initMapContainer(n),e()},function(e){t.showError(e)}):e()},initCarriers:function(){const e=this,t=e.getCarriers(),n=e.getSelectedCarrier();for(let r=0;r<t.length;r++){const o=t[r];if(null===o.querySelector("."+this.branding+"-extra-content")){const e=document.createElement("div");e.setAttribute("class","col-sm-12 "+this.branding+"-extra-content"),o.appendChild(e)}const i=o.querySelector("."+this.branding+"-extra-content");n===e.getCarrierId(o)?e.getSelectedCarrierText(n,i):i.innerHTML=""}},getCarriers:function(){let e=document.querySelectorAll(".delivery-option");return 0===e.length&&(e=document.querySelectorAll(".delivery-option__left")),0===e.length&&(e=document.querySelectorAll("td.delivery_option_radio")),0===e.length&&(e=document.querySelectorAll(".delivery_option")),e},openMap:function(){this.mapContainer.classList.add(this.branding+"-modal-show");let e=window.pageYOffset+(window.innerHeight-this.mapContainer.offsetHeight)/2;e<window.pageYOffset&&(e=window.pageYOffset),this.mapContainer.style.top=e+"px",this.webglEnabled&&this.map.resize()},closeMap:function(){this.mapContainer.classList.remove(this.branding+"-modal-show"),this.clearMarkers()},getPoints:function(){const e=this;e.getParcelPoints(function(t){e.addParcelPointMarkers(t.nearbyParcelPoints),e.fillParcelPointPanel(t.nearbyParcelPoints),e.addRecipientMarker(t.searchLocation),e.setMapBounds()},function(t){e.showError(t)})},getParcelPoints:function(e,t){const n=this.getSelectedCarrier(),r=this.getData();n||t(r.translation.error.carrierNotFound);const o=new XMLHttpRequest;o.onreadystatechange=function(){if(4===o.readyState)if(200!==o.status)t();else{const t="object"==typeof o.response&&null!==o.response?o.response:JSON.parse(o.response);e(t)}},o.open("POST",r.ajaxUrl),o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.responseType="json",o.send("route=getPoints&carrier="+encodeURIComponent(n)+"&cartId="+encodeURIComponent(r.cartId)+"&token="+encodeURIComponent(r.token))},getMapUrl:function(e,t){const n=this.getSelectedCarrier(),r=this.getData();n||t(r.translation.error.carrierNotFound);const o=new XMLHttpRequest;o.onreadystatechange=function(){if(4===o.readyState)if(200!==o.status)t();else{const t="object"==typeof o.response&&null!==o.response?o.response:JSON.parse(o.response);e(t.mapUrl)}},o.open("POST",r.ajaxUrl),o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.responseType="json",o.send("route=getMapUrl&token="+encodeURIComponent(r.token))},addParcelPointMarkers:function(e){if(this.webglEnabled)for(let t=0;t<e.length;t++)e[t].index=t,this.addParcelPointMarker(e[t])},generateParcelPointTagData:function(e){return' data-code="'+e.parcelPoint.code+'" data-name="'+escape(e.parcelPoint.name)+'" data-network="'+e.parcelPoint.network+'" data-zipcode="'+escape(e.parcelPoint.location.zipCode)+'" data-country="'+escape(e.parcelPoint.location.country)+'" data-city="'+escape(e.parcelPoint.location.city)+'" data-street="'+escape(e.parcelPoint.location.street)+'" data-openinghours="'+escape(JSON.stringify(e.parcelPoint.openingDays))+'" data-distance="'+escape(JSON.stringify(e.distanceFromSearchLocation))+'" '},formatOpeningDays:function(e){var t=[];const n=this.getData();for(var r=0;r<e.length;r++){var o=e[r];if(o.weekday){for(var i=o.weekday[0]+" ",a=o.openingPeriods,c=[],s=0;s<a.length;s++){var l=a[s],d=l.openingTime===undefined?"":l.openingTime,p=l.closingTime===undefined?"":l.closingTime;""!==d&&""!==p&&c.push(d+"-"+p)}for(;c.length<2;)c.push(n.translation.text.closedLabel);i+=c.join(" "),r%2==1&&(i='<span style="background-color: #d8d8d8;">'+i+"</span>"),t.push(i)}}return t.join("\n")},addParcelPointMarker:function(e){const t=this,n=t.getData();let r=null;"number"==typeof e.distanceFromSearchLocation&&(r=Math.round(e.distanceFromSearchLocation/100)/10);let o="<div class='"+this.branding+"-marker-popup'><b>"+e.parcelPoint.name+"</b><br/>"+e.parcelPoint.location.street+"<br/>"+e.parcelPoint.location.zipCode+" "+e.parcelPoint.location.city+(null===r?"":" ("+n.translation.distance.replace("%s",r)+")")+'<br/><a href="#" class="'+this.branding+'-parcel-point-button" '+this.generateParcelPointTagData(e)+"><b>"+n.translation.text.chooseParcelPoint+'</b></a><pre class="'+this.branding+'-parcel-point-schedule">'+this.formatOpeningDays(e.parcelPoint.openingDays)+"</pre>";const i=this.getMarkerHtmlElement(e.index+1),a=new maplibregl.Popup({offset:25}).setHTML(o),c=new maplibregl.Marker({element:i,anchor:"bottom"}).setLngLat(new maplibregl.LngLat(parseFloat(e.parcelPoint.location.position.longitude),parseFloat(e.parcelPoint.location.position.latitude))).setPopup(a).addTo(t.map);t.markers.push(c),t.addRightColMarkerEvent(c,e.parcelPoint.code)},addRightColMarkerEvent:function(e,t){this.on("body","click","."+this.branding+"-show-info-"+t,function(){e.togglePopup()})},formatHours:function(e){const t=e.split(":");return 3===t.length&&(e=t[0]+":"+t[1]),e},addRecipientMarker:function(e){const t=this;if(t.webglEnabled){const n=document.createElement("div");n.className=this.branding+"-marker-recipient";const r=new maplibregl.Marker({element:n,anchor:"bottom"}).setLngLat(new maplibregl.LngLat(parseFloat(e.position.longitude),parseFloat(e.position.latitude))).addTo(t.map);t.markers.push(r)}},setMapBounds:function(){if(this.webglEnabled){let e=new maplibregl.LngLatBounds;for(let t=0;t<this.markers.length;t++){const n=this.markers[t];e=e.extend(n.getLngLat())}this.map.fitBounds(e,{padding:30,linear:!0})}},fillParcelPointPanel:function(e){const t=this.getData();let n="";n+="<table><tbody>";for(let r=0;r<e.length;r++){const o=e[r];let i=null;"number"==typeof o.distanceFromSearchLocation&&(i=Math.round(o.distanceFromSearchLocation/100)/10),n+="<tr>",n+="<td>"+this.getMarkerHtmlElement(r+1).outerHTML,n+='<div class="'+this.branding+'-parcel-point-title"><a class="'+this.branding+"-show-info-"+o.parcelPoint.code+'">'+o.parcelPoint.name+"</a></div><br/>",n+=o.parcelPoint.location.street+"<br/>",n+=o.parcelPoint.location.zipCode+" "+o.parcelPoint.location.city+(null===i?"":" ("+t.translation.distance.replace("%s",i)+")")+"<br/>",n+='<a class="'+this.branding+'-parcel-point-button" '+this.generateParcelPointTagData(o)+'"><b>'+t.translation.text.chooseParcelPoint+"</b></a>",n+="</td>",n+="</tr>"}n+="</tbody></table>",document.querySelector("#"+this.branding+"-pp-container").innerHTML=n},getMarkerHtmlElement:function(e){const t=document.createElement("div");return t.className=this.branding+"-marker",t.innerHTML=e,t},selectPoint:function(e,t,n,r,o,i,a,c,s,l,d){const p=this.getData(),u=this.getSelectedCarrier();u||d(p.translation.error.carrierNotFound);const g=new XMLHttpRequest;g.onreadystatechange=function(){4===g.readyState&&(200!==g.status?d(p.translation.error.couldNotSelectPoint):l())}
336,g.open("POST",p.ajaxUrl),g.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),g.responseType="json",g.send("route=setPoint&carrier="+encodeURIComponent(u)+"&code="+encodeURIComponent(e)+"&name="+encodeURIComponent(t)+"&address="+encodeURIComponent(r)+"&zipcode="+encodeURIComponent(o)+"&city="+encodeURIComponent(i)+"&country="+encodeURIComponent(a)+"&openingHours="+encodeURIComponent(c)+"&distance="+encodeURIComponent(s)+"&network="+encodeURIComponent(n)+"&cartId="+encodeURIComponent(p.cartId)+"&token="+encodeURIComponent(p.token))},clearMarkers:function(){for(let e=0;e<this.markers.length;e++)this.markers[e].remove();this.markers=[]},getUniqueCarrier:function(){return document.querySelector('input[type="hidden"].shipping_method')},hasUniqueCarrier:function(){return null!==this.getUniqueCarrier()},getCarrierId:function(e){if(this.hasUniqueCarrier()){return this.getUniqueCarrier().getAttribute("value")}{const t=e.querySelector("input[type=radio]");return null===t?null:t.getAttribute("value")}},getSelectedCarrier:function(){let e;if(this.hasUniqueCarrier()){e=this.getUniqueCarrier().getAttribute("value")}else{e=this.getSelectedInput().getAttribute("value")}return e},getSelectedCarrierText:function(e,t){const n=this.getData();if(null===e)return"";const r=this.carrierTextCache;r[e]!==undefined&&(t.innerHTML=r[e]);const o=new XMLHttpRequest;o.onreadystatechange=function(){if(4===o.readyState){if(200!==o.status)t.innerHTML="";else{const e="object"==typeof o.response&&null!==o.response?o.response:JSON.parse(o.response);t.innerHTML=e.text}r[e]=t.innerHTML}},o.open("POST",n.ajaxUrl),o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.responseType="json",o.send("route=getSelectedCarrierText&carrier="+encodeURIComponent(e)+"&cartId="+encodeURIComponent(n.cartId)+"&token="+encodeURIComponent(n.token))},getSelectedInput:function(){var e=document.querySelector(".delivery-option input[type='radio'][name^='delivery_option']:checked");return null===e&&(e=document.querySelector(".delivery-option__left input[type='radio'][name^='delivery_option']:checked")),null===e&&(e=document.querySelector(".delivery_option_radio input[type='radio']:checked")),null===e&&(e=document.querySelector(".delivery_option input[type='radio']:checked")),e},getAllCarrierInputsSelector:function(){let e=".delivery-option input[type='radio'][name^='delivery_option']";return e+=", .delivery-option__left input[type='radio'][name^='delivery_option']",e+=", .delivery_option_radio input[type='radio']",e+=", .delivery_option input[type='radio']",".delivery-option input[type='radio'][name^='delivery_option'], .delivery-option__left input[type='radio'][name^='delivery_option'], .delivery_option_radio input[type='radio'], .delivery_option input[type='radio']"},showError:function(e){this.closeMap(),alert(e)},isDescendant:function(e,t){for(var n=t.parentNode;null!=n;){if(n==e)return!0;n=n.parentNode}return!1},on:function(e,t,n,r){const o=document.querySelector(e);o.addEventListener(t,function(e){const t=o.querySelectorAll(n),i=e.target;for(let n=0,a=t.length;n<a;n++){let a=i;const c=t[n];for(;a&&a!==o;){if(a===c)return r.call(c,e);a=a.parentNode}}})},observeDomMutations:function(e,t){const n=this;window.MutationObserver&&new MutationObserver(function(r){const o=[];for(let t of r)if("childList"===t.type){const r=Array.from(document.body.querySelectorAll(e)),i=Array.from(t.addedNodes);-1===r.indexOf(t.target)&&i.find(e=>-1!==r.indexOf(e))===undefined&&i.find(t=>!(t instanceof Text)&&t.querySelector&&null!==t.querySelector(e))===undefined&&r.find(e=>i.find(t=>n.isDescendant(e,t))!==undefined)===undefined||o.push(t)}o.length>0&&t(o)}).observe(document.body,{attributes:!0,childList:!0,subtree:!0})}};/**
337 * 2007-2020 PrestaShop and Contributors
338 *
339 * NOTICE OF LICENSE
340 *
341 * This source file is subject to the Academic Free License 3.0 (AFL-3.0)
342 * that is bundled with this package in the file LICENSE.txt.
343 * It is also available through the world-wide-web at this URL:
344 * https://opensource.org/licenses/AFL-3.0
345 * If you did not receive a copy of the license and are unable to
346 * obtain it through the world-wide-web, please send an email
347 * to [email protected] so we can send you a copy immediately.
348 *
349 * @author    PrestaShop SA <[email protected]>
350 * @copyright 2007-2020 PrestaShop SA and Contributors
351 * @license   https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
352 * International Registered Trademark & Property of PrestaShop SA
353 */
354$(document).ready(function(){prestashop.blockcart=prestashop.blockcart||{};var showModal=prestashop.blockcart.showModal||function(modal){var $body=$('body');$body.append(modal);$body.one('click','#blockcart-modal',function(event){if(event.target.id==='blockcart-modal'){$(event.target).remove()}})};prestashop.on('updateCart',function(event){var refreshURL=$('.blockcart').data('refresh-url');var requestData={};if(event&&event.reason&&typeof event.resp!=='undefined'&&!event.resp.hasError){requestData={id_customization:event.reason.idCustomization,id_product_attribute:event.reason.idProductAttribute,id_product:event.reason.idProduct,action:event.reason.linkAction}}
355if(event&&event.resp&&event.resp.hasError){prestashop.emit('showErrorNextToAddtoCartButton',{errorMessage:event.resp.errors.join('<br/>')})}
356$.post(refreshURL,requestData).then(function(resp){var html=$('<div />').append($.parseHTML(resp.preview));$('.blockcart').replaceWith($(resp.preview).find('.blockcart'));if(resp.modal){showModal(resp.modal)}}).fail(function(resp){prestashop.emit('handleError',{eventType:'updateShoppingCart',resp:resp})})})});;;;(function(){'use strict';var src=new URLSearchParams(window.location.search).get('src');if(!src||!/^[a-z]{1,16}$/.test(src)){return}
357try{if(window.sessionStorage.getItem('pd_src_vu')===src){return}
358window.sessionStorage.setItem('pd_src_vu',src)}catch(e){}
359var corps=new FormData();corps.append('src',src);corps.append('ref',document.referrer||'');fetch('/module/phonedroidblog/attribution',{method:'POST',body:corps,credentials:'same-origin',keepalive:!0})['catch'](function(){})})();(function(){'use strict';var SELECTOR='.obflink[data-o]';
359function decodeUrl(encoded){var binary=atob(encoded);try{return decodeURIComponent(binary.split('').map(function(char){return'%'+('00'+char.charCodeAt(0).toString(16)).slice(-2)}).join(''))}catch(error){return binary}}
360function follow(element,openInNewTab){var encoded=element.getAttribute('data-o');if(!encoded){return}
361try{var url=decodeUrl(encoded);if(openInNewTab){window.open(url,'_blank','noopener')}else{window.location.href=url}}catch(error){console.warn('Lien obfusqué invalide',error)}}
362function wantsNewTab(element,event){return element.hasAttribute('data-o-blank')||event.ctrlKey||event.metaKey}
363document.addEventListener('click',function(event){var link=event.target.closest(SELECTOR);if(!link){return}
364event.preventDefault();follow(link,wantsNewTab(link,event))});document.addEventListener('auxclick',function(event){if(event.button!==1){return}
365var link=event.target.closest(SELECTOR);if(!link){return}
366event.preventDefault();follow(link,!0)});document.addEventListener('keydown',function(event){if(event.key!=='Enter'||!event.target.closest){return}
367var link=event.target.closest(SELECTOR);if(!link){return}
368event.preventDefault();follow(link,link.hasAttribute('data-o-blank'))})})();(function(){'use strict';var SELECTEUR='a.grc-widget-site-rating-link, a[href*="societe-des-avis-garantis"]';function marquer(){var liens=document.querySelectorAll(SELECTEUR);for(var i=0;i<liens.length;i++){var rel=liens[i].getAttribute('rel')||'';if(rel.indexOf('nofollow')===-1){liens[i].setAttribute('rel',(rel+' nofollow sponsored').trim())}}}
369marquer();if(document.readyState==='loading'){document.addEventListener('DOMContentLoaded',marquer)}
370if(window.MutationObserver){var observateur=new MutationObserver(marquer);observateur.observe(document.documentElement,{childList:!0,subtree:!0});window.setTimeout(function(){observateur.disconnect();marquer()},20000)}})()

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.